/*
  Art34Bis per Polis Lombardia, presentazione. Direzione A «Istituzionale nitida»:
  molto bianco, verde Polis come colore guida, linee da 1 px, card dal raggio ampio, numeri tabellari.
  Motivo «filo e rombo» (il rombo del logo Polis) su carta millimetrata. Contrasti testo ≥ 4,5:1.
  Qui stanno palcoscenico, impaginazione e animazioni di scena; lo stile dell'app e dell'omino è in ab-app.css.
*/
:root {
  /* Verdi istituzionali, campionati dai loghi */
  --verde: #027a37;          /* Polis: testo e pulsanti, 5,47:1 su bianco */
  --verde-scuro: #015c29;    /* hover, testo su verde tenue, 7,19:1 */
  --verde-rl: #16a030;       /* Regione Lombardia: solo grafica (3,44:1) */
  --verde-notte: #0e3321;
  --verde-notte-2: #1c4a33;
  --verde-tenue: #e7f3ec;
  --verde-velo: #f2f8f4;
  --verde-linea: #cfe3d6;
  /* Neutri */
  --carta: #ffffff;
  --fondo: #f3f5f4;
  --ink: #13211a;            /* 16,66:1 su bianco */
  --muted: #4f5b55;          /* 7,09:1 su bianco */
  --soft: #66716b;           /* 5,07:1 su bianco, 4,63:1 su fondo */
  --line: #e2e8e4;
  --line-strong: #c9d3cd;
  --grafite: #56554d;
  /* Stati */
  --ambra: #8a5a00; --ambra-bg: #fff3d6;
  --rosso: #b42318; --rosso-bg: #fdecea;
  /* Forma */
  --r-card: 20px;
  --r-tile: 14px;
  --ombra: 0 1px 2px rgba(14, 51, 33, .05), 0 10px 30px -12px rgba(14, 51, 33, .16);
  --ombra-alta: 0 2px 4px rgba(14, 51, 33, .06), 0 30px 60px -24px rgba(14, 51, 33, .28);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Kit movimento (etichette fluttuanti) e scrittura (campo, manina) */
  --mv-surface: #fff; --mv-text: var(--ink); --mv-line: var(--line); --mv-accent: var(--verde-notte); --mv-accent-ink: #fff;
  --mv-highlight: var(--verde-rl); --mv-muted: var(--soft);
  --ty-text: var(--ink); --ty-muted: var(--soft); --ty-caret: var(--verde); --ty-send: #fff; --ty-ring: var(--verde-rl);
  --ty-finger: #fff; --ty-finger-line: var(--verde-scuro); --ty-finger-mark: var(--verde-linea);
  font-family: var(--font);
  color-scheme: light;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.story-guided { scroll-behavior: auto; }
body { margin: 0; background: var(--carta); color: var(--ink); overflow-x: hidden; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.032em; line-height: 1.04; text-wrap: balance; }
h1 { font-size: clamp(40px, 5vw, 78px); }
h2 { font-size: clamp(34px, 4vw, 60px); }
.soft { color: var(--verde); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .35; }
:where(button, a):focus-visible { outline: 3px solid var(--verde-rl); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 100; transform: translateY(-160%); background: #fff; color: var(--ink); padding: 12px 20px; font-weight: 700; border-radius: 10px; transition: transform .2s ease; }
.skip-link:focus { transform: none; }

/* Carta millimetrata: griglia da 1 px, il «registro» su cui poggia tutto */
.paper { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; background-position: -1px -1px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 45%, #000 0%, transparent 78%); mask-image: radial-gradient(ellipse 75% 70% at 70% 45%, #000 0%, transparent 78%); }

/* Testata */
.masthead { position: fixed; inset: 0 0 auto; z-index: 40; height: 72px; padding: 0 clamp(16px, 4vw, 56px); display: flex; align-items: center; pointer-events: none; }
.brand { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .94); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(14, 51, 33, .07); font-weight: 650; font-size: 15px; letter-spacing: -.01em; backdrop-filter: blur(10px); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; }
.brand-mark img { width: 34px; height: 34px; }
.brand-client { width: 86px; height: auto; padding-left: 12px; border-left: 1px solid var(--line); }

/* Etichette di stato: «Oggi», «Proposta», «Prototipo», col rombo */
.state-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.state-tag::before { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); border-radius: 1px; }
.state-tag.is-prop { background: var(--verde-tenue); color: var(--verde-scuro); border: 1px solid var(--verde-linea); }
.state-tag.is-oggi { background: #eef0ee; color: var(--grafite); border: 1px solid var(--line-strong); }
.state-tag.is-proto { background: #fff; color: var(--verde-scuro); border: 1.5px dashed var(--verde); }
.track { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.track-num { font-size: 12.5px; font-weight: 700; color: var(--soft); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.track-num::before { content: ""; display: inline-block; vertical-align: middle; width: 28px; height: 1px; margin-right: 10px; background: var(--line-strong); }

.chapter { position: relative; min-height: 100vh; min-height: 100svh; }
.lead { margin-top: 20px; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--muted); max-width: 42ch; }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; border: 0; font-weight: 650; font-size: 15px; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.button.primary { background: var(--verde); color: #fff; box-shadow: 0 12px 26px -10px rgba(2, 122, 55, .6); }
.button.primary:hover { background: var(--verde-scuro); transform: translateY(-2px); }

/* L'omino fuori dalle schermate: .ab-app serve solo a dargli lo stile di ab-app.css, senza disegnare un riquadro */
.ab-app.ab-inline { display: contents; }
/* Riquadro neutro al posto di una schermata, se ab-ui.js manca o non risponde */
.ab-missing { display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; background: repeating-linear-gradient(135deg, var(--fondo) 0 14px, #fff 14px 28px); color: var(--soft); font: 600 18px/1.3 var(--font); text-align: center; }
.ab-missing span { padding: 10px 18px; border-radius: 999px; background: #fff; border: 1px dashed var(--line-strong); }

/* =========================================================================
   00 Apertura
   ========================================================================= */
.intro { height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; background: linear-gradient(180deg, #fff 0%, #fff 60%, var(--verde-velo) 100%); }
/* Il rombo del logo Polis, grande e tagliato, dietro al MacBook */
.intro-rombo { position: absolute; right: -14vw; top: 50%; width: 74vh; height: 74vh; transform: translateY(-50%) rotate(45deg); pointer-events: none; }
.intro-rombo i { position: absolute; inset: 0; border-radius: 9vh; }
.intro-rombo i:first-child { background: linear-gradient(135deg, var(--verde-tenue), var(--verde-velo)); }
.intro-rombo i:last-child { inset: 7vh; border: 1px solid var(--verde-linea); border-radius: 6vh; }
.intro-copy { position: absolute; z-index: 4; left: clamp(16px, 6vw, 110px); top: 50%; transform: translateY(-44%); width: min(37rem, 41vw); }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 26px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow-logos { display: flex; align-items: center; gap: 14px; padding-right: 16px; border-right: 1px solid var(--line-strong); }
.eyebrow-logos img { width: auto; height: 40px; }
.intro-copy h1 { font-size: clamp(40px, min(4.6vw, 7.4vh), 74px); }
.intro-lead { margin-top: 24px; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.6; color: var(--muted); max-width: 44ch; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.intro-visual { position: absolute; z-index: 3; right: clamp(24px, 5.5vw, 100px); top: 51%; width: min(47vw, 780px, calc((100vh - 220px) * 1.5)); width: min(47vw, 780px, calc((100svh - 220px) * 1.5)); transform: translateY(-50%); }
.intro-tag { position: absolute; left: 3%; top: -18px; z-index: 3; background: #fff; box-shadow: var(--ombra); }
/* Etichette fluttuanti (kit movimento): pillole bianche col rombo verde */
.fluttua > span { gap: 9px; padding: 9px 16px 9px 12px; font-size: 14px; font-weight: 650; box-shadow: var(--ombra-alta); }
.fluttua > span::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 2px; background: var(--verde); transform: rotate(45deg); }
.fluttua.is-accent > span::before { background: var(--verde-rl); }

/* MacBook ambientato: ombra verde-notte morbida, base chiara */
.macbook .mb-screen { box-shadow: 0 50px 90px -36px rgba(14, 51, 33, .45), 0 0 0 1px rgba(255, 255, 255, .4) inset; }
.macbook .mb-base { background: linear-gradient(#e9ecea, #a9b1ac); }
.mb-view > .screen-layer { position: absolute; inset: 0; overflow: hidden; }
/* Nelle scene l'app è un'immagine: la conversazione non scorre a mano (la porta in fondo presentation.js)
   e la manina che preme Invia non viene tagliata dalla card dell'assistente. */
.stage .ab-thread, .intro-visual .ab-thread { overflow: hidden; }
#assistente-mac .ab-ai { overflow: visible; }
#assistente-mac .ab-fig { border-radius: 22px 0 0 22px; }

/* =========================================================================
   Scene a passaggi: copia a sinistra, palcoscenico a destra
   ========================================================================= */
.scene { background: var(--fondo); overflow: hidden; }
.scene .paper { opacity: .7; }
.spread { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.48fr); align-items: center; gap: clamp(28px, 4vw, 72px); padding: 104px clamp(16px, 5vw, 96px) 104px; max-width: 1640px; margin: 0 auto; }
.copy { position: relative; }
.copy h2 { font-size: clamp(32px, min(3.5vw, 6.4vh), 58px); }
/* Passaggi: filo sottile con nodi a rombo (vuoto = da vedere, pieno = visto), il passo attivo è una pillola verde */
.step-choices { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.step-choices button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.step-choices button::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 1.5px; transform: rotate(45deg); border: 1.5px solid var(--verde); transition: background .2s ease; }
.step-choices button:hover { border-color: var(--verde); }
.step-choices button.is-done::before { background: var(--verde); }
.step-choices button[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: #fff; box-shadow: 0 8px 20px -10px rgba(2, 122, 55, .7); }
.step-choices button[aria-pressed="true"]::before { border-color: #fff; background: #fff; }
.step-caption { margin-top: 20px; min-height: 4.8em; font-size: 16px; line-height: 1.6; color: var(--ink); max-width: 46ch; padding-left: 16px; border-left: 2px solid var(--verde); }

.stage { position: relative; width: 100%; padding-bottom: 2%; }
.stage-floor { position: absolute; left: 6%; right: 6%; bottom: 6%; height: 20%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(14, 51, 33, .14), transparent 70%); filter: blur(8px); pointer-events: none; }
/* Il MacBook sta in larghezza e in altezza: sotto ci sono il filo o la nota */
.stage .macbook { position: relative; width: min(92%, calc((100vh - 330px) * 1.5)); width: min(92%, calc((100svh - 330px) * 1.5)); margin: 0 auto; }
.stage-note { position: relative; margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--soft); }
.stage-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 2px; transform: rotate(45deg); background: var(--verde-rl); }

/* ---------------------------------------------------------------------------
   01 Il percorso oggi: avviso nello schermo e filo degli stati sotto
   --------------------------------------------------------------------------- */
.filo { position: relative; display: flex; width: min(92%, calc((100vh - 330px) * 1.5)); width: min(92%, calc((100svh - 330px) * 1.5)); margin: 24px auto 0; }
.filo::before { content: ""; position: absolute; left: 10%; right: 10%; top: 5px; height: 1px; background: var(--line-strong); }
.filo li { position: relative; flex: 1; padding-top: 20px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--soft); transition: color .3s ease; }
.filo li::before { content: ""; position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 2px; transform: rotate(45deg); background: #fff; border: 1.5px solid var(--line-strong); box-shadow: 0 0 0 4px var(--fondo); transition: background .3s ease, border-color .3s ease, transform .3s ease; }
.filo li.is-done::before { background: var(--verde); border-color: var(--verde); }
.filo li.is-here { color: var(--ink); font-weight: 700; }
.filo li.is-here::before { background: var(--verde); border-color: var(--verde); transform: rotate(45deg) scale(1.35); box-shadow: 0 0 0 4px var(--fondo), 0 0 0 7px var(--verde-tenue); }

/* ---------------------------------------------------------------------------
   03 Il nuovo volto: «Oggi» a sinistra, «Proposta» a destra, separati dal cursore
   --------------------------------------------------------------------------- */
.vs-labels { position: relative; display: flex; justify-content: space-between; width: min(92%, calc((100vh - 330px) * 1.5)); width: min(92%, calc((100svh - 330px) * 1.5)); margin: 0 auto 14px; }
.vs-label { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.vs-label.is-oggi { background: #eef0ee; color: var(--grafite); border: 1px solid var(--line-strong); }
.vs-label.is-oggi::before { content: "◀"; font-size: 9px; }
.vs-label.is-prop { background: var(--verde-tenue); color: var(--verde-scuro); border: 1px solid var(--verde-linea); }
.vs-label.is-prop::after { content: "▶"; font-size: 9px; }
.vs-slot { touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.vs-view, .vs-prima, .vs-dopo { position: absolute; inset: 0; overflow: hidden; }
.vs-dopo { clip-path: inset(0 0 0 var(--pos, 50%)); }
.vs-handle { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--pos, 50%); width: 0; pointer-events: none; }
.vs-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(14, 51, 33, .2), 0 0 16px rgba(14, 51, 33, .35); }
.vs-handle i { position: absolute; left: 0; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; color: var(--verde); font-style: normal; font-size: 10px; letter-spacing: -.1em; box-shadow: 0 8px 20px -6px rgba(14, 51, 33, .45), 0 0 0 1px var(--verde-linea); }

/* ---------------------------------------------------------------------------
   05 Dati al sicuro: schema con le tre garanzie; il passaggio attivo resta pieno, il resto si attenua
   --------------------------------------------------------------------------- */
.schema { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1fr); grid-template-areas: "ai link viste" "model link out" "log log log"; gap: 16px 18px; width: min(100%, 860px); margin: 0 auto; padding: 28px; border-radius: 28px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); box-shadow: var(--ombra-alta); backdrop-filter: blur(2px); }
.sk-node, .sk-model, .sk-link { transition: opacity .45s ease, transform .45s ease, box-shadow .45s ease, border-color .45s ease; opacity: .62; }
.sk-node { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--ombra); }
.sk-node b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sk-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-tile); background: var(--verde-tenue); color: var(--verde); }
.sk-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sk-ai { grid-area: ai; align-items: center; text-align: center; background: linear-gradient(180deg, var(--verde-velo), #fff); }
.sk-om { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: #fff; border: 1px solid var(--verde-linea); }
.sk-om svg { width: 64px; height: 64px; display: block; }
.sk-model { grid-area: model; align-self: start; justify-self: center; text-align: center; }
.sk-model span { display: inline-block; padding: 7px 14px; border-radius: 14px; border: 1.5px dashed var(--verde); background: #fff; color: var(--verde-scuro); font-size: 13px; font-weight: 650; line-height: 1.35; }
.sk-link { grid-area: link; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.sk-arrow { position: relative; width: 100%; height: 2px; background: repeating-linear-gradient(90deg, var(--verde) 0 8px, transparent 8px 14px); background-size: 14px 2px; }
.sk-arrow i { position: absolute; right: -2px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-top: 2px solid var(--verde); border-right: 2px solid var(--verde); transform: rotate(45deg); }
.sk-read { padding: 6px 14px; border-radius: 999px; background: var(--verde-notte); color: #fff; font-size: 13px; font-weight: 700; }
.sk-ops { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sk-ops li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.sk-ops .is-ok { background: var(--verde-tenue); color: var(--verde-scuro); }
.sk-ops .is-ok::before { content: "✓"; }
.sk-ops .is-no { background: var(--rosso-bg); color: var(--rosso); text-decoration: line-through; }
.sk-ops .is-no::before { content: "✕"; text-decoration: none; display: inline-block; }
.sk-viste { grid-area: viste; }
.sk-bars { display: flex; align-items: flex-end; gap: 5px; height: 38px; }
.sk-bars i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: var(--verde); opacity: .85; }
.sk-out { grid-area: out; flex-direction: row; align-items: center; border: 1.5px dashed var(--rosso); background: var(--rosso-bg); }
.sk-out .sk-ico { flex: none; background: #fff; color: var(--rosso); }
.sk-out b { color: var(--rosso); font-size: 15px; }
.sk-log { grid-area: log; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 8px 14px; }
.sk-log .sk-ico { grid-row: span 2; }
.sk-lines { display: grid; gap: 4px; grid-column: 2; }
.sk-lines li { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-lines time { flex: none; font-weight: 700; color: var(--verde-scuro); font-variant-numeric: tabular-nums; }
/* Passaggio 1: viste aggregate e dati esclusi · 2: sola lettura · 3: registro e scelta del modello */
.schema .sk-ai { opacity: 1; }
.schema[data-step="0"] .sk-viste, .schema[data-step="0"] .sk-out,
.schema[data-step="1"] .sk-link, .schema[data-step="1"] .sk-viste,
.schema[data-step="2"] .sk-log, .schema[data-step="2"] .sk-model { opacity: 1; }
.schema[data-step="0"] .sk-viste, .schema[data-step="2"] .sk-log { border-color: var(--verde); box-shadow: 0 0 0 4px var(--verde-tenue), var(--ombra-alta); transform: translateY(-2px); }
.schema[data-step="0"] .sk-out { box-shadow: 0 0 0 4px rgba(180, 35, 24, .08), var(--ombra-alta); transform: translateY(-2px); }
.schema[data-step="1"] .sk-arrow { animation: sk-flusso .8s linear infinite; }
.schema[data-step="2"] .sk-lines li { animation: sk-riga .5s cubic-bezier(.2, .8, .2, 1) both; }
.schema[data-step="2"] .sk-lines li:nth-child(2) { animation-delay: .35s; }
.schema[data-step="2"] .sk-lines li:nth-child(3) { animation-delay: .7s; }
@keyframes sk-flusso { to { background-position: 14px 0; } }
@keyframes sk-riga { from { opacity: 0; transform: translateX(-10px); } }

/* =========================================================================
   02 Il patrimonio di dati: contatori reali, enti che arrivano, barre per anno
   ========================================================================= */
.dati { height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; background: var(--fondo); }
.dati .paper { opacity: .7; }
.dati-inner { position: relative; height: 100%; max-width: 1640px; margin: 0 auto; padding: 100px clamp(16px, 5vw, 96px) 92px; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); grid-template-rows: minmax(0, 1fr) auto auto; gap: 18px clamp(28px, 4vw, 72px); }
.dati-copy { grid-column: 1; grid-row: 1; align-self: center; }
.dati-copy h2 { font-size: clamp(32px, min(3.4vw, 6.2vh), 56px); }
.contatori { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: 12px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.contatori dt { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contatori b { display: block; margin-top: 4px; font-family: var(--font-display); font-size: clamp(30px, 3vw, 46px); font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.contatori div:first-child b { color: var(--verde-scuro); }
.enti { grid-column: 2; grid-row: 1; align-self: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 10px 0 24px; }
.ente { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--ombra-alta); will-change: transform, opacity; }
/* Sfalsate in verticale con translate (GSAP anima transform: non si toccano) */
.ente:nth-child(even) { translate: 0 26px; }
.ente::before { content: ""; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--verde-tenue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23027a37' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V6l8-3v17M12 9h8v11M2 20h20M7 9h2M7 13h2M15 13h2M15 16h2'/%3E%3C/svg%3E") center / 19px no-repeat; }
.ente b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.ente small { flex: none; padding: 2px 8px; border-radius: 999px; background: #eef0ee; color: var(--grafite); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ente:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
.anni { grid-column: 1 / -1; grid-row: 2; }
.anni-barre { display: grid; grid-template-columns: repeat(var(--n, 17), minmax(0, 1fr)); gap: 6px; align-items: end; height: clamp(48px, 9vh, 92px); padding: 0 2px; border-bottom: 1px solid var(--line-strong); }
.anno { position: relative; display: block; height: var(--h); border-radius: 4px 4px 1px 1px; background: var(--verde); opacity: .82; }
.anno.is-peak { background: var(--verde-scuro); opacity: 1; }
.anno.is-part { background: repeating-linear-gradient(135deg, var(--verde) 0 3px, #9fcfb1 3px 6px); }
.anno small { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--verde-scuro); font-variant-numeric: tabular-nums; opacity: 0; }
.anno.is-peak small { opacity: 1; }
.anni-filo { position: relative; display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.anni-filo span { display: inline-flex; align-items: center; gap: 8px; }
.anni-filo span::before { content: ""; width: 8px; height: 8px; border-radius: 1.5px; background: var(--verde); transform: rotate(45deg); }
.anni-filo span:last-child { flex-direction: row-reverse; }
.dati-note { grid-column: 1 / -1; grid-row: 3; font-size: 12.5px; color: var(--soft); }
.dati-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 2px; transform: rotate(45deg); background: var(--verde-rl); }

/* =========================================================================
   06 Provatelo voi: MacBook sopra i 900 px, iPhone sotto
   ========================================================================= */
.prova { display: flex; height: 100vh; height: 100svh; min-height: 620px; padding: 84px clamp(16px, 4vw, 64px) 78px; background: var(--fondo); overflow: hidden; }
.prova-inner { position: relative; flex: 1; width: 100%; max-width: 1500px; min-height: 0; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px 24px; }
.prova-head { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.prova-head .track { margin: 0; align-self: center; }
.prova-head h2 { font-size: clamp(24px, 2.2vw, 34px); }
.prova-lead { flex-basis: 100%; font-size: 14px; line-height: 1.5; color: var(--muted); }
.proto-bar { grid-column: 2; grid-row: 1; align-self: start; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.proto-reset { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--verde-scuro); font-size: 13px; font-weight: 650; }
.proto-reset:hover { border-color: var(--verde); }
/* Le missioni hanno una riga tutta loro sotto il titolo e vanno a capo (know-how §2) */
.missions { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: mission; }
.missions li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px; counter-increment: mission; background: #fff; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; transition: background .3s ease, border-color .3s ease; }
.missions li::before { content: counter(mission); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--verde-tenue); color: var(--verde-scuro); font-size: 11px; font-weight: 800; }
.missions li.is-done { background: var(--verde-tenue); border-color: var(--verde); }
.missions li.is-done::before { content: "✓"; background: var(--verde); color: #fff; }
.proto-stage { grid-column: 1 / -1; grid-row: 3; min-height: 0; display: flex; align-items: center; justify-content: center; }
.proto-mac { flex: none; width: 70%; }
.proto-mac .macbook { width: 100%; }
.proto-slot { aspect-ratio: 980 / 612; }
.proto-phone { display: none; }

/* =========================================================================
   07 Prossimi passi e richiesta finale
   ========================================================================= */
.closing { display: flex; align-items: center; padding: 96px clamp(16px, 6vw, 110px) 104px; background: #fff; overflow: hidden; }
.closing .paper { opacity: .45; }
.closing-inner { position: relative; width: 100%; max-width: 1240px; margin: 0 auto; }
.closing-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: end; gap: 0 48px; }
.closing-head .track { grid-column: 1 / -1; }
.closing-head h2 { font-size: clamp(32px, 3.5vw, 54px); }
.closing-head .lead { margin: 0 0 6px; }
.tappe { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 40px; padding-top: 32px; }
/* Il filo con i nodi a rombo: le prime due tappe piene, il pilota vuoto */
.tappe::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, var(--verde) 0 66%, var(--line-strong) 66%); }
.tappe li { position: relative; padding: 22px 24px 24px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--ombra); }
.tappe li::before { content: ""; position: absolute; left: 28px; top: -38px; width: 11px; height: 11px; border-radius: 2px; transform: rotate(45deg); background: var(--verde); box-shadow: 0 0 0 5px #fff; }
.tappe li:last-child::before { background: #fff; border: 1.5px solid var(--verde); }
.tappa-num { display: block; font-family: var(--font-display); font-size: 48px; font-weight: 300; letter-spacing: -.04em; line-height: 1; color: var(--verde); font-variant-numeric: tabular-nums; }
.tappa-ico { position: absolute; right: 24px; top: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-tile); background: var(--verde-tenue); color: var(--verde); }
.tappa-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tappe h3 { margin-top: 16px; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.tappe p { margin-top: 8px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.ask { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 24px; margin-top: 22px; padding: 26px 34px; border-radius: 26px; color: #fff; overflow: hidden; background: linear-gradient(135deg, var(--verde-notte) 0%, var(--verde-notte-2) 100%); box-shadow: 0 30px 60px -30px rgba(14, 51, 33, .6); }
.ask::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 60px; border: 1px solid rgba(255, 255, 255, .12); transform: rotate(45deg); pointer-events: none; }
.ask-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a8e0b8; }
.ask-text { margin-top: 10px; max-width: 46ch; font-family: var(--font-display); font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.ask-omino { position: relative; z-index: 1; justify-self: center; width: 140px; }
.ask-omino svg { display: block; width: 100%; height: auto; }

/* =========================================================================
   08 Alesca
   ========================================================================= */
.outro { display: grid; place-items: center; background: var(--fondo); padding: 100px 16px 130px; text-align: center; }
.outro-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.outro-logo { width: clamp(160px, 20vw, 260px); height: auto; }
.outro-line { max-width: 32ch; font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 32px); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
.outro-line span { color: var(--verde); }
.outro-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 14px; font-weight: 600; color: var(--muted); }
.outro-link:hover { color: var(--verde); border-color: var(--verde); }

/* =========================================================================
   Indice a rombi e player
   ========================================================================= */
.chapter-nav { position: fixed; right: 22px; top: 50%; z-index: 30; display: grid; gap: 16px; transform: translateY(-50%); }
.chapter-nav::before { content: ""; position: absolute; left: 4.5px; top: 4px; bottom: 4px; width: 1px; background: var(--line-strong); }
.chapter-nav a { position: relative; display: block; width: 10px; height: 10px; }
.chapter-nav a::after { content: ""; position: absolute; inset: 1px; border-radius: 1.5px; transform: rotate(45deg); background: #fff; border: 1.5px solid var(--soft); transition: transform .25s ease, background .25s ease, border-color .25s ease; }
.chapter-nav a[aria-current]::after { background: var(--verde); border-color: var(--verde); transform: rotate(45deg) scale(1.45); }
.chapter-nav a span { position: absolute; right: 24px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; pointer-events: none; padding: 6px 12px; border-radius: 999px; background: var(--verde-notte); color: #fff; font-size: 12.5px; font-weight: 600; opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.chapter-nav a:hover span, .chapter-nav a:focus-visible span { opacity: 1; transform: translate(0, -50%); }

.player { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; overflow: hidden; background: rgba(14, 51, 33, .9); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(14, 51, 33, .28); color: #fff; }
.player > button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 16px; }
.player > button:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.player > .chapter-jump { font-size: 20px; line-height: 1; padding-bottom: 3px; }
.player #play { background: var(--verde); }
.player #play:hover { background: var(--verde-rl); }
.player-counter { min-width: 60px; text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.player-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.player-progress i { display: block; height: 100%; background: var(--verde-rl); transform-origin: left; transform: scaleX(0); }

/* Stato della scena fissata */
.story-progress { display: none; }
.story-chapter .story-progress { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 12.5px; font-weight: 700; }
.story-chapter .story-progress + .step-choices { margin-top: 10px; }
.story-position { font-variant-numeric: tabular-nums; color: var(--verde); }
.story-hint { margin-left: auto; color: var(--soft); font-size: 12px; font-weight: 600; }
.story-chapter .spread { height: 100vh; height: 100svh; min-height: 0; }

@media (max-height: 800px) and (min-width: 901px) {
  .story-chapter .lead { display: none; }
  .spread { padding-top: 92px; padding-bottom: 96px; }
  .dati-inner { padding-top: 88px; padding-bottom: 84px; }
  .dati .lead { font-size: 16px; margin-top: 14px; }
  .contatori { margin-top: 18px; padding-top: 16px; }
  .schema { padding: 20px; gap: 12px 14px; }
  .sk-node { padding: 14px 16px; }
}
@media (max-width: 1100px) and (min-width: 901px) { .chapter-nav { right: 10px; } }

/* =========================================================================
   Telefono e tablet stretti: una colonna, dispositivi scalati
   ========================================================================= */
@media (max-width: 900px) {
  h2 { font-size: clamp(28px, 7.6vw, 44px); }
  .masthead { height: 60px; }
  .brand { font-size: 14px; padding: 4px 12px 4px 4px; }
  .brand-mark, .brand-mark img { width: 28px; height: 28px; }
  .brand-client { width: 64px; padding-left: 10px; }
  .chapter-nav { display: none; }

  .intro-rombo { right: -40vw; top: 26%; width: 100vw; height: 100vw; }
  .intro-copy { left: 16px; right: 16px; top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); width: auto; transform: none; }
  .intro-copy h1 { font-size: clamp(30px, 8.2vw, 44px); }
  .eyebrow { margin-bottom: 14px; font-size: 10.5px; gap: 8px 12px; }
  .eyebrow-logos { gap: 10px; padding-right: 12px; }
  .eyebrow-logos img { height: 28px; }
  .intro-lead { margin-top: 12px; font-size: 15px; line-height: 1.5; }
  .intro-actions { margin-top: 18px; }
  .intro-actions .button { padding: 12px 20px; font-size: 14px; }
  .intro-visual { left: 24px; right: 24px; top: 92px; width: auto; transform: none; }
  .intro-tag { top: -14px; font-size: 11px; padding: 3px 10px 3px 8px; }
  .fluttua > span { font-size: 11.5px; padding: 6px 11px 6px 9px; gap: 7px; }
  .fluttua > span::before { width: 7px; height: 7px; }

  .spread { grid-template-columns: minmax(0, 1fr); padding: 80px 16px 104px; gap: 22px; }
  .copy h2 { font-size: clamp(26px, 7vw, 36px); }
  .scene .lead { display: none; }
  .track { margin-bottom: 12px; }
  .step-choices { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 16px -16px 0; padding: 0 16px; border: 0; }
  .step-choices::-webkit-scrollbar { display: none; }
  .step-choices button { flex: none; padding: 7px 13px 7px 10px; font-size: 13px; }
  .step-caption { min-height: 0; margin-top: 14px; font-size: 14px; line-height: 1.5; padding-left: 12px; }
  .stage .macbook, .vs-labels, .filo { width: 94%; }
  .stage-note { font-size: 11.5px; margin-top: 12px; }
  .filo { margin-top: 16px; }
  /* Su telefono restano solo i nodi: il nome dello stato è già nel pulsante del passaggio */
  .filo li { font-size: 0; padding-top: 14px; }
  .vs-labels { margin-bottom: 10px; }
  .vs-label { font-size: 12px; padding: 4px 11px; }

  /* Scena fissata: una colonna, il dispositivo riempie lo spazio che resta */
  .story-chapter .spread { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 12px; padding: 72px 16px calc(84px + env(safe-area-inset-bottom)); }
  .story-chapter .copy { display: contents; }
  .story-chapter .track { display: none; }
  .story-chapter h2 { order: 1; font-size: clamp(24px, 6.6vw, 34px); }
  .story-chapter .lead { display: none; }
  .story-chapter .story-progress { order: 2; margin: 0; }
  .story-chapter .story-hint { display: none; }
  .story-chapter .step-choices { order: 3; margin: 0 -16px; padding-top: 0; }
  .story-chapter .step-caption { order: 4; margin: 0; }
  .story-chapter .stage { order: 5; flex: none; margin-top: 6px; }

  .schema { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "ai viste" "link link" "model out" "log log"; gap: 10px; padding: 14px; border-radius: 20px; }
  .sk-node { padding: 12px; gap: 6px; border-radius: 16px; }
  .sk-node b { font-size: 13.5px; }
  .sk-ico { width: 32px; height: 32px; border-radius: 10px; }
  .sk-ico svg { width: 17px; height: 17px; }
  .sk-om { width: 54px; height: 54px; border-radius: 16px; }
  .sk-om svg { width: 46px; height: 46px; }
  .sk-bars { height: 24px; }
  .sk-link { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sk-arrow { width: 40px; flex: none; }
  .sk-read { font-size: 12px; padding: 4px 10px; }
  .sk-ops li { font-size: 11px; padding: 2px 8px; }
  .sk-model span { font-size: 11.5px; padding: 6px 10px; }
  .sk-out b { font-size: 13px; }
  .sk-lines li { font-size: 11.5px; }
  .sk-lines li:nth-child(n+2) { display: none; }

  .dati-inner { display: flex; flex-direction: column; gap: 14px; padding: 76px 16px calc(84px + env(safe-area-inset-bottom)); }
  .dati-copy { align-self: stretch; }
  .dati-copy h2 { font-size: clamp(26px, 7vw, 36px); }
  .dati .lead { font-size: 14px; line-height: 1.5; margin-top: 10px; }
  .contatori { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 14px; padding-top: 12px; }
  .contatori dt { font-size: 9.5px; letter-spacing: .04em; }
  .contatori b { font-size: clamp(20px, 6vw, 30px); }
  .enti { flex: 1; min-height: 0; align-content: center; gap: 8px 10px; padding: 0 0 12px; }
  .ente { gap: 8px; padding: 7px 10px 7px 7px; border-radius: 14px; }
  .ente::before { width: 28px; height: 28px; border-radius: 9px; background-size: 15px; }
  .ente b { font-size: 12px; }
  .ente small { font-size: 10px; padding: 1px 6px; }
  .ente:nth-child(even) { translate: 0 12px; }
  .anni-barre { gap: 3px; height: 44px; }
  .dati-note { font-size: 11.5px; }

  .prova { padding: 68px 12px calc(80px + env(safe-area-inset-bottom)); }
  .prova-inner { display: flex; flex-direction: column; gap: 8px; }
  .prova-head { gap: 2px 10px; }
  .prova-head .track { display: none; }
  .prova-head h2 { font-size: clamp(22px, 6.2vw, 30px); }
  .prova-lead { font-size: 13px; }
  .proto-bar { flex-direction: row; align-items: center; justify-content: flex-end; }
  .proto-reset { flex: none; padding: 5px 12px; font-size: 12.5px; }
  .missions li { font-size: 12px; }
  .proto-stage { flex: 1; align-items: stretch; }
  .proto-mac { display: none; }
  .proto-phone { display: block; flex: 1; min-width: 0; }
  .proto-phone > .device-slot { height: 100%; }

  .closing { padding: 84px 16px 110px; }
  .closing-head { grid-template-columns: 1fr; }
  .closing-head .lead { margin-top: 14px; }
  .tappe { grid-template-columns: 1fr; gap: 14px; margin-top: 32px; padding-top: 0; padding-left: 26px; }
  .tappe::before { left: 5px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; background: linear-gradient(180deg, var(--verde) 0 66%, var(--line-strong) 66%); }
  .tappe li { padding: 20px; }
  .tappe li::before { left: -26px; top: 24px; }
  .tappa-num { font-size: 40px; }
  .tappa-ico { right: 18px; top: 20px; }
  .tappe h3 { margin-top: 14px; font-size: 18px; }
  .ask { grid-template-columns: 1fr; padding: 24px 22px; }
  .ask-omino { width: 104px; justify-self: end; margin-top: -10px; }
}
@media (max-width: 900px) and (max-height: 760px) {
  .intro-lead { display: none; }
  .dati .lead { display: none; }
  .prova-lead { display: none; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .story-chapter .step-caption { display: none; }
}
@media (max-width: 600px) { .player-counter { min-width: 48px; } .player > button { width: 38px; height: 38px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Telefono: le missioni restano su una riga che scorre di lato (setPressed-like in markMission), per lasciare spazio all'iPhone */
@media (max-width: 600px) {
  .missions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding-inline: 12px; }
  .missions::-webkit-scrollbar { display: none; }
  .missions li { flex: none; }
}
