/* ================= Fonts (self-hosted, OFL) ================= */
@font-face { font-family: "Bricolage"; src: url(fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument"; src: url(fonts/instrument-sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument"; src: url(fonts/instrument-sans-italic.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "JBMono"; src: url(fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

/* ================= Tokens ================= */
:root {
  --paper: #F3F0E8;
  --paper-2: #EAE6DB;
  --card: #FBFAF6;
  --ink: #121211;
  --ink-2: #3B3A36;
  --mute: #66635B;
  --line: rgba(18, 18, 17, .11);
  --line-2: rgba(18, 18, 17, .2);
  --accent: #FF4A1C;          /* playhead */
  --accent-ink: #B3300B;      /* accent text on paper (contrast) */
  --deck: #161614;
  --deck-2: #22221F;
  --deck-line: rgba(243, 240, 232, .1);

  --f-display: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --f-text: "Instrument", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JBMono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.125rem, 1rem + .5vw, 1.3125rem);
  --t-h3: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --t-h2: clamp(2.125rem, 1.5rem + 3vw, 3.75rem);
  --t-hero: clamp(3.25rem, 1.6rem + 7.4vw, 7.25rem);

  --gutter: clamp(1rem, .5rem + 2.5vw, 2.5rem);
  --max: 1180px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.3, 1.6, .5, 1); /* mascot only: character overshoot */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .07 0 0 0 0 .07 0 0 0 0 .06 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --col: var(--max); /* width of the text column: lanes stay outside it */
  --shadow: 0 1px 0 rgba(18,18,17,.06), 0 10px 30px -18px rgba(18,18,17,.35);
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--t-md)/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip; min-height: 100dvh;
}
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 1; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ================= Background: cutting-room sheet ================= */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: -64px 0 0;
  background:
    linear-gradient(90deg, rgba(18,18,17,.075) 1px, transparent 1px) 0 0 / 96px 100%,
    linear-gradient(90deg, rgba(18,18,17,.035) 1px, transparent 1px) 0 0 / 12px 100%,
    linear-gradient(rgba(18,18,17,.05) 1px, transparent 1px) 0 0 / 100% 48px;
  -webkit-mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%);
          mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%);
}
/* drifting clip lanes: crisp blocks, never blurred, and only in the margins (never behind text) */
.bg-lanes {
  position: absolute; inset: 0;
  --edge: calc(50% - min(var(--col), 100vw) / 2);
  -webkit-mask: linear-gradient(90deg, #000 calc(var(--edge) - 56px), transparent var(--edge), transparent calc(100% - var(--edge)), #000 calc(100% - var(--edge) + 56px));
          mask: linear-gradient(90deg, #000 calc(var(--edge) - 56px), transparent var(--edge), transparent calc(100% - var(--edge)), #000 calc(100% - var(--edge) + 56px));
}
body.in-lesson { --col: 760px; }
.bg-track {
  position: absolute; left: -50%; width: 200%; height: 10px;
  background-repeat: repeat-x;
  animation: drift linear infinite;
}
.bg-track.t1 { top: 31%; opacity: .07; background-image: linear-gradient(90deg, var(--ink) 0 140px, transparent 140px 164px, var(--ink) 164px 236px, transparent 236px 300px, var(--ink) 300px 520px, transparent 520px 560px); background-size: 560px 10px; animation-duration: 120s; }
.bg-track.t2 { top: 33.2%; height: 4px; opacity: .1; background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 7px, var(--ink) 7px 8px, transparent 8px 11px); background-size: 330px 4px; animation-duration: 160s; animation-direction: reverse; }
.bg-track.t3 { top: 78%; opacity: .06; background-image: linear-gradient(90deg, var(--ink) 0 90px, transparent 90px 120px, var(--ink) 120px 380px, transparent 380px 430px, var(--ink) 430px 470px, transparent 470px 640px); background-size: 640px 10px; animation-duration: 140s; }
@keyframes drift { to { transform: translate3d(-25%, 0, 0); } }

.bg-sprocket { display: none; }
@media (min-width: 1100px) {
  .bg-sprocket {
    display: block; position: absolute; top: 0; bottom: 0; left: 14px; width: 16px;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    background: repeating-linear-gradient(180deg, transparent 0 6px, rgba(18,18,17,.13) 6px 16px, transparent 16px 24px) 3px 0 / 8px 100% no-repeat;
    animation: sprocket 3s linear infinite;
  }
}
@keyframes sprocket { to { background-position: 3px 24px; } }

.crop { position: absolute; width: 18px; height: 18px; border: 0 solid rgba(18,18,17,.35); }
.crop.tl { top: 10px; left: 10px; border-top-width: 1.5px; border-left-width: 1.5px; }
.crop.tr { top: 10px; right: 10px; border-top-width: 1.5px; border-right-width: 1.5px; }
.crop.bl { bottom: 10px; left: 10px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.crop.br { bottom: 10px; right: 10px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.bg-grain {
  position: absolute; inset: -120px; opacity: .22; mix-blend-mode: multiply;
  background-image: var(--grain);
  animation: grain .9s steps(1) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-37px, 21px); } 40% { transform: translate(19px, -44px); }
  60% { transform: translate(-12px, 58px); } 80% { transform: translate(41px, 9px); }
}

/* ================= Top bar ================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand-mark { width: 30px; height: 26px; border-radius: 6px; background: var(--ink); position: relative; overflow: hidden; }
.brand-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(115deg, var(--accent) 0 5px, var(--ink) 5px 10px); transform-origin: 0 100%; transition: transform .35s var(--ease-snap); }
.brand:hover .brand-mark::before { transform: rotate(-14deg); }
.brand-mark i { position: absolute; left: 6px; right: 6px; bottom: 4px; top: 11px; border-radius: 3px; background: var(--paper); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: 750 1.0625rem/1 var(--f-display); font-stretch: 88%; letter-spacing: -.02em; }
.brand-text small { font: 500 .6875rem/1.3 var(--f-mono); color: var(--mute); letter-spacing: .02em; }
.topnav { display: flex; align-items: center; gap: 4px; }
.navlink { display: none; padding: 10px 12px; font-size: var(--t-sm); font-weight: 500; text-decoration: none; color: var(--ink-2); border-radius: 999px; }
.navlink:hover { background: var(--paper-2); color: var(--ink); }
@media (min-width: 640px) { .navlink { display: inline-flex; } }

/* ================= Buttons ================= */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--h); padding: 0 1.25em; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1 var(--f-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s, color .2s, box-shadow .25s var(--ease), border-color .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-sm { --h: 44px; padding: 0 1em; font-size: var(--t-sm); }
.btn-lg { --h: 54px; padding: 0 1.5em; font-size: 1.0625rem; }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 8px 20px -12px rgba(18,18,17,.7); }
.btn-ink:hover { background: #000; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 14px 26px -14px rgba(18,18,17,.8), 4px 4px 0 -1px var(--accent); transform: translate(-2px, -2px); }
.btn-ghost { border-color: var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent); }
.btn-ghost:hover { border-color: var(--ink); background: var(--card); }
.btn-ghost .ic { transition: transform .3s var(--ease); }
.btn-ghost:hover .ic { transform: translateX(3px); }
.btn-accent { background: var(--accent); color: var(--ink); box-shadow: 0 10px 24px -14px var(--accent); }
.btn-accent:hover { background: #f03d10; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 -1px var(--ink); }
.btn[disabled], .btn.is-off { opacity: .35; pointer-events: none; }
.btn:focus-visible { outline-offset: 3px; border-radius: 999px; }
.btn-ghost-dark { border-color: rgba(243,240,232,.3); color: var(--paper); background: transparent; }
.btn-ghost-dark:hover { border-color: var(--paper); background: rgba(243,240,232,.06); }
.linkbtn { background: none; border: 0; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; color: var(--mute); cursor: pointer; font-size: var(--t-sm); min-height: 44px; }
.linkbtn:hover { color: var(--ink); }

/* ================= Hero ================= */
main { display: block; }
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(28px, 6vw, 56px) var(--gutter) 24px;
  display: grid; gap: 32px; align-items: center;
}
/* phone order: promise + CTA, then proof (stats/members), then the stage */
.hero-foot { order: 1; }
.hero-stage { order: 2; }
@media (min-width: 960px) {
  /* first screen lands whole: copy + stage share the middle, proof sits on a ruler at the fold */
  .hero {
    grid-template-columns: 1.1fr .9fr; grid-template-rows: auto auto; align-content: center; column-gap: 56px; row-gap: clamp(40px, 7vh, 80px);
    min-height: calc(100vh - 65px); min-height: calc(100svh - 65px); padding-block: 32px;
  }
  .hero-copy { grid-column: 1; grid-row: 1; }
  .hero-stage { grid-column: 2; grid-row: 1; }
  .hero-foot { grid-column: 1 / -1; grid-row: 2; order: 0; }
}
.hero-foot { display: grid; gap: 18px; }
@media (min-width: 960px) {
  .hero-foot {
    grid-template-columns: auto 1fr; align-items: center; gap: 32px; padding-top: 22px;
    /* a ruler at the fold: minor ticks every 12px, majors every 96px (matches the sheet grid) */
    background:
      linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 0 0 / 96px 12px repeat-x,
      linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 12px 6px repeat-x,
      linear-gradient(var(--line-2), var(--line-2)) 0 0 / 100% 1px no-repeat;
  }
  .hero-foot .stats, .hero-foot .members { margin: 0; }
  .hero-foot .members { justify-self: end; }
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); background: var(--card);
}
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: .35; } }
.display {
  margin: 0; font-family: var(--f-display); font-weight: 760; font-stretch: 80%;
  font-size: var(--t-hero); line-height: .92; letter-spacing: -.028em; font-variation-settings: "opsz" 96;
}
.display .cut { position: relative; display: inline-block; color: var(--ink); }
.display .cut { padding: 0 .14em; margin-left: -.14em; }
.display .cut::before, .display .cut::after { /* in/out marks bracketing the phrase */
  content: ""; position: absolute; top: .12em; bottom: .02em; width: .14em; border: .055em solid var(--accent);
}
.display .cut::before { left: 0; border-right: 0; }
.display .cut::after { right: 0; border-left: 0; }
.lede { max-width: 33em; margin: 22px 0 0; font-size: var(--t-lg); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
@media (max-width: 479px) { .cta .btn { flex: 1 1 100%; } }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: var(--t-xs); color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
.stats span { display: inline-flex; gap: 6px; align-items: baseline; }
.stats span + span::before { content: ""; width: 1px; height: 10px; background: var(--line-2); margin-right: 12px; align-self: center; }
.stats b { color: var(--ink); font-weight: 600; font-size: .8125rem; }
.members { display: flex; align-items: center; gap: 14px; }
.members p { margin: 0; font-size: var(--t-sm); color: var(--mute); line-height: 1.35; max-width: 18em; }

/* ===== Hero stage: mascot standing on the timeline deck ===== */
.hero-stage { position: relative; padding-top: 142px; } /* feet of a 140px Snip land on the deck edge */
.stage-mascot { position: absolute; top: 0; left: 6%; width: 140px; z-index: 2; }
@media (min-width: 960px) { .hero-stage { padding-top: 204px; } .stage-mascot { width: 200px; left: 8%; } }
.deck {
  position: relative; background: var(--deck); color: var(--paper); border-radius: var(--r-lg);
  padding: 14px 14px 30px; box-shadow: 0 30px 60px -30px rgba(18,18,17,.6), 0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
}
.deck::after { /* scanline sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
.deck-head { display: flex; justify-content: space-between; gap: 8px; font-size: .6875rem; letter-spacing: .05em; color: rgba(243,240,232,.74); padding: 2px 2px 12px; }
.deck-head .tc { color: var(--accent); font-variant-numeric: tabular-nums; }
.ruler {
  display: flex; justify-content: space-between; margin-left: 30px; padding-bottom: 8px;
  font-size: .625rem; color: rgba(243,240,232,.4);
  background: repeating-linear-gradient(90deg, rgba(243,240,232,.28) 0 1px, transparent 1px 10%) 0 100% / 100% 5px no-repeat,
              repeating-linear-gradient(90deg, rgba(243,240,232,.14) 0 1px, transparent 1px 2%) 0 100% / 100% 3px no-repeat;
}
.tracks { position: relative; display: grid; gap: 6px; padding-top: 8px; }
.track { display: grid; grid-template-columns: 24px 1fr; gap: 6px; align-items: center; height: 46px; }
.track.a { height: 34px; }
.track em { font: 600 .625rem/1 var(--f-mono); font-style: normal; color: rgba(243,240,232,.45); text-align: center; }
.clips { position: relative; height: 100%; }
.clips i {
  position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: calc(var(--w) * 1% - 3px);
  border-radius: 6px; background: var(--deck-2);
  box-shadow: inset 0 0 0 1px rgba(243,240,232,.12);
  background-image: repeating-linear-gradient(90deg, rgba(243,240,232,.06) 0 22px, transparent 22px 24px);
}
.clips i.hot { background-color: #3a2a24; box-shadow: inset 0 0 0 1.5px var(--accent); background-image: repeating-linear-gradient(90deg, rgba(255,74,28,.18) 0 22px, transparent 22px 24px); }
.wave {
  height: 100%; border-radius: 6px; background: var(--deck-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='34'%3E%3Cg fill='%23000'%3E%3Crect x='1' y='14' width='2' height='6'/%3E%3Crect x='5' y='10' width='2' height='14'/%3E%3Crect x='9' y='6' width='2' height='22'/%3E%3Crect x='13' y='12' width='2' height='10'/%3E%3Crect x='17' y='3' width='2' height='28'/%3E%3Crect x='21' y='9' width='2' height='16'/%3E%3Crect x='25' y='13' width='2' height='8'/%3E%3Crect x='29' y='7' width='2' height='20'/%3E%3Crect x='33' y='11' width='2' height='12'/%3E%3Crect x='37' y='5' width='2' height='24'/%3E%3Crect x='41' y='14' width='2' height='6'/%3E%3Crect x='45' y='9' width='2' height='16'/%3E%3Crect x='49' y='2' width='2' height='30'/%3E%3Crect x='53' y='8' width='2' height='18'/%3E%3Crect x='57' y='12' width='2' height='10'/%3E%3Crect x='61' y='6' width='2' height='22'/%3E%3Crect x='65' y='15' width='2' height='4'/%3E%3Crect x='69' y='10' width='2' height='14'/%3E%3Crect x='73' y='4' width='2' height='26'/%3E%3Crect x='77' y='11' width='2' height='12'/%3E%3Crect x='81' y='8' width='2' height='18'/%3E%3Crect x='85' y='13' width='2' height='8'/%3E%3Crect x='89' y='5' width='2' height='24'/%3E%3Crect x='93' y='10' width='2' height='14'/%3E%3Crect x='97' y='14' width='2' height='6'/%3E%3Crect x='101' y='7' width='2' height='20'/%3E%3Crect x='105' y='11' width='2' height='12'/%3E%3Crect x='109' y='3' width='2' height='28'/%3E%3Crect x='113' y='9' width='2' height='16'/%3E%3Crect x='117' y='13' width='2' height='8'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 120px 34px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='34'%3E%3Cg fill='%23000'%3E%3Crect x='1' y='14' width='2' height='6'/%3E%3Crect x='5' y='10' width='2' height='14'/%3E%3Crect x='9' y='6' width='2' height='22'/%3E%3Crect x='13' y='12' width='2' height='10'/%3E%3Crect x='17' y='3' width='2' height='28'/%3E%3Crect x='21' y='9' width='2' height='16'/%3E%3Crect x='25' y='13' width='2' height='8'/%3E%3Crect x='29' y='7' width='2' height='20'/%3E%3Crect x='33' y='11' width='2' height='12'/%3E%3Crect x='37' y='5' width='2' height='24'/%3E%3Crect x='41' y='14' width='2' height='6'/%3E%3Crect x='45' y='9' width='2' height='16'/%3E%3Crect x='49' y='2' width='2' height='30'/%3E%3Crect x='53' y='8' width='2' height='18'/%3E%3Crect x='57' y='12' width='2' height='10'/%3E%3Crect x='61' y='6' width='2' height='22'/%3E%3Crect x='65' y='15' width='2' height='4'/%3E%3Crect x='69' y='10' width='2' height='14'/%3E%3Crect x='73' y='4' width='2' height='26'/%3E%3Crect x='77' y='11' width='2' height='12'/%3E%3Crect x='81' y='8' width='2' height='18'/%3E%3Crect x='85' y='13' width='2' height='8'/%3E%3Crect x='89' y='5' width='2' height='24'/%3E%3Crect x='93' y='10' width='2' height='14'/%3E%3Crect x='97' y='14' width='2' height='6'/%3E%3Crect x='101' y='7' width='2' height='20'/%3E%3Crect x='105' y='11' width='2' height='12'/%3E%3Crect x='109' y='3' width='2' height='28'/%3E%3Crect x='113' y='9' width='2' height='16'/%3E%3Crect x='117' y='13' width='2' height='8'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 120px 34px repeat-x;
  background: linear-gradient(90deg, rgba(243,240,232,.45) 0 23%, var(--accent) 23% 54%, rgba(243,240,232,.45) 54%);
  margin-left: 0;
}
.moment {
  position: absolute; top: 0; bottom: -4px;
  left: calc(30px + (100% - 30px) * var(--x) / 100); width: calc((100% - 30px) * var(--w) / 100 - 3px);
  border-top: 2px solid var(--accent); pointer-events: none;
}
.moment::before, .moment::after { content: ""; position: absolute; top: -2px; width: 8px; height: 10px; border: 2px solid var(--accent); border-bottom: 0; }
.moment::before { left: 0; border-right: 0; } .moment::after { right: 0; border-left: 0; }
.moment span { position: absolute; bottom: -22px; left: 0; font-size: .625rem; letter-spacing: .12em; color: var(--accent); white-space: nowrap; }
.playhead {
  position: absolute; top: -18px; bottom: -6px; left: 30px; width: 2px; background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  animation: playhead 9s linear infinite;
}
.playhead::before { content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 10px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
@keyframes playhead { from { transform: translateX(0); } to { transform: translateX(var(--run, 300px)); } }

/* ================= Sections ================= */
.block { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 9vw, 120px) var(--gutter) 0; }
.block-head { max-width: 40rem; margin-bottom: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow .ic { width: 16px; height: 16px; }
.h2 { margin: 0; font: 740 var(--t-h2)/.98 var(--f-display); font-stretch: 84%; letter-spacing: -.026em; font-variation-settings: "opsz" 72; text-wrap: balance; }
.h3 { margin: 0; font: 720 var(--t-h3)/1.02 var(--f-display); font-stretch: 86%; letter-spacing: -.03em; }
.sub { margin: 14px 0 0; color: var(--ink-2); font-size: var(--t-lg); line-height: 1.5; max-width: 34em; text-wrap: pretty; }

/* ===== Continue card ===== */
.continue { max-width: var(--max); margin: 24px auto 0; padding: 0 var(--gutter); }
.continue-card {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none;
}
@media (min-width: 720px) { .continue-card { grid-template-columns: 1fr auto; align-items: center; padding: 22px 26px; } }
.continue-card .k { font-size: var(--t-xs); color: var(--mute); letter-spacing: .08em; text-transform: uppercase; }
.continue-card h3 { margin: 4px 0 12px; font: 700 1.375rem/1.1 var(--f-display); font-stretch: 88%; letter-spacing: -.02em; }

/* ===== Segmented progress (8 clips on a track) ===== */
.segs { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 4px; position: relative; }
.segs i { height: 10px; border-radius: 3px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .4s var(--ease); }
.segs i.done { background: var(--ink); box-shadow: none; }
.segs i.now { background: repeating-linear-gradient(115deg, var(--ink) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--t-xs); color: var(--mute); letter-spacing: .05em; }
.seg-meta b { color: var(--ink); font-weight: 600; }

/* ===== Outline: lessons as clips on a vertical edit timeline =====
   [in/out timecodes] [ruler rail] [clip]. Done clips fill the rail and the clip; the next clip carries the playhead. */
.outline { --tcw: 44px; --rail: 10px; --gap: 8px; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
@media (min-width: 380px) { .outline { --tcw: 48px; } }
@media (min-width: 1000px) { .outline { --tcw: 56px; --gap: 10px; } }
.clip {
  position: relative; display: grid; grid-template-columns: var(--tcw) 1fr; column-gap: calc(var(--rail) + 16px);
  text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent;
}
a.clip:focus-visible { outline: none; }
a.clip:focus-visible .clip-block { outline: 2px solid var(--accent); outline-offset: 3px; }
/* the rail: a ruler segment per clip, joined across the gaps */
.clip::before {
  content: ""; position: absolute; top: 0; bottom: calc(var(--gap) * -1); left: calc(var(--tcw) + 8px); width: var(--rail);
  background:
    linear-gradient(var(--line-2), var(--line-2)) 50% 0 / 1px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--line-2) 0 1px, transparent 1px 8px) 50% 0 / 7px 100% no-repeat;
}
.outline li:last-child .clip::before { bottom: 0; }
.clip.done::before, .clip.finish.open::before { background: linear-gradient(var(--ink), var(--ink)) 50% 0 / 4px 100% no-repeat; }
/* playhead on the next clip's in point */
.clip.next::after {
  content: ""; position: absolute; top: 12px; left: calc(var(--tcw) + 6px); width: 14px; height: 16px;
  background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.clip-tc {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 14px;
  font-size: var(--t-xs); font-weight: 600; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.clip-tc small { font-size: var(--t-xs); font-weight: 500; letter-spacing: .08em; color: var(--mute); }
.clip.next .clip-tc { color: var(--accent-ink); }

.clip-block {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  min-height: 76px; padding: 14px 14px 14px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line-2);
  transition: transform .35s var(--ease), border-color .2s, box-shadow .35s var(--ease), background-color .3s;
}
/* trim handles appear on hover / focus, like grabbing a clip's edges */
.clip-block::before, .clip-block::after {
  content: ""; position: absolute; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: currentColor;
  opacity: 0; transform: scaleY(.4); transition: opacity .2s, transform .35s var(--ease);
}
.clip-block::before { left: 5px; } .clip-block::after { right: 5px; }
a.clip:hover .clip-block, a.clip:focus-visible .clip-block { border-color: var(--ink); box-shadow: var(--shadow); transform: translateX(3px); }
a.clip:hover .clip-block::before, a.clip:hover .clip-block::after,
a.clip:focus-visible .clip-block::before, a.clip:focus-visible .clip-block::after { opacity: .9; transform: none; }
a.clip:active .clip-block { transform: translateX(3px) scale(.99); }
.clip-meta { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); line-height: 1.2; color: var(--mute); letter-spacing: .05em; text-transform: uppercase; }
.clip .tag { font: 600 .6875rem/1 var(--f-mono); letter-spacing: .06em; padding: 4px 7px 3px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.clip h3 { margin: 5px 0 3px; font: 680 1.125rem/1.15 var(--f-display); font-stretch: 92%; letter-spacing: -.015em; text-wrap: balance; }
.clip p { margin: 0; font-size: var(--t-sm); color: var(--mute); line-height: 1.4; text-wrap: pretty; }
.clip .lic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--ink); transition: background-color .3s, color .3s; }
.clip .lic .ic { width: 22px; height: 22px; }
a.clip:hover .lic { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* next: the playhead's clip */
.clip.next .clip-block { border: 1.5px solid var(--accent); box-shadow: var(--shadow); }
.clip.next .tag { background: var(--accent); color: var(--ink); }
.clip.next .lic { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* done: a filled clip */
.clip.done .clip-block { background: var(--deck); border-color: var(--deck); color: var(--paper);
  background-image: repeating-linear-gradient(90deg, rgba(243,240,232,.07) 0 1px, transparent 1px 28px); background-size: 100% 6px; background-repeat: no-repeat; }
.clip.done .clip-meta, .clip.done p { color: rgba(243,240,232,.74); }
.clip.done .tag { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px rgba(243,240,232,.4); }
.clip.done .lic, a.clip.done:hover .lic { background: var(--deck-2); border-color: rgba(243,240,232,.14); color: var(--accent); }
.clip.done .lic .ic { stroke-width: 2.2; }
.clip.done .clip-tc { color: var(--ink); }
/* finish line */
.clip.finish.locked .clip-block { background: transparent; border-style: dashed; }
.clip.finish.locked h3 { color: var(--ink-2); }
.clip.finish.locked .lic { background: transparent; color: var(--mute); }
.clip.finish.open .clip-block { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.clip.finish.open p, .clip.finish.open .clip-meta { color: var(--ink); }
.clip.finish.open .tag { background: var(--ink); color: var(--paper); }
.clip.finish.open .lic { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (min-width: 1000px) {
  /* desktop: the heading holds still on the left while the timeline scrolls past */
  #outline { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
  #outline .block-head { position: sticky; top: 112px; margin: 0; }
  .clip-block { min-height: 88px; padding: 16px 18px 16px 20px; gap: 16px; }
  .clip .lic { width: 48px; height: 48px; border-radius: 12px; }
  .clip .lic .ic { width: 26px; height: 26px; }
  .clip h3 { font-size: 1.25rem; }
  .clip-tc { padding-top: 16px; }
  .clip.next::after { top: 13px; }
}

/* ===== Honest card ===== */
.honest-card {
  position: relative; padding: clamp(22px, 4vw, 40px); border-radius: var(--r-lg); background: var(--deck); color: var(--paper); overflow: hidden;
}
.honest-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(243,240,232,.06) 1px, transparent 1px) 0 0 / 24px 100%; pointer-events: none; }
.honest-card .eyebrow { color: var(--accent); }
.rules { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: r; }
@media (min-width: 860px) { .rules { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.rules li { position: relative; padding-top: 14px; border-top: 1px solid var(--deck-line); color: rgba(243,240,232,.72); font-size: var(--t-md); line-height: 1.5; }
.rules li b { display: block; color: var(--paper); font-weight: 600; margin-bottom: 4px; }

/* ===== FAQ ===== */
.faq { display: grid; border-top: 1px solid var(--line-2); max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary {
  list-style: none; display: grid; grid-template-columns: 1fr 28px; gap: 16px; align-items: center;
  padding: 18px 2px; min-height: 64px; cursor: pointer; font: 650 1.125rem/1.3 var(--f-display); font-stretch: 94%; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { width: 22px; height: 22px; transition: transform .35s var(--ease); justify-self: end; }
.faq details[open] summary .ic { transform: rotate(45deg); color: var(--accent); }
.faq .ans { padding: 0 40px 20px 2px; color: var(--ink-2); }
.faq .ans p { margin: 0; }

/* ===== Final CTA ===== */
.final { text-align: left; padding-bottom: 20px; }
.final .btn { margin-top: 26px; }

/* ===== Footer ===== */
.foot { max-width: var(--max); margin: clamp(64px, 10vw, 120px) auto 0; padding: 22px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); color: var(--mute); font-size: var(--t-sm); display: grid; gap: 4px; }
.foot p { margin: 0; }
.foot .mono { font-size: var(--t-xs); letter-spacing: .08em; color: var(--ink-2); }
body.in-lesson .foot { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ================= Lesson view ================= */
.lesson-bar {
  position: sticky; top: 64px; z-index: 20; padding: 10px var(--gutter) 12px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lesson-bar-in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.backlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; margin-left: -8px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: var(--t-sm); }
.backlink:hover { background: var(--paper-2); }
.lesson-bar .segs a { display: block; padding: 8px 0; }
.lesson-bar .segs i { height: 8px; }
.lesson-bar .seg-meta { margin-top: 0; }

/* the lesson is a sheet of paper laid on the cutting-room desk: text never sits on grid or lanes */
.lesson {
  position: relative; isolation: isolate;
  max-width: 760px; margin: 26px auto 0; padding: 34px clamp(18px, 5vw, 44px) 40px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 1px 0 rgba(18,18,17,.05), 0 30px 60px -44px rgba(18,18,17,.45);
}
.lesson::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: var(--grain); opacity: .22; mix-blend-mode: multiply;
}
@media (max-width: 799px) { .lesson { margin: 14px 10px 0; } }
.lesson-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; }
.lesson-head .eyebrow { margin-bottom: 12px; }
.lesson-title { margin: 0; font: 760 clamp(2.25rem, 1.4rem + 4.4vw, 4rem)/.95 var(--f-display); font-stretch: 82%; letter-spacing: -.028em; font-variation-settings: "opsz" 96; text-wrap: balance; }
.lesson-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--ink); color: var(--paper); transform: rotate(-4deg); box-shadow: 4px 4px 0 var(--accent); }
.lesson-icon .ic { width: 34px; height: 34px; stroke-width: 1.6; }
.lesson-body { margin-top: 26px; font-size: 1.0625rem; line-height: 1.7; color: var(--ink-2); }
.lesson-body p { margin: 0 0 1em; max-width: 38em; }
.lesson-body strong { color: var(--ink); font-weight: 650; }
.lesson-body h3::before { content: ""; display: block; width: 18px; height: 3px; margin-bottom: 12px; border-radius: 2px; background: var(--accent); }
.lesson-body h3 { margin: 1.9em 0 .45em; color: var(--ink); font: 700 1.375rem/1.15 var(--f-display); font-stretch: 90%; letter-spacing: -.02em; }
.lesson-body ul { margin: 0 0 1.1em; padding: 0; list-style: none; display: grid; gap: 8px; }
.lesson-body li { position: relative; padding-left: 22px; }
.lesson-body li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 10px; height: 2px; background: var(--ink); }
.lesson-body .tcode { font: 500 .9em var(--f-mono); background: var(--paper-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); white-space: nowrap; }
.callout { margin: 1.4em 0; padding: 16px 18px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line-2); }
.callout .k { display: flex; align-items: center; gap: 8px; font: 600 var(--t-xs)/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

.checklist { position: relative; margin-top: 84px; padding: 20px; border-radius: var(--r-lg); background: var(--deck); color: var(--paper); }
.checklist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.checklist-head h2 { margin: 0; font: 720 1.375rem/1.1 var(--f-display); font-stretch: 88%; letter-spacing: -.02em; }
.checklist-head .mono { font-size: var(--t-xs); color: rgba(243,240,232,.74); letter-spacing: .05em; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; }
.check {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start;
  padding: 14px 4px; min-height: 56px; cursor: pointer; border-top: 1px solid var(--deck-line);
  -webkit-tap-highlight-color: transparent;
}
.check { position: relative; }
.check input { position: absolute; top: 14px; left: 4px; width: 26px; height: 26px; margin: 0; opacity: 0; pointer-events: none; }
.check .box {
  width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid rgba(243,240,232,.4);
  display: grid; place-items: center; transition: background-color .25s, border-color .25s, transform .3s var(--ease-snap);
}
.check .box .ic { width: 16px; height: 16px; stroke-width: 2.4; color: var(--deck); stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s var(--ease) .05s; }
.check .txt { color: rgba(243,240,232,.86); line-height: 1.45; padding-top: 2px; transition: color .25s; }
.check:hover .box { border-color: var(--paper); }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 3px; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.check input:checked + .box .ic { stroke-dashoffset: 0; color: #fff; }
.check input:checked ~ .txt { color: rgba(243,240,232,.66); text-decoration: line-through; text-decoration-color: rgba(255,74,28,.7); text-decoration-thickness: 1.5px; }
.check input:focus-visible ~ .txt { color: var(--paper); }
.check:active .box { transform: scale(.92); }

/* after a lesson: saved note + the next clip */
.after { margin-top: 18px; display: grid; gap: 12px; scroll-margin: 150px 0 calc(104px + env(safe-area-inset-bottom)); }
.done-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.done-note .ic { width: 16px; height: 16px; color: var(--accent-ink); stroke-width: 2.2; }
.next-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  min-height: 72px; padding: 12px 18px 12px 12px; border-radius: var(--r-md); text-decoration: none;
  background: var(--card); border: 1.5px solid var(--accent); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), border-color .2s;
}
.next-card:hover { transform: translateX(3px); }
.next-card .lic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--paper); }
.next-card .lic .ic { width: 26px; height: 26px; }
.next-card .k { display: block; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.next-card b { display: block; margin-top: 3px; font: 700 1.1875rem/1.15 var(--f-display); font-stretch: 90%; letter-spacing: -.015em; }
.next-card > .ic { width: 22px; height: 22px; transition: transform .3s var(--ease); }
.next-card:hover > .ic { transform: translateX(3px); }
.after.fresh, .wrap.fresh { animation: up .7s var(--ease) both; }

/* ===== Course wrap: a slate claps shut over the final cut ===== */
.wrap { position: relative; margin-top: 22px; border-radius: var(--r-lg); background: var(--deck); color: var(--paper); overflow: hidden; scroll-margin-top: 150px; }
.continue .wrap { margin-top: 0; scroll-margin-top: 90px; }
.wrap-slate { position: relative; height: 26px; background: var(--deck-2); border-bottom: 1px solid var(--deck-line); }
.wrap-slate i {
  position: absolute; inset: 0; transform-origin: 14px 100%;
  background: repeating-linear-gradient(115deg, var(--accent) 0 18px, var(--paper) 18px 36px);
}
.wrap.fresh .wrap-slate i { animation: clap .75s var(--ease-snap) .25s both; }
@keyframes clap { 0% { transform: rotate(-9deg); } 55% { transform: rotate(0); } 70% { transform: rotate(-2.5deg); } 100% { transform: rotate(0); } }
.wrap-in { padding: clamp(20px, 4vw, 36px); }
.wrap-k { margin: 0; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.wrap-h { margin: 10px 0 0; font: 760 clamp(2.5rem, 1.6rem + 4vw, 4rem)/.95 var(--f-display); font-stretch: 82%; letter-spacing: -.028em; }
.wrap-h:focus { outline: none; }
.wrap-p { margin: 14px 0 0; max-width: 34em; color: rgba(243,240,232,.8); line-height: 1.55; text-wrap: pretty; }
.edl { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--deck-line); font-size: var(--t-xs); }
.edl li {
  display: grid; grid-template-columns: 2.2em 7.6em 1fr auto; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--deck-line); color: rgba(243,240,232,.8);
}
.edl li span:first-child { color: var(--accent); }
.edl li span:nth-child(2) { color: rgba(243,240,232,.66); font-variant-numeric: tabular-nums; }
.edl li span:nth-child(3) { font-family: var(--f-text); font-size: var(--t-sm); color: var(--paper); min-width: 0; }
.edl .ic { width: 16px; height: 16px; color: var(--accent); stroke-width: 2.2; }
.wrap.fresh .edl li { animation: up .5s var(--ease) both; animation-delay: calc(.45s + var(--k) * 60ms); }
@media (max-width: 420px) { .edl li { grid-template-columns: 2em 1fr auto; } .edl li span:nth-child(2) { display: none; } }
.wrap-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 479px) { .wrap-cta .btn { flex: 1 1 100%; } }

/* bottom action dock: thumb zone on phones */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.dock-in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.dock .btn { width: 100%; padding: 0 1em; }
.dock .sq { width: 52px; height: 52px; padding: 0; border-radius: 16px; }
.dock .sq .ic { width: 22px; height: 22px; }
.dock .sq.go { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dock .sq.go .ic { animation: nudge 1.6s var(--ease) .6s 3; }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateX(4px); } }
.btn-done:hover { background: #000; }
.btn-done.is-done:hover { border-color: var(--ink); background: var(--card); }
.btn-done { background: var(--ink); color: var(--paper); }
.btn-done.is-done { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-done.is-done .ic { color: var(--accent); }

/* lesson mascot (corner) */
.lesson-mascot { position: absolute; right: 14px; top: -76px; width: 78px; z-index: 2; } /* peeks over the checklist card */
@media (min-width: 1100px) { .lesson-mascot { position: fixed; top: auto; width: 140px; right: 32px; bottom: 110px; } }

/* ================= Mascot ================= */
.mascot { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.snip { width: 100%; height: auto; overflow: visible; }
.snip .ink { fill: var(--ink); }
.snip .screen { fill: var(--paper); }
.snip .sprockets rect { fill: var(--paper); opacity: .92; }
.snip .stripe { fill: var(--paper); }
.snip .hinge { fill: var(--accent); }
.snip .recdot { fill: var(--accent); animation: rec 1.4s ease-in-out infinite; }
.snip .eye ellipse { fill: var(--ink); }
.snip .glint { fill: var(--paper); }
.snip .m-legs path, .snip .m-arm path { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.snip .m-arm circle { fill: var(--ink); }
.snip .mo { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.snip .mo-open { fill: var(--ink); }
.snip .mo-o { fill: var(--ink); stroke: none; }
.snip .cheek { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.snip .m-shadow { fill: rgba(18,18,17,.14); transform-box: fill-box; transform-origin: center; }
.snip .m-think { fill: var(--ink); opacity: 0; }
.snip .m-think circle { transform-box: fill-box; transform-origin: center; }

.snip .m-all { transform-box: view-box; transform-origin: 80px 166px; }
.snip .m-clap { transform-box: view-box; transform-origin: 34px 50px; transition: transform .3s var(--ease-spring); }
.snip .m-arm-l { transform-box: view-box; transform-origin: 31px 104px; transition: transform .45s var(--ease-spring); }
.snip .m-arm-r { transform-box: view-box; transform-origin: 129px 104px; transition: transform .45s var(--ease-spring); }
.snip .m-eyes { transform-box: fill-box; transform-origin: center; transition: transform .35s var(--ease); }
.snip .eye { transform-box: fill-box; transform-origin: center; }

/* idle: breathing bob + blink + small clapper twitch */
.m-idle .m-all, .m-wave .m-all, .m-think .m-all { animation: bob 3.2s ease-in-out infinite; }
.m-idle .m-shadow, .m-wave .m-shadow, .m-think .m-shadow { animation: shadow 3.2s ease-in-out infinite; }
.mascot .eye { animation: blink 5.2s infinite; }
.mascot .eye + .eye { animation-delay: .02s; }
.m-idle .mo-idle, .m-wave .mo-idle { opacity: 1; }
.m-idle .m-clap { animation: clapIdle 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes shadow { 50% { transform: scaleX(.9); opacity: .75; } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.1); } }
@keyframes clapIdle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-12deg); } 80% { transform: rotate(0); } 84% { transform: rotate(-6deg); } 87% { transform: rotate(0); } }

/* wave */
.m-wave .m-arm-r { animation: wave 1.1s var(--ease) 1 both; }
.m-wave .cheek { opacity: 1; }
@keyframes wave { 0% { transform: rotate(0); } 22% { transform: rotate(-128deg); } 40% { transform: rotate(-104deg); } 58% { transform: rotate(-132deg); } 76% { transform: rotate(-106deg); } 100% { transform: rotate(-118deg); } }

/* think: hand up, eyes drift up-left, bubble dots */
.m-think .m-arm-r { transform: rotate(-150deg); }
.m-think .m-eyes { transform: translate(-3px, -4px); }
.m-think .mo-o { opacity: 1; }
.m-think .m-think { opacity: 1; }
.m-think .m-think circle { animation: dot 1.4s ease-in-out infinite; }
.m-think .m-think circle:nth-child(2) { animation-delay: .18s; }
.m-think .m-think circle:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 100% { transform: scale(.6); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }

/* cheer: jump, both arms up, clapper snaps */
.m-cheer .m-all { animation: jump .9s var(--ease) 2; }
.m-cheer .m-shadow { animation: shadowJump .9s var(--ease) 2; }
.m-cheer .m-arm-l { transform: rotate(118deg); }
.m-cheer .m-arm-r { transform: rotate(-118deg); }
.m-cheer .mo-open { opacity: 1; }
.m-cheer .cheek { opacity: 1; }
.m-cheer .m-clap { animation: snap .45s var(--ease) 4; }
.m-cheer .eye { animation: none; transform: scaleY(.55); }
@keyframes jump { 0% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(2px) scale(1.06, .92); } 45% { transform: translateY(-26px) scale(.97, 1.04); } 75% { transform: translateY(0) scale(1.04, .95); } 100% { transform: translateY(0) scale(1); } }
@keyframes shadowJump { 45% { transform: scaleX(.6); opacity: .4; } }
@keyframes snap { 0% { transform: rotate(0); } 35% { transform: rotate(-28deg); } 70%, 100% { transform: rotate(0); } }

/* nod: small acknowledgement on each checklist tick */
.m-nod .m-all { animation: nod .5s var(--ease); }
.m-nod .mo-idle { opacity: 1; }
.m-nod .cheek { opacity: 1; }
@keyframes nod { 30% { transform: translateY(3px) rotate(-3deg); } 65% { transform: translateY(-3px) rotate(2deg); } }

/* speech bubble: a caption card with a timecode */
.bubble {
  position: absolute; bottom: calc(100% - 14px); right: 40%; min-width: 150px; max-width: 220px;
  padding: 9px 12px 10px; border-radius: 12px 12px 4px 12px; background: var(--ink); color: var(--paper);
  font: 500 .8125rem/1.35 var(--f-text); text-align: left;
  opacity: 0; transform: translateY(6px) scale(.96); transform-origin: 100% 100%;
  transition: opacity .25s, transform .35s var(--ease-snap); pointer-events: none;
}
.bubble.show { opacity: 1; transform: none; }
.bubble .tc { display: block; font: 500 .6875rem/1 var(--f-mono); color: var(--accent); letter-spacing: .08em; margin-bottom: 4px; }
.stage-mascot .bubble { right: auto; left: 72%; bottom: 66%; border-radius: 12px 12px 12px 4px; transform-origin: 0 100%; }

/* confetti: cut markers */
.confetti { position: fixed; pointer-events: none; z-index: 60; width: 10px; height: 14px; }
.confetti.a { background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.confetti.b { background: var(--ink); width: 4px; height: 16px; border-radius: 1px; }
.confetti.c { border: 2px solid var(--ink); border-right: 0; width: 7px; height: 14px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100vw - 32px); white-space: nowrap;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: var(--t-sm); box-shadow: 0 0 0 1px rgba(243,240,232,.16), 0 14px 30px -14px rgba(0,0,0,.6);
  transform: translate(-50%, 16px); opacity: 0; transition: transform .45s var(--ease-snap), opacity .25s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
/* in a lesson the thumb zone holds the dock and the next-clip card, so the toast drops in under the lesson bar */
body.in-lesson .toast { bottom: auto; top: calc(var(--bar-bottom, 140px) + 12px); transform: translate(-50%, -16px); }
body.in-lesson .toast.show { transform: translate(-50%, 0); }
.toast .mono { color: var(--accent); font-size: var(--t-xs); }

/* ================= Entrances ================= */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero-foot { animation: up .9s var(--ease) .45s both; } /* sits at the fold, so it enters on load, not on scroll */
.view-lesson:not(.no-enter) .lesson > * { animation: up .7s var(--ease) both; }
.view-lesson .lesson > *:nth-child(2) { animation-delay: .06s; }
.view-lesson .lesson > *:nth-child(3) { animation-delay: .12s; }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }

/* ================= Reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .bg-track, .bg-grain, .bg-sprocket, .playhead, .rec, .snip .recdot { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Lesson figures + sources */
.fig { margin: 1.6em 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(12px, 3vw, 22px); }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { font: 500 var(--t-xs)/1.4 var(--f-mono); color: var(--mute); letter-spacing: .04em; margin-top: 10px; }
.sources { font-size: var(--t-sm); color: var(--mute); }
.sources a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.lesson-body ol { margin: 0 0 1.1em; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: st; }
.lesson-body ol li { counter-increment: st; padding-left: 34px; }
.lesson-body ol li::before { content: counter(st); width: auto; height: auto; top: 0; left: 0; background: none; font: 700 .9rem/1.9 var(--f-mono); color: var(--accent-ink); }

/* lesson polish */
.lesson-title:focus { outline: none; }
.lesson-mascot .bubble { right: calc(100% - 6px); bottom: 34%; border-radius: 12px 12px 4px 12px; }
@media (min-width: 1100px) { .lesson-mascot .bubble { right: 40%; bottom: calc(100% - 14px); } }
@media (max-width: 479px) { .fig { padding: 8px 8px 10px; margin-inline: -6px; border-radius: var(--r-md); } .fig figcaption { padding-inline: 4px; } }
.fig svg { max-width: 600px; margin-inline: auto; }
.lesson-body :is(img, video) { max-width: 100%; height: auto; }

/* ===== Real example block (lessons 4 and 5) ===== */
.example { margin: 2em 0; padding: clamp(14px, 3vw, 22px); border-radius: var(--r-lg); background: var(--deck); color: rgba(243,240,232,.86); }
.example p { color: inherit; }
.example strong, .example h3 { color: var(--paper); }
.example h3 { margin-top: 1.2em; }
.example li::before { background: var(--accent); }
.ex-k { margin: 0 0 12px; font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ex-vid { display: block; width: 100%; border-radius: 12px; background: #000; box-shadow: 0 0 0 1px var(--deck-line); }
.ex-wide { aspect-ratio: 16 / 9; }
.ex-tall { aspect-ratio: 9 / 16; max-height: 72vh; width: auto; max-width: 100%; margin-inline: auto; }
.ex-pair { display: grid; gap: 14px; }
.ex-pair figure { margin: 0; display: grid; gap: 8px; align-content: start; }
@media (min-width: 640px) { .ex-pair { grid-template-columns: 1.5fr 1fr; align-items: start; } .ex-tall { max-height: none; width: 100%; } }
.ex-tag { font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: rgba(243,240,232,.74); }
.ex-log { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 0; font-size: .8125rem; }
.lesson-body .ex-log li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 10px 0 10px 12px; border-top: 1px solid var(--deck-line); }
.lesson-body .ex-log li::before { display: none; }
.ex-log li { border-left: 2px solid transparent; }
.ex-log li.in, .ex-log li.out { border-left-color: var(--accent); }
.ex-log b { color: var(--paper); font-weight: 600; }
.ex-log li.in b, .ex-log li.out b { color: var(--accent); }
.ex-log span { font-family: var(--f-text); font-size: .9375rem; color: rgba(243,240,232,.8); }
.ex-transcript { margin-top: 12px; border-top: 1px solid var(--deck-line); padding-top: 10px; }
.ex-transcript summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--paper); }
.ex-credit { margin: 14px 0 0; font-size: var(--t-sm); color: rgba(243,240,232,.7) !important; }
.ex-credit a { color: var(--paper); text-underline-offset: 3px; }

/* ===== Live Discord member line (real counts from the public invite) ===== */
.members { text-decoration: none; min-height: 44px; border-radius: 14px; padding: 4px 8px 4px 4px; margin-left: -4px; transition: background-color .2s; }
.members:hover { background: color-mix(in srgb, var(--card) 80%, transparent); }
.server-icon { position: relative; flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: var(--paper); display: grid; place-items: center; overflow: hidden; box-shadow: 3px 3px 0 var(--accent); }
.server-icon .ic { width: 22px; height: 22px; }
.server-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.members-txt { display: grid; gap: 3px; }
.mcount { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--t-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.mcount b { color: var(--ink); font-weight: 600; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.mcount .sep { width: 1px; height: 10px; background: var(--line-2); margin: 0 4px; }
.mcount .rec { width: 7px; height: 7px; }
.mline { font-size: var(--t-sm); color: var(--mute); line-height: 1.35; }
.faces { display: flex; align-items: center; flex: none; }
.faces img, .faces .more { width: 36px; height: 36px; border-radius: 50%; margin-left: -10px; border: 2px solid var(--paper); background: var(--paper-2); object-fit: cover; }
.faces img:first-child { margin-left: 0; }
.faces .more { display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: .6875rem; font-weight: 600; }
.mcount { white-space: nowrap; }
@media (max-width: 559px) { .members.has-faces { flex-direction: column; align-items: flex-start; gap: 10px; } }
