/* K studio — landing
   Palette e font derivati dal logo e dal biglietto da visita. */

/* Unbounded ospitato in locale (OFL): niente richieste ai server Google */
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --k-light: #3475f4;
  --k-deep: #0034d6;
  --ice: #eef3ff;
  --muted: #5b6070;
  --rule: #d9deea;

  --k-grad: linear-gradient(90deg, var(--k-light), var(--k-deep));

  --display: "Unbounded", system-ui, sans-serif;
  --text: "avenir-next-lt-pro-condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1320px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 400;
  font-size: clamp(18px, 1.15vw + 12px, 21px);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--k-light);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* Etichette: maiuscolo spaziato, come l'indirizzo sul biglietto */
.label {
  font-family: var(--text);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

em { font-style: normal; }
.claim em,
.step__title em {
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Bottoni ----------
   Sono blob: la forma cambia piano, e il cursore ci si fonde dentro (vedi .btn__goo). */

.btn {
  --fill: var(--k-grad);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--paper);
  font-family: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .4s var(--ease-out);
}
.btn--ghost { --fill: var(--ink); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 16px; }

/* Con lo strato liquido attivo, lo sfondo lo disegna il blob */
.btn.has-goo { background: none; }
.btn__label { position: relative; z-index: 1; }

.btn__goo {
  position: absolute;
  inset: -60px;
  z-index: 0;
  filter: url(#goo);
  pointer-events: none;
}
.btn__shape {
  position: absolute;
  inset: 60px;
  background: var(--fill);
  border-radius: 999px;
  animation: btn-blob 5s ease-in-out infinite alternate;
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.btn__drop {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--k-grad);
  opacity: 0;
}
.btn__bump,
.btn__neck {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: var(--fill);
  opacity: 0;
}
.btn__bump { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.btn__neck { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--k-grad); }
.btn.is-gooing .btn__drop,
.btn.is-gooing .btn__bump,
.btn.is-gooing .btn__neck { opacity: 1; }

@keyframes btn-blob {
  0%   { border-radius: 40px 34px 38px 30px / 30px 38px 34px 40px; }
  50%  { border-radius: 30px 42px 32px 40px / 38px 30px 40px 32px; }
  100% { border-radius: 36px 30px 42px 34px / 34px 40px 30px 38px; }
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand span {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
}

.top nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); }
.top nav a:not(.btn) {
  font-weight: 500;
  font-size: 17px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}


/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  max-width: var(--max);
  min-height: calc(100svh - 70px);
  margin: 0 auto;
  padding: clamp(32px, 6vh, 80px) var(--gutter) clamp(48px, 8vh, 96px);
}

.hero { position: relative; }
.hero__text { position: relative; z-index: 1; display: grid; gap: clamp(20px, 3vh, 32px); }
.hero__mark { z-index: 1; }

/* Particelle: tutta la larghezza dello schermo, dietro al testo */
.hero__particles {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  /* Sotto il testo le gocce si attenuano */
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .3) 15%, #000 60%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .3) 15%, #000 60%);
}

.claim {
  display: grid;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 5.5vw, 92px);
  line-height: 1;
  letter-spacing: -.035em;
}
.claim a { text-decoration: none; white-space: nowrap; }
.claim span {
  display: inline-block;
  padding: .04em 0;
}

/* Luce blu che segue il cursore dentro le lettere del claim (--mx/--my da main.js) */
@property --glow {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.claim span {
  background-image: radial-gradient(circle var(--glow) at var(--mx, 50%) var(--my, 50%),
    #7aa8ff 0%, var(--k-light) 30%, var(--k-deep) 62%, var(--ink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: --glow .6s var(--ease-out);
}
.claim a:hover span,
.claim a:focus-visible span { --glow: 280px; }

.lede { max-width: 30em; font-size: clamp(20px, 1.3vw + 12px, 25px); line-height: 1.35; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__mark {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 600px;
  justify-self: end;
  touch-action: pan-y;
}
.blob { width: 100%; height: 100%; overflow: visible; }
.blob #k-live,
.blob #k-src { filter: drop-shadow(0 16px 22px rgba(0, 52, 214, .2)); }
.blob.is-live #k-src { visibility: hidden; }



/* ---------- Servizi ----------
   Le fasce si fanno più blu man mano che si scende: bianco, ghiaccio, gradiente K, poi i contatti. */

.services__head {
  display: grid;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) var(--gutter) clamp(40px, 6vh, 72px);
}
.services__head h2 {
  max-width: 17em;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.services__head h2 em {
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.services__head p { max-width: 34em; font-size: clamp(19px, .8vw + 14px, 23px); color: var(--muted); }

.step {
  position: relative;
  scroll-margin-top: 70px;
}
.step__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px clamp(24px, 5vw, 80px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) var(--gutter);
}
.step:first-of-type .step__inner {
  padding-top: clamp(40px, 6vh, 64px);
  background: linear-gradient(var(--ink), var(--ink)) no-repeat var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 2px;
}

/* Bordo liquido in cima alla fascia, con le curve della K */
.edge {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  width: 100%;
  height: clamp(36px, 6vw, 90px);
  pointer-events: none;
}
.step--ice { background: var(--ice); }
.step--ice .edge { fill: var(--ice); }
.step--k {
  background: linear-gradient(180deg, var(--k-light), var(--k-deep));
  color: var(--paper);
}
.step--k .edge { fill: var(--k-light); }

.step__title {
  align-self: start;
  position: sticky;
  top: 96px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1;
  letter-spacing: -.035em;
}
.step--k .step__title em { background: none; color: var(--paper); }

.step__body { display: grid; gap: 24px; align-content: start; }
.step__intro { font-size: clamp(21px, 1.2vw + 14px, 27px); font-weight: 500; line-height: 1.25; }

.svc li {
  display: grid;
  grid-template-columns: minmax(0, 15em) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.step--ice .svc li { border-top-color: #cdd7f0; }
.step--k .svc li { border-top-color: rgba(255, 255, 255, .3); }
.svc strong { font-weight: 700; letter-spacing: .01em; }
.svc span { color: var(--muted); }
.step--k .svc span { color: rgba(255, 255, 255, .8); }



/* ---------- Contatti ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(64px, 12vh, 140px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  position: relative;
  overflow: hidden;
  background: var(--k-deep);
  color: var(--paper);
  scroll-margin-top: 60px;
}
.contact > :not(.contact__k) { position: relative; }
.contact__k {
  position: absolute;
  right: -12vw;
  bottom: -18vw;
  width: min(80vw, 1000px);
  fill: #fff;
  opacity: .07;
  pointer-events: none;
}
.contact__info { display: grid; gap: clamp(20px, 3vh, 32px); }
.contact h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 2.8vw, 42px);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.contact .label { color: rgba(255, 255, 255, .75); }

.contact__phone {
  justify-self: start;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 54px);
  letter-spacing: -.04em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.contact__list { display: grid; gap: 16px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .35); }
.contact dt,
.field label,
.chips legend {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.contact dt { margin-bottom: 2px; color: rgba(255, 255, 255, .75); }
.contact dd a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.contact :focus-visible { outline-color: var(--paper); }

/* Modulo: bianco su blu, campi a sottolineatura come una scheda da compilare */
.form {
  display: grid;
  gap: 22px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
}
.form :focus-visible { outline-color: var(--k-light); }
.form__title { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -.03em; }

.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.opt { margin-left: 6px; color: var(--muted); letter-spacing: .08em; text-transform: none; font-weight: 400; }

.form input[type="text"],
.form input[type="email"],
.form input[type="tel"],
.form textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  transition: border-color .2s;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus,
.form textarea:focus { outline: none; border-bottom-color: var(--k-deep); }
.form ::placeholder { color: #9aa0b0; }
.form [aria-invalid="true"] { border-bottom-color: #c8102e; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.chips legend { width: 100%; margin-bottom: 10px; padding: 0; }
.chips label { position: relative; letter-spacing: .04em; text-transform: none; font-size: 17px; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips label > span {
  display: inline-block;
  padding: 7px 16px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  transition: background-color .2s, border-color .2s, color .2s;
}
.chips label:hover > span { border-color: var(--ink); }
.chips input:checked + span { background: var(--k-deep); border-color: var(--k-deep); color: var(--paper); }
.chips input:focus-visible + span { outline: 3px solid var(--k-light); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 16px; line-height: 1.4; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--k-deep); }

.btn--light { justify-self: start; }
.form .btn:disabled { opacity: .6; cursor: progress; }

.form__status { min-height: 1.4em; font-weight: 500; }
.form__status.is-ok { color: var(--k-deep); }
.form__status.is-error { color: #c8102e; }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 48px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  background: var(--ink);
  color: rgba(255, 255, 255, .7);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.foot a { color: var(--paper); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__mark { order: -1; max-width: 340px; justify-self: center; margin-bottom: -8px; }
  .step__inner { grid-template-columns: 1fr; }
  .step__title { position: static; }
  .svc li { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .top nav a:not(.btn) { display: none; }
  .hero__mark { max-width: 240px; }
  .claim { font-size: 11vw; }
  .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Pagina informativa ---------- */

.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(64px, 10vh, 120px);
}
.legal h1 {
  margin: 12px 0 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.legal__lede { font-size: clamp(20px, 1vw + 14px, 24px); line-height: 1.35; }
.legal h2 {
  margin: 48px 0 12px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.02em;
}
.legal p + p,
.legal p + ul,
.legal ul + p { margin-top: 12px; }
.legal ul { display: grid; gap: 10px; padding-left: 1.1em; list-style: disc; }
.legal a { color: var(--k-deep); }

/* ---------- Mini blob che segue il mouse ---------- */

.cursor-blob {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.cursor-blob.is-on { opacity: 1; }
.cursor-blob i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--k-grad);
  border-radius: 46% 54% 58% 42% / 44% 48% 52% 56%;
  animation: blob-morph 3.2s ease-in-out infinite alternate;
  transition: transform .35s var(--ease-out), background-color .3s, opacity .3s;
}
.cursor-blob.is-merged,
.cursor-blob.is-merged-k { opacity: 0; transition: opacity .12s; }
.cursor-blob.is-light i { background: #fff; }
@keyframes blob-morph {
  0%   { border-radius: 46% 54% 58% 42% / 44% 48% 52% 56%; }
  50%  { border-radius: 58% 42% 40% 60% / 55% 38% 62% 45%; }
  100% { border-radius: 40% 60% 54% 46% / 60% 52% 48% 40%; }
}

/* ---------- Link: il gradiente si accende dentro le lettere al passaggio ---------- */

.top nav a:not(.btn):hover,
.consent a:hover,
.legal a:hover {
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration-color: var(--k-light);
}
.contact dd a:hover,
.contact__phone:hover,
.foot a:hover {
  background: linear-gradient(90deg, #fff, #9cc0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration-color: #9cc0ff;
}

/* ---------- Animazioni d'entrata e interazioni ----------
   Ogni blocco .reveal riceve .is-in quando entra nello schermo (l'hero al caricamento).
   Dentro: parole e righe salgono da dietro una maschera, i paragrafi passano da sfocati a nitidi.
   --i è l'indice dell'elemento nel suo blocco, usato per lo sfasamento. */

.w { display: inline-block; vertical-align: top; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.w__i { display: inline-block; }
.line { display: block; overflow: hidden; padding: .06em 0 .14em; margin: -.06em 0 -.14em; }
.claim a.line { display: block; }

/* Le parole del titolo in gradiente: il gradiente va sulla singola parola */
.services__head h2 em { background: none; color: inherit; }
.services__head h2 em .w__i {
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .js .reveal .w__i,
  .js .reveal .line__i {
    transform: translateY(112%) rotate(5deg);
    transform-origin: 0 100%;
    transition: transform 1s cubic-bezier(.19, 1, .22, 1);
    transition-delay: calc(var(--i, 0) * 45ms + var(--d, 0ms));
  }
  .js .reveal.is-in .w__i,
  .js .reveal.is-in .line__i { transform: none; }

  /* Paragrafi: parole che emergono dalla sfocatura */
  .js .reveal .soft .w__i {
    transform: translateY(40%);
    opacity: 0;
    filter: blur(8px);
    transition: transform .9s var(--ease-out), opacity .9s var(--ease-out), filter .9s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 12ms + var(--d, 0ms));
  }
  .js .reveal.is-in .soft .w__i { transform: none; opacity: 1; filter: none; }

  /* Etichette: la spaziatura si stringe mentre compaiono */
  .js .reveal .label {
    opacity: 0;
    letter-spacing: .5em;
    transition: opacity .9s var(--ease-out), letter-spacing 1.2s cubic-bezier(.19, 1, .22, 1);
  }
  .js .reveal.is-in .label { opacity: 1; letter-spacing: .16em; }

  /* Elementi interi: salgono e compaiono */
  .js .reveal .pop {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 70ms + var(--d, 0ms));
  }
  .js .reveal.is-in .pop { opacity: 1; transform: none; }

  /* Righe dei servizi: entrano da destra, una dopo l'altra */
  .js .reveal .svc li {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .8s var(--ease-out), transform .9s cubic-bezier(.19, 1, .22, 1);
    transition-delay: calc(var(--i, 0) * 90ms + 350ms);
  }
  .js .reveal.is-in .svc li { opacity: 1; transform: none; }
}

/* Titoli del payoff: si riempiono di gradiente scorrendo (--fill da main.js, da 0 a 1) */
.step__title .line__i {
  background: linear-gradient(90deg,
    var(--k-light) 0%,
    var(--k-deep) calc(var(--fill, 1) * 100% - 6%),
    var(--ink) calc(var(--fill, 1) * 100% + 6%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.step--k .step__title .line__i {
  background: linear-gradient(90deg,
    #fff calc(var(--fill, 1) * 100% - 6%),
    rgba(255, 255, 255, .35) calc(var(--fill, 1) * 100% + 6%));
  -webkit-background-clip: text;
  background-clip: text;
}
.step__title em,
.step--k .step__title em { background: none; color: inherit; }

/* Servizi: al passaggio una macchia morbida scorre sotto la riga */
.svc li { position: relative; isolation: isolate; }
.svc li::before {
  content: "";
  position: absolute;
  inset: 4px -16px;
  z-index: -1;
  border-radius: 28px 40px 32px 44px / 40px 28px 44px 32px;
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .7s cubic-bezier(.19, 1, .22, 1);
}
.step--ice .svc li::before { background: #dfe8ff; }
.step--k .svc li::before { background: rgba(255, 255, 255, .12); }
.svc li:hover::before { transform: scaleX(1); }
.svc strong { display: inline-block; transition: transform .6s cubic-bezier(.19, 1, .22, 1), color .3s; }
.svc li:hover strong { transform: translateX(10px); }

/* Pulsanti magnetici: si spostano verso il cursore, senza ingrandirsi (--mx/--my da main.js) */
.btn { translate: var(--mx, 0) var(--my, 0); transition: translate .5s cubic-bezier(.19, 1, .22, 1); }

/* Header: barra di avanzamento e scomparsa scendendo */
.top { transition: transform .5s var(--ease-out); }
.top.is-hidden { transform: translateY(-100%); }
.top::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--k-grad);
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
}

/* K gigante dei contatti: galleggia piano e segue il mouse (translate da main.js) */
@media (prefers-reduced-motion: no-preference) {
  .contact__k {
    animation: k-float 16s ease-in-out infinite alternate;
    transition: translate 1.2s cubic-bezier(.19, 1, .22, 1);
  }
}
@keyframes k-float {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(6deg) translateY(-3%); }
}

.line__i { display: inline-block; }

/* ---------- Intro liquida ---------- */

/* Copertura dal primo disegno (classe messa nell'<head>); se lo script non parte, sparisce da sola */
html.intro body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(180deg, var(--k-light), var(--k-deep));
  animation: intro-safety .4s 3s forwards;
}
@keyframes intro-safety { to { opacity: 0; visibility: hidden; } }

.intro-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--k-light), var(--k-deep));
  pointer-events: none;
  will-change: transform;
}
.intro__wave {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  width: 100%;
  height: 120px;
  fill: var(--k-light);
}
.intro__k {
  width: min(30vw, 190px);
  fill: #fff;
  overflow: visible;
  animation: intro-k 1.25s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes intro-k {
  0%   { transform: scale(.2) rotate(-30deg); opacity: 0; }
  35%  { opacity: 1; }
  55%  { transform: scale(1) rotate(0); }
  75%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(.8) translateY(-30px); opacity: 0; }
}

/* ---------- Nastro tipografico ---------- */

.marquee {
  display: grid;
  gap: clamp(4px, 1vw, 14px);
  overflow: hidden;
  padding: clamp(28px, 6vh, 72px) 0 clamp(8px, 2vh, 24px);
  user-select: none;
}
.mq-row {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.mq-word {
  padding: 0 .22em;
  font-family: var(--display);
  white-space: nowrap;
  letter-spacing: -.04em;
  line-height: 1.05;
}
.mq-row--big .mq-word {
  font-weight: 800;
  font-size: clamp(56px, 10.5vw, 170px);
  /* Contorno sotto un riempimento bianco: nasconde le sovrapposizioni interne dei tratti del font */
  color: var(--paper);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  transition: -webkit-text-stroke-color .4s;
}
.mq-row--big .mq-word.is-solid { color: var(--ink); -webkit-text-stroke-color: transparent; }
.mq-row--big .mq-word:hover {
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke-color: transparent;
}
.mq-row--small .mq-word {
  font-weight: 600;
  font-size: clamp(26px, 4vw, 64px);
  color: var(--ink);
}
.mq-row--small .mq-word em {
  font-style: normal;
  background: var(--k-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mq-dot {
  flex: none;
  width: .5em;
  height: .5em;
  margin: 0 .25em;
  fill: url(#kgrad);
  overflow: visible;
}
.mq-row--big .mq-dot { font-size: clamp(56px, 10.5vw, 170px); }
.mq-row--small .mq-dot { font-size: clamp(26px, 4vw, 64px); }
@media (prefers-reduced-motion: no-preference) {
  .mq-dot { animation: mq-spin 7s linear infinite; }
}
@keyframes mq-spin { to { transform: rotate(360deg); } }

/* Touch: niente goccia del cursore, quindi lo strato liquido dei pulsanti resta dentro il pulsante
   (fuori allargherebbe la pagina oltre lo schermo) */
@media (hover: none), (pointer: coarse) {
  .btn__goo { inset: 0; }
  .btn__shape { inset: 0; }
}
body { overflow-x: clip; }
