/* ==========================================================================
   Agostino Colamussi - portfolio
   Struttura: variabili -> base -> componenti -> sezioni -> responsive
   ========================================================================== */

/* ---------- Variabili ---------- */
:root {
  --colore-ciano: #22c8e5;
  --colore-viola: #82009f;
  --colore-testo: rgba(255, 255, 255, 0.5);
  --colore-titolo: #fff;
  --font-titoli: "Nunito Sans", "Segoe UI", Arial, sans-serif;
  --font-testo: "Inconsolata", "Courier New", monospace;
  --altezza-menu: 90px;

  /* Tipografia: testo, titolo hero (h1), titoli grandi, titoli di colonna, altezza pulsanti */
  --t-testo: 20px;
  --t-testo-lh: 25px;
  --t-h1: 60px;
  --t-h1-lh: 70px;
  --t-big: 50px;
  --t-big-lh: 60px;
  --t-h3: 30px;
  --t-h3-lh: 40px;
  --t-btn-lh: 60px;
  --t-btn-pad: 50px;
}

@media (max-width: 1239px) {
  :root {
    --t-testo: 17px;
    --t-testo-lh: 23px;
    --t-h1: 50px;
    --t-h1-lh: 60px;
    --t-big: 30px;
    --t-big-lh: 40px;
    --t-h3: 20px;
    --t-h3-lh: 30px;
    --t-btn-lh: 50px;
    --t-btn-pad: 40px;
  }
}

@media (max-width: 1023px) {
  :root {
    --t-testo: 15px;
    --t-testo-lh: 20px;
    --t-h1: 40px;
    --t-h1-lh: 50px;
  }
}

@media (max-width: 777px) {
  :root {
    --t-testo: 13px;
    --t-h1: 30px;
    --t-h1-lh: 40px;
    --t-big: 20px;
    --t-big-lh: 30px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: #000;
  color: var(--colore-testo);
  font-family: var(--font-testo);
  font-size: var(--t-testo);
  line-height: var(--t-testo-lh);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

.material-icons {
  font-style: normal;
  vertical-align: middle;
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--colore-ciano);
  color: #000;
  font-family: var(--font-titoli);
  font-weight: 700;
}

.skip-link:focus {
  top: 10px;
}

:focus-visible {
  outline: 2px solid var(--colore-ciano);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Componenti ---------- */

/* Menu fisso in alto */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

/* Si vede solo il simbolo; al passaggio del mouse compare il logo intero */
.site-nav__logo {
  display: flex;
  align-items: center;
}

/* Si vede solo il simbolo; al passaggio del mouse, al focus o al tocco compare il nome */
.site-nav__symbol {
  display: block;
  width: 44px;
  height: 50px;
  overflow: hidden;
  flex: none;
}

.site-nav__symbol img {
  max-width: none;
  width: 125px;
  height: 50px;
}

.site-nav__brand {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-family: var(--font-titoli);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #fff;
  transition: max-width 0.6s ease, opacity 0.4s ease, margin 0.6s ease;
}

.site-nav__logo:hover .site-nav__brand,
.site-nav__logo:focus-visible .site-nav__brand,
.site-nav__logo.is-open .site-nav__brand {
  max-width: 260px;
  margin-left: 12px;
  opacity: 1;
}

.site-nav__links {
  display: flex;
  gap: 30px;
  font-size: var(--t-testo);
}

.site-nav__link {
  white-space: nowrap;
  color: var(--colore-testo);
  transition: color 0.3s;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--colore-ciano);
}

/* Etichetta sopra i titoli */
.eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
}

.eyebrow__accent {
  color: var(--colore-ciano);
}

.eyebrow--viola .eyebrow__accent {
  color: var(--colore-viola);
}

.eyebrow .material-icons {
  font-size: 1em;
  letter-spacing: 0;
}

/* Titoli di sezione */
.section-title {
  font-family: var(--font-titoli);
  font-size: var(--t-h3);
  line-height: var(--t-h3-lh);
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-align: center;
  color: var(--colore-titolo);
}

.section-title--grande {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--t-big);
  line-height: var(--t-big-lh);
}

.section-title--enorme {
  font-size: var(--t-h1);
  line-height: var(--t-h1-lh);
}

/* Testi descrittivi */
.section-text {
  max-width: 800px;
  margin: 40px auto 0;
  text-align: center;
  color: var(--colore-testo);
}

.section-text .material-icons {
  margin-right: 4px;
}

/* Pulsanti */
.btn {
  display: inline-block;
  padding: 0 var(--t-btn-pad);
  line-height: var(--t-btn-lh);
  font-family: var(--font-titoli);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: filter 0.3s;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.2);
}

.btn--ciano {
  background: linear-gradient(90deg, #22c8e5, rgba(34, 200, 229, 0.5));
  box-shadow: 0 0 70px rgba(34, 200, 229, 0.35);
}

.btn--outline {
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.btn--viola {
  background: linear-gradient(90deg, #82009f, rgba(130, 0, 159, 0.5));
  box-shadow: 0 0 70px rgba(130, 0, 159, 0.35);
}

/* Particelle (canvas disegnato da main.js) */
.particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Comparsa degli elementi allo scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Sezioni ---------- */
.section {
  position: relative;
  overflow: hidden;
  padding: 140px 5vw;
}

.section__inner {
  position: relative;
  z-index: 5;
}

/* Hero */
.hero {
  min-height: 100vh;
  padding-top: 100px;
  padding-bottom: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__shape {
  position: absolute;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 2;
}

.hero__shape--left {
  top: 115px;
  left: 0;
  width: 400px;
  height: 590px;
  background-image: url("../img/hero-left.jpg");
  background-position: left center;
  clip-path: polygon(100% 0, 0 100%, 0 28%);
}

.hero__shape--right {
  top: 0;
  right: 0;
  width: 410px;
  height: 100%;
  background-image: url("../img/hero-right.jpg");
  background-position: center;
  clip-path: polygon(51% 0, 0 37%, 83% 100%, 100% 100%, 100% 0);
}

.hero__triangle {
  position: absolute;
  z-index: 1;
  background: linear-gradient(rgba(247, 247, 247, 0.07), rgba(255, 255, 255, 0));
}

.hero__triangle--grande {
  left: 120px;
  top: 0;
  width: 700px;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.hero__triangle--piccolo {
  right: 200px;
  bottom: 0;
  width: 400px;
  height: 291px;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.hero__content {
  position: relative;
  z-index: 5;
  max-width: 800px;
}

.hero__title {
  display: block;
  margin: 40px 0 0;
  font-family: var(--font-titoli);
  font-size: var(--t-h1);
  line-height: var(--t-h1-lh);
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: azure;
  text-shadow: 0 0 10px azure, 0 0 20px aqua, 0 0 40px dodgerblue, 0 0 80px blue;
  filter: saturate(60%);
  will-change: filter, color;
  animation: neon-flicker 3s steps(100) 1s infinite;
}

@keyframes neon-flicker {
  50% {
    color: #fff;
    filter: saturate(200%) hue-rotate(20deg);
  }
}

.hero__line {
  display: block;
}

.hero__tagline {
  margin-top: 50px;
}

.hero__tagline + .section-text {
  margin-top: 24px;
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.hero__proof li {
  padding: 6px 16px;
  border: 1px solid rgba(34, 200, 229, 0.5);
  border-radius: 30px;
  font-size: 16px;
  color: #fff;
  background: rgba(34, 200, 229, 0.08);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

/* Servizi (due colonne) */
.services {
  background: #000;
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1240px;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.panel .section-title {
  margin-top: 50px;
}

.panel .section-text {
  margin-top: 50px;
}

.panel__cta {
  margin-top: 50px;
}

.services__triangle {
  position: absolute;
  z-index: 1;
  background: linear-gradient(90deg, rgba(247, 247, 247, 0.06), rgba(255, 255, 255, 0));
}

.services__triangle--basso {
  left: 120px;
  bottom: -100px;
  width: 400px;
  height: 291px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.services__triangle--destra {
  right: 0;
  top: 0;
  width: 700px;
  height: 100%;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* Approccio (sfondo sfumato con cerchio di icone) */
.approach {
  min-height: 790px;
  background:
    linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.85) 18%, rgba(0, 0, 0, 0) 42%),
    linear-gradient(0deg, #22c8e5 0%, rgba(130, 0, 159, 0.6) 40%, rgba(130, 0, 159, 0.5) 50%, rgba(130, 0, 159, 0) 75%),
    url("../img/approach-bg.jpg") center / cover no-repeat,
    #000;
  padding-bottom: 100px;
}

.approach__grid {
  display: grid;
  grid-template-columns: 1fr 400px 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.approach__col {
  padding-top: 100px;
  text-align: center;
}

.approach__col .section-title {
  margin-top: 40px;
}

.approach__col .section-text {
  margin-top: 30px;
}

.approach__cta {
  margin-top: 90px;
  text-align: center;
}

/* Cerchio tratteggiato con tre icone */
.orbit {
  position: relative;
  width: 400px;
  height: 400px;
  margin-top: 50px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  font-size: 17px;
  color: #fff;
}

.orbit__item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.orbit__item--alto {
  top: -45px;
  left: calc(50% - 45px);
}

.orbit__item--sinistra {
  top: 240px;
  left: -20px;
}

.orbit__item--destra {
  top: 240px;
  right: -20px;
}

.orbit__icon {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--colore-ciano);
  box-shadow: 0 0 50px var(--colore-ciano);
  font-size: 50px;
  color: #fff;
}

.orbit__icon .material-icons {
  font-size: inherit;
}

/* Competenze */
.skills {
  background: #000;
  text-align: center;
  padding-top: 200px;
  padding-bottom: 120px;
}

.skills .section-title {
  margin-top: 40px;
}

.skills__list {
  margin: 50px auto 0;
  padding: 0;
  max-width: 900px;
  list-style: none;
  color: var(--colore-testo);
}

.skills__list li {
  line-height: var(--t-testo-lh);
}

/* Chi sono / domande frequenti */
.about {
  background: #000;
  text-align: center;
  padding-bottom: 120px;
}

.about .section-title {
  margin-top: 40px;
}

.faq {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 50px;
  max-width: 1100px;
  margin: 60px auto 0;
  text-align: left;
}

.faq__item {
  padding: 24px 26px;
  border-left: 3px solid var(--colore-ciano);
  background: rgba(255, 255, 255, 0.04);
}

.faq__question {
  margin-bottom: 10px;
  font-family: var(--font-titoli);
  font-size: calc(var(--t-testo) + 1px);
  line-height: calc(var(--t-testo-lh) + 3px);
  font-weight: 700;
  color: #fff;
}

.faq__answer {
  font-size: var(--t-testo);
  line-height: var(--t-testo-lh);
  color: var(--colore-testo);
}

/* Piè di pagina */
.site-footer {
  padding: 30px 5vw 40px;
  background: #82009f;
  text-align: center;
  font-size: 15px;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a {
  text-decoration: underline;
}

/* Contatti */
.contact {
  min-height: 900px;
  background: linear-gradient(180deg, #000 0%, #000 35%, #82009f 100%);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: center;
}

.contact__name {
  font-size: var(--t-big);
  line-height: var(--t-big-lh);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0 20px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: 30px;
  color: #fff;
  transition: transform 0.3s, color 0.3s;
}

.social-links a:hover,
.social-links a:focus-visible {
  transform: scale(1.2);
  color: var(--colore-ciano);
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-top: 40px;
}

.contact-form__field {
  width: 100%;
  padding: 16px 30px;
  border: 1px solid #ddd;
  border-radius: 30px;
  background: #f2f2f7;
  color: #222;
  font: inherit;
  font-family: var(--font-titoli);
  font-size: 17px;
  outline: none;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.contact-form__field::placeholder {
  color: #8a84a8;
}

.contact-form__field:focus {
  border-color: rgba(81, 203, 238, 1);
  box-shadow: 0 0 5px rgba(81, 203, 238, 1);
}

textarea.contact-form__field {
  min-height: 100px;
  resize: vertical;
}

.contact-form__submit {
  padding: 0 60px;
  line-height: 50px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(90deg, #22c8e5, rgba(34, 200, 229, 0.5));
  box-shadow: 0 0 70px rgba(34, 200, 229, 0.35);
  color: #fff;
  font-family: var(--font-titoli);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.3s;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  filter: brightness(1.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .approach__grid {
    grid-template-columns: 1fr 330px 1fr;
  }

  .orbit {
    width: 330px;
    height: 330px;
  }

  .orbit__icon {
    width: 74px;
    height: 74px;
    font-size: 41px;
  }

  .orbit__item--alto {
    top: -37px;
    left: calc(50% - 37px);
  }

  .orbit__item--sinistra,
  .orbit__item--destra {
    top: 198px;
  }
}

@media (max-width: 1024px) {
  .services__grid,
  .contact__grid,
  .faq {
    grid-template-columns: 1fr;
  }

  .approach__grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .approach__col {
    padding-top: 40px;
  }

  .orbit {
    order: -1;
    margin-bottom: 40px;
  }
}

@media (max-width: 778px) {
  .section {
    padding: 110px 6vw 80px;
  }

  .site-nav {
    padding: 10px 20px;
  }

  .site-nav__link--secondaria {
    display: none;
  }

  .site-nav__brand {
    font-size: 12px;
    letter-spacing: 2px;
  }


  .hero__shape--left {
    width: 250px;
    height: 364px;
    top: 150px;
  }

  .hero__shape--right {
    width: 150px;
  }

  .hero__triangle--grande {
    display: none;
  }

  .eyebrow {
    font-size: 12px;
    letter-spacing: 5px;
  }

  .orbit {
    width: 246px;
    height: 246px;
    font-size: 10px;
  }

  .orbit__icon {
    width: 55px;
    height: 55px;
    font-size: 24px;
  }

  .orbit__item--alto {
    top: -27px;
    left: calc(50% - 27px);
  }

  .orbit__item--sinistra,
  .orbit__item--destra {
    top: 148px;
  }
}

/* Chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__title {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Hero: animazioni d'ingresso (come nel template originale) e parallax
   ========================================================================== */
[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

.hero__shape--left {
  animation: entra-da-sinistra 4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero__shape--right {
  animation: entra-da-destra 4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero__triangle--grande {
  animation: entra-da-sinistra 4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero__triangle--piccolo {
  animation: entra-dal-basso 4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s both;
}

.hero__content .eyebrow {
  animation: entra-dall-alto 1s ease both;
}

.hero__line {
  animation: sale-e-appare 1.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.hero__line:nth-child(2) { animation-delay: 0.1s; }
.hero__line:nth-child(3) { animation-delay: 0.2s; }
.hero__line:nth-child(4) { animation-delay: 0.3s; }

.hero__tagline,
.hero__content .section-text,
.hero__proof,
.hero__actions {
  animation: appare 1.5s ease 1.5s both;
}

@keyframes entra-da-sinistra {
  from { translate: -110% 0; scale: 1.2; }
  to { translate: 0 0; scale: 1; }
}

@keyframes entra-da-destra {
  from { translate: 110% 0; scale: 1.2; }
  to { translate: 0 0; scale: 1; }
}

@keyframes entra-dal-basso {
  from { translate: 0 100%; }
  to { translate: 0 0; }
}

@keyframes entra-dall-alto {
  from { opacity: 0; translate: 0 -50px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes sale-e-appare {
  from { opacity: 0; translate: 0 50px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes appare {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Il testo della colonna "approccio" resta leggibile sullo sfondo colorato */
.approach .section-text {
  color: rgba(255, 255, 255, 0.82);
}

/* Pulsanti di fondo sezione */
.skills__cta,
.about__cta {
  margin-top: 60px;
  text-align: center;
}

/* ==========================================================================
   Effetto "ritorno al futuro" durante lo scroll dei pulsanti
   ========================================================================== */
.time-travel {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  visibility: hidden;
}

.time-travel.is-active {
  visibility: visible;
}

.time-travel__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.time-travel__flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}

.time-travel__flash.is-flash {
  animation: time-travel-flash 0.8s ease-out;
}

@keyframes time-travel-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.time-travel__speed {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid #ff6a1a;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  font-family: "Courier New", monospace;
  color: #ff6a1a;
  text-shadow: 0 0 10px #ff6a1a;
  opacity: 0;
  transition: opacity 0.2s;
}

.time-travel.is-active .time-travel__speed {
  opacity: 1;
}

.time-travel__value {
  min-width: 2ch;
  text-align: right;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 4px;
}

.time-travel__unit {
  font-size: 16px;
  letter-spacing: 3px;
}

.time-travel__speed.is-88 {
  color: #fff;
  border-color: #fff;
  text-shadow: 0 0 14px #22c8e5, 0 0 30px #22c8e5;
}

/* La sezione "materializza" all'arrivo */
.is-arriving > .section__inner,
.is-arriving .hero__content {
  animation: time-travel-arrivo 0.9s ease-out;
}

@keyframes time-travel-arrivo {
  from { opacity: 0.15; filter: blur(8px) brightness(2.2); scale: 1.04; }
  to { opacity: 1; filter: none; scale: 1; }
}

@media (max-width: 777px) {
  .time-travel__value {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__shape,
  .hero__triangle,
  .hero__content .eyebrow,
  .hero__line,
  .hero__tagline,
  .hero__content .section-text,
  .hero__proof,
  .hero__actions {
    animation: none;
  }

  .time-travel {
    display: none;
  }
}
