/*
  AIBGolf · Dalla gara alla classifica. Direzione «Il campo»:
  fondo chiaro con le strisce del taglio del fairway, verde bosco come accento, curve di livello del green
  come motivo; i capitoli degli SVILUPPI FUTURI passano al color sabbia (bunker) con bordo tratteggiato.
  Contrasti dei testi (WCAG): --ink su --prato 15,9:1 · --slate su --prato 6,4:1 · --erba-testo su --prato 6,9:1
  · bianco su --erba 6,8:1 · --sabbia-testo su --sabbia-fondo 7,4:1.
*/
:root {
  --prato: #f3f6ef;          /* fondo */
  --carta: #ffffff;
  --striscia: #e8efe3;       /* strisce del fairway (grafica) */
  --erba: #1f6b3a;           /* accento: pulsanti, passaggio attivo, marchio */
  --erba-scura: #165130;
  --erba-testo: #1d6537;
  --bosco: #0f3d26;          /* player, apertura e chiusura */
  --green: #8cc97a;          /* luce del green (solo su fondo scuro) */
  --ink: #13261b;
  --slate: #4c5e52;
  --linea: #d6e0d2;
  --sabbia: #c59a3e;         /* sviluppi futuri */
  --sabbia-fondo: #f7efdc;
  --sabbia-testo: #6b4c0c;
  --rosso: #b42318;
  --velo: rgba(31, 107, 58, .22);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, "SF Pro Display", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "SF Mono", ui-monospace, Consolas, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --mv-surface: var(--carta); --mv-text: var(--ink); --mv-line: var(--linea); --mv-accent: var(--erba); --mv-accent-ink: #fff;
  --mv-highlight: #f3d98a; --mv-muted: var(--slate);
  --ty-text: var(--ink); --ty-muted: var(--slate); --ty-caret: var(--erba); --ty-send: var(--erba); --ty-ring: var(--erba);
  --ty-finger: #fff; --ty-finger-line: var(--erba-scura); --ty-finger-mark: #b8dcae;

  --st-font: var(--font);
  --st-accent: var(--erba);
  --st-pick-fg: var(--ink);
  --st-pick-border: var(--linea);
  --st-pick-on-bg: var(--erba);
  --st-pick-on-fg: #fff;
  --st-mac-wallpaper: radial-gradient(70% 60% at 78% 24%, #b9e0a6 0%, transparent 60%), repeating-linear-gradient(115deg, rgba(255, 255, 255, .07) 0 60px, transparent 60px 120px), linear-gradient(165deg, #3f8f55 0%, #1f6b3a 55%, #0f3d26 100%);
  --st-win-wallpaper: radial-gradient(60% 70% at 50% 110%, #0f3d26 0%, transparent 70%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 80px, transparent 80px 160px), linear-gradient(180deg, #d8ecd0 0%, #6fae6a 55%, #1f6b3a 100%);
  --st-phone-wallpaper: radial-gradient(90% 50% at 20% 10%, #c8e8b8 0%, transparent 60%), repeating-linear-gradient(160deg, rgba(255, 255, 255, .08) 0 26px, transparent 26px 52px), linear-gradient(170deg, #4f9d5f 0%, #1f6b3a 55%, #0f3d26 100%);

  font-family: var(--font);
  color-scheme: light;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.story-guided { scroll-behavior: auto; }
body { margin: 0; background: var(--prato); color: var(--ink); overflow-x: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2 { font-family: var(--font-display); font-weight: 680; letter-spacing: -0.034em; line-height: 1.03; text-wrap: balance; }
h1 { font-size: clamp(40px, min(5vw, 8vh), 84px); }
h2 { font-size: clamp(32px, min(3.4vw, 6.2vh), 58px); }
.soft { color: var(--erba-testo); }
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(--erba); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.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: 8px; transition: transform .2s ease; }
.skip-link:focus { transform: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: inherit; }

/* 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: 5px 16px 5px 5px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--linea); box-shadow: 0 8px 24px rgba(15, 61, 38, .08); font-weight: 700; font-size: 15px; letter-spacing: -.01em; backdrop-filter: blur(10px); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-product { padding-left: 10px; border-left: 1px solid var(--linea); color: var(--slate); font-weight: 600; font-size: 13px; }

/* Etichette di capitolo: il numero della buca */
.eyebrow, .track { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.code { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--erba); color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.track .is-now { display: inline-flex; align-items: center; gap: 7px; letter-spacing: .08em; }
.track .is-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--erba); box-shadow: 0 0 0 3px rgba(31, 107, 58, .18); }
.evo-tag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 2px dashed var(--sabbia); border-radius: 999px; letter-spacing: .08em; color: var(--sabbia-testo); background: var(--sabbia-fondo); }
.track.is-evo .code { background: var(--sabbia); color: #2e2208; }
.proto-label { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--erba); color: #fff; letter-spacing: .1em; }

.chapter { position: relative; min-height: 100vh; min-height: 100svh; }
.lead { margin-top: 18px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; color: var(--slate); 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; }
.button.primary { background: var(--erba); color: #fff; box-shadow: 0 10px 24px -8px var(--velo), 0 4px 12px var(--velo); }
.button.primary:hover { background: var(--erba-scura); transform: translateY(-1px); }
.text-link { font-size: 14px; font-weight: 600; color: var(--slate); }
.text-link:hover { color: var(--erba-testo); }
.ag-missing { display: grid; place-items: center; width: 100%; height: 100%; min-height: 140px; background: repeating-linear-gradient(135deg, var(--prato) 0 14px, #fff 14px 28px); color: var(--slate); font: 600 16px/1.3 var(--font); text-align: center; }
.ag-missing span { display: grid; gap: 2px; padding: 10px 18px; border-radius: 16px; background: #fff; border: 1.5px dashed var(--linea); }
.ag-missing small { font-size: 12px; }

/* Motivo: curve di livello del green (apertura e chiusura) */
.green-lines { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-radial-gradient(ellipse 60% 44% at 74% 56%, transparent 0 34px, rgba(140, 201, 122, .22) 34px 35.5px),
    radial-gradient(ellipse 40% 30% at 74% 56%, rgba(140, 201, 122, .18), transparent 70%); }

/* =========================================================================
   00 Apertura: fondo bosco, MacBook a tre quarti
   ========================================================================= */
.intro { height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; background: linear-gradient(160deg, #134a2d 0%, var(--bosco) 55%, #0a2a1a 100%); color: #fff; }
.intro .eyebrow { color: #cfe8c6; }
.intro .soft { color: var(--green); }
.intro-copy { position: absolute; z-index: 4; left: clamp(16px, 6vw, 110px); top: 50%; transform: translateY(-46%); width: min(38rem, 42vw); }
.intro-lead { margin-top: 22px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; color: #d4e5d7; max-width: 46ch; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.intro .button.primary { background: #fff; color: var(--bosco); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); }
.intro .button.primary:hover { background: #e7f4e1; }
.intro .text-link { color: #cfe8c6; }
.intro-visual { position: absolute; z-index: 3; right: 3vw; top: 50%; width: min(52vw, calc((100svh - 200px) * 1.55)); transform: translateY(-50%); perspective: 1600px; }
.intro-device { transform: rotateY(-24deg) rotateX(6deg) rotate(-1.5deg); transform-origin: 30% 50%; transform-style: preserve-3d; }
.intro-device .macbook .mb-screen { box-shadow: -40px 50px 90px -30px rgba(0, 0, 0, .6); }
.intro-visual .fluttua { z-index: 4; }
.fluttua > span { gap: 8px; padding: 9px 15px; border-color: var(--linea); font-size: 15px; font-weight: 650; box-shadow: 0 14px 32px -10px rgba(0, 0, 0, .35); }

/* =========================================================================
   Scene: struttura comune (il kit transizioni decide i lati)
   ========================================================================= */
.scene { overflow: hidden; background: var(--prato); }
/* Strisce del fairway, molto leggere: il prato tagliato */
.scene::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(100deg, var(--striscia) 0 140px, transparent 140px 280px); opacity: .55; }
.spread {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center; gap: clamp(28px, 4vw, 72px); padding: 110px clamp(16px, 5vw, 96px) 110px; max-width: 1640px; margin: 0 auto;
}
.scene.tr-chapter .spread { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.scene.tr-chapter[data-focus="left"] .spread { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.scene.is-wide.tr-chapter .spread { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.scene.is-wide.tr-chapter[data-focus="left"] .spread { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); }
.scene.is-phone.tr-chapter .spread { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.copy { position: relative; z-index: 2; }
.step-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.step-choices button { padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid var(--linea); background: var(--carta); color: var(--ink); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.step-choices button:hover { border-color: #b4c6ae; }
.step-choices button.is-done { border-color: #b4c6ae; color: var(--erba-testo); }
.step-choices button[aria-pressed="true"] { background: var(--erba); border-color: var(--erba); color: #fff; box-shadow: 0 6px 16px var(--velo); }
/* La didascalia: una linea di tiro tratteggiata che termina con la bandierina */
.step-caption { position: relative; margin-top: 18px; min-height: 4.8em; font-size: 16px; line-height: 1.55; color: var(--ink); max-width: 46ch; padding-left: 20px; }
.step-caption::before { content: ""; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 2px; background: repeating-linear-gradient(to bottom, var(--erba) 0 6px, transparent 6px 11px); }
.step-caption::after { content: ""; position: absolute; left: 0; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--erba); }
.stage { position: relative; width: 100%; z-index: 1; }
.stage-tag { position: absolute; z-index: 3; right: 2%; top: 3%; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px 9px 12px; border-radius: 999px; background: var(--carta); color: var(--ink); border: 1px solid var(--linea); font-size: 14.5px; font-weight: 650; white-space: nowrap; box-shadow: 0 14px 32px -10px rgba(15, 61, 38, .28); }
.stage-tag:empty { display: none; }
.stage-tag svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--erba); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stage-tag.is-ok { border-color: #a9d3a0; }
.stage-tag.is-warn { border-color: #e2c45b; background: #fff9df; }
.stage-tag.is-warn svg { stroke: #9a6b00; }
.stage-tag.is-evo { border: 2px dashed var(--sabbia); background: var(--sabbia-fondo); color: var(--sabbia-testo); }
.stage-tag.is-evo svg { stroke: var(--sabbia-testo); }
.stage-tag.is-new { animation: tag-in .5s var(--ease) both; }
@keyframes tag-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
[data-focus="left"] .stage-tag { right: auto; left: 2%; }

/* Schermate nei dispositivi */
.screen-layer { position: absolute; inset: 0; overflow: hidden; transition: transform .9s var(--ease); }
.screen-layer > .ag-app { height: 100%; }
.screen-layer .ag-app { scrollbar-width: none; }
.screen-layer .ag-app::-webkit-scrollbar { display: none; }
.screen-layer .ag-tip { animation: tip-in .35s var(--ease) both; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 6px); } }
.phone-fallback { position: absolute; inset: 0; border-radius: 40px; overflow: hidden; background: #fff; }
.mb-view .mac-win.is-browser { border-radius: 0; border: 0; box-shadow: none; }
.macbook .mb-screen { box-shadow: 0 40px 80px -28px rgba(15, 61, 38, .45); }
.monitor .mon-screen { box-shadow: 0 40px 80px -28px rgba(15, 61, 38, .45); }
.desk { background: var(--st-win-wallpaper); }
.desk .wf-win.is-browser { border-radius: 0; border: 0; box-shadow: none; }
.desk .wf-win.is-browser .wf-body { display: flex; flex-direction: column; overflow: hidden; background: #f4f6f3; }
.win-addr { flex: 0 0 38px; display: flex; align-items: center; padding: 0 12px; background: #f7f8fa; border-bottom: 1px solid #e2e5ea; }
.win-addr span { flex: 1; display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid #e2e5ea; font-size: 12.5px; color: #3b4350; }
.win-lock { position: relative; width: 8px; height: 7px; border-radius: 1px; background: #8b95a3; margin-top: 3px; flex: none; }
.win-lock::before { content: ""; position: absolute; left: 1px; top: -5px; width: 4px; height: 5px; border: 1.5px solid #8b95a3; border-bottom: 0; border-radius: 3px 3px 0 0; }
.win-page { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ag-ch-table-wrap { overflow: visible; }

/* Dimensioni dei dispositivi: entro l'altezza dello schermo */
.scene .macbook { width: min(100%, calc((100svh - 250px) * 1.5)); margin-inline: auto; }
.scene .monitor { width: min(100%, calc((100svh - 300px) * 1.62)); margin-inline: auto; }
.is-phone .phone-stand { width: min(300px, calc((100svh - 260px) * 320 / 660)); margin-inline: auto; }

/* 03 e 07: composizione centrale, titolo in alto, dispositivo grande */
.scene.is-center.tr-chapter .spread { grid-template-rows: auto minmax(0, 1fr); align-content: center; gap: 16px; padding-top: 96px; padding-bottom: 96px; }
.scene.is-center [data-transition-copy] { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 6px 36px; text-align: left !important; max-width: 1240px; margin-inline: auto; width: 100%; }
.scene.is-center [data-transition-copy] .track { grid-column: 1 / -1; margin-bottom: 4px; }
.scene.is-center [data-transition-copy] h2 { grid-column: 1; }
.scene.is-center [data-transition-copy] .step-choices { grid-column: 2; margin: 0; justify-content: flex-end; }
.scene.is-center [data-transition-copy] .step-caption { grid-column: 1 / -1; min-height: 0; max-width: 90ch; }
.scene.is-center .monitor { width: min(100%, calc((100svh - 370px) * 1.62)); }
.scene.is-center .macbook { width: min(100%, calc((100svh - 360px) * 1.52)); }

/* 06 Tre dispositivi che si passano il fuoco */
.is-trio .spread { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(0, 1fr); gap: 18px; padding-top: 96px; padding-bottom: 100px; }
.is-trio [data-transition-copy] { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 6px 36px; max-width: 1240px; width: 100%; margin-inline: auto; text-align: left !important; }
.is-trio [data-transition-copy] .track { grid-column: 1 / -1; margin-bottom: 4px; }
.is-trio [data-transition-copy] .step-choices { grid-column: 2; margin: 0; justify-content: flex-end; }
.is-trio [data-transition-copy] .step-caption { grid-column: 1 / -1; min-height: 0; max-width: 90ch; }
.trio { display: grid; grid-template-columns: 1.25fr .42fr 1.15fr; align-items: end; gap: clamp(14px, 2vw, 34px); max-width: min(1400px, calc((100svh - 330px) * 3.2)); margin-inline: auto; }
.trio-item { position: relative; transition: transform .8s var(--ease), opacity .6s ease, filter .6s ease; transform-origin: 50% 100%; opacity: .5; filter: saturate(.5); transform: scale(.9); }
.trio .macbook, .trio .monitor { width: 100%; }
.trio[data-focus-device="0"] .trio-item[data-k="0"],
.trio[data-focus-device="1"] .trio-item[data-k="1"],
.trio[data-focus-device="2"] .trio-item[data-k="2"] { opacity: 1; filter: none; transform: scale(1.04) translateY(-6px); z-index: 2; }
.trio-item::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -14px; height: 4px; border-radius: 2px; background: var(--erba); transform: scaleX(0); transition: transform .6s var(--ease); }
.trio[data-focus-device="0"] .trio-item[data-k="0"]::after,
.trio[data-focus-device="1"] .trio-item[data-k="1"]::after,
.trio[data-focus-device="2"] .trio-item[data-k="2"]::after { transform: scaleX(1); }

/* =========================================================================
   Sviluppi futuri: color sabbia, bordo tratteggiato
   ========================================================================= */
.is-future { background: var(--sabbia-fondo); }
.is-future::before { background: radial-gradient(circle at 20% 30%, rgba(197, 154, 62, .14) 0 2px, transparent 2.5px) 0 0 / 22px 22px; opacity: 1; }
.is-future .soft { color: var(--sabbia-testo); }
.is-future .step-choices button[aria-pressed="true"] { background: var(--sabbia-testo); border-color: var(--sabbia-testo); }
.is-future .step-caption::before { background: repeating-linear-gradient(to bottom, var(--sabbia) 0 6px, transparent 6px 11px); }
.is-future .step-caption::after { background: var(--sabbia); }
.is-future .lead { color: #5c4a26; }
.is-future .macbook .mb-screen, .is-future .device.iphone { outline: 3px dashed var(--sabbia); outline-offset: 10px; }
.future-gate { position: absolute; z-index: 3; left: 50%; top: 84px; transform: translateX(-50%); }
.future-gate span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--sabbia-testo); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.chapter-nav a.is-future::after { border-style: dashed; border-color: var(--sabbia); }

/* 10 Due flussi */
.is-flow .spread { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.flow { display: grid; gap: 22px; }
.lane-row { display: flex; align-items: center; gap: 10px; padding: 22px; border-radius: 22px; border: 2px dashed rgba(107, 76, 12, .3); background: rgba(255, 255, 255, .6); transition: opacity .5s ease, transform .6s var(--ease), border-color .5s ease, background .5s ease; opacity: .45; transform: scale(.97); }
.flow[data-lane="0"] .lane-row[data-lane="0"], .flow[data-lane="1"] .lane-row[data-lane="1"] { opacity: 1; transform: none; border-color: var(--sabbia); background: #fff; box-shadow: 0 18px 40px -20px rgba(107, 76, 12, .35); }
.node { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 14px; background: var(--prato); text-align: center; }
.node b { font-size: 15px; }
.node small { font-size: 12.5px; color: var(--slate); }
.node.is-core { background: var(--erba); color: #fff; }
.node.is-core small { color: #d8ecd0; }
.node.is-info { background: #e9f0f6; }
.node i { width: 34px; height: 34px; border-radius: 9px; background: currentColor; opacity: .85; -webkit-mask: var(--ico) center / 22px no-repeat; mask: var(--ico) center / 22px no-repeat; }
.ico-file { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M6 2h8l4 4v16H6z'/%3E%3Cpath d='M9 12h6M9 16h6'/%3E%3C/svg%3E"); color: var(--erba); }
.ico-check { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='m5 12 4.5 4.5L19 7'/%3E%3C/svg%3E"); color: var(--erba); }
.ico-flag { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6 22V2l12 5-12 5'/%3E%3C/svg%3E"); color: #fff; }
.ico-sheet { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M3 15h18M10 4v16'/%3E%3C/svg%3E"); color: #1d6f42; }
.ico-table { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 10h18M9 10v9'/%3E%3C/svg%3E"); color: #2f5f8a; }
.arrow { flex: 0 0 34px; height: 2px; background: var(--sabbia); position: relative; }
.arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--sabbia); border-right: 0; }
.arrow.is-long { flex: 1.4; }
.flow-note { padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--sabbia); background: rgba(255, 255, 255, .7); font-size: 14px; color: var(--sabbia-testo); }

/* =========================================================================
   11 Provatelo voi (come ParcheggiAPP: intestazione nella testata, postazione ampia)
   ========================================================================= */
.prova { display: flex; height: 100vh; height: 100svh; min-height: 620px; padding: 80px clamp(16px, 4vw, 64px) 76px; background: var(--prato); 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) auto; gap: 10px 24px; }
.prova-head { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-width: 0; }
.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(--slate); max-width: 90ch; }
.proto-bar { grid-column: 2; grid-row: 1; align-self: start; display: flex; align-items: center; gap: 8px; }
.proto-reset { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--linea); background: var(--carta); color: var(--erba-testo); font-size: 13px; font-weight: 650; }
.proto-reset:hover { border-color: var(--erba); }
.missions-box { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.missions-sum { display: none; }
.missions { display: flex; flex-wrap: wrap; gap: 6px 8px; counter-reset: mission; min-width: 0; }
.missions li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; counter-increment: mission; background: var(--carta); border: 1px solid var(--linea); font-size: 13px; font-weight: 600; }
.missions li::before { content: counter(mission); display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: #e3efdd; color: var(--erba-testo); font: 700 11px/1 var(--font-mono); }
.missions li small { font-weight: 600; color: var(--sabbia-testo); }
.missions li.is-evo-mission { border-style: dashed; border-color: var(--sabbia); }
.missions li.is-done { background: #e3efdd; border-color: var(--erba); }
.missions li.is-done::before { content: "✓"; background: var(--erba); color: #fff; font-family: var(--font); }
.proto-station { grid-column: 1 / -1; grid-row: 3; min-height: 0; min-width: 0; }
.proto-note { grid-column: 1 / -1; grid-row: 4; font-size: 12.5px; color: var(--slate); text-align: center; }
@media (min-width: 901px) {
  .prova { padding: 0 48px 76px 12px; }
  .prova-inner { max-width: none; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 72px minmax(0, 1fr) auto; gap: 0 12px; }
  .prova-head { margin-left: clamp(330px, 25vw, 380px); align-self: center; }
  .prova-head h2 { font-size: 16px; letter-spacing: -.015em; }
  .prova-head .track, .prova-lead { display: none; }
  .proto-bar { grid-column: 3; grid-row: 1; align-self: center; }
  .missions-box { position: relative; grid-column: 2; grid-row: 1; align-self: center; z-index: 12; }
  .missions-sum { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; border: 1px solid var(--linea); border-radius: 999px; background: var(--carta); cursor: pointer; list-style: none; }
  .missions-sum::-webkit-details-marker { display: none; }
  .missions-sum::after { content: '▾'; }
  .missions-sum b { color: var(--erba-testo); font-variant-numeric: tabular-nums; }
  .missions { position: absolute; right: 0; top: calc(100% + 8px); width: min(500px, 80vw); flex-direction: column; align-items: flex-start; padding: 12px; border-radius: 16px; background: var(--carta); box-shadow: 0 12px 36px rgba(15, 61, 38, .2); }
  .proto-station { grid-column: 1 / -1; grid-row: 2; }
  .proto-note { grid-row: 3; padding-top: 6px; }
}

/* =========================================================================
   12 Alesca
   ========================================================================= */
.outro { display: grid; place-items: center; background: linear-gradient(160deg, #134a2d 0%, var(--bosco) 60%, #0a2a1a 100%); color: #fff; padding: 110px 16px 130px; overflow: hidden; }
.outro .eyebrow { justify-content: center; color: #cfe8c6; }
.outro .code { background: #fff; color: var(--bosco); }
.outro .soft { color: var(--green); }
.outro-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; max-width: 62rem; }
.outro h2 { font-size: clamp(34px, min(4vw, 7vh), 64px); max-width: 20ch; }
.outro-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.outro-points li { padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(207, 232, 198, .4); background: rgba(255, 255, 255, .06); font-weight: 600; }
.outro-points li::before { content: "✓ "; color: var(--green); }
.outro-lead { margin-top: 18px; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: #d4e5d7; max-width: 44ch; }
.outro .button { margin-top: 28px; }
.outro .button.primary { background: #fff; color: var(--bosco); }
.outro-logo { width: 120px; margin-top: clamp(30px, 5vh, 54px); padding: 14px; border-radius: 24px; background: #fff; }

/* =========================================================================
   Indice e player
   ========================================================================= */
.chapter-nav { position: fixed; right: 22px; top: 50%; z-index: 30; display: grid; gap: 9px; transform: translateY(-50%); }
.chapter-nav a { position: relative; display: block; width: 12px; height: 12px; }
.chapter-nav a::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(76, 94, 82, .5); border-radius: 50%; background: rgba(255, 255, 255, .7); transition: background .25s ease, border-color .25s ease, transform .25s ease; }
.chapter-nav a[aria-current]::after { background: var(--erba); border-color: var(--erba); transform: scale(1.2); }
.chapter-nav a.is-future[aria-current]::after { background: var(--sabbia); border-color: var(--sabbia); }
.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(--bosco); 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(15, 61, 38, .92); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(15, 61, 38, .3); 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: #fff; color: var(--bosco); }
.player-counter { min-width: 60px; white-space: nowrap; text-align: center; font: 700 11.5px/1 var(--font-mono); letter-spacing: .04em; }
.player-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.player-progress i { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform .3s ease; }
html.is-future-zone .player-progress i { background: #e6c27a; }

.story-progress { display: none; }
.story-chapter .story-progress { display: flex; align-items: center; gap: 14px; margin-top: 20px; font-size: 12.5px; font-weight: 700; }
.story-chapter .story-progress + .step-choices { margin-top: 10px; }
.story-position { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--erba-testo); }
.is-future .story-position { color: var(--sabbia-testo); }
.story-hint { margin-left: auto; color: var(--slate); font-size: 12px; font-weight: 600; }
.story-chapter .spread { height: 100vh; height: 100svh; min-height: 0; }
.scene.is-center.story-chapter .story-progress, .is-trio.story-chapter .story-progress { display: none; }

@media (max-height: 800px) and (min-width: 901px) {
  .story-chapter .lead { display: none; }
  .story-chapter .spread { padding-top: 90px; padding-bottom: 96px; }
  .step-caption { min-height: 0; }
  .prova-lead { display: none; }
}
@media (max-height: 640px) and (min-width: 901px) {
  .prova { height: auto; min-height: 100svh; padding-bottom: 96px; }
  .prova-inner { grid-template-rows: 72px auto auto; }
  .proto-station { height: max(380px, calc(100svh - 180px)); }
}
@media (max-width: 1100px) and (min-width: 901px) { .chapter-nav { right: 10px; } }

/* =========================================================================
   Telefono e tablet stretto
   ========================================================================= */
@media (max-width: 900px) {
  h2 { font-size: clamp(26px, 7vw, 40px); }
  .masthead { height: 60px; }
  .brand { font-size: 14px; padding: 4px 12px 4px 4px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-product { font-size: 12px; }
  .chapter-nav { display: none; }
  .eyebrow, .track { margin-bottom: 12px; font-size: 11px; gap: 10px; }
  .code { width: 26px; height: 26px; font-size: 11px; }
  .evo-tag, .proto-label { height: 24px; padding: 0 10px; }
  .fluttua > span { font-size: 12px; padding: 6px 10px; }

  .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.4vw, 44px); }
  .intro-lead { margin-top: 12px; font-size: 15px; }
  .intro-actions { margin-top: 16px; gap: 12px 18px; }
  .intro-actions .button { padding: 12px 18px; font-size: 14px; }
  .intro-visual { left: 16px; right: -30px; top: 76px; width: auto; transform: none; }
  .intro-device { transform: rotateY(-18deg) rotateX(4deg); }

  .spread, .scene.tr-chapter .spread, .scene.tr-chapter[data-focus] .spread, .is-flow .spread { grid-template-columns: minmax(0, 1fr) !important; padding: 80px 16px 104px; gap: 22px; }
  .scene .lead { display: none; }
  .step-choices { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 0 16px; }
  .step-choices::-webkit-scrollbar { display: none; }
  .step-choices button { flex: none; padding: 7px 12px; font-size: 13px; }
  .step-caption { min-height: 0; margin-top: 12px; font-size: 14px; line-height: 1.5; }
  .stage-tag { display: none; }
  .scene .macbook, .scene .monitor, .scene.is-center .macbook, .scene.is-center .monitor { width: 100%; }
  .is-phone .phone-stand { width: min(260px, 64vw); }
  .scene.is-center [data-transition-copy], .is-trio [data-transition-copy] { display: block; }
  .scene.is-center [data-transition-copy] .step-choices, .is-trio [data-transition-copy] .step-choices { margin: 14px -16px 0; justify-content: flex-start; }
  .trio { grid-template-columns: 1fr; max-width: none; }
  .trio-item { display: none; opacity: 1; filter: none; transform: none; }
  .trio-item.is-phone-item { width: min(240px, 60vw); margin-inline: auto; }
  .trio[data-focus-device="0"] .trio-item[data-k="0"], .trio[data-focus-device="1"] .trio-item[data-k="1"], .trio[data-focus-device="2"] .trio-item[data-k="2"] { display: block; transform: none; }
  .trio-item::after { display: none; }
  .future-gate { top: 66px; }
  .lane-row { flex-wrap: wrap; padding: 14px; }
  .node { flex: 1 1 100%; flex-direction: row; text-align: left; gap: 10px; padding: 10px; }
  .node small { margin-left: auto; text-align: right; }
  .arrow { flex: 0 0 18px; height: 18px; width: 2px; margin-left: 26px; }
  .arrow::after { right: -5px; top: auto; bottom: -4px; border: 6px solid transparent; border-top: 8px solid var(--sabbia); border-bottom: 0; }
  .arrow.is-long { flex: 0 0 18px; }

  /* Scena fissata: una colonna, il dispositivo riempie lo spazio che resta */
  .story-chapter .spread { display: flex !important; 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, .story-chapter [data-transition-copy] { display: contents !important; }
  .story-chapter .track { display: none; }
  .story-chapter .track.is-evo { display: flex; order: 0; margin: 0; }
  .story-chapter h2 { order: 1; font-size: clamp(24px, 6.6vw, 34px); }
  .story-chapter .story-progress { order: 2; margin: 0; display: flex !important; }
  .story-chapter .story-hint { display: none; }
  .story-chapter .step-choices { order: 3; margin: 0 -16px; }
  .story-chapter h2, .story-chapter .story-progress, .story-chapter .step-choices, .story-chapter .step-caption { flex-shrink: 0; }
  .story-chapter .step-caption { order: 4; margin: 0; font-size: 13.5px; line-height: 1.45; }
  .story-chapter .stage { order: 5; flex: none; margin-top: 4px; }
  .story-chapter.is-phone .phone-stand { width: min(270px, calc((100svh - 430px) * 320 / 660), 66vw); }
  .is-future .future-gate { display: none; }

  .prova { height: auto; min-height: 100svh; padding: 68px 12px calc(88px + env(safe-area-inset-bottom)); }
  .prova-inner { display: flex; flex-direction: column; gap: 8px; }
  .prova-head { gap: 2px 10px; padding-right: 120px; }
  .prova-head .track { display: none; }
  .prova-head h2 { font-size: clamp(20px, 5.6vw, 26px); }
  .prova-lead { display: none; }
  .proto-bar { position: absolute; right: 0; top: 2px; }
  .proto-reset { padding: 5px 12px; font-size: 12.5px; }
  .missions-sum { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--linea); background: var(--carta); font-size: 12.5px; font-weight: 650; cursor: pointer; list-style: none; }
  .missions-sum::-webkit-details-marker { display: none; }
  .missions-sum::after { content: "▾"; color: var(--erba-testo); }
  .missions-box[open] .missions-sum::after { content: "▴"; }
  .missions-sum b { font-family: var(--font-mono); font-size: 11.5px; color: var(--erba-testo); }
  .missions-box[open] .missions { margin-top: 6px; }
  .missions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; }
  .missions li { font-size: 11px; line-height: 1.25; padding: 3px 10px 3px 3px; gap: 6px; border-radius: 14px; }
  .missions li::before { width: 18px; height: 18px; font-size: 10px; }
  .proto-station { flex: none; height: min(calc((100vw - 90px) * 852 / 393 + 70px), max(740px, calc(100svh - 120px))); }
  .proto-note { font-size: 10.5px; line-height: 1.3; }

  .outro { padding: 90px 16px 120px; }
  .outro h2 { font-size: clamp(28px, 7.6vw, 40px); }
  .outro-lead { font-size: 16px; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .story-chapter .step-caption { display: none; }
  .intro-lead { display: none; }
}
@media (max-width: 600px) { .player-counter { min-width: 48px; } .player > button { width: 38px; height: 38px; } }
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .prova { height: 100svh; min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .prova-head, .missions-box, .proto-note { display: none; }
  .proto-station { flex: 1; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
}
