/* AIMate landing concept. One sheet of paper, on the app's blue board.
   The look is the app's own (apps/web/browser/tokens.css on main, read 17 Nov 2026): page #EEF1F8, board #2A3FD6,
   ink #0B1020, ink-2 #4A5270, line #D9DEEB, blue-soft #E3E8FF, sun #FFD23F; Bricolage Grotesque for headings,
   Figtree for text, Gochi Hand for handwriting. STIX Two stays only for the equations in the choices.
   Contrast (WCAG AA needs 4.5 for text): white on the board 6.9 : 1, blue-soft on the board 5.6 : 1,
   ink on the page 17.6 : 1, ink-2 on the page 7.0 : 1, ink on sun 12.7 : 1.                          */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-500-800.woff2") format("woff2");
  font-weight: 500 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-400-800.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("../fonts/gochi-hand-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-roman.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --page: #EEF1F8;
  --paper: #FFFEFA;
  --ink: #0B1020;
  --soft: #4A5270;
  --rule: #D9DEEB;
  --board: #2A3FD6;
  --deep: #1C2DA8;
  --blue-soft: #E3E8FF;
  --pen: #2A3FD6;
  --red: #C8281F;
  --sun: #FFD23F;
  --sun-edge: #E0B41A;
  --grid: rgba(157, 182, 224, 0.5);
  --shade: 10, 16, 84;          /* the navy every shadow is made of */

  --serif: "STIX Two Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;   /* equations only */
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --top-h: 76px;                /* room under the header island */
  /* the sheet: 4 wide, 5 tall. On a wide screen its height is set by the window. */
  --sheet-h: min(76svh, 780px);
  --sheet-w: calc(var(--sheet-h) * 0.8);
  --sheet-top: calc((100svh - var(--sheet-h)) / 2 + 14px);
  --side: calc((100vw - var(--sheet-w)) / 2);
  --story-len: 940;             /* how far the story scrolls, in hundredths of the window's height (keep equal to LEN in story/main.js) */
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 1.125rem; line-height: 1.5; overflow-x: clip;
  -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
img, canvas, svg { display: block; }
i, em { font-style: italic; }

:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; border-radius: 3px; }
.stage :focus-visible { outline-color: var(--sun); }
.stage .sheet :focus-visible { outline-color: var(--deep); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Lenis (smooth scrolling) asks for these */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- the way round the story ---------- */
/* The header: one compact island, centred, as wide as what it holds, floating over the board. story/lands.js switches
   it from the story (logo, "Skip the story") to the page (its links, Pricing, Sign in) and widens it smoothly. White, as
   the app's own cards are, so it sits on the blue board and the light page alike; the one bold thing is the gold button. */
.top { position: fixed; z-index: 40; top: 14px; left: 50%; translate: -50% 0; max-width: calc(100vw - 24px);
  transition: transform 0.32s ease; }
.isle { display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 6px 0 14px; border-radius: 999px;
  background: #fff; color: var(--ink); overflow: hidden; white-space: nowrap;
  box-shadow: 0 18px 40px -18px rgba(5, 10, 40, 0.55), inset 0 0 0 1px rgba(11, 16, 32, 0.06); }
.top[data-mode="story"] .page-only, .top[data-mode="page"] .story-only { display: none; }
.mark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 10px;
  font: 800 1.25rem/1 var(--display); letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.mark img { width: 28px; height: 28px; }
.mark b { font-weight: inherit; color: var(--board); }
.isle-links { display: flex; gap: 2px; list-style: none; margin: 0 6px 0 0; padding: 0; }
.isle-links a, .isle-quiet { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px;
  font: 600 0.9375rem/1 var(--sans); color: var(--soft); text-decoration: none; transition: color 0.2s, background 0.2s; }
.isle-links a:hover, .isle-quiet:hover, .isle-links a[aria-current="true"] { color: var(--deep); background: var(--blue-soft); }
.isle-cta { display: inline-flex; align-items: center; min-height: 40px; margin-left: 6px; padding: 0 18px; border-radius: 999px;
  font: 700 0.9375rem/1 var(--sans); text-decoration: none; background: var(--sun); color: var(--ink); }
.isle-cta:hover { background: #FFC61A; }
.top :focus-visible { outline-color: var(--deep); }
@media (max-width: 1080px) { .isle-links { display: none; } }
.calm .top { transition: none; }
.isle-tabs { display: none; }

/* A phone (Tanya, 24 Nov 2026: "on phones it must be a bottom navigation bar, not a top notch"): the island is a bar at
   the foot of the screen, full width, clear of the home bar. In the story it holds the logo and "Skip the story"; on the
   landing it becomes the landing's own tabs (as /students's SectionNav draws them). It stays on screen all the way down,
   footer included (Tanya, 24 Nov 2026: "it must be visibile always"). */
@media (max-width: 760px) {
  /* A floating notch, not a bar fused to the screen's edge (Tanya, 25 Nov 2026: "it should look separate"): inset from
     both sides and the foot, rounded all round, its shadow falling on the page beneath it. */
  .top { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; right: 10px; translate: none; max-width: none; }
  .isle { justify-content: space-between; height: auto; min-height: 60px; gap: 8px; padding: 8px 8px 8px 12px;
    border-radius: 26px; overflow: visible; }
  /* Depth (Tanya, 25 Nov 2026: "add some shadow, depth animation to this bottom nav"): the notch rises in, lit along its
     top edge, lifted off the page by a layered shadow; its gold button sits on a ledge and presses in. */
  .isle { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(11, 16, 32, 0.07),
      0 2px 4px rgba(5, 10, 40, 0.10), 0 10px 22px -6px rgba(5, 10, 40, 0.35), 0 24px 44px -14px rgba(5, 10, 40, 0.45);
    background: linear-gradient(#fff, #F4F6FC); animation: isle-rise 0.7s cubic-bezier(.22, 1, .36, 1) both; }
  .isle-cta, .isle-tabs a.go { box-shadow: 0 3px 0 #D9A400, 0 8px 16px -6px rgba(140, 95, 0, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .isle-cta:active, .isle-tabs a.go:active { transform: translateY(3px); box-shadow: 0 0 0 #D9A400, 0 3px 8px -4px rgba(140, 95, 0, 0.5); }
  .calm .isle { animation: none; }
  .top[data-mode="page"] .isle { padding-inline: 6px; }
  .top[data-mode="page"] .mark, .top[data-mode="page"] .isle-quiet, .top[data-mode="page"] .isle-cta { display: none; }
  .top[data-mode="page"] .isle-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; width: 100%;
    margin: 0; padding: 0; list-style: none; }
  .isle-tabs a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 50px; padding: 4px 2px;
    border-radius: 14px; font: 700 0.75rem/1.2 var(--sans); color: var(--soft); text-decoration: none;
    transition: background-color .25s ease, color .25s ease, scale .2s ease; }
  .isle-tabs a:active { scale: .92; }
  .isle-tabs a[aria-current="true"] svg { animation: tab-pop .5s cubic-bezier(.22, 1, .36, 1); }
  .isle-tabs { position: relative; }
  .isle-tabs::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; z-index: 0; border-radius: 14px;
    width: calc((100% - (var(--n, 5) - 1) * 4px) / var(--n, 5)); background: var(--board);
    box-shadow: 0 6px 16px -8px rgba(28, 45, 168, .7); opacity: 0;
    transform: translateX(calc(var(--i, 0) * (100% + 4px)));
    transition: transform .55s cubic-bezier(.22, 1, .36, 1), opacity .3s ease; }
  .isle-tabs[data-on]::before { opacity: 1; }
  .isle-tabs li { position: relative; z-index: 1; }
  .isle-tabs a[aria-current="true"] { color: #fff; }
  .isle-tabs a.go { background: var(--sun); color: var(--ink); }
  .isle-tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
    stroke-linejoin: round; }
}

/* ---------- the story ---------- */
.story { position: relative; height: calc(var(--story-len) * 1svh + 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: clip; }
/* The app's blue board, with the paper on it: the board's grid fades out where the sheet lies, so the paper sits
   in clear light, as on the app's own hero backdrop (apps/web/browser/img/aimate-cover.webp). */
.board { position: absolute; left: clamp(8px, 1.2vw, 18px); right: clamp(8px, 1.2vw, 18px); top: clamp(8px, 1.2vw, 18px);
  bottom: clamp(8px, 1.2vw, 18px); border-radius: 26px; overflow: hidden; pointer-events: none;
  background: radial-gradient(130% 90% at 50% 115%, rgba(20, 32, 138, 0.75), transparent 62%), var(--board);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 60px -40px rgba(var(--shade), 0.6); }
.board .grid { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.085) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center;
  -webkit-mask-image: radial-gradient(42% 52% at 50% 46%, transparent 35%, #000 100%);
          mask-image: radial-gradient(42% 52% at 50% 46%, transparent 35%, #000 100%); }
.board .light { position: absolute; inset: 0;
  background: radial-gradient(38% 46% at 50% 44%, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.05) 55%, transparent 75%); }
.tool { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: auto; rotate: var(--r);
  filter: drop-shadow(0 18px 22px rgba(var(--shade), 0.45)); animation: bob 9s ease-in-out infinite; animation-delay: var(--d); }
.tool.far { filter: drop-shadow(0 12px 14px rgba(var(--shade), 0.4)) blur(0.6px); opacity: 0.85; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
.calm .tool { animation: none; }
.top[data-mode="page"] + main .tool { animation-play-state: paused; }
/* A phone: no tools at all; on a narrow board they could only sit on the words (Tanya, 24 Nov 2026: "the protractor sits on
   'This is where you stopped'"). */
@media (max-width: 700px) { .tool { display: none; } }

.paper { position: absolute; left: 50%; top: var(--sheet-top); width: var(--sheet-w); height: var(--sheet-h);
  margin-left: calc(var(--sheet-w) / -2); }

/* The film: the rendered frames. A frame is wider and taller than the sheet (the sheet is 86% of its height). */
.film, .poster, .poster img { position: absolute; left: 50%; top: 50%; width: 126.39%; height: 116.28%;
  transform: translate(-50%, -50%); pointer-events: none; }
.poster img { left: 0; top: 0; width: 100%; height: 100%; transform: none; }
.poster { opacity: 1; }
.film { opacity: 0; }                      /* shown by the script once its first frame is drawn */

/* The live sheet: the same sheet, drawn as strokes, laid exactly over the last frame of the film. */
.sheet { position: absolute; inset: 0; background: var(--paper); opacity: 0;
  box-shadow: 0 1px 1px rgba(var(--shade), 0.18), 0 14px 30px -10px rgba(var(--shade), 0.5); }
.sheet svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sheet .words-in { fill: transparent; font-family: var(--serif); pointer-events: none; user-select: none; }
.ink path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink.pencil path { stroke: #55585F; stroke-width: 2.7; }
.ink.red path { stroke: var(--red); stroke-width: 4.2; }
.ink.pen path { stroke: var(--pen); stroke-width: 3; }
.ink.unwritten { display: none; }

/* the crossed line is a real button laid over the sheet */
.crossed { position: absolute; left: 30%; top: 59.6%; width: 35%; height: 9.4%; padding: 0; border: 0; background: none;
  cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.crossed::after { content: ""; position: absolute; inset: -4px -6px; border-radius: 8px; border: 2px dashed var(--pen);
  opacity: 0; }
.sheet.is-waiting .crossed::after { opacity: 0.55; animation: beckon 2.2s ease-in-out infinite; }
.crossed:hover::after { opacity: 0.9; }
.sheet:not(.is-waiting) .crossed { pointer-events: none; }
.sheet:not(.is-waiting) .crossed::after { opacity: 0; animation: none; }
@keyframes beckon { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.75; } }

/* the fold (drawn in code until the rendered fold is in): four quarters of the corrected sheet */
.fold { position: absolute; inset: 0; opacity: 0; visibility: hidden; perspective: 1800px; pointer-events: none; }
.fold .packet, .fold .half, .fold .flap { position: absolute; transform-style: preserve-3d; }
.fold .packet { inset: 0; }
.fold .q { position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
  background: var(--paper) url("../assets/sheet-corrected.svg") no-repeat; background-size: 200% 200%; }
.fold .q.back { background: var(--paper); transform: rotateY(180deg); }
.fold .shade { position: absolute; inset: 0; background: rgb(var(--shade)); opacity: 0; }
/* the rendered fold: a 3:4 picture in which the sheet is 86% of the height */
.fold-film { position: absolute; left: 50%; top: 50%; width: 109.01%; height: 116.28%; transform: translate(-50%, -50%);
  opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- words beside the paper ---------- */
.words { position: absolute; z-index: 3; opacity: 0; visibility: hidden; }
.cue { z-index: 3; }
.words { color: #fff; }
.words h1, .words h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.w-ball { left: 0; right: 0; top: calc(var(--sheet-top) + var(--sheet-h) * 0.79); text-align: center; padding: 0 20px;
  opacity: 1; visibility: visible; }
.w-ball h1 { font-size: clamp(2.1rem, 4.4vw, 3.75rem); line-height: 1.02; }
.w-side { left: clamp(20px, 5vw, 72px); width: calc(var(--side) - clamp(20px, 5vw, 72px) - 36px); max-width: 23rem;
  top: 50%; transform: translateY(-50%); }
.w-side h2 { font-size: clamp(1.6rem, 2.6vw, 2.6rem); line-height: 1.04; }
.w-side p { margin-top: 0.9rem; color: var(--blue-soft); font-size: 1.0625rem; max-width: 19rem; }

.cue { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: var(--blue-soft);
  font: 700 0.75rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.cue span { display: inline-block; padding-bottom: 30px; position: relative; }
.cue span::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 22px; background: var(--blue-soft);
  transform-origin: top; animation: drip 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- the question beside the sheet ---------- */
.ask { position: absolute; left: calc(50% + var(--sheet-w) / 2 + 36px); right: clamp(20px, 4vw, 60px); max-width: 21rem;
  top: 50%; transform: translateY(-50%); }
.ask { opacity: 0; visibility: hidden; }
.ask-in { opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0s 0.45s; }
.ask.is-open .ask-in { opacity: 1; visibility: visible; transition: opacity 0.45s ease; }
.ask { color: #fff; }
.ask-q { font: 700 0.75rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-soft); }
.choices { margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.28); }
.choice { display: flex; align-items: baseline; gap: 14px; width: 100%; min-height: 56px; padding: 13px 6px; border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28); background: none; text-align: left; cursor: pointer; font-size: 1.4375rem;
  font-family: var(--serif); color: #fff;
  line-height: 1.2; -webkit-tap-highlight-color: transparent; }
.choice .tag { font: 700 0.75rem/1 var(--sans); letter-spacing: 0.08em; color: var(--sun); width: 1em; text-transform: uppercase; }
.choice:hover:not([aria-disabled="true"]) { background: rgba(255, 255, 255, 0.1); }
.choice[aria-disabled="true"] { cursor: default; color: rgba(227, 232, 255, 0.62); }
.choice[aria-disabled="true"] .eq { text-decoration: line-through; text-decoration-thickness: 1px; }
.choice.is-right { color: var(--sun); }
.choice.is-right .eq { text-decoration: none; }
.ask-say { min-height: 3.2em; margin-top: 14px; font-size: 1.0625rem; color: #fff; }
.onward { display: inline-block; margin-top: 2px; padding: 8px 0; font: 700 0.9375rem/1.2 var(--sans); color: var(--sun);
  text-underline-offset: 0.35em; }
.onward[hidden] { display: none; }
/* the caption sits in the stage's bottom-right corner, shown with the question */
/* Written on the sheet itself, in its bottom-right corner (Tanya, 25 Nov 2026: "on this checked paper"). */
.honest { position: absolute; z-index: 3; right: calc(50% - var(--sheet-w) / 2 + 16px);
  bottom: calc(100svh - var(--sheet-top) - var(--sheet-h) + 12px); max-width: calc(var(--sheet-w) - 32px); text-align: right;
  font: 500 0.8125rem/1.3 var(--sans); color: rgba(11, 16, 32, 0.55); opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- where it lands: the app's own landing page, reused whole ---------- */
/* It is the app's page in a frame of the same site, as tall as its content, so this page does all the scrolling.
   story/lands.js sizes it, keeps its header at the top, sends its links on, and sets the bird's stair (#start). */
/* The hand-over: the frame lies over the story's last 100svh, unseen, while the story's board shrinks to the app's hero
   board (story/lands.js). When it reaches the top the board is already the hero's, and the hero simply appears on it. */
.lands { position: relative; z-index: 5; margin-top: -100svh; outline: none; }
html:not(.js) .lands { margin-top: 0; }
.lands { perspective: 1600px; }
.lands iframe { display: block; width: 100%; max-width: 100%; height: 100svh; border: 0; background: var(--page);
  opacity: 0; pointer-events: none; will-change: transform, opacity; transform-origin: 50% 0; backface-visibility: hidden; }
.lands.is-here iframe, html:not(.js) .lands iframe { opacity: 1; pointer-events: auto; }
.perch { position: absolute; left: 0; top: 0; width: 2px; height: 2px; pointer-events: none; }

.foot { max-width: 800px; margin: 0 auto; padding: 32px clamp(24px, 7vw, 100px) 64px; font: 400 0.8125rem/1.55 var(--sans);
  color: var(--soft); }
.foot p + p { margin-top: 8px; }

/* ---------- Aim ---------- */
.aim { position: fixed; left: 0; top: 0; z-index: 30; width: 0; height: 0; opacity: 0; pointer-events: none;
  will-change: transform, opacity; }
.aim { --aim-size: 150px; }
.aim .body { position: absolute; left: 0; top: 0; width: var(--aim-size); height: var(--aim-size);
  margin: calc(var(--aim-size) * -0.992) 0 0 calc(var(--aim-size) * -0.486); transform-origin: 48.6% 99.2%; }
.aim svg { width: 100%; height: 100%; overflow: visible; }
.aim .tap { position: absolute; left: calc(var(--aim-size) * -0.3); top: calc(var(--aim-size) * -0.9);
  width: calc(var(--aim-size) * 0.6); height: calc(var(--aim-size) * 0.85); pointer-events: auto;
  -webkit-tap-highlight-color: transparent; }
.aim .floor { position: absolute; left: -34%; bottom: -3%; width: 68%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--shade), 0.3), rgba(var(--shade), 0)); }

/* ---------- a phone is its own layout: the sheet fills the width, words above, choices below ---------- */
@media (max-width: 700px) {
  /* The bar is at the foot on a phone, so the words start near the top; 16 px clear of both edges.
     Fewer scrolls on a phone (Tanya, 25 Nov 2026: "reduce the scrolling ... in less scrolls"): the same story in about
     three fifths of the distance; every moment keeps its place in it (story/main.js measures moments as shares of it).
     One screen, nothing on top of anything (Tanya, 25 Nov 2026: "clutterd n overlap"): the heading, the "worked example"
     line, the sheet, the three choices and Aim's line stack top to bottom, and the sheet takes only the height left
     over, clear of the bottom bar (--below: the choices, Aim's line and the bar). */
  :root { --story-len: 580; --top-h: 12px; --head-h: 68px; --below: calc(300px + env(safe-area-inset-bottom));
    --sheet-top: calc(var(--top-h) + var(--head-h) + 12px);
    --sheet-w: min(100vw - 32px, (100svh - var(--sheet-top) - var(--below)) * 0.8); --sheet-h: calc(var(--sheet-w) * 1.25); }
  body { font-size: 1.0625rem; }
  .mark { font-size: 1.1875rem; }
  .w-ball { top: calc(var(--sheet-top) + var(--sheet-h) * 0.82); padding: 0 32px; }
  .w-ball h1 { font-size: clamp(1.75rem, 8.4vw, 2.25rem); }
  /* The words sit well inside the blue board, not on its edge (Tanya, 25 Nov 2026: "add some padding from the margin"). */
  .w-side { left: 30px; right: 30px; width: auto; max-width: none; top: calc(var(--top-h) + 4px); transform: none;
    height: var(--head-h); display: flex; flex-direction: column; justify-content: center; }
  .w-side h2 { font-size: clamp(1.1875rem, 5.4vw, 1.4375rem); line-height: 1.15; }
  .w-side p { margin-top: 3px; font-size: 0.875rem; line-height: 1.3; max-width: none; }
  .w-fix p { display: none; }
  .ask { left: 30px; right: 30px; max-width: none; top: calc(var(--sheet-top) + var(--sheet-h) + 6px); transform: none; }
  .ask-q { display: none; }
  .choices { margin-top: 0; display: grid; grid-template-columns: 1fr; }
  .choice { min-height: 44px; padding: 7px 6px; font-size: 1.125rem; }
  .ask-say { min-height: 0; margin-top: 6px; font-size: 0.875rem; line-height: 1.3; }
  .honest { right: calc(50% - var(--sheet-w) / 2 + 10px); bottom: calc(100svh - var(--sheet-top) - var(--sheet-h) + 8px);
    font-size: 0.6875rem; }
  .cue { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .aim { --aim-size: 104px; }
}
@media (max-width: 700px) and (max-height: 700px) {
  :root { --head-h: 54px; }
  .w-side p { display: none; }
}
/* wide but short windows: keep the words clear of the sheet */
@media (min-width: 701px) and (max-width: 1040px) {
  .w-side { width: calc(var(--side) - 40px); left: 20px; }
  .w-side h2 { font-size: 1.375rem; }
  .w-side p { font-size: 0.9375rem; }
  .ask { left: calc(50% + var(--sheet-w) / 2 + 20px); right: 14px; }
  .choice { font-size: 1.125rem; gap: 8px; }
}

/* ---------- calm mode: no drawing, no following, no loops ---------- */
.calm .cue span::after, .calm .sheet.is-waiting .crossed::after { animation: none; }
.calm .sheet.is-waiting .crossed::after { opacity: 0.7; }
.calm .story { height: calc(var(--story-len) * 0.62svh + 100svh); }

/* without scripts the story cannot play: show the ball, and let the page read on */
html:not(.js) .story { height: 100svh; }
html:not(.js) .ask, html:not(.js) .honest { display: none; }

@keyframes tab-pop { 45% { transform: translateY(-2px) scale(1.1); } }
@keyframes isle-rise { from { transform: translateY(calc(100% + 24px)); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .isle-tabs a, .isle-tabs a svg, .isle-tabs::before, .isle, .isle-cta { transition: none; animation: none; } }
