/* Base reset, platform defaults, typography and small utilities. */
*, *::before, *::after { box-sizing: border-box; }

/* Apple's continuous corners everywhere (Ștefan, 2026-10-24, picked against the real iOS
   shape on a side-by-side): every rounded box — cards, rows, chips, every button — draws its
   radius as a squircle. iOS's corner for a nominal R runs (1 + .6 smoothing) × R = 1.6R along
   each edge, so where corner-shape exists the radii scale by --rk 1.6: the token radii here,
   and every literal one in the sheets as `calc(Npx * var(--rk))`. Measured side by side, a CSS
   squircle at 1.6R is the iOS shape. Progressive: corner-shape is Chromium 139+ only; Safari
   and Firefox keep the plain arc at the nominal radius (--rk 1), so nothing gets rounder there.
   ⚠️ Circles and pills (--r-round, --r-pill, 50%, 999px) — avatars, dots, radios, progress
   bars, badges — opt out with `corner-shape: round` next to their radius. A BUTTON is never a
   pill or a circle: text buttons --r-control, icon-only ones --r-tile. A new literal radius
   is written `calc(Npx * var(--rk))`. A box that copies its parent's shape (`border-radius:
   inherit` — a pulse ring, a press tint, a focus outline layer) writes `corner-shape: inherit`
   beside it: corner-shape is not inherited, so the copy would otherwise be a squircle. */
:root { --rk: 1; }
@supports (corner-shape: squircle) {
  :root {
    --rk: 1.6;
    --r-mark: calc(6px * var(--rk));
    --r-chip: calc(8px * var(--rk));
    --r-tile: calc(10px * var(--rk));
    --r-row: calc(12px * var(--rk));
    --r-control: calc(14px * var(--rk));
    --r-card: calc(18px * var(--rk));
    --r-feature: calc(22px * var(--rk));
  }
  *, *::before, *::after { corner-shape: squircle; }
}

html {
  /* Windows/Linux keep a classic scrollbar: reserve its gutter, so a short page and a long
     one (or a scroll-locked one under a dialog) lay out at the same width — no 15–17px jump. */
  scrollbar-gutter: stable;
  /* Never let a mobile browser inflate our type on its own: on a tablet asking
     for the desktop layout, autosizing blows up rail labels past their column
     and clips them mid-word. Font sizes are ours alone. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Source Serif 4 has an opsz axis (Text → Display by size); written out because WebKit
     does not always default it (bug 227353). Never set opsz by hand. */
  font-optical-sizing: auto;
  /* The grey flash on tap is off ONLY because every control has its own :active state
     (components.css). Inherited, so this one line covers the page. */
  -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling is a movement, so Reduce Motion turns it off. It applies to in-page
   anchors and to scrolls that do not name a behaviour; a jump that must be instant (the next
   question) passes `behavior: "instant"`. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* A modal <dialog> locks the page scroll without moving it (the gutter above stays). */
html:has(dialog[open]:modal) { overflow: hidden; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  /* Inter's cv05: the l with a tail, so l / I / 1 differ in a dose ("1 l"). */
  font-feature-settings: "cv05";
  font-size: var(--t-body-size);
  line-height: 1.55;
  letter-spacing: var(--t-body-track);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--teal); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--teal-hover); }
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: var(--t-title-2-track);
  color: inherit;
  margin: 0;
}

img, svg { max-width: 100%; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Controls: no double-tap-zoom wait before the tap lands. */
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }

/* Every figure is tabular, and inputs hold figures more often than not. */
input, textarea, select { font-family: var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; }

:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* ---- Figures (static/CLAUDE.md, "The number rule") ----
   Big figures (>= ~20px: scores, timer, big stats) are the serif; small ones (counters,
   badges, "2 / 20") are Inter. Both are ALWAYS tabular, so columns of numbers line up. */
.fig { font-family: var(--font-figure); font-variant-numeric: tabular-nums; }
.fig-ui { font-family: var(--font-figure-ui); font-variant-numeric: tabular-nums; }
/* Historical name for .fig (it used to be the mono stack). Kept so the screens that wear it
   keep the serif; a screen moving a SMALL figure to the new rule switches it to .fig-ui. */
.mono { font-family: var(--font-figure); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--muted); }

/* Eyebrow: an uppercase kicker — Inter 600, 12px, +0.06em. */
.eyebrow {
  font-family: var(--font-eyebrow);
  font-size: var(--t-eyebrow-size);
  font-weight: var(--t-eyebrow-weight);
  letter-spacing: var(--t-eyebrow-track);
  text-transform: uppercase;
  color: var(--teal);
}

.eyebrow--dim { color: var(--muted-2); }
.eyebrow--bright { color: var(--teal-bright); }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
