/* ==========================================================================
   SPORTSTECH WEEKEND 2027 — núcleo visual
   Tokens, tipografia, layout, componentes, HUD de prova, loader e efeitos.
   Todo capítulo usa estes tokens; CSS de capítulo fica em css/chapters/ e é
   sempre prefixado pelo id da seção.
   ========================================================================== */

@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: italic; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-standard-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: italic; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext-standard-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/jetbrains-mono-latin-700-normal.woff2) format('woff2'); }

:root {
  /* Superfícies — o navy da marca SPORTSTECH, medido no PDF */
  --space: #020816;
  --navy-950: #030b1c;
  --navy-900: #05142e;
  --navy-850: #071833;
  --navy-800: #0b2145;
  --navy-700: #12305e;
  --navy-600: #1b3f77;

  /* Sinal — teal e azul-ciano da marca (SUMMIT teal, RUN azul) */
  --teal: #12c5b5;
  --teal-hi: #4ff0dc;
  --teal-deep: #0e7e86;
  --cyan: #1d9fd0;
  --cyan-hi: #6fd3ff;
  --ice: #e6f7ff;
  --alert: #ff5a6e;

  /* Tinta */
  --ink: #eef4ff;
  --ink-2: #b3c3dd;
  --ink-3: #7489ad;
  --ink-4: #4a5f86;
  --line: rgba(126, 170, 232, 0.16);
  --line-2: rgba(126, 170, 232, 0.28);
  --line-teal: rgba(18, 197, 181, 0.45);

  /* Papel (capítulos claros) */
  --paper: #f4f8fc;
  --paper-2: #e7eef7;
  --paper-ink: #0a1a38;
  --paper-ink-2: #3c4f72;
  --paper-line: rgba(10, 26, 56, 0.12);

  /* Degradês de assinatura (logo: verde-água → ciano) */
  --grad-brand: linear-gradient(120deg, #43e3c4 0%, #12c5b5 38%, #1d9fd0 100%);
  --grad-brand-v: linear-gradient(180deg, #43e3c4 0%, #12c5b5 40%, #1d9fd0 100%);
  --grad-glass: linear-gradient(160deg, rgba(27, 63, 119, 0.42) 0%, rgba(7, 24, 51, 0.62) 55%, rgba(5, 20, 46, 0.72) 100%);
  --grad-tier-1: linear-gradient(120deg, #0b2145, #12305e);
  --grad-tier-2: linear-gradient(120deg, #0f3b62, #135a80);
  --grad-tier-3: linear-gradient(120deg, #0e7e86, #11948f);
  --grad-tier-4: linear-gradient(120deg, #12a99f, #16bba9);
  --grad-tier-5: linear-gradient(120deg, #3fc8bd, #6fdccf);

  --glow-teal: 0 0 0.6em rgba(18, 197, 181, 0.55), 0 0 2.2em rgba(18, 197, 181, 0.25);
  --glow-cyan: 0 0 0.6em rgba(29, 159, 208, 0.55), 0 0 2.2em rgba(29, 159, 208, 0.25);
  --shadow-deep: 0 40px 120px -30px rgba(0, 0, 0, 0.75), 0 12px 40px -12px rgba(0, 8, 30, 0.8);

  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(16px, 4.2vw, 72px);
  --maxw: 1480px;
  --hud-h: 64px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(18, 197, 181, 0.35); color: #fff; }
.sr-only { position: absolute !important; 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; left: 16px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-s); background: var(--teal); color: var(--navy-950); font-weight: 700; text-decoration: none; transition: top 0.2s; }
.skip-link:focus { top: 16px; }

/* ---------- Layout ---------- */
main { position: relative; z-index: 2; }
.ch {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(104px, 14vh, 176px);
  isolation: isolate;
}
.ch--flush { padding-block: 0; }
.ch--light { background: var(--paper); color: var(--paper-ink); color-scheme: light; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; }
.wrap--narrow { max-width: 1120px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
.stack > * + * { margin-top: var(--stack, 1rem); }

/* ---------- Tipografia ---------- */
.t-eyebrow {
  display: inline-flex; align-items: center; gap: 0.9em;
  margin: 0 0 1.4rem;
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(11px, 0.82vw, 13px); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--teal);
}
.t-eyebrow .idx { color: var(--ink-3); }
.t-eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; box-shadow: 0 0 10px currentColor; }
.ch--light .t-eyebrow { color: var(--teal-deep); }
.ch--light .t-eyebrow .idx { color: var(--paper-ink-2); }

.t-mega, .t-display {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic; font-weight: 850; font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.86;
}
.t-mega { font-size: clamp(52px, 11.2vw, 210px); }
.t-display { font-size: clamp(40px, 6.6vw, 118px); }
.t-h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 720; font-stretch: 100%;
  font-size: clamp(30px, 4.3vw, 72px); line-height: 1.02; letter-spacing: -0.028em;
  text-wrap: balance;
}
.t-h3 {
  margin: 0;
  font-family: var(--font-display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(20px, 1.8vw, 28px); line-height: 1.1; letter-spacing: -0.01em; text-transform: uppercase;
}
.t-lead { margin: 0; font-size: clamp(17px, 1.45vw, 23px); line-height: 1.5; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.ch--light .t-lead { color: var(--paper-ink-2); }
.t-body { font-size: clamp(15px, 1.05vw, 17px); color: var(--ink-2); }
.t-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.t-num { font-family: var(--font-display); font-style: italic; font-weight: 850; font-stretch: 118%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 0.9; }
.t-note { font-size: clamp(14px, 1.1vw, 16px); line-height: 1.5; color: var(--ink-3); font-style: italic; max-width: 80ch; }
.ch--light .t-note { color: var(--paper-ink-2); }
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text .split-word, .grad-text .split-char, .grad-text .split-line { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.outline-text { color: transparent; -webkit-text-stroke: 1.4px var(--teal); }
.hl-teal { color: var(--teal); }
.hl-cyan { color: var(--cyan); }
.ch--light .hl-teal { color: var(--teal-deep); }

/* ---------- Componentes ---------- */
.glass {
  position: relative;
  background: var(--grad-glass);
  border-radius: var(--radius-l);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(79, 240, 220, 0.55), rgba(29, 159, 208, 0.12) 35%, rgba(126, 170, 232, 0.08) 65%, rgba(79, 240, 220, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.ch--light .glass { background: rgba(255, 255, 255, 0.72); box-shadow: 0 30px 80px -40px rgba(10, 26, 56, 0.35); }

/* Cantoneiras de HUD */
.hud-frame { position: relative; }
.hud-frame > .hud-c { position: absolute; width: 18px; height: 18px; border: 0 solid var(--teal); pointer-events: none; opacity: 0.9; }
.hud-frame > .hud-c.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.hud-frame > .hud-c.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.hud-frame > .hud-c.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.hud-frame > .hud-c.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(11, 33, 69, 0.55);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.ch--light .chip { background: #fff; border-color: var(--paper-line); color: var(--paper-ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.35s;
}
.btn--primary { background: var(--grad-brand); color: var(--navy-950); box-shadow: 0 10px 40px -10px rgba(18, 197, 181, 0.7); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -10px rgba(18, 197, 181, 0.9); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); background: rgba(11, 33, 69, 0.4); }
.btn--ghost:hover { border-color: var(--teal); box-shadow: var(--glow-teal); }

.tick-list { list-style: none; margin: 0; padding: 0; }
.tick-list li { position: relative; padding: 14px 0 14px 30px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: clamp(15px, 1.12vw, 18px); line-height: 1.45; }
.tick-list li:last-child { border-bottom: 0; }
.tick-list li::before { content: ''; position: absolute; left: 4px; top: calc(14px + 0.72em - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.tick-list li:nth-child(even)::before { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.ch--light .tick-list li { color: var(--paper-ink-2); border-color: var(--paper-line); }

.stat { display: grid; gap: 10px; }
.stat__n { font-size: clamp(44px, 6vw, 104px); }
.stat__l { color: var(--ink-2); font-size: clamp(14px, 1.05vw, 17px); line-height: 1.4; max-width: 28ch; }

.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2) 15%, var(--line-2) 85%, transparent); border: 0; margin: 0; }
.rule--teal { background: linear-gradient(90deg, transparent, var(--teal) 20%, var(--cyan) 80%, transparent); box-shadow: 0 0 12px rgba(18, 197, 181, 0.6); }

.concept-tag {
  position: absolute; z-index: 5; right: 14px; bottom: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(230, 247, 255, 0.72); background: rgba(3, 11, 28, 0.55); padding: 5px 8px; border-radius: 6px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Mídia de capítulo */
.media-cover { position: absolute; inset: 0; overflow: hidden; }
.media-cover > img, .media-cover > video, .media-cover > picture > img { width: 100%; height: 100%; object-fit: cover; }
.media-shade-l { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 8, 22, 0.94) 0%, rgba(2, 8, 22, 0.72) 38%, rgba(2, 8, 22, 0.1) 75%); }
.media-shade-b { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2, 8, 22, 0.96) 0%, rgba(2, 8, 22, 0.5) 40%, rgba(2, 8, 22, 0) 70%); }
.scrub-video { background: #000; }
.scrub-video[data-state='loading'] { filter: saturate(0.9); }

/* ---------- Revelações (estado inicial só com JS ativo) ---------- */
.js [data-reveal] { opacity: 0; }
.js [data-reveal-stagger] > * { opacity: 0; }
.js.reduced [data-reveal], .js.reduced [data-reveal-stagger] > * { opacity: 1 !important; transform: none !important; filter: none !important; }
.split-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-word { display: inline-block; will-change: transform; }

/* ---------- Efeitos globais ---------- */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
.fx-vignette { position: fixed; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 4, 14, 0.55) 100%); }
.fx-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(126, 170, 232, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 170, 232, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 20%, transparent 80%);
  mask-image: radial-gradient(80% 70% at 50% 45%, #000 20%, transparent 80%);
}
.fx-scan { position: absolute; left: 0; right: 0; height: 120px; top: -120px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(79, 240, 220, 0.08) 60%, rgba(79, 240, 220, 0.35) 98%, transparent); mix-blend-mode: screen; }

/* Cursor de luz (desktop) */
.cursor-glow { position: fixed; left: 0; top: 0; z-index: 4; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(18, 197, 181, 0.1) 0%, rgba(29, 159, 208, 0.05) 35%, transparent 65%); mix-blend-mode: screen; opacity: 0; transition: opacity 0.6s; }
.has-pointer .cursor-glow { opacity: 1; }

/* ---------- HUD de prova ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 80; height: var(--hud-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding-inline: clamp(14px, 2.2vw, 32px);
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), opacity 0.5s;
}
.hud::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 8, 22, 0.78), rgba(2, 8, 22, 0)); pointer-events: none; }
.hud > * { position: relative; pointer-events: auto; }
.hud__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; justify-self: start; }
.hud__brand svg { width: 30px; height: 30px; }
.hud__brand span { font-family: var(--font-display); font-style: italic; font-weight: 850; font-stretch: 118%; font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; }
.hud__brand small { display: block; margin-top: 3px; font-family: var(--font-mono); font-style: normal; font-weight: 500; font-size: 9.5px; letter-spacing: 0.22em; color: var(--ink-3); }
.hud__chapter { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.hud__chapter b { color: var(--teal); font-weight: 700; }
.hud__chapter .sep { width: 18px; height: 1px; background: var(--line-2); }
.hud__right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.hud__km { display: flex; align-items: baseline; gap: 6px; margin-right: 10px; font-family: var(--font-mono); color: var(--ink-3); font-size: 10px; letter-spacing: 0.2em; }
.hud__km output { font-family: var(--font-display); font-style: italic; font-weight: 850; font-stretch: 118%; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3.1ch; text-align: right; }
.hud__btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 20, 46, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color 0.3s, box-shadow 0.3s; }
.hud__btn:hover { border-color: var(--teal); box-shadow: var(--glow-teal); }
.hud__btn svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; }
.hud__btn[aria-pressed='true'] { border-color: var(--teal); }
.hud__btn[aria-pressed='true'] svg { stroke: var(--teal-hi); }
.hud__progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 81; pointer-events: none; }
.hud__progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad-brand); box-shadow: 0 0 12px var(--teal); }
body.is-light-ch .hud::before { background: linear-gradient(180deg, rgba(244, 248, 252, 0.92), rgba(244, 248, 252, 0)); }
body.is-light-ch .hud { color: var(--paper-ink); }
body.is-light-ch .hud__chapter, body.is-light-ch .hud__km { color: var(--paper-ink-2); }
body.is-light-ch .hud__km output { color: var(--paper-ink); }
body.is-light-ch .hud__btn { background: rgba(255, 255, 255, 0.7); border-color: var(--paper-line); }
body.is-light-ch .hud__btn svg { stroke: var(--paper-ink); }
body.is-light-ch .hud__brand small { color: var(--paper-ink-2); }
.logo-mark .lm-a { stroke: url(#lm-grad); }

/* Trilho lateral: a prova inteira como uma pista de 10 km */
.rail { position: fixed; right: clamp(10px, 1.4vw, 22px); top: 50%; z-index: 79; transform: translateY(-50%); height: min(62vh, 560px); width: 26px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.rail::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line-2); }
.rail__fill { position: absolute; top: 0; left: calc(50% - 0.5px); width: 1px; height: 100%; transform-origin: 50% 0; transform: scaleY(0); background: var(--grad-brand-v); box-shadow: 0 0 10px var(--teal); }
.rail__tick { position: relative; width: 26px; height: 12px; display: grid; place-items: center; }
.rail__tick::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); transition: background 0.3s, box-shadow 0.3s, transform 0.3s; }
.rail__tick.is-passed::before { background: var(--teal); }
.rail__tick.is-active::before { background: var(--teal-hi); box-shadow: 0 0 0 4px rgba(18, 197, 181, 0.2), 0 0 14px var(--teal); transform: scale(1.3); }
.rail__tick span { position: absolute; right: 30px; top: 50%; transform: translate(8px, -50%); white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); background: rgba(3, 11, 28, 0.85); padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease-out); }
.rail__tick:hover span, .rail__tick:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.rail__runner { position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--teal-hi); box-shadow: 0 0 0 5px rgba(79, 240, 220, 0.18), 0 0 22px var(--teal-hi); }
body.is-light-ch .rail::before { background: var(--paper-line); }
body.is-light-ch .rail__tick::before { background: #b9c6d8; }

/* Menu de capítulos */
.menu { position: fixed; inset: 0; z-index: 95; display: grid; background: rgba(2, 8, 22, 0.92); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease-out), visibility 0s 0.45s; overflow-y: auto; }
.menu.is-open { opacity: 1; visibility: visible; transition: opacity 0.45s var(--ease-out); }
.menu__inner { width: 100%; max-width: var(--maxw); margin: auto; padding: calc(var(--hud-h) + 24px) var(--gutter) 48px; }
.menu__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
.menu__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.menu__list a { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 14px; padding: 18px 20px; background: var(--navy-950); text-decoration: none; transition: background 0.3s; }
.menu__list a:hover, .menu__list a:focus-visible { background: var(--navy-800); }
.menu__list .n { font-family: var(--font-mono); font-size: 11px; color: var(--teal); letter-spacing: 0.12em; }
.menu__list .t { font-family: var(--font-display); font-weight: 750; font-stretch: 108%; font-size: 17px; letter-spacing: -0.01em; }
.menu__list .k { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.14em; }
.menu__list a[aria-current='true'] { background: linear-gradient(90deg, rgba(18, 197, 181, 0.18), var(--navy-950)); }
.menu__keys { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }
.menu__keys kbd { display: inline-block; min-width: 22px; padding: 2px 6px; margin-right: 6px; border: 1px solid var(--line-2); border-radius: 5px; text-align: center; color: var(--ink); font-family: inherit; }

/* ---------- Loader / pré-show ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--space); overflow: hidden; }
.boot__grid { position: absolute; inset: 0; opacity: 0.6; background-image: linear-gradient(rgba(126, 170, 232, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 170, 232, 0.06) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent); mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent); }
.boot__center { position: relative; display: grid; justify-items: center; gap: 26px; text-align: center; padding: 24px; width: min(640px, 100%); }
.boot__mark { width: clamp(96px, 14vw, 150px); height: auto; overflow: visible; }
.boot__mark path { fill: none; stroke: url(#boot-grad); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.boot__title { font-family: var(--font-display); font-style: italic; font-weight: 850; font-stretch: 125%; font-size: clamp(22px, 3.6vw, 40px); line-height: 0.95; text-transform: uppercase; letter-spacing: -0.01em; }
.boot__log { width: 100%; min-height: 7.4em; margin: 0; padding: 0; list-style: none; text-align: left; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; letter-spacing: 0.06em; color: var(--ink-3); }
.boot__log li b { color: var(--teal); font-weight: 500; }
.boot__bar { position: relative; width: 100%; height: 2px; background: var(--line); overflow: hidden; }
.boot__bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad-brand); box-shadow: 0 0 14px var(--teal); }
.boot__pct { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-2); }
.boot__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; opacity: 0; visibility: hidden; }
.boot.is-ready .boot__actions { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease-out); }
.boot__hint { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-4); text-transform: uppercase; }
.boot.is-done { pointer-events: none; }
html.is-booting, html.is-booting body { overflow: hidden; }
.no-js .boot { display: none; }
.no-js.is-booting, .no-js.is-booting body { overflow: visible; }

/* ---------- Rodapé técnico ---------- */
.site-foot { position: relative; z-index: 2; padding: 40px var(--gutter) 56px; border-top: 1px solid var(--line); background: var(--space); color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; line-height: 1.8; }
.site-foot .wrap { padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .hud__chapter { display: none; }
  .hud { grid-template-columns: 1fr auto; }
}
@media (max-width: 820px) {
  :root { --hud-h: 56px; }
  body { font-size: 16px; }
  .rail { display: none; }
  .hud__km output { font-size: 18px; }
  /* no celular o conteúdo passa por baixo da barra: fundo real + desfoque com borda suave */
  .hud::before { height: calc(100% + 22px); background: linear-gradient(180deg, rgba(2, 8, 22, 0.94) 0%, rgba(2, 8, 22, 0.82) 62%, rgba(2, 8, 22, 0) 100%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
  body.is-light-ch .hud::before { background: linear-gradient(180deg, rgba(244, 248, 252, 0.95) 0%, rgba(244, 248, 252, 0.85) 62%, rgba(244, 248, 252, 0) 100%); }
  .hud__km span { display: none; }
  .hud__btn { width: 38px; height: 38px; }
  .hud__brand span { font-size: 11px; }
  .hud__brand small { display: none; }
  .cursor-glow { display: none; }
  .ch { padding-block: clamp(84px, 12vh, 120px); }
  .ch.ch--flush { padding-block: 0; }
}
@media (max-width: 420px) {
  .hud__btn[data-action='sound'] { display: none; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-grain { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Impressão: tudo visível ---------- */
@media print {
  .hud, .rail, .menu, .boot, .fx-grain, .fx-vignette, .cursor-glow, #bg-canvas { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal], [data-reveal-stagger] > * { opacity: 1 !important; transform: none !important; }
  .ch { min-height: 0; break-inside: avoid-page; }
}
