/* FAIVE · landing v2
   Palette ricavata dall'interfaccia reale (video demo):
   blu notte della barra laterale, superficie grigio chiaro, lime del "sei qui". */

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --navy-950: #0c2638;
  --navy-900: #0f3047;
  --navy-800: #133a57;
  --navy-700: #1a4b72;
  --navy-600: #215479;
  --navy-100: #e6eef6;
  --lime: #b3d44f;
  --lime-strong: #9cc232;
  --lime-soft: #eef6d4;
  --paper: #f3f4f6;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #535d6d;
  --line: #dce1e8;
  --warn-bg: #fbf2d9;
  --warn-ink: #6b4f00;
  --ok-bg: #e7f3e5;

  --sans: "Manrope", ui-sans-serif, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(15, 48, 71, .06), 0 12px 32px -12px rgba(15, 48, 71, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1200px;
  --topbar-h: 68px;

  /* Scala spaziature: solo questi valori */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  /* Griglia: 12 colonne, stesso contenitore e stesso gutter per tutte le sezioni */
  --edge: 24px;
  --gutter: clamp(24px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01";
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

:focus-visible {
  outline: 3px solid var(--lime-strong);
  outline-offset: 3px;
  border-radius: 6px;
}
.section :focus-visible, .lab :focus-visible { outline-color: var(--navy-700); }
.demo :focus-visible { outline-color: var(--lime); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.nowrap { white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--lime); color: var(--navy-900); padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--edge), var(--wrap)); margin-inline: auto; }

/* ---------- Griglia a 12 colonne ---------- */
.hero__inner, .section__head, .problem__grid, .player, .start__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
}
/* testata singola: 9 colonne; testata divisa e contenuti a due colonne: 7 + 5 (la colonna destra parte sempre dalla 8) */
.section__head > * { grid-column: 1 / span 9; }
.section__head--split > :first-child { grid-column: 1 / span 7; }
.section__head--split > :last-child { grid-column: 8 / -1; }
.problem__grid > :first-child { grid-column: 1 / span 7; }
.problem__grid > :last-child { grid-column: 8 / -1; }
.start__grid > :first-child { grid-column: 1 / span 6; }
.start__grid > :last-child { grid-column: 8 / -1; }
/* video: 8 colonne, capitoli: 4 */
.player > :first-child { grid-column: 1 / span 8; }
.player > :last-child { grid-column: 9 / -1; }
.hero__copy { grid-column: 1 / span 6; }
.hero__visual { grid-column: 7 / -1; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--lime { background: var(--lime); color: var(--navy-950); box-shadow: 0 8px 24px -10px rgba(179, 212, 79, .7); }
.btn--lime:hover { background: #c1de62; }
.btn--navy { background: var(--navy-700); color: #fff; }
.btn--navy:hover { background: var(--navy-800); }
.btn--navy:disabled { background: #c9d2dc; color: #4f5a69; cursor: not-allowed; transform: none; }
.btn--ghost { background: transparent; color: var(--navy-700); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy-700); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn--big { min-height: 60px; padding: 0 32px; font-size: 1.125rem; }

.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .4em; padding: 8px 2px; }
.link-arrow::after { content: "→"; transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }
.link-arrow--light { color: #fff; }

/* ---------- Eyebrow / titoli sezione ---------- */
.eyebrow {
  font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-700); display: flex; align-items: center; gap: 12px;
}
.eyebrow--light { color: #cfe0ee; }
.eyebrow__num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--navy-700); color: #fff; letter-spacing: 0; font-size: .8rem;
}
.eyebrow--light .eyebrow__num { background: var(--lime); color: var(--navy-950); }

.section { padding: clamp(var(--s-8), 10vw, var(--s-10)) 0; }
.section__head { margin-bottom: clamp(var(--s-7), 6vw, var(--s-8)); align-items: end; }
.section__head h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); margin-top: var(--s-4); }
.soft { color: #4f7391; }
.demo .soft { color: #a9c1d6; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--topbar-h);
  color: #fff; transition: background-color .3s, color .3s, box-shadow .3s;
}
.topbar.is-scrolled { background: rgba(12, 38, 56, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar.is-solid { background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar__inner { height: 100%; width: min(100% - 2 * var(--edge), var(--wrap)); margin-inline: auto; display: flex; align-items: center; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; letter-spacing: .08em; font-size: 1.05rem; }
.brand__mark { display: inline-flex; gap: 3px; align-items: flex-end; height: 20px; }
.brand__mark span { width: 5px; border-radius: 2px; background: currentColor; opacity: .55; }
.brand__mark span:nth-child(1) { height: 8px; }
.brand__mark span:nth-child(2) { height: 11px; }
.brand__mark span:nth-child(3) { height: 14px; }
.brand__mark span:nth-child(4) { height: 17px; }
.brand__mark span:nth-child(5) { height: 20px; background: var(--lime); opacity: 1; }

.menu { margin-left: auto; display: flex; align-items: center; gap: var(--s-5); }
.menu ol { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-1); }
.menu ol a {
  display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 600; font-size: .9375rem;
  padding: 8px 12px; border-radius: 999px; transition: background-color .2s;
}
.menu ol a span { font-size: .72rem; font-weight: 800; opacity: .6; }
.menu ol a:hover { background: rgba(127, 150, 175, .16); }
.menu ol a[aria-current="true"] { background: var(--lime); color: var(--navy-950); }
.menu ol a[aria-current="true"] span { opacity: 1; }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 85% 10%, rgba(179, 212, 79, .10), transparent 60%),
    linear-gradient(160deg, #1f517d 0%, var(--navy-800) 45%, var(--navy-950) 100%);
  padding: calc(var(--topbar-h) + clamp(var(--s-7), 7vw, var(--s-9))) 0 0;
}
.hero::after { /* linea di base: la "strada" */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255, 255, 255, .12);
}
.hero__inner {
  width: min(100% - 2 * var(--edge), var(--wrap)); margin-inline: auto; align-items: end;
}
.hero__copy { padding-bottom: clamp(var(--s-8), 8vw, var(--s-10)); }
.hero__title { font-size: clamp(2.6rem, 5.6vw, 4.9rem); margin-top: var(--s-5); letter-spacing: -0.04em; line-height: 1.02; }
.hero__title em { color: var(--lime); font-size: 1.08em; letter-spacing: -0.02em; }
.hero__lead { margin-top: var(--s-5); font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: #d6e3ee; max-width: 52ch; }
.hero__actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-5); align-items: center; }

.hero__visual { position: relative; margin: 0; align-self: end; }
.shot {
  border-radius: 18px 18px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  width: calc(100% + var(--s-10)); /* esce dal bordo destro */
}
.shot__bar { height: 30px; display: flex; gap: 7px; align-items: center; padding: 0 16px; background: #eef1f5; }
.shot__bar span { width: 10px; height: 10px; border-radius: 50%; background: #cfd6df; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; }

.note {
  position: absolute; z-index: 2; border-radius: 14px; font-weight: 600; font-size: .9rem; line-height: 1.35;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
}
.note--buddy {
  left: -36px; top: 46%; max-width: 250px; background: #fff; color: var(--ink); padding: 12px 16px;
  border: 2px solid var(--lime);
}
.note__who { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); margin-bottom: 4px; }
.note--week {
  right: 6%; top: -18px; background: var(--lime); color: var(--navy-950); padding: 8px 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.note__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-950); }

/* entrata hero */
.reveal-load { opacity: 0; transform: translateY(22px); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 120ms + 80ms); }
.hero__visual.reveal-load { transform: translateY(60px); animation-duration: 1.2s; }
.note { opacity: 0; animation: pop .6s var(--ease) forwards; }
.note--week { animation-delay: .9s; }
.note--buddy { animation-delay: 1.25s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Problema ---------- */
.problem { background: var(--paper); }
.problem__grid { align-items: start; }
.problem__text { padding-top: var(--s-5); } /* prima riga allineata al contenuto del primo gradino */
.cascade { list-style: none; margin: 0; padding: 0; position: relative; }
.cascade__step {
  position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: var(--s-5); align-items: end;
  padding: var(--s-5) 0; border-top: 1px solid var(--line);
}
.cascade__step:nth-child(2) { margin-left: var(--s-7); }
.cascade__step:nth-child(3) { margin-left: var(--s-9); }
.cascade__who { grid-column: 1; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); }
.cascade__what { grid-column: 1; font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 600; margin-top: var(--s-2); letter-spacing: -0.01em; }
.cascade__what--q { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.3rem); color: var(--navy-800); }
.cascade__num {
  grid-column: 2; grid-row: 1 / span 2; font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800; letter-spacing: -0.05em; line-height: .9;
  color: var(--navy-700); font-variant-numeric: tabular-nums;
}
.cascade__num--q { color: var(--ink); position: relative; }
.cascade__num--q::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 2px; height: .32em; background: var(--lime); z-index: -1; border-radius: 4px; }
.cascade__step--last { border-bottom: 1px solid var(--line); }
.cascade__step::before { /* freccia che scende */
  content: ""; position: absolute; left: -20px; top: -1px; width: 1px; height: 0; background: var(--navy-600);
}

.problem__intro { font-size: 1.2rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.truths { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-5); }
.truths li { padding-left: var(--s-4); border-left: 3px solid var(--lime); color: var(--muted); }
.truths strong { display: block; color: var(--ink); font-weight: 700; }

/* reveal allo scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--rd, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Metodo / laboratorio ---------- */
.method { background: #fff; border-top: 1px solid var(--line); }
.method__intro { display: grid; gap: var(--s-4); color: var(--muted); }
.method__intro strong { color: var(--ink); }
.method__hint { font-size: .95rem; padding-left: var(--s-4); border-left: 3px solid var(--lime); }

.lab {
  /* colonne del laboratorio sulla griglia: 3 + 6 + 3, bordi a metà gutter */
  --lab-side: calc((100% - 11 * var(--gutter)) / 12 * 3 + 2.5 * var(--gutter));
  display: grid; grid-template-columns: var(--lab-side) minmax(0, 1fr) var(--lab-side);
  border-radius: var(--r-lg); overflow: hidden; background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(15, 48, 71, .35);
  min-height: 640px;
}
.lab[data-stage="roadmap"] { grid-template-columns: var(--lab-side) minmax(0, 1fr); }
.lab[data-stage="roadmap"] .lab__chat, .lab[data-stage="roadmap"] .lab__plan { display: none; }

.lab__rail { background: #fff; border-right: 1px solid var(--line); padding: var(--s-5); display: flex; flex-direction: column; }
.lab__rail-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.lab__progress { height: 6px; border-radius: 6px; background: var(--navy-100); margin-top: var(--s-4); overflow: hidden; }
.lab__progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6bb754, var(--lime)); border-radius: inherit; transition: width .6s var(--ease); }
.lab__rail-count { font-size: .82rem; color: var(--muted); margin-top: var(--s-2); }
.rail { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: var(--s-1); }
.rail li {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); border-radius: 14px; color: #5f6876; font-weight: 600;
  border: 1.5px solid transparent; transition: background-color .3s, border-color .3s, color .3s;
}
.rail .letter {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; background: var(--paper); color: #5f6876; transition: background-color .3s, color .3s;
}
.rail li.is-current { background: var(--navy-100); border-color: #b8cadb; color: var(--ink); }
.rail li.is-current .letter { background: var(--navy-700); color: #fff; }
.rail li.is-done { color: var(--ink); }
.rail li.is-done .letter { background: #6bb754; color: #fff; font-size: 0; }
.rail li.is-done .letter::before { content: "✓"; font-size: 1rem; }
.lab__restart { margin-top: auto; align-self: flex-start; }

.lab__chat { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.lab__chat-head {
  background: linear-gradient(110deg, #1f517d, var(--navy-900)); color: #fff; padding: var(--s-4) var(--s-5);
}
.lab__chat-title { font-weight: 700; }
.lab__chat-status { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(179, 212, 79, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(179, 212, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(179, 212, 79, 0); } }

.chat { flex: 1; overflow-y: auto; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); max-height: 470px; min-height: 300px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: var(--s-3) var(--s-4); border-radius: 16px; font-size: .97rem; line-height: 1.5; animation: msg .45s var(--ease); }
.msg--buddy { background: #fff; align-self: flex-start; box-shadow: 0 1px 2px rgba(15, 48, 71, .08); border-top-left-radius: 6px; }
.msg--buddy b { font-weight: 800; }
.msg--user {
  background: var(--navy-700); color: #fff; align-self: flex-end; border-top-right-radius: 6px;
  font-family: var(--serif); font-style: italic; font-size: 1.18rem; line-height: 1.35;
}
.msg--challenge { background: var(--warn-bg); color: #3d2f00; border-left: 4px solid #d9a400; }
.msg--challenge .msg__tag, .msg--ok .msg__tag { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.msg--challenge .msg__tag { color: var(--warn-ink); }
.msg--ok { background: var(--ok-bg); }
.msg--ok .msg__tag { color: #2f6a24; }
.msg--warn { background: var(--warn-bg); }
.msg--step {
  align-self: stretch; max-width: none; display: flex; align-items: center; gap: var(--s-4);
  background: linear-gradient(110deg, var(--navy-900), #1f517d); color: #fff; border-radius: 16px; padding: var(--s-3) var(--s-4);
}
.msg--step .letter { width: 44px; height: 44px; border-radius: 12px; background: var(--lime); color: var(--navy-950); display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; }
.msg--step small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.msg--step strong { font-size: 1.1rem; }
.typing { align-self: flex-start; background: #fff; border-radius: 14px; padding: 12px 16px; display: flex; gap: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa6b4; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; transform: translateY(-2px); } }
@keyframes msg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.composer { border-top: 1px solid var(--line); background: #fff; padding: var(--s-4) var(--s-5) var(--s-5); } /* bordi allineati alla chat */
.composer__label { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); margin-bottom: var(--s-2); }
.composer__options { display: grid; gap: var(--s-2); }
.opt {
  text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: var(--s-3) var(--s-4); cursor: pointer;
  font-family: var(--serif); font-style: italic; font-size: 1.12rem; line-height: 1.35; color: var(--ink);
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.opt:hover:not(:disabled) { border-color: var(--navy-700); background: #fff; transform: translateX(3px); }
.opt:disabled { cursor: not-allowed; color: #5f6876; text-decoration: line-through; text-decoration-color: #c08a00; background: transparent; }
.opt:disabled::after { content: " · rifiutata dal Buddy"; font-family: var(--sans); font-style: normal; font-size: .75rem; font-weight: 700; color: var(--warn-ink); text-decoration: none; display: inline-block; margin-left: 4px; }
.composer.is-busy .opt { pointer-events: none; opacity: .6; }
.composer__done { font-size: .95rem; color: var(--muted); }

.lab__plan { background: #fff; padding: var(--s-5); display: flex; flex-direction: column; }
.lab__plan-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-700); }
.lab__plan-title { font-size: 1.25rem; margin-top: var(--s-1); letter-spacing: -0.02em; }
.plan-slots { list-style: none; padding: 0; margin: var(--s-4) 0 var(--s-5); display: grid; gap: var(--s-2); }
.slot { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); padding: var(--s-3); border-radius: 14px; border: 1.5px dashed var(--line); transition: border-color .4s, background-color .4s; }
.slot .letter { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--paper); color: #5f6876; font-size: .9rem; }
.slot__name { font-weight: 700; font-size: .92rem; }
.slot__text { font-size: .86rem; color: #5f6876; margin-top: 2px; line-height: 1.4; }
.slot.is-filled { border-style: solid; border-color: transparent; background: var(--paper); }
.slot.is-filled .letter { background: var(--navy-700); color: #fff; }
.slot.is-filled .slot__text { color: var(--ink); }
.slot.is-new .slot__text { background: linear-gradient(90deg, var(--lime-soft), var(--lime-soft)) no-repeat 0 0 / 0% 100%; animation: marker 1.1s var(--ease) .1s forwards; }
@keyframes marker { to { background-size: 100% 100%; } }
.lab__build { margin-top: auto; width: 100%; }

/* roadmap */
.lab__roadmap { padding: var(--s-6) clamp(var(--s-5), 3vw, var(--s-6)); min-width: 0; outline: none; }
.road__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.road__kicker { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-700); }
.road__title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-top: var(--s-1); }
.tag { flex: none; font-size: .75rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.tag--ok { background: var(--ok-bg); color: #2f6a24; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--s-5) 0 0; background: #fff; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.metrics > div { padding: var(--s-4); border-left: 1px solid var(--line); }
.metrics > div:first-child { border-left: 0; }
.metrics dt { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.metrics dd { margin: var(--s-1) 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.metrics dd small { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.metrics .is-changed dd { color: var(--ink); }
.metrics .is-changed { background: linear-gradient(var(--lime-soft), var(--lime-soft)); }
.metrics .is-short dd { color: #8a5d00; }
.metrics__bar { height: 6px; background: var(--navy-100); border-radius: 6px; margin-top: var(--s-2); overflow: hidden; }
.metrics__bar span { display: block; height: 100%; background: linear-gradient(90deg, #6bb754, var(--lime)); width: 0; transition: width .8s var(--ease); }

.road__diff { margin-top: var(--s-4); background: #fff; border-radius: var(--r-md); padding: var(--s-4) var(--s-5); border-left: 4px solid var(--lime-strong); box-shadow: 0 0 0 1px var(--line); }
.road__diff h4 { margin: 0 0 var(--s-2); font-size: 1rem; }
.road__diff ul { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-1); font-size: .95rem; }
.road__diff b { font-weight: 800; }

.weeks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.week { background: #fff; border-radius: var(--r-md); padding: var(--s-4); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: var(--s-3); }
/* le tre settimane condividono le righe: intestazione, stato, focus e attività partono alla stessa altezza */
@supports (grid-template-rows: subgrid) {
  .weeks { grid-auto-rows: auto; }
  .week { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .week__head { grid-row: 1; margin-bottom: var(--s-3); }
  .week__done { grid-row: 2; margin-bottom: var(--s-3); justify-self: start; }
  .week__focus { grid-row: 3; margin-bottom: var(--s-3); }
  .week .acts { grid-row: 4; align-content: start; }
}
.week__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.week__name { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); }
.week__dates { font-size: .8rem; color: var(--muted); }
.week__focus { font-weight: 700; font-size: .95rem; letter-spacing: -0.01em; }
.week.is-past { background: #f9fafb; }
.week__done { font-size: .78rem; font-weight: 700; color: #2f6a24; background: var(--ok-bg); padding: var(--s-1) var(--s-2); border-radius: 999px; align-self: flex-start; }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.act { background: var(--paper); border-radius: 12px; padding: var(--s-3); font-size: .88rem; line-height: 1.4; position: relative; }
.act strong { font-weight: 700; display: block; }
.act .chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.chip { font-size: .74rem; font-weight: 700; color: var(--navy-700); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: var(--s-1) var(--s-2); white-space: nowrap; }
.act--coach { background: var(--ok-bg); }
.act--check { background: var(--warn-bg); }
.act.is-changed { background: var(--lime-soft); box-shadow: inset 4px 0 0 var(--lime-strong); animation: flash 1.2s var(--ease); }
.act__badge { position: absolute; top: var(--s-3); right: var(--s-3); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: var(--navy-950); color: var(--lime); padding: 2px 7px; border-radius: 999px; }
.act.is-changed strong { padding-right: 78px; }
.act s { color: #5f6876; }
@keyframes flash { from { background: #d8eba0; } }

.road__event { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-5); align-items: center; justify-content: space-between; background: var(--navy-900); color: #fff; border-radius: var(--r-md); padding: var(--s-4) var(--s-5); }
.road__event p { max-width: 62ch; }
.road__event p b { color: var(--lime); }
.road__event .btns { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.road__event .btn--ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.road__event .btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.road__event :focus-visible { outline-color: var(--lime); }

/* ---------- Demo video ---------- */
.demo { background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #fff; }
.demo .section__head h2 { color: #fff; }
.demo__intro { color: #c9d8e5; }
.player { align-items: start; row-gap: var(--s-5); }
.player__screen { border-radius: var(--r-md); overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08); }
.player video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.timeline { position: relative; height: 32px; background: #0a2131; display: flex; gap: 2px; padding: 0; }
.tl-seg { position: relative; height: 100%; background: #163a55; overflow: hidden; }
.tl-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(179, 212, 79, .35); }
.tl-seg.is-active { background: #1d4b6e; }
.tl-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 6px; background: var(--lime); color: var(--navy-950); font-size: .7rem; font-weight: 800; display: grid; place-items: center; z-index: 2; pointer-events: none; }

.chapters__title { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #cfe0ee; margin-bottom: var(--s-2); padding-left: var(--s-3); /* allineato ai tempi */ }
.chapters ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: ch; }
.ch-btn {
  width: 100%; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-4); align-items: baseline; text-align: left;
  background: transparent; border: 0; color: #dbe7f1; padding: var(--s-3); border-radius: 12px; cursor: pointer; position: relative;
  transition: background-color .2s, color .2s;
}
.ch-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ch-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: .85rem; color: var(--lime); }
.ch-title { font-weight: 600; }
.ch-btn[aria-current="true"] { background: #fff; color: var(--navy-950); }
.ch-btn[aria-current="true"] .ch-time { color: var(--navy-700); }
.ch-letters { display: flex; gap: var(--s-2); padding: var(--s-1) var(--s-3) var(--s-3) calc(var(--s-3) + 48px + var(--s-4)); /* allineate ai titoli */ }
.ch-letter {
  width: 32px; height: 32px; border-radius: 9px; border: 1.5px solid rgba(179, 212, 79, .55); background: transparent; color: var(--lime);
  font-weight: 800; cursor: pointer; transition: background-color .2s, color .2s;
}
.ch-letter:hover, .ch-letter[aria-current="true"] { background: var(--lime); color: var(--navy-950); }

/* ---------- Come si parte ---------- */
.start { background: var(--paper); }
.principle { margin: 0 0 var(--s-8); max-width: calc((100% - 11 * var(--gutter)) / 12 * 10 + 9 * var(--gutter)); /* 10 colonne */ position: relative; padding-left: var(--s-6); border-left: 4px solid var(--lime); }
.principle p { font-family: var(--serif); font-style: italic; font-size: clamp(1.7rem, 3.4vw, 2.75rem); line-height: 1.18; color: var(--navy-900); letter-spacing: -0.01em; }
.start__grid { row-gap: var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.start__block h3 { font-size: 1.35rem; letter-spacing: -0.02em; }
.start__block p { margin-top: var(--s-2); color: var(--muted); max-width: 52ch; }

.route-wrap { margin-top: var(--s-8); }
.route__title { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-700); margin-bottom: var(--s-5); }
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.route::before { content: ""; position: absolute; left: 23px; width: 80%; top: 22px; height: 3px; background: var(--line); border-radius: 3px; }
.route::after { content: ""; position: absolute; left: 23px; top: 22px; height: 3px; width: 0; background: var(--lime-strong); border-radius: 3px; transition: width 1.6s var(--ease); }
.route.is-in::after { width: 80%; } /* dal centro della tappa 1 al centro della 5 */
.route__stop { position: relative; padding-right: var(--s-4); }
.route__n {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800;
  background: #fff; color: var(--navy-700); box-shadow: 0 0 0 1.5px var(--line); transition: background-color .4s, color .4s, box-shadow .4s;
  transition-delay: var(--sd, 0ms);
}
.route.is-in .route__n { background: var(--navy-700); color: #fff; box-shadow: 0 0 0 4px var(--paper); }
.route.is-in .route__stop:last-child .route__n { background: var(--lime); color: var(--navy-950); }
.route__label { display: block; font-weight: 800; margin-top: var(--s-4); letter-spacing: -0.01em; }
.route__desc { display: block; color: var(--muted); font-size: .92rem; margin-top: var(--s-1); }

/* ---------- CTA finale ---------- */
.cta {
  color: #fff; text-align: center; padding: clamp(var(--s-9), 12vw, var(--s-10)) 0;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(179, 212, 79, .14), transparent 70%),
    linear-gradient(180deg, #1f517d, var(--navy-950));
}
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta__title { font-size: clamp(2.3rem, 5.4vw, 4.4rem); margin: var(--s-5) 0 0; max-width: 16ch; letter-spacing: -0.04em; }
.cta__title em { color: var(--lime); }
.cta__lead { margin-top: var(--s-5); color: #d6e3ee; font-size: 1.15rem; max-width: 48ch; }
.cta .btn--big { margin-top: var(--s-6); }
.cta__small { margin-top: var(--s-4); font-size: .9rem; color: #b9cbda; max-width: 52ch; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-950); color: #b9cbda; padding: var(--s-7) 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer__inner { display: grid; gap: var(--s-2); }
.footer__acro { font-size: clamp(1.05rem, 2vw, 1.4rem); color: #fff; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; gap: 0 .35em; }
.footer__acro b { color: var(--lime); font-weight: 800; }
.footer__meta a { color: #fff; }
.footer__note { font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .weeks { grid-template-columns: 1fr; }
  .player > :first-child, .player > :last-child { grid-column: 1 / -1; }
  .chapters ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-3); }
}

@media (max-width: 960px) {
  :root { --topbar-h: 60px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto; background: transparent; border: 1.5px solid currentColor;
    border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 700; cursor: pointer; color: inherit;
  }
  .menu-toggle__bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
  .menu {
    position: absolute; top: var(--topbar-h); left: 0; right: 0; background: #fff; color: var(--ink);
    flex-direction: column; align-items: stretch; gap: var(--s-4); padding: var(--s-4) var(--edge) var(--s-5); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .3);
    display: none;
  }
  .menu.is-open { display: flex; }
  .menu ol { flex-direction: column; }
  .menu ol a { width: 100%; padding: 12px 16px; font-size: 1.05rem; }
  .topbar.menu-open { background: #fff; color: var(--ink); }

  /* sotto i 960 px tutte le colonne vanno a tutta larghezza */
  .hero__copy, .hero__visual,
  .section__head > *, .section__head--split > :first-child, .section__head--split > :last-child,
  .problem__grid > :first-child, .problem__grid > :last-child,
  .start__grid > :first-child, .start__grid > :last-child { grid-column: 1 / -1; }
  .hero__copy { padding-bottom: var(--s-2); }
  .hero__visual { margin-top: var(--s-5); }
  .shot { width: calc(100% + var(--edge)); }
  .principle { max-width: none; }
  .note--buddy { left: 8px; top: auto; bottom: 18px; }

  .section__head--split { row-gap: var(--s-5); align-items: start; }
  .problem__grid { row-gap: var(--s-7); }
  .problem__text { padding-top: 0; }

  .lab, .lab[data-stage="roadmap"] { grid-template-columns: 1fr; min-height: 0; }
  .lab__rail { border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s-4); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
  .lab__rail-title { grid-column: 1; }
  .lab__rail-count { grid-column: 1; margin-top: 0; }
  .lab__progress { display: none; }
  .lab__restart { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .rail { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-2); }
  .rail li { flex-direction: column; gap: var(--s-1); padding: var(--s-2) var(--s-1); font-size: .68rem; text-align: center; }
  .rail .letter { width: 34px; height: 34px; }
  .lab__chat { border-right: 0; }
  .chat { max-height: 420px; padding: var(--s-4); }
  .composer, .lab__plan { padding-inline: var(--s-4); }
  .msg { max-width: 94%; }
  .lab__plan { border-top: 1px solid var(--line); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics > div:nth-child(3) { border-left: 0; }
  .metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }

  .route { grid-template-columns: 1fr; gap: var(--s-5); }
  .route::before, .route::after { left: 22px; right: auto; top: 22px; bottom: 22px; width: 3px; height: auto; }
  .route::before { width: 3px; }
  .route::after { height: 0; bottom: auto; transition: height 1.6s var(--ease); }
  .route.is-in::after { width: 3px; height: calc(100% - 44px); }
  .route__stop { display: grid; grid-template-columns: 46px 1fr; column-gap: var(--s-4); }
  .route__n { grid-row: 1 / span 2; }
  .route__label { margin-top: 0; align-self: end; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  :root { --edge: 16px; }
  .hero__title { font-size: clamp(2.3rem, 10.5vw, 3rem); }
  .hero__actions .btn { width: 100%; }
  .note--week { right: 8px; font-size: .78rem; padding: 8px 12px; }
  .note--buddy { max-width: 200px; font-size: .82rem; padding: 8px 12px; }
  .shot__bar { height: 22px; }
  .cascade__step:nth-child(2) { margin-left: var(--s-5); }
  .cascade__step:nth-child(3) { margin-left: var(--s-7); }
  .cascade__step::before { display: none; }
  .chapters ol { grid-template-columns: 1fr; }
  .ch-letter { width: 40px; height: 40px; }
  .metrics dd { font-size: 1.4rem; }
  .road__head { flex-direction: column; }
  .road__event .btns, .road__event .btns .btn { width: 100%; }
  .cta .btn--big { width: 100%; }
  .timeline { height: 26px; }
  .tl-mark { width: 16px; height: 16px; font-size: .6rem; }
}

@media (max-width: 380px) {
  .rail li span:not(.letter) { display: none; }
  .opt { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal-load, .note, .js .reveal { opacity: 1 !important; transform: none !important; }
  .chat { scroll-behavior: auto; }
}
