/* ==========================================================================
   MERITORA opening site (index.html), Grail-inspired remodel.
   Brief: docs/landing-grail-brief.md. Engine: assets/js/opening.js.

   Every chapter is a [data-scene] section. Under .has-motion it is
   --len screens tall and its .stage sticks to the top for the whole run;
   opening.js writes three numbers on the section each frame:
     --p    0..1 over the pinned run
     --in   0..1 over the first screen of it (wipes, entrances)
     --out  0..1 over the screen before it lets go (exits); for an
            unpinned sheet, the screen in which its foot leaves
   data-over slides the section one screen back so it is drawn over the
   previous one's last screen (a sheet rising, or a wipe; a pinned wipe goes
   two screens back so it finishes before the one beneath lets go);
   data-over="under" tucks it beneath instead, revealed as the sheet lifts.
   Without .has-motion (reduced motion, no script) it is a plain page.
   ========================================================================== */

@font-face { font-family: 'Gloock'; src: url('../fonts/gloock-400-latin.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('../fonts/dm-serif-display-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* colour */
  --l-ink: #000000;
  --l-ink-2: #0E0D0C;
  --l-edge: rgba(255, 255, 255, .09);
  --l-text: #FFFFFF;
  --l-text-2: rgba(255, 255, 255, .66);
  --l-cream: #F4EEE2;
  --l-cream-ink: #3B2416;
  --l-cream-ink-2: rgba(59, 36, 22, .74);
  --l-sheet: #F7F5F0;
  --l-sheet-ink: #0B0B0B;
  --l-sheet-ink-2: rgba(11, 11, 11, .64);
  --l-accent: #FF5A2B;
  --l-accent-deep: #D93A12;
  --l-on-accent: #000000;
  --l-mark: #E1BB68;

  /* type */
  --f-display: 'Gloock', Georgia, 'Times New Roman', serif;
  --f-text: 'Switzer', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --f-logo: 'DM Serif Display', Georgia, serif;
  --t-hero: clamp(44px, 8.9vw, 196px);
  --t-h2: clamp(46px, 6vw, 92px);
  --t-h2-s: clamp(34px, 4.4vw, 64px);
  --t-giant: clamp(64px, 13vw, 200px);
  --t-ghost: clamp(120px, 24vw, 360px);
  --t-lead: 18px;
  --t-body: 16px;
  --t-small: 14px;
  --t-label: 13px;

  /* motion (Grail's curve; exits accelerate and are shorter) */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --d-press: 150ms;
  --d-ui: 420ms;
  --d-line: 650ms;
  --d-big: 1150ms;
  --press-scale: .98;

  /* space and shape */
  --gutter: clamp(16px, 2.2vw, 32px);
  --r-pill: 999px;
  --r-sheet: 28px;
  --vh: 100svh;

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--l-ink); -webkit-text-size-adjust: 100%; scrollbar-color: rgba(255, 255, 255, .28) var(--l-ink); }
body { margin: 0; background: var(--l-ink); color: var(--l-text); font: 400 var(--t-body)/1.35 var(--f-text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
::selection { background: var(--l-accent); color: var(--l-on-accent); }
:focus-visible { outline: 2px solid var(--l-accent); outline-offset: 3px; border-radius: 4px; }
.tone-cream ::selection, .tone-sheet ::selection { background: var(--l-cream-ink); color: var(--l-cream); }
.vh { 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 { position: fixed; z-index: 100; left: var(--gutter); top: 12px; padding: 10px 16px; border-radius: var(--r-pill); background: var(--l-accent); color: var(--l-on-accent); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform var(--d-ui) var(--ease-out); }
.skip:focus-visible { transform: none; }

/* display type */
.display { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: -.01em; line-height: .88; font-kerning: normal; }
.ln { display: block; }
.ln > span { display: block; }

/* text roles */
.lead { font-size: var(--t-lead); font-weight: 700; line-height: 1.3; }
.body { font-size: var(--t-body); line-height: 1.35; max-width: 46ch; }
.note { font-size: var(--t-small); line-height: 1.32; max-width: 40ch; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--l-text); }
.logo__spark { width: 18px; height: 18px; flex: none; color: var(--l-mark); }
.logo__word { font: 400 26px/1 var(--f-logo); letter-spacing: -.02em; transform: translateY(-1px); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border: 0; border-radius: var(--r-pill); background: var(--l-accent); color: var(--l-on-accent); font: 600 15px/1 var(--f-text); text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform var(--d-press) var(--ease-out), background-color var(--d-press) linear; }
.pill:hover { background: #FF6E44; }
.pill:active { transform: scale(var(--press-scale)); background: var(--l-accent-deep); }
.pill--quiet { background: rgba(255, 255, 255, .1); color: var(--l-text); }
.pill--quiet:hover { background: rgba(255, 255, 255, .16); }
.pill--quiet[aria-pressed="true"] { background: var(--l-text); color: var(--l-ink); }

/* ---------- top bar (lives in the hero, scrolls away with it) ---------- */
.top { position: absolute; z-index: 5; inset: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: var(--gutter); }
.top__line { max-width: 36ch; color: var(--l-text-2); font-size: 15px; line-height: 1.35; text-align: center; }
.top .pill { justify-self: end; }

/* ---------- bottom pill (fixed, appears after the hero) ---------- */
.dock { position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: var(--r-pill); background: var(--l-ink-2); box-shadow: inset 0 0 0 1px var(--l-edge); --dx: 0px; transform: translate(calc(-50% + var(--dx)), 160%); opacity: 0; visibility: hidden; transition: transform var(--d-line) var(--ease-out), opacity var(--d-ui) var(--ease-out), visibility 0s linear var(--d-line); }
.dock .logo__spark { width: 20px; height: 20px; margin-right: 6px; }
.dock .pill { height: 40px; padding: 0 18px; }
/* hidden means out of the tab order too, not only out of sight */
.dock-on .dock { transform: translate(calc(-50% + var(--dx)), 0); opacity: 1; visibility: visible; transition-delay: 0s; }
[data-dock="left"] .dock { --dx: calc(-50vw + 50% + var(--gutter) + 120px); }
[data-dock="right"] .dock { --dx: calc(50vw - 50% - var(--gutter) - 120px); }
/* the last chapter has its own Start studying button, so the pill steps aside */
.dock-on[data-dock="hide"] .dock { transform: translate(calc(-50% + var(--dx)), 160%); opacity: 0; visibility: hidden; transition-delay: 0s, 0s, var(--d-line); }

/* ---------- the air: one smoke backdrop for every black chapter (opening-air.js) ----------
   Blended with screen, so it only adds light: visible on black, nothing on cream or a sheet. */
.air { position: fixed; z-index: 50; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity 1600ms var(--ease-out); }
.has-air .air { opacity: 1; }

/* ---------- scenes ---------- */
.scene { position: relative; isolation: isolate; }
.stage { position: relative; display: grid; min-height: 100svh; padding: calc(var(--gutter) + 40px) var(--gutter) calc(var(--gutter) + 72px); overflow: clip; }
.chap { position: absolute; z-index: 4; inset: var(--gutter) var(--gutter) auto; display: flex; justify-content: space-between; font-size: var(--t-label); font-weight: 500; line-height: 1; pointer-events: none; }

/* the ground belongs to the stage, so a wipe or a sheet reveals it, never the section box */
.tone-ink { color: var(--l-text); }
.tone-ink > .stage { background: var(--l-ink); }
.tone-cream { color: var(--l-cream-ink); }
.tone-cream > .stage { background: var(--l-cream); }
.tone-sheet { color: var(--l-sheet-ink); }
.tone-cream .body, .tone-cream .note { color: var(--l-cream-ink-2); }
.tone-ink .body, .tone-ink .note { color: var(--l-text-2); }
.tone-sheet .body, .tone-sheet .note { color: var(--l-sheet-ink-2); }
.tone-cream ::selection { background: var(--l-cream-ink); }

/* sheets: off-white panels that slide over what is pinned beneath */
.sheet { position: relative; background: var(--l-sheet); border-radius: var(--r-sheet); }

/* pinned behaviour */
.has-motion .scene[data-pin] { height: calc(var(--len, 200) * var(--vh) / 100); }
.has-motion .scene[data-pin] > .stage { position: sticky; top: 0; height: var(--vh); min-height: 0; }
.has-motion .scene[data-over] { margin-top: calc(-1 * var(--vh)); }
.has-motion .scene[data-over][data-wipe] { margin-top: calc(-2 * var(--vh)); }
.has-motion .scene[data-wipe] > .stage { clip-path: inset(calc((1 - var(--in, 0)) * 50%) round calc((1 - var(--in, 0)) * 40px)); }

/* continuous scroll: nothing on a held stage sits still while the page moves.
   Layers drift with the scene's progress at their own rate (the translate
   property, so it never fights an entrance's transform), headlines slide
   along their lines, and the big figures breathe in scale. */
.has-motion [data-drift] { translate: 0 calc((0.5 - var(--p, 0)) * var(--drift, 80px)); }
/* every layer that moves each frame gets its own compositor layer, so a frame never repaints text */
.has-motion .is-on [data-drift], .has-motion .is-on .problem h2 .ln, .has-motion .is-on.problem h2 .ln, .has-motion .is-on .loop__ghost, .has-motion .is-on .subjects__name, .has-motion .is-on .subjects__plate, .has-motion .is-on.map h2, .has-motion .is-on.session h2, .has-motion .is-on .marking__w, .has-motion .is-on .marking__device, .has-motion .is-on .ui__track, .has-motion .is-on .loop__tilt { will-change: translate, scale, rotate, transform; }
.has-motion .problem h2 .ln:nth-child(odd) { translate: calc((0.5 - var(--p, 0)) * -7vw) 0; }
.has-motion .problem h2 .ln:nth-child(even) { translate: calc((0.5 - var(--p, 0)) * 7vw) 0; }
.has-motion .loop__ghost { scale: calc(0.9 + var(--p, 0) * 0.2); }
.has-motion .subjects__name { translate: 0 calc((0.5 - var(--p, 0)) * 120px); }
.has-motion .subjects__plate { rotate: calc((var(--p, 0) - 0.5) * 10deg); }
.has-motion .map h2, .has-motion .session h2, .has-motion .session__sub { translate: 0 calc((0.5 - var(--p, 0)) * 60px); }

/* entrances: a line rises out of its own mask, once, when the scene arrives.
   Hidden first states exist only under .has-motion, which opening.js keeps. */
.has-motion .rise .ln { overflow: clip; padding-bottom: .06em; margin-bottom: -.06em; }
.has-motion .rise .ln > span { transform: translateY(108%); transition: transform var(--d-big) var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.has-motion .is-in .rise .ln > span { transform: none; }
.has-motion [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--d-line) var(--ease-out), transform var(--d-line) var(--ease-out); transition-delay: calc(240ms + var(--i, 0) * 120ms); }
.has-motion .is-in [data-reveal] { opacity: 1; transform: none; }
/* keyboard focus never lands on something still waiting to be revealed */
.has-motion [data-reveal]:focus-within, .has-motion [data-reveal]:focus-visible { opacity: 1; transform: none; transition-delay: 0s; }

/* ======================= hero ======================= */
.hero .stage { place-items: start center; padding-top: clamp(96px, 15vh, 150px); }
.hero h1 { position: relative; z-index: 2; width: 100%; font-size: var(--t-hero); text-align: center; white-space: nowrap; }
.hero h1 .ln { display: inline-block; }
.hero__cloud { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the still fan: what the hero shows with reduced motion, without WebGL or without scripts */
.hero__still { position: absolute; left: 50%; bottom: clamp(56px, 9vh, 110px); display: flex; transform: translateX(-50%); }
.hero__still img { width: clamp(150px, 15vw, 230px); height: auto; margin: 0 -18px; }
.hero__still img:nth-child(1) { transform: rotate(-9deg) translateY(18px); }
.hero__still img:nth-child(2) { position: relative; z-index: 1; transform: translateY(-14px); }
.hero__still img:nth-child(3) { transform: rotate(8deg) translateY(22px); }
.has-cloud .hero__still { display: none; }

/* ======================= loader ======================= */
.loader { display: none; }
.has-motion .loader { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; background: var(--l-cream); clip-path: inset(0 0 0 0); }
.loader__card { display: grid; justify-items: center; align-content: center; gap: 6px; width: 196px; aspect-ratio: 3 / 4; border: 10px solid var(--l-cream-ink); border-radius: 22px; background: var(--l-sheet); box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .3); transform: rotate(-5deg); color: var(--l-cream-ink); }
.loader__spark { width: 46px; height: 46px; margin-bottom: 10px; color: var(--l-mark); }
.loader__word, .loader__pct { font: 400 22px/.95 var(--f-display); text-transform: uppercase; letter-spacing: .01em; font-variant-numeric: lining-nums tabular-nums; }
.is-leaving .loader { clip-path: inset(0 0 100% 0); transition: clip-path 900ms cubic-bezier(.76, 0, .24, 1) 120ms; }
.is-leaving .loader__card { transform: rotate(-2deg) translateY(-10vh) scale(1.04); transition: transform 900ms cubic-bezier(.76, 0, .24, 1) 120ms; }
/* the headline waits behind the loader, then rises as it lifts */
.has-motion.is-loading .rise .ln > span { transform: translateY(108%); }
.is-leaving .hero .rise .ln > span { transition-delay: calc(380ms + var(--i, 0) * 90ms); }
.has-motion .hero h1 { transform: scale(calc(1 + var(--p, 0) * .08)); opacity: calc(1 - var(--p, 0) * 1.6); }
/* the headline as letters in the card cloud (opening-ink.js): drawn exactly over this type, which stays for readers */
.has-inktitle .hero h1 { transform: none; opacity: 0; -webkit-user-select: none; user-select: none; }
.has-inktitle .hero .rise .ln > span { transform: none; transition: none; }

/* ======================= 01 problem ======================= */
.problem .stage { align-content: center; }
.problem h2 { font-size: var(--t-h2); }
.problem h2 .ln:nth-child(1) { padding-left: 40%; }
.problem h2 .ln:nth-child(2) { padding-left: 26%; }
.problem h2 .ln:nth-child(3) { padding-left: 16%; }
.problem h2 .ln:nth-child(4) { padding-left: 40%; }
.problem__inner { display: grid; grid-template-columns: 16% 24% minmax(0, 1fr); }
.problem h2 { grid-column: 1 / -1; }
.problem .body { grid-column: 3; grid-row: 2; margin-top: 40px; }
.problem__card { grid-column: 2; grid-row: 2; width: clamp(150px, 13.5vw, 210px); margin: 40px 0 0; }
.problem__card img { width: 100%; }
/* the card leaves the cloud: it comes in from the top right, far off and turned,
   passes behind the headline and settles under it. Then, as Chapter 02 nears,
   the words lift away and the card glides to the middle of the screen, where it
   becomes Chapter 02's card (opening-chapters.js writes its transform) */
.problem h2, .problem .body { position: relative; z-index: 2; }
.has-motion .problem__card { transform-origin: 50% 50%; will-change: transform, opacity, filter; }
.has-motion .problem .stage { --exit: clamp(0, calc((var(--p, 0) - .34) / .13), 1); }
.has-motion .problem h2 { transform: translateY(calc(var(--exit) * var(--exit) * -30vh)); opacity: calc(1 - var(--exit) * 1.25); }
.has-motion .problem .body { translate: 0 calc((0.5 - var(--p, 0)) * var(--drift, 80px) - var(--exit) * var(--exit) * 30vh); filter: opacity(calc(1 - var(--exit) * 1.25)); }

/* ======================= 02 loop ======================= */
.loop .stage { grid-template-rows: auto 1fr auto; justify-items: center; text-align: center; }
.loop h2 { font-size: var(--t-h2); }
.loop__count { position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none; }
.loop__ghost { font: 400 var(--t-ghost)/.8 var(--f-display); letter-spacing: -.02em; color: var(--l-cream-ink); opacity: .11; font-variant-numeric: lining-nums tabular-nums; }
.loop__caption { max-width: 30ch; margin: 14px auto 0; font-size: var(--t-small); line-height: 1.35; color: var(--l-cream-ink-2); }
.loop__card { position: relative; z-index: 2; align-self: center; margin: 0; }
.loop__tilt { display: block; width: clamp(150px, 15vw, 230px); margin: 0 auto; }
.loop__flip { display: block; position: relative; }
.loop__card img { width: 100%; }
.loop__back { display: none; }
/* the card in front of the counter: it leans toward the pointer (opening-chapters.js
   writes --rx and --ry) and turns a little with the scroll */
.has-motion .loop__tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform 700ms var(--ease-out); rotate: calc((var(--p, 0) - .5) * 8deg); scale: calc(.9 + var(--in, 0) * .1); }

/* Chapter 02 opens as ink (opening-chapters.js, html.has-blot): its cream ground bursts
   from behind the card as a ragged blot drawn on .loop__blot, the card turns once to
   show its back and comes round again, and the chapter's words surface as the cream
   reaches them. Without WebGL the chapter keeps the plain wipe from its centre. */
.loop__blot { display: none; }
.has-blot .loop__blot { display: block; position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.has-blot .loop[data-wipe] > .stage { clip-path: none; background: none; visibility: hidden; }
.has-blot .loop.is-bursting > .stage, .has-blot .loop.is-burst > .stage { visibility: visible; }
.has-blot .loop.is-burst > .stage { background: var(--l-cream); }
.has-blot .loop.is-burst .loop__blot { display: none; }
.has-blot .loop__flip { --f: clamp(0, calc((var(--in, 0) - .04) / .8), 1); transform-style: preserve-3d; transform: rotateY(calc(var(--f) * var(--f) * (3 - 2 * var(--f)) * 360deg)); }
.has-blot .loop__flip img { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.has-blot .loop__back { display: block; position: absolute; inset: 0; height: 100%; transform: rotateY(180deg); }
.has-blot .loop__caption { opacity: clamp(0, calc((var(--in, 0) - .14) / .22), 1); }
.has-blot .loop__count { opacity: clamp(0, calc((var(--in, 0) - .2) / .3), 1); }
.has-blot .loop .chap { opacity: clamp(0, calc((var(--in, 0) - .46) / .26), 1); }
/* the headline comes into focus a word at a time as the cream reaches it */
.has-blot .loop .rise .ln { overflow: visible; }
.has-blot .loop h2 .w { display: inline-block; --k: clamp(0, calc((var(--in, 0) - .44 - var(--w, 0) * .07) / .2), 1); opacity: var(--k); filter: blur(calc((1 - var(--k)) * .14em)); translate: 0 calc((1 - var(--k)) * .14em); }
.has-blot .loop__foot { opacity: clamp(0, calc((var(--in, 0) - .5) / .26), 1); }
/* the loop of cards (opening-chapters.js places every card each frame) */
.loop__ring { display: none; }
/* the ring has no layer of its own: each card and each half of the line takes its own place in front of or behind the middle card (z-index 2) */
.has-ring .loop__ring { display: block; position: absolute; inset: 0; pointer-events: none; }
.loop__line { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loop__line--near { z-index: 3; }
.loop__line path { fill: none; stroke: var(--l-cream-ink); stroke-opacity: .2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.loop__ring img { position: absolute; z-index: 1; left: 0; top: 0; width: var(--rw, 120px); height: auto; opacity: 0; filter: drop-shadow(0 10px 16px rgba(59, 36, 22, .24)); will-change: transform, opacity; }
/* the four steps of the loop light in order as the cards go round */
.has-ring .loop [data-step] { opacity: .3; transition: opacity 240ms linear; }
.has-ring .loop [data-step].is-lit { opacity: 1; }
.loop__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; width: 100%; text-align: left; }
.loop__foot .lead { justify-self: start; }
.loop__foot .body { justify-self: end; }

/* ======================= 03 a session (sheet) ======================= */
.session { padding: 0 0 0; }
.session > .sheet { padding: clamp(96px, 14vh, 160px) var(--gutter) clamp(120px, 18vh, 200px); }
.session h2 { font-size: var(--t-h2); }
.session__sub { margin-top: 20px; }
/* the question card, face down, set into the headline between its words: the card that came through Chapters 01 and 02 */
.session__chip { display: inline-block; width: auto; height: .7em; margin: 0 .06em; border-radius: .05em; vertical-align: baseline; }
.has-motion .session__chip { scale: 0; rotate: -40deg; transition: scale 900ms var(--ease-out) 620ms, rotate 900ms var(--ease-out) 620ms; }
.has-motion .is-in .session__chip { scale: 1; rotate: 0deg; }
.rows { list-style: none; margin: clamp(56px, 8vh, 96px) 0 0; padding: 0; display: grid; gap: clamp(56px, 9vh, 104px); }
.row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); gap: 32px; align-items: start; }
.row:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 2fr); }
.row__label { font-size: var(--t-body); color: var(--l-sheet-ink-2); }
.row .lead { margin-top: 4px; }
.row__pic { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #E9E5DC; }
/* each screenshot is zoomed onto the part the row talks about (--z, --o per figure) */
.row__pic img { width: 100%; height: 100%; object-fit: cover; transform-origin: var(--o, 50% 50%); scale: var(--z, 1); }
/* rows open as they come up the screen: the picture unclips and settles, the words rise */
.has-motion .row__pic { clip-path: inset(10% 6% round 10px); transition: clip-path var(--d-big) var(--ease-out); }
.has-motion .row__pic img { translate: 0 6%; transition: translate var(--d-big) var(--ease-out); }
.has-motion .row > :not(figure) { opacity: 0; transform: translateY(24px); transition: opacity var(--d-line) var(--ease-out), transform var(--d-line) var(--ease-out); }
.has-motion .row > .body { transition-delay: 120ms; }
.has-motion .row.is-in .row__pic { clip-path: inset(0 0 round 10px); }
.has-motion .row.is-in .row__pic img { translate: 0 0; }
.has-motion .row.is-in > :not(figure) { opacity: 1; transform: none; }
/* with the script running (html.has-rows) each row follows the scroll instead: --r runs 0 to 1 as the row
   comes up the lower half of the screen. The picture unclips and pushes in from the whole screen to the
   part the row talks about, the words sharpen and slide into line. A thread (.session__thread) then leads
   from each picture to the next: it draws just before the next row opens. */
.has-rows .row { --e: calc(1 - (1 - var(--r, 0)) * (1 - var(--r, 0))); }
.has-rows .row__pic { clip-path: inset(calc((1 - var(--e)) * 14%) calc((1 - var(--e)) * 9%) round 10px); transition: none; }
.has-rows .row__pic img { scale: calc(1 + (var(--z, 1) - 1) * var(--e)); translate: 0 calc((1 - var(--e)) * 5%); transition: none; will-change: scale, translate; }
.has-rows .row > :not(figure) { opacity: calc(.16 + .84 * var(--e)); transform: translateX(calc((1 - var(--e)) * 44px)); transition: none; }
.has-rows .row > .body { transform: translateX(calc((1 - var(--e)) * -44px)); }
.session__thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.session__thread path { fill: none; stroke: var(--l-sheet-ink); stroke-opacity: .5; stroke-width: 1.25; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.session__thread circle { fill: var(--l-sheet-ink); }
.has-motion .session > .sheet { transform-origin: 0 100%; transform: rotate(calc(var(--out, 0) * -6deg)) translateY(calc(var(--out, 0) * -12vh)); }

/* ======================= 04 marking ======================= */
.marking .stage { grid-template-columns: 1fr minmax(260px, 340px) 1fr; grid-template-rows: 1fr auto; align-items: center; gap: 0 32px; }
.marking__words { display: contents; }
.marking__w { font-size: var(--t-giant); color: var(--l-cream-ink); }
/* stepped, so the words read in order: MARK AS upper left, then YOU GO lower right */
.marking__w--l { grid-column: 1; text-align: right; align-self: start; margin-top: 6vh; }
.marking__w--r { grid-column: 3; text-align: left; align-self: end; margin-bottom: 6vh; }
.marking__device { grid-column: 2; grid-row: 1; justify-self: center; height: min(64vh, 620px); aspect-ratio: 9 / 19; padding: 7px; border-radius: 46px; background: #1A1918; }
/* the phone's screen: a fragment of the study space, drawn small in its own night colours */
.ui { position: relative; height: 100%; overflow: clip; border-radius: 39px; background: #050505; color: #F4F2EE; font: 400 10.5px/1.35 var(--f-text); text-align: left; }
.ui__island { position: absolute; z-index: 2; top: 9px; left: 50%; width: 30%; height: 19px; border-radius: 99px; background: #000; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .05); }
.ui__track { display: flex; width: 200%; height: 100%; }
.ui__pane { display: flex; flex-direction: column; gap: 9px; width: 50%; padding: 42px 12px 14px; }
.ui__q { font-size: 13px; font-weight: 600; }
.ui__meta, .ui__dim { color: rgba(244, 242, 238, .56); font-size: 9.5px; }
.ui__meta { margin-top: -7px; }
.ui__paper { padding: 11px 11px 9px; border-radius: 10px; background: #FAF8F3; color: #111; font: 400 10.5px/1.4 Georgia, 'Times New Roman', serif; }
.ui__paper b { font-weight: 700; margin-right: 3px; }
.ui__marks { margin-top: 4px; text-align: right; font-weight: 700; }
.ui__card { display: grid; gap: 8px; padding: 11px; border-radius: 14px; background: #121212; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.ui__row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ui__row b { font-weight: 600; }
.ui__row > :last-child:not(:first-child) { margin-left: auto; }
.ui__ok { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 7px; border-radius: 99px; background: rgba(95, 196, 139, .16); color: #6FD49A; font-size: 9.5px; font-weight: 600; }
.ui__ok::before, .ui__btn::before, .ui__good::before { content: ''; display: inline-block; flex: none; width: 1.05em; height: 1.05em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat; }
.ui__point { display: flex; align-items: center; gap: 5px; font: 400 16px/1 Georgia, serif; }
.ui__box { display: flex; align-items: center; flex: 1; height: 30px; padding: 0 9px; border-radius: 9px; background: #EEF0F6; color: #111; font: 400 14px/1 Georgia, serif; }
.ui__caret { display: inline-block; width: 1px; height: 15px; margin-left: 1px; background: #111; animation: ui-blink 1s steps(1) infinite; }
.ui__btn { justify-self: start; display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 99px; background: #F2F0EB; color: #111; font-size: 10px; font-weight: 600; transition: transform var(--d-press) var(--ease-out); }
.ui__btn::before { margin-right: 6px; }
.ui__btn.is-down { transform: scale(.94); }
.ui__ms { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; background: #F4F2EE; color: #111; font-size: 10px; }
.ui__tick { display: grid; place-items: center; flex: none; width: 17px; height: 17px; border-radius: 4px; background: #3A3A3A; color: #fff; font-size: 11px; line-height: 1; }
.ui__tick:has(.is-on) { background: #111; }
.ui__chk { width: 12px; height: 12px; color: #fff; }
.ui__result { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }
.ui__good { color: #6FD49A; font-weight: 600; }
.ui__good { display: flex; align-items: center; }
.ui__good::before { margin-right: 5px; }
.ui__links { display: flex; gap: 12px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.ui__card--next { opacity: .7; }
.ui__nav { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 10px; font-weight: 600; }
.ui__nav-main { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 99px; background: #F2F0EB; color: #111; }
.has-motion .ui__result.is-on { animation: ui-pop 420ms var(--ease-out); transform-origin: 50% 0; }
@keyframes ui-blink { 50% { opacity: 0; } }
@keyframes ui-pop { from { opacity: 0; transform: scale(.6); } }
/* played by the scroll: [data-at] parts are hidden until their point, [data-until] parts go at theirs */
.has-motion .ui [data-at]:not(.is-on), .has-motion .ui [data-until].is-off { display: none; }
.has-motion .ui__ok.is-on, .has-motion .ui__tick .is-on { animation: ui-pop 380ms var(--ease-out); }
html:not(.has-motion) .ui [data-until] { display: none; }
/* Chapter 04 is clear of the sheet above from about .3 and of Chapter 05's wipe until about .66:
   the phone comes up turned and squares itself by .3, a Maths answer is typed and checked
   (.3–.47), the screen slides to a Physics mark scheme (.5–.56, the phone swinging with it)
   and two marks are ticked (.59, .63). The four words fill in like a marker, one at each of
   those moments, and a pen tick draws in the open corners for each mark earned. */
.marking__device { box-shadow: 0 50px 70px -40px rgba(59, 36, 22, .5); }
.has-motion .marking .stage { --k: min(1, calc(var(--p, 0) / .3)); --u: calc((1 - var(--k)) * (1 - var(--k)) * (1 - var(--k))); --s: clamp(0, calc((var(--p, 0) - .5) / .06), 1); }
.has-motion .marking__device { transform: perspective(1500px) translateY(calc(var(--u) * 46vh)) rotateX(calc(var(--u) * 22deg + var(--lx, 0deg))) rotateY(calc(var(--u) * -38deg + var(--s) * (1 - var(--s)) * -48deg + var(--ly, 0deg))) rotateZ(calc(var(--u) * 9deg)); }
.has-motion .ui__track { transform: translateX(calc(-50% * var(--s))); }
/* a band of light crosses the glass as the answer comes back correct */
.has-motion .ui::after { content: ''; position: absolute; z-index: 3; inset: -20% auto -20% 0; width: 46%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, 0)); transform: translateX(calc(-130% + clamp(0, calc((var(--p, 0) - .455) / .09), 1) * 480%)); pointer-events: none; }
.marking__foot { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.marking__foot .body:last-child { justify-self: end; }
.has-motion .marking__w--l { transform: translateX(calc(var(--u) * -26vw)); }
.has-motion .marking__w--r { transform: translateX(calc(var(--u) * 26vw)); }
.has-motion .marking__w .ln { --f: 0; padding-block: .05em; margin-block: -.05em; color: transparent; background: linear-gradient(90deg, var(--l-cream-ink) 50%, rgba(59, 36, 22, .15) 50%) calc((1 - var(--f)) * 100%) 0 / 200% 100% no-repeat; -webkit-background-clip: text; background-clip: text; }
.has-motion .marking__w--l .ln:nth-child(1) { --f: clamp(0, calc((var(--p, 0) - .22) / .1), 1); }
.has-motion .marking__w--l .ln:nth-child(2) { --f: clamp(0, calc((var(--p, 0) - .4) / .07), 1); }
.has-motion .marking__w--r .ln:nth-child(1) { --f: clamp(0, calc((var(--p, 0) - .525) / .065), 1); }
.has-motion .marking__w--r .ln:nth-child(2) { --f: clamp(0, calc((var(--p, 0) - .585) / .055), 1); }
/* the tally: one large tick lower left, over the words about the Maths checker; two upper right for the two Physics marks */
.marking__tally { position: absolute; display: flex; gap: 1.2vw; pointer-events: none; }
.marking__tally svg { display: block; width: var(--tw); height: auto; overflow: visible; }
.marking__tally path { fill: none; stroke: var(--l-cream-ink); stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; }
.marking__tally--a { --tw: clamp(120px, 13vw, 210px); left: 12%; bottom: 23%; rotate: -5deg; }
.marking__tally--b { --tw: clamp(76px, 8vw, 130px); right: 9%; top: 13%; rotate: 4deg; }
.has-motion .marking__tally path { --t: 0; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--t)); opacity: min(1, calc(var(--t) * 40)); }
.has-motion .marking__tally--a path { --t: clamp(0, calc((var(--p, 0) - .465) / .05), 1); }
.has-motion .marking__tally--b svg:nth-child(1) path { --t: clamp(0, calc((var(--p, 0) - .59) / .035), 1); }
.has-motion .marking__tally--b svg:nth-child(2) path { --t: clamp(0, calc((var(--p, 0) - .63) / .035), 1); }

/* ======================= 05 subjects ======================= */
.subjects .stage { grid-template-rows: auto 1fr auto; }
.subjects__panel { grid-row: 1 / 3; grid-column: 1; display: grid; grid-template-rows: auto 1fr; }
.subjects__panel[hidden] { display: none; }
.subjects__meta { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-top: 4px; }
.subjects__meta .lead { max-width: 22ch; }
.subjects__count { font: 400 clamp(40px, 5vw, 72px)/1 var(--f-display); }
.subjects__name { align-self: center; position: relative; z-index: 4; font-size: var(--t-giant); text-align: center; }
.subjects__plate { position: absolute; z-index: 1; left: 50%; top: 50%; width: min(34vw, 420px); transform: translate(-50%, -50%); opacity: .9; }
/* the 3D objects draw behind the giant name (opening-subjects.js); the plates stay for no-WebGL */
.subjects__gl { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.has-subjects-gl .subjects__plate { display: none; }
.subjects__count, .subjects__meta { position: relative; z-index: 4; }
.has-motion .subjects__name { overflow: clip; padding-block: .06em; }
.has-motion .subjects__name .ch { display: inline-block; transform: translateY(108%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 38ms); }
.has-motion .subjects__panel.is-shown .ch { transform: none; }
.subjects__foot { position: relative; z-index: 4; grid-row: 3; display: grid; grid-template-columns: 1fr minmax(0, 30ch); gap: 32px; align-items: end; }
.subjects__foot h2 { font-size: var(--t-h2-s); }
.subjects__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.subjects__tabs .pill { height: 36px; padding: 0 16px; font-size: 14px; }

/* ======================= 06 progress ======================= */
.progress .stage { grid-template-rows: 1fr auto; }
.progress__copy { align-self: center; }
.progress h2 { font-size: var(--t-h2); }
.progress .body { margin-top: 28px; }
.stats { position: relative; z-index: 2; display: grid; gap: 16px; }
.stats__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; }
.stats__grid div { display: grid; gap: 6px; }
.stats dt { font-size: var(--t-small); color: var(--l-text-2); }
.stats dd { margin: 0; font: 600 clamp(32px, 3.4vw, 52px)/1 var(--f-text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats__tag { font-size: var(--t-label); color: var(--l-text-2); }

.progress__goo { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.progress__copy { position: relative; z-index: 2; }

/* ======================= 07 course map (sheet) ======================= */
.map > .sheet { min-height: 150svh; display: grid; place-content: center; justify-items: center; gap: 28px; padding: 30vh var(--gutter) 20vh; text-align: center; border-radius: var(--r-sheet); }
.map h2 { font-size: var(--t-h2); }
.map__fall { position: absolute; inset: 0; overflow: clip; border-radius: inherit; pointer-events: none; }
.chip-fall { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill); background: #E9E4D9; color: var(--l-sheet-ink); font: 500 15px/1 var(--f-text); white-space: nowrap; opacity: 0; will-change: transform; }
.chip-fall.is-done { background: var(--l-sheet-ink); color: var(--l-sheet); }
.map h2, .map .body { position: relative; z-index: 2; }
/* the headline's letters gather as the sheet scrolls in: scattered at the start, set by 45% of its run */
.map .wd { display: inline-block; white-space: nowrap; }
.map .lt { display: inline-block; }
.has-motion .map .lt { --k: clamp(0, calc(var(--p, 0) / .45), 1); translate: calc(var(--dx) * (1 - var(--k))) calc(var(--dy) * (1 - var(--k))); rotate: calc(var(--dr) * (1 - var(--k))); }
.has-motion .is-on.map .lt { will-change: translate, rotate; }
.has-motion .map > .sheet { transform-origin: 100% 100%; transform: rotate(calc(var(--out, 0) * 4deg)) translateY(calc(var(--out, 0) * -10vh)); }

/* ======================= 08 start ======================= */
.start__rays { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.start .stage > :not(.start__rays):not(.chap) { position: relative; z-index: 1; }
.start .stage { place-content: center; justify-items: center; gap: 28px; text-align: center; }
.start h2 { font-size: var(--t-h2); }
.start__form { display: grid; justify-items: center; gap: 22px; margin: 0; padding: 0; border: 0; }
.start__form > .pill { height: 56px; padding: 0 30px; font-size: 17px; }
.start__form legend { padding: 0; margin-bottom: 14px; font-size: var(--t-small); color: var(--l-text-2); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .1); font-size: 15px; font-weight: 500; transition: background-color var(--d-press) linear, color var(--d-press) linear, transform var(--d-press) var(--ease-out); }
.chip input:hover + span { background: rgba(255, 255, 255, .16); }
.chip input:checked + span { background: var(--l-text); color: var(--l-ink); }
.chip input:active + span { transform: scale(var(--press-scale)); }
.chip input:focus-visible + span { outline: 2px solid var(--l-accent); outline-offset: 3px; }
/* the waitlist form */
/* the stage column is sized by its content, so size the form from the viewport */
.start__form.wl { width: min(960px, calc(100vw - 2 * var(--gutter))); }
.wl__field { display: grid; justify-items: center; gap: 14px; width: 100%; }
.wl__label { font-size: var(--t-small); color: var(--l-text-2); }
.wl__row { display: grid; justify-items: center; gap: 16px; width: 100%; }
/* a textarea, not an input: a long address wraps onto more lines instead of scrolling out of view.
   opening.js shrinks the type to keep it on one line, between --wl-max and --wl-min, then lets it wrap. */
.wl__input { --wl-max: clamp(24px, 3.4vw, 40px); --wl-min: 20px; display: block; box-sizing: border-box; width: 100%; min-height: 96px; padding: 26px 40px; resize: none; overflow: hidden; border: 1px solid rgba(255, 255, 255, .14); border-radius: 32px; background: rgba(255, 255, 255, .06); color: var(--l-text); font: 400 var(--wl-max)/1.25 var(--f-text); text-align: center; overflow-wrap: anywhere; word-break: break-all; transition: border-color var(--d-press) linear, background-color var(--d-press) linear; }
.wl__input::placeholder { color: rgba(255, 255, 255, .4); }
.wl__input:hover { border-color: rgba(255, 255, 255, .24); }
.wl__input:focus-visible { outline: 2px solid var(--l-accent); outline-offset: 3px; border-color: transparent; background: rgba(255, 255, 255, .1); }
.start__form .wl__go { height: 64px; padding: 0 40px; font-size: 19px; }
.wl__go:disabled { opacity: .6; cursor: progress; }
.wl__note { max-width: 46ch; margin: 0; font-size: var(--t-small); line-height: 1.45; color: var(--l-text-2); }
.wl__note a { color: var(--l-text); }
.wl__status { min-height: 1.4em; max-width: 46ch; margin: 0; font-size: 15px; line-height: 1.4; }
.wl__status:empty { display: none; }
.wl__status[data-kind="error"] { color: #FF9C7F; }
.wl.is-done .wl__status { font: 600 var(--t-lead)/1.3 var(--f-text); color: var(--l-text); outline: none; }
.wl [hidden] { display: none; }
.wl__ts:not(:empty) { margin-top: 16px; }
.wl__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- moving between pages ----------
   Same-origin navigations to setup.html cross-fade instead of flashing white
   (setup.css opts in too). Browsers without view transitions just navigate. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms var(--ease-in) both vt-out; }
::view-transition-new(root) { animation: 420ms var(--ease-out) 60ms both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 30; padding: 64px var(--gutter) calc(96px + env(safe-area-inset-bottom)); background: var(--l-ink); color: var(--l-text-2); }
.foot__word { display: block; font: 400 clamp(80px, 21vw, 420px)/.8 var(--f-logo); letter-spacing: -.04em; color: var(--l-text); text-align: center; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; margin-top: 40px; font-size: var(--t-small); }
.foot__row nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot__row a { text-decoration: none; color: var(--l-text); }
.foot__row a:hover { text-decoration: underline; }
.foot__credits { margin-top: 24px; max-width: 110ch; font-size: 12px; line-height: 1.5; }
.foot__credits a { color: var(--l-text); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .wl__input { min-height: 80px; padding: 20px 22px; border-radius: 24px; }
  .start__form .wl__go { width: 100%; }
  :root { --t-hero: 12.6vw; --t-h2: clamp(38px, 11vw, 52px); --t-h2-s: 34px; --t-giant: 14vw; --t-ghost: 30vw; }
  .top { grid-template-columns: 1fr auto; }
  .top__line { display: none; }
  .top .pill { height: 38px; padding: 0 14px; font-size: 14px; }
  .logo__word { font-size: 22px; }
  .hero h1 { white-space: normal; }
  .hero h1 .ln { display: block; }
  .hero__still img { width: 34vw; margin: 0 -14px; }
  .problem h2 .ln:nth-child(n) { padding-left: 0; }
  .problem h2 .ln:nth-child(2), .problem h2 .ln:nth-child(4) { padding-left: 14%; }
  .problem__inner { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
  .problem .body { grid-column: 1; margin-top: 28px; }
  .problem__card { grid-column: 2; width: 30vw; margin-top: 28px; }
  /* phones: the counter sits above the card instead of behind it, so it reads */
  .loop__count { place-content: start center; padding-top: 21vh; }
  .loop__card { align-self: end; margin-bottom: 3vh; }
  .loop__tilt { width: 32vw; }
  .loop__foot, .marking__foot { grid-template-columns: 1fr; gap: 16px; }
  .loop__foot .body, .marking__foot .body:last-child { justify-self: start; }
  .row { grid-template-columns: 1fr; gap: 14px; }
  .row:nth-child(even) { padding-left: 0; }
  .row:nth-child(n) { grid-template-columns: 1fr; }
  .marking .stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto 1fr; justify-items: center; align-content: start; gap: 10px; padding-top: calc(var(--gutter) + 36px); }
  .marking__w--l, .marking__w--r { grid-column: 1; text-align: center; align-self: auto; margin: 0; }
  .marking__w { font-size: 13vw; }
  .marking__w .ln { display: inline; }
  .marking__w .ln + .ln { margin-left: .22em; }
  .marking__tally { display: none; }
  .marking__device { grid-column: 1; grid-row: auto; height: min(52vh, 440px); width: calc(min(52vh, 440px) * 9 / 19); padding: 6px; border-radius: 34px; }
  .marking__device .ui { border-radius: 28px; font-size: 9px; }
  .marking__device .ui__pane { gap: 7px; padding: 36px 10px 10px; }
  .marking__device .ui__paper { padding: 8px 9px 7px; font-size: 9px; }
  .marking__device .ui__q { font-size: 11.5px; }
  .marking__device .ui__meta, .marking__device .ui__dim, .marking__device .ui__links, .marking__device .ui__ok { font-size: 8.5px; }
  .marking__device .ui__card { padding: 9px; gap: 6px; }
  .marking__device .ui__box { height: 25px; font-size: 12px; }
  .marking__device .ui__btn, .marking__device .ui__nav-main { height: 22px; font-size: 9px; }
  .marking__device .ui__ms { font-size: 9px; padding: 6px 7px; }
  .marking__foot { align-self: end; }
  .has-motion .marking__device[data-drift] { translate: 0 calc((0.5 - var(--p, 0)) * 36px); }
  .marking__foot .body { font-size: var(--t-small); }
  .subjects__foot { grid-template-columns: 1fr; gap: 12px; }
  .stats__grid { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  [data-dock] .dock { --dx: 0px; }
  .chip-fall { height: 32px; padding: 0 12px; font-size: 12px; }
  .map > .sheet { padding-top: 16vh; place-content: start center; }
  .subjects__tabs .pill { height: 40px; }
  .start h2 { font-size: min(var(--t-h2), 9.6vw); }
}

/* ---------- no motion: a plain page that reads top to bottom ---------- */
html:not(.has-motion) .scene + .scene { margin-top: 0; }
html:not(.has-motion) .stage { min-height: auto; padding-block: 112px; }
html:not(.has-motion) .hero .stage { min-height: 88svh; }
html:not(.has-motion) .map > .sheet { min-height: auto; padding-block: 140px; }
html:not(.has-motion) .hero .stage { min-height: 0; padding-bottom: 72px; }
html:not(.has-motion) .hero__cloud { position: relative; inset: auto; width: 100%; }
html:not(.has-motion) .hero__still { position: relative; left: auto; bottom: auto; justify-content: center; margin-top: 56px; transform: none; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .pill:active, .chip input:active + span { transform: none; }
}
