/* Fare Strada · pagina dinamica
   Colori e font dalla scheda brand (brand/identita.md). Nessun framework, nessuna build.
   Le animazioni partono solo con JavaScript attivo (classe .js su <html>) e si spengono
   con "Ferma animazioni" (classe .fermo) o con la preferenza di sistema "riduci movimento". */

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-latin-var.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --blu: #183D6B;
  --cotto: #D05418;          /* solo grafica su chiaro (3.8:1) */
  --cotto-testo: #A8430F;    /* testi e bottoni su chiaro (5.4:1) */
  --cotto-chiaro: #F58B4B;   /* su blu e su scuro */
  --inchiostro: #122032;
  --grigio: #3E4C5E;
  --travertino: #F6F3EC;
  --sabbia: #ECE6DA;
  --carta: #FBF9F4;
  --bordo: #DDD5C5;
  --notte: #091B31;
  --notte-2: #0F2744;
  --blu-chiaro: #BED4EB;
  --nebbia: #9FB3CB;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --larg: 76rem;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --raggio: 18px;
  --font: "Lexend", Verdana, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--notte); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0; font-family: var(--font); font-weight: 300; font-size: 1.125rem; line-height: 1.65;
  color: var(--inchiostro); background: var(--travertino); overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
a { color: inherit; }
em { font-style: normal; color: var(--cotto-testo); }
strong { font-weight: 500; }

:focus-visible { outline: 3px solid var(--cotto-chiaro); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--blu); color: #fff;
  padding: .7rem 1rem; border-radius: 10px; text-decoration: none; transition: top .2s;
}
.skip:focus { top: 1rem; }

.griglia { width: 100%; max-width: var(--larg); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em; padding: .95em 1.4em; border-radius: 999px;
  font: 500 1rem/1.2 var(--font); letter-spacing: .01em; text-decoration: none; border: 2px solid transparent;
  transition: transform .35s var(--ease), background-color .25s, color .25s, box-shadow .35s var(--ease);
}
.btn span { transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover span { transform: translateX(4px); }
.btn-cotto { background: var(--cotto-testo); color: #fff; box-shadow: 0 10px 24px -12px rgba(168, 67, 15, .7); }
.btn-cotto:hover { background: #923909; }
.btn-cotto-chiaro { background: var(--cotto-chiaro); color: var(--notte); }
.btn-cotto-chiaro:hover { background: #FFA36B; }
.btn-linea { border-color: var(--blu); color: var(--blu); }
.btn-linea:hover { background: var(--blu); color: #fff; }
.btn-piccolo { padding: .6em 1.05em; font-size: .9rem; }

/* ---------- Testata ---------- */
.testata {
  position: fixed; inset: 0 0 auto; z-index: 50; transition: background-color .4s, box-shadow .4s, transform .5s var(--ease);
}
.testata-in {
  max-width: var(--larg); margin: 0 auto; padding: .9rem var(--pad); display: flex; align-items: center; gap: 1.5rem;
}
.marchio { position: relative; flex: none; display: block; width: 150px; height: 54px; }
.marchio img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .35s; }
.marchio-scuro { opacity: 0; }
.testata nav { margin-left: auto; }
.testata ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.testata nav a { text-decoration: none; font-weight: 400; font-size: .98rem; color: var(--blu); position: relative; transition: color .3s; }
.testata nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.testata nav a:hover::after { transform: scaleX(1); }
.movimento {
  display: inline-flex; align-items: center; gap: .45em; background: none; border: 1.5px solid currentColor; color: var(--blu);
  border-radius: 999px; padding: .45em .85em; font: 400 .82rem/1 var(--font); cursor: pointer; transition: color .3s;
}
.movimento-icona { width: 10px; height: 11px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.fermo .movimento-icona { border: 0; width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.testata.is-pieno { background: rgba(246, 243, 236, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(18, 32, 50, .08); }
.testata.is-scuro.is-pieno { background: rgba(9, 27, 49, .88); box-shadow: 0 1px 0 rgba(190, 212, 235, .12); }
.testata.is-scuro nav a, .testata.is-scuro .movimento { color: var(--blu-chiaro); }
.testata.is-scuro .marchio-chiaro { opacity: 0; }
.testata.is-scuro .marchio-scuro { opacity: 1; }
.testata.is-nascosta { transform: translateY(-100%); }

@media (max-width: 1180px) {
  .testata nav { display: none; }
  .movimento { margin-left: auto; }
}
@media (max-width: 860px) {
  .movimento { margin-left: auto; }
  .movimento-testo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .movimento { padding: .55em .65em; }
  .marchio { width: 122px; height: 44px; }
}

/* ---------- Sezioni ---------- */
.sez { position: relative; padding: clamp(5rem, 11vw, 9rem) 0; }
.sez-chiara { background: var(--travertino); }
.sez-sabbia { background: var(--sabbia); }
.sez-notte { background: var(--notte); color: #E4ECF5; }
.sez-blu { background: var(--blu); color: #fff; }
.sez-notte em, .sez-blu em { color: var(--cotto-chiaro); }

.occhiello {
  display: flex; align-items: center; gap: .8em; font-size: .85rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cotto-testo); margin-bottom: 1.4rem;
}
.occhiello span {
  display: inline-grid; place-items: center; min-width: 2.4em; height: 2.4em; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: .78rem; letter-spacing: 0;
}
.sez-notte .occhiello, .sez-blu .occhiello { color: var(--cotto-chiaro); }
.titolo-grande { font-size: clamp(2.1rem, 5.2vw, 4.3rem); max-width: 17ch; color: var(--blu); }
.sez-notte .titolo-grande, .sez-blu .titolo-grande { color: #fff; }
.titolo-enorme { font-size: clamp(3rem, 10vw, 8.5rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1; color: #fff; }
.intro { font-size: clamp(1.15rem, 1.9vw, 1.4rem); max-width: 40ch; color: var(--grigio); }
.sez-notte .intro { color: var(--nebbia); }
.sez-blu .intro { color: var(--blu-chiaro); }
.nota { margin-top: 3rem; max-width: 52ch; color: var(--grigio); border-left: 3px solid var(--cotto); padding-left: 1.1rem; }
.piccolo { font-size: .95rem; opacity: .85; }

/* ---------- Comparse allo scorrere ---------- */
.js .rivela {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--rit, 0) * 110ms);
}
.js .rivela.is-in { opacity: 1; transform: none; }
.titolo-righe .riga { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.titolo-righe .riga > span { display: inline-block; }
.js .titolo-righe .riga > span { transform: translateY(108%); transition: transform 1.1s var(--ease); }
.js .titolo-righe .riga:nth-child(2) > span { transition-delay: .12s; }
.js .titolo-righe.is-in .riga > span { transform: none; }

/* ---------- 1 · Apertura ---------- */
.apertura { padding-top: clamp(6.5rem, 11vw, 8rem); padding-bottom: 0; overflow: hidden; }
.apertura::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60rem 36rem at 85% 30%, rgba(245, 139, 75, .16), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(24, 61, 107, .08), transparent 70%);
}
.apertura-griglia { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; min-height: min(78vh, 760px); }
.badge {
  display: inline-flex; align-items: center; gap: .6em; padding: .45em 1em; border-radius: 999px; background: #fff;
  border: 1px solid var(--bordo); font-size: .92rem; font-weight: 400; color: var(--blu);
}
.badge-punto { width: .55em; height: .55em; border-radius: 50%; background: var(--cotto); box-shadow: 0 0 0 0 rgba(208, 84, 24, .5); }
.js:not(.fermo) .badge-punto { animation: pulsa 2.4s infinite; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(208, 84, 24, .45); } 70% { box-shadow: 0 0 0 .7em rgba(208, 84, 24, 0); } 100% { box-shadow: 0 0 0 0 rgba(208, 84, 24, 0); } }
.apertura h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1; color: var(--blu); margin: 1.4rem 0 1.4rem; }
.apertura h1 em { color: var(--cotto-testo); font-weight: 400; }
.lead { font-size: clamp(1.15rem, 1.7vw, 1.35rem); max-width: 36ch; color: var(--grigio); }
.azioni { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.strada { position: relative; aspect-ratio: 520 / 600; width: 100%; max-width: 520px; justify-self: end; }
.strada-svg { width: 100%; height: 100%; overflow: visible; }
.strada-bordo { fill: none; stroke: #E6DCCB; stroke-width: 66; stroke-linecap: round; }
.strada-asfalto { fill: none; stroke: var(--blu); stroke-width: 52; stroke-linecap: round; }
.strada-mezzeria { fill: none; stroke: var(--travertino); stroke-width: 3; stroke-dasharray: 14 16; stroke-linecap: round; opacity: .8; }
.strada-rivela { fill: none; stroke: #fff; stroke-width: 90; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.strada-freccia { fill: none; stroke: var(--cotto); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.strada-viaggiatore { fill: var(--cotto-chiaro); stroke: #fff; stroke-width: 4; opacity: 0; }
.js:not(.fermo) .strada-rivela { stroke-dashoffset: 1; }
.js:not(.fermo) .strada.is-in .strada-rivela { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s var(--ease-io) .3s; }
.js:not(.fermo) .strada-freccia { opacity: 0; transform: translate(-10px, 10px); transition: opacity .6s, transform .8s var(--ease); }
.js:not(.fermo) .strada.is-in .strada-freccia { opacity: 1; transform: none; transition-delay: 2.3s; }
.strada.is-viaggio .strada-viaggiatore { opacity: 1; transition: opacity .5s; }

.tappe { list-style: none; margin: 0; padding: 0; }
.tappa { position: absolute; left: var(--x); top: var(--y); --tx: -11px; transform: translate(var(--tx), -50%); display: flex; align-items: center; gap: .5rem; }
.tappa-sx { flex-direction: row-reverse; --tx: calc(-100% + 11px); }
.tappa-segno { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid var(--cotto); box-shadow: 0 6px 16px -6px rgba(9, 27, 49, .5); }
.tappa-nome {
  background: #fff; color: var(--blu); font-size: .92rem; font-weight: 500; padding: .35em .8em; border-radius: 999px;
  box-shadow: 0 8px 22px -12px rgba(9, 27, 49, .45); white-space: nowrap;
}
.tappa-arrivo .tappa-nome { background: var(--cotto-testo); color: #fff; }
.tappa-arrivo .tappa-segno { border-color: var(--blu); }
.js:not(.fermo) .tappa { opacity: 0; transform: translate(var(--tx), -20%) scale(.9); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.js:not(.fermo) .strada.is-in .tappa { opacity: 1; transform: translate(var(--tx), -50%); transition-delay: calc(.7s + var(--i) * .5s); }
.tappa.is-attiva .tappa-segno { background: var(--cotto-chiaro); }

.nastro { position: relative; margin-top: clamp(3rem, 6vw, 5rem); background: var(--blu); color: var(--travertino); overflow: hidden; padding: 1.3rem 0; }
.nastro-scorre { display: flex; align-items: center; gap: 2.2rem; width: max-content; padding-left: 2rem; will-change: transform; }
.nastro span { font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 300; letter-spacing: -0.02em; white-space: nowrap; }
.nastro span:nth-of-type(even) { color: var(--cotto-chiaro); }
.nastro i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--cotto-chiaro); flex: none; }

/* ---------- Schede ---------- */
.schede { list-style: none; margin: 3.5rem 0 0; padding: 0; display: grid; gap: 1.2rem; }
.schede-3 { grid-template-columns: repeat(3, 1fr); }
.scheda { border-radius: var(--raggio); padding: 1.8rem 1.6rem 1.6rem; }
.scheda h3, .scheda h4 { font-size: 1.35rem; margin-bottom: .5em; }
.scheda p { margin: 0; }
.scheda-scura {
  background: linear-gradient(180deg, var(--notte-2), rgba(15, 39, 68, .4)); border: 1px solid rgba(190, 212, 235, .14); color: var(--nebbia);
  transition: border-color .4s, transform .5s var(--ease);
}
.scheda-scura:hover { border-color: var(--cotto-chiaro); transform: translateY(-4px); }
.scheda-scura h3 { color: #fff; }
.scheda-num { display: block; font-size: 1.7rem; color: var(--cotto-chiaro); margin-bottom: 1.6rem; font-weight: 300; }
.scheda-vetro { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: var(--blu-chiaro); }
.scheda-vetro h4 { color: #fff; }

/* ---------- 3 · Strumento (scena fissata) ---------- */
.strumento-griglia { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.frase-accende .parola { transition: color .35s; }
.js:not(.fermo) .frase-accende .parola { color: rgba(24, 61, 107, .2); }
.js:not(.fermo) .frase-accende .parola.is-on { color: var(--blu); }
.js:not(.fermo) .frase-accende .parola.is-on.parola-cotto { color: var(--cotto-testo); }
.passi { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: .2rem; max-width: 30rem; counter-reset: p; }
.passo {
  counter-increment: p; display: flex; gap: 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--bordo);
  color: var(--grigio); font-size: 1.08rem; transition: color .4s;
}
.passo::before { content: "0" counter(p); font-size: .8rem; font-weight: 500; color: var(--grigio); width: 2rem; }
.passo::after { content: ""; flex: 1; height: 2px; background: var(--cotto); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.passo.is-on { color: var(--blu); font-weight: 400; }
.passo.is-on::before { color: var(--cotto-testo); }
.passo.is-on::after { transform: scaleX(1); }

.telefono { justify-self: center; perspective: 1400px; }
.telefono-corpo {
  position: relative; width: min(300px, 72vw); aspect-ratio: 300 / 610; border-radius: 46px; background: var(--notte);
  padding: 14px; box-shadow: 0 50px 80px -40px rgba(9, 27, 49, .65), inset 0 0 0 2px #24456E;
  transform: rotateY(-10deg) rotateX(4deg); transition: transform 1.2s var(--ease);
}
.telefono:hover .telefono-corpo { transform: none; }
.telefono-isola { position: absolute; top: 24px; left: 50%; width: 86px; height: 24px; margin-left: -43px; border-radius: 20px; background: #000; z-index: 3; }
.schermo {
  position: absolute; inset: 14px; border-radius: 34px; background: var(--carta); padding: 64px 18px 18px; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .6s var(--ease), transform .8s var(--ease); font-size: .9rem;
}
.schermo.is-on { opacity: 1; transform: none; }
.app-titolo { font-weight: 500; font-size: 1.3rem; color: var(--blu); margin-bottom: .8rem; }
.app-cerca { background: #fff; border: 1px solid var(--bordo); border-radius: 12px; padding: .6rem .8rem; color: var(--grigio); font-size: .85rem; margin-bottom: 1rem; }
.corsa { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .7rem .8rem; border-radius: 12px; color: var(--grigio); font-size: .82rem; }
.corsa b { font-weight: 500; font-size: 1.05rem; color: var(--inchiostro); }
.corsa em { font-size: .72rem; padding: .25em .6em; border-radius: 999px; background: var(--cotto-testo); color: #fff; }
.corsa-prima { background: #fff; box-shadow: 0 10px 22px -16px rgba(9, 27, 49, .6); }
.app-nota { position: absolute; left: 18px; right: 18px; bottom: 20px; font-size: .75rem; color: var(--grigio); text-align: center; margin: 0; }
.calendario { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; text-align: center; font-size: .82rem; color: var(--grigio); margin-bottom: 1.2rem; }
.calendario span { padding: .45rem 0; border-radius: 10px; }
.calendario span:nth-child(-n+5) { font-size: .7rem; font-weight: 500; }
.giorno-ok { background: var(--blu); color: #fff; font-weight: 500; }
.conferma { background: #fff; border-radius: 14px; padding: .9rem; color: var(--inchiostro); box-shadow: 0 10px 22px -16px rgba(9, 27, 49, .6); line-height: 1.4; }
.conferma small { color: var(--grigio); }
.spunta { display: inline-block; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #2E7D4F; margin-right: .5rem; vertical-align: -3px; position: relative; }
.spunta::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.app-bottone { background: var(--blu); color: #fff; text-align: center; border-radius: 12px; padding: .8rem; margin-bottom: .6rem; font-weight: 500; }
.app-bottone-chiaro { background: #fff; color: var(--blu); border: 1.5px solid var(--blu); }
.app-passi { display: flex; justify-content: center; gap: .5rem; margin-top: 1.2rem; }
.app-passi span { width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--bordo); font-size: .75rem; color: var(--grigio); }
.app-passi .fatto { background: var(--cotto-testo); border-color: var(--cotto-testo); color: #fff; }

.bolla { max-width: 86%; padding: .65rem .85rem; border-radius: 16px; margin-bottom: .55rem; line-height: 1.4; font-size: .86rem; }
.bolla-io { margin-left: auto; background: var(--blu); color: #fff; border-bottom-right-radius: 4px; }
.bolla-ai { background: #fff; color: var(--inchiostro); border: 1px solid var(--bordo); border-bottom-left-radius: 4px; }
.bolla-corta { max-width: 70%; }

/* scena fissata: solo schermi larghi, con animazioni attive */
@media (min-width: 961px) {
  .js:not(.fermo) [data-fissa] { height: var(--corsa, 340vh); padding: 0; }
  .js:not(.fermo) [data-fissa] > .fissa { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
  .js:not(.fermo) .ia[data-fissa] { --corsa: 320vh; }
}
@media (max-width: 960px) {
  .strumento-griglia { grid-template-columns: 1fr; }
  .telefono { margin-top: 1rem; }
}

/* ---------- 4 · Attività ---------- */
.attivita { list-style: none; margin: 4rem 0 0; padding: 0; display: grid; gap: clamp(4rem, 8vw, 7rem); }
.att { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.att-inversa .att-testo { order: 2; }
.att-num {
  display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--blu); color: #fff;
  font-weight: 500; font-size: 1.2rem; margin-bottom: 1.2rem;
}
.att h3 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); color: var(--blu); }
.att p { color: var(--grigio); max-width: 46ch; }
.att-visivo {
  position: relative; min-height: 340px; border-radius: 28px; background: var(--carta); padding: 2rem;
  box-shadow: 0 40px 70px -50px rgba(9, 27, 49, .55); overflow: hidden;
}
.js:not(.fermo) .att .att-testo, .js:not(.fermo) .att .att-visivo { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js:not(.fermo) .att .att-visivo { transition-delay: .15s; }
.js:not(.fermo) .att.is-in .att-testo, .js:not(.fermo) .att.is-in .att-visivo { opacity: 1; transform: none; }

/* chat */
.foglio { width: 58%; background: #fff; border: 1px solid var(--bordo); border-radius: 10px; padding: .9rem; margin-bottom: 1rem; transform: rotate(-3deg); }
.foglio span { display: block; height: 7px; border-radius: 4px; background: #E3DDD0; margin: 6px 0; }
.foglio .corta { width: 60%; }
.visivo-chat .bolla { font-size: .95rem; }
.digita::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--cotto); margin-left: 2px; vertical-align: -2px; opacity: 0; }
.digita.is-scrive::after { opacity: 1; animation: lampeggia .8s steps(1) infinite; }
@keyframes lampeggia { 50% { opacity: 0; } }
.avvisi { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.avvisi span { font-size: .8rem; font-weight: 500; padding: .35em .8em; border-radius: 999px; background: #FBE6DA; color: #8A3409; }
.js:not(.fermo) .visivo-chat .bolla, .js:not(.fermo) .visivo-chat .avvisi span { opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .6s var(--ease); }
.js:not(.fermo) .visivo-chat .bolla-io { transition-delay: .5s; }
.js:not(.fermo) .visivo-chat .bolla-ai { transition-delay: 1.1s; }
.js:not(.fermo) .visivo-chat .avvisi span:nth-child(1) { transition-delay: .2s; }
.js:not(.fermo) .visivo-chat .avvisi span:nth-child(2) { transition-delay: .5s; }
.js:not(.fermo) .is-in .visivo-chat .bolla, .js:not(.fermo) .visivo-chat.is-fine .avvisi span { opacity: 1; transform: none; }

/* sportello */
.visivo-sportello { display: flex; flex-direction: column; justify-content: center; gap: .8rem; background: linear-gradient(160deg, var(--carta), #F3EADC); }
.cartella {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; background: #fff; border-radius: 14px; padding: 1rem 1.2rem;
  border-left: 5px solid var(--blu); box-shadow: 0 14px 28px -22px rgba(9, 27, 49, .6);
}
.cartella b { font-weight: 500; color: var(--blu); }
.cartella span { font-size: .85rem; color: var(--grigio); }
.cartella:nth-child(2) { border-left-color: var(--cotto); margin-left: 1.5rem; }
.cartella:nth-child(3) { margin-left: 3rem; }
.js:not(.fermo) .cartella { opacity: 0; transform: translateX(40px); transition: opacity .6s, transform .9s var(--ease); transition-delay: calc(.35s + var(--i) * .22s); }
.js:not(.fermo) .is-in .cartella { opacity: 1; transform: none; }
.sportello-voce { display: flex; align-items: center; gap: 4px; margin-top: .6rem; font-size: .85rem; color: var(--blu); font-weight: 500; }
.onda { width: 4px; height: 14px; border-radius: 2px; background: var(--cotto); margin-right: 2px; }
.js:not(.fermo) .onda { animation: onda 1.1s ease-in-out infinite; }
.onda:nth-child(2) { animation-delay: .15s !important; }
.onda:nth-child(3) { animation-delay: .3s !important; margin-right: .5rem; }
@keyframes onda { 50% { transform: scaleY(.4); } }

/* cucito */
.visivo-cucito { display: flex; flex-direction: column; justify-content: center; background: var(--blu); }
.visivo-cucito svg { width: 100%; overflow: visible; }
.stoffa { fill: #234D80; stroke: rgba(255, 255, 255, .25); stroke-width: 2; stroke-dasharray: 2 8; }
.cucitura-guida { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 2; }
.cucitura { fill: none; stroke: var(--cotto-chiaro); stroke-width: 5; stroke-dasharray: 14 10; stroke-linecap: round; }
.cucitura-rivela { fill: none; stroke: #fff; stroke-width: 24; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.ago line { stroke: #E4ECF5; stroke-width: 3.5; stroke-linecap: round; }
.ago circle { fill: none; stroke: var(--blu); stroke-width: 1.5; }
.ago { opacity: 0; }
.js:not(.fermo) .is-in .ago { opacity: 1; }
.cucito-nota { color: var(--blu-chiaro); text-align: center; margin: 1rem 0 0; font-size: .95rem; }

/* ---------- 5 · Intelligenza artificiale ---------- */
.ia { overflow: clip; }
.ia::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50rem 34rem at 80% 50%, rgba(245, 139, 75, .16), transparent 65%);
}
.ia-griglia { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.ia .titolo-grande { max-width: 14ch; font-size: clamp(2.1rem, 4.4vw, 3.7rem); }
.ia-passi { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: .5rem; max-width: 32rem; }
.ia-passo {
  display: grid; grid-template-columns: 5.2rem 1fr; column-gap: 1rem; padding: .85rem 1rem; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1); color: var(--blu-chiaro); transition: background-color .5s, border-color .5s, opacity .5s;
}
.ia-quando { grid-row: span 2; font-size: .78rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--cotto-chiaro); padding-top: .2rem; }
.ia-passo b { font-weight: 500; color: #fff; font-size: 1.12rem; }
.ia-spiega { font-size: .95rem; line-height: 1.45; }
.js:not(.fermo) .ia-passo { opacity: .5; }
.js:not(.fermo) .ia-passo.is-fatto { opacity: .8; }
.js:not(.fermo) .ia-passo.is-on { opacity: 1; background: rgba(255, 255, 255, .08); border-color: var(--cotto-chiaro); }

.ia-scena { position: relative; min-height: 560px; }
.lettera {
  position: relative; width: 88%; background: var(--carta); color: var(--inchiostro); border-radius: 10px; padding: 1.6rem 1.6rem 1.4rem;
  font-size: 1.08rem; line-height: 2.25; box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .6); transform: rotate(-2deg);
}
.lettera p { margin: 0 0 .4rem; }
.lettera-int { font-size: .75rem; letter-spacing: .14em; font-weight: 500; color: var(--grigio); line-height: 1.4; margin-bottom: .8rem !important; }
.dato { position: relative; white-space: nowrap; }
.dato::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 1.25em; margin-top: -.62em; background: var(--inchiostro); border-radius: 3px;
  transform-origin: left; transition: transform .7s var(--ease);
}
.dato + .dato::after { transition-delay: .25s; }
.js:not(.fermo) .ia-scena:not(.a0) .dato::after { transform: scaleX(0); }
.timbro {
  position: absolute; right: 1.2rem; bottom: -.9rem; background: var(--carta); border: 2px solid #2E7D4F; color: #2E7D4F; font-size: .75rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; padding: .2em .6em; border-radius: 6px; line-height: 1.4; transform: rotate(6deg);
  transition: opacity .4s .6s, transform .6s var(--ease) .6s;
}
.js:not(.fermo) .ia-scena:not(.a0) .timbro { opacity: 0; transform: rotate(6deg) scale(1.6); }
.difficile { position: relative; white-space: nowrap; border-radius: 4px; transition: background-color .5s; background: rgba(245, 139, 75, .32); }
.difficile::after {
  content: attr(data-facile); position: absolute; left: 50%; bottom: 82%; transform: translateX(-50%); white-space: nowrap;
  background: var(--blu); color: #fff; font-size: .7rem; font-weight: 500; line-height: 1.5; padding: 0 .5em; border-radius: 999px;
  transition: opacity .4s, transform .5s var(--ease);
}
.js:not(.fermo) .ia-scena:not(.a1) .difficile { background: transparent; }
.js:not(.fermo) .ia-scena:not(.a1) .difficile::after { opacity: 0; transform: translate(-50%, 6px); }
.js:not(.fermo) .ia-scena.a1 .difficile:nth-of-type(2)::after { transition-delay: .2s; }
.verifica { transition: box-shadow .4s; }
.ia-scena.a2 .verifica, .fermo .verifica, html:not(.js) .verifica { box-shadow: inset 0 -3px 0 #4CAF7A; }

.ia-chat { position: absolute; right: 0; bottom: 0; width: 66%; }
.ia-chat .bolla { font-size: .98rem; max-width: 100%; box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .6); transition: opacity .5s, transform .6s var(--ease); }
.ia-chat .bolla-io { width: max-content; max-width: 90%; background: var(--cotto-chiaro); color: var(--notte); }
.ia-chat .bolla-ai { min-height: 5.6em; }
.ia-etichetta { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cotto-testo); margin-bottom: .2rem; }
.js:not(.fermo) .ia-scena:not(.a1) .ia-chat .bolla { opacity: 0; transform: translateY(14px); }
.js:not(.fermo) .ia-scena.a1 .ia-chat .bolla-ai { transition-delay: .5s; }
.spunte { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.spunte li {
  font-size: .82rem; font-weight: 500; background: #E3F3EA; color: #1F5E3A; padding: .3em .75em .3em .5em; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .35em; transition: opacity .4s, transform .5s var(--ease);
}
.spunte li::before { content: "✓"; font-weight: 600; }
.spunte li:nth-child(2) { transition-delay: .2s; }
.spunte li:nth-child(3) { transition-delay: .4s; }
.ia-esito { margin: .6rem 0 0; font-size: .9rem; color: var(--blu-chiaro); transition: opacity .4s .7s; }
.ia-esito::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #4CAF7A; margin-right: .5rem; }
.js:not(.fermo) .ia-scena:not(.a2) .spunte li { opacity: 0; transform: scale(.7); }
.js:not(.fermo) .ia-scena:not(.a2) .ia-esito { opacity: 0; }
.risposta-scrive::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--cotto); margin-left: 2px; vertical-align: -2px; animation: lampeggia .8s steps(1) infinite; }

.ia-usi { padding-top: 0; }
.usi { margin-top: 0; }
.usi h3 { color: #fff; font-size: 1.3rem; }
.uso-icona { display: flex; gap: 4px; height: 2.6rem; align-items: flex-end; margin-bottom: 1.3rem; }
.uso-icona i { display: block; border-radius: 4px; background: var(--cotto-chiaro); }
.uso-lettera { flex-direction: column; align-items: flex-start; justify-content: center; width: 2.2rem; padding: .4rem; border: 2px solid var(--blu-chiaro); border-radius: 6px; }
.uso-lettera i { height: 3px; width: 100%; }
.uso-lettera i:last-child { width: 60%; }
.uso-messaggio i { width: 1.9rem; height: 1.1rem; border-radius: 10px 10px 10px 2px; }
.uso-messaggio i:last-child { background: var(--blu-chiaro); border-radius: 10px 10px 2px 10px; height: 1.5rem; margin-bottom: 1rem; }
.uso-colloquio i { width: 1.1rem; height: 1.1rem; border-radius: 50%; margin-bottom: 1.4rem; }
.uso-colloquio i:last-child { background: var(--blu-chiaro); }
.js:not(.fermo) .usi .is-in .uso-icona i { animation: salta 2.6s var(--ease) infinite; }
.js:not(.fermo) .usi .uso-icona i:nth-child(2) { animation-delay: .25s; }
.js:not(.fermo) .usi .uso-icona i:nth-child(3) { animation-delay: .5s; }
@keyframes salta { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }
.ia-motto { margin: 3.5rem 0 0; font-size: clamp(1.5rem, 3.2vw, 2.4rem); font-weight: 300; letter-spacing: -0.02em; color: #fff; max-width: 30ch; line-height: 1.25; }

/* ---------- 6 · Partecipa ---------- */
.scheda-chiara { background: #fff; border: 1px solid var(--bordo); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.scheda-chiara:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -36px rgba(9, 27, 49, .5); }
.scheda-chiara h3 { color: var(--blu); }
.scheda-chiara p { color: var(--grigio); }
.partecipa-azione { margin-top: 2.5rem; }

/* ---------- 6 · Chiusura ---------- */
.chiusura { padding-bottom: 0; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; }
.luci { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chiusura-in { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 3rem; padding-bottom: 4rem; }
.chiusura h2 { margin: .3rem 0 2rem; }
.chiusura h2 em { color: var(--cotto-chiaro); }
.mail a {
  display: inline-block; font-size: clamp(1.6rem, 4.5vw, 3.4rem); font-weight: 300; letter-spacing: -0.02em; color: #fff; text-decoration: none;
  background: linear-gradient(var(--cotto-chiaro), var(--cotto-chiaro)) 0 100% / 100% 3px no-repeat; padding-bottom: .1em;
  transition: background-size .5s var(--ease), color .3s;
}
.mail a:hover { color: var(--cotto-chiaro); background-size: 0 3px; background-position: 100% 100%; }

.piede { position: relative; border-top: 1px solid rgba(190, 212, 235, .14); padding: 2.2rem 0 2.6rem; color: var(--nebbia); font-size: .95rem; }
.piede-in { display: flex; gap: 2rem; align-items: flex-start; }
.piede-logo { flex: none; width: 110px; height: auto; }
.piede strong { color: #fff; }
.privacy summary { cursor: pointer; color: var(--blu-chiaro); text-decoration: underline; text-underline-offset: 3px; width: max-content; }
.privacy p { max-width: 62ch; margin-top: .8rem; }

/* ---------- Schermi piccoli ---------- */
@media (max-width: 960px) {
  .apertura-griglia { grid-template-columns: 1fr; min-height: 0; }
  .strada { justify-self: center; max-width: 380px; margin-top: 1rem; }
  .schede-3 { grid-template-columns: 1fr; }
  .att, .ia-griglia { grid-template-columns: 1fr; }
  .ia-scena { min-height: 0; display: grid; gap: 1rem; }
  .lettera { width: 100%; }
  .ia-chat { position: relative; width: 92%; justify-self: end; }
  .att-inversa .att-testo { order: 0; }
}
@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .lettera { font-size: .92rem; padding: 1.2rem; }
  .ia-passo { grid-template-columns: 1fr; }
  .ia-quando { grid-row: auto; }
  .att-visivo { min-height: 0; padding: 1.4rem; }
  .cartella { flex-direction: column; gap: .1rem; }
  .cartella:nth-child(2) { margin-left: .8rem; }
  .cartella:nth-child(3) { margin-left: 1.6rem; }
  .tappa-nome { font-size: .8rem; }
  .piede-in { flex-direction: column; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
.fermo *, .fermo *::before, .fermo *::after { animation: none !important; }
.fermo .rivela, .fermo .titolo-righe .riga > span { opacity: 1 !important; transform: none !important; }
