/* Design tokens. All colour values live here and only here (site.css uses var(--token)).
   Contrast (WCAG 2.x): ink/paper 17.06, ink2/paper 10.55, muted/paper 6.15, accent/paper 6.65,
   warn/paper 7.00, on-accent/accent 6.65. --rule is decorative (hairlines); control borders use --muted. */
:root {
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 57ch;            /* about 68 characters per line for Literata at 17px (TYPOGRAPHY.md: 55ch = 66, 60ch = 71.5) */
  --page: 1240px; --gutter: 32px; --rail: 16rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;   /* spacing scale */
  --r: 2px;                   /* the only radius */
  --t-fast: 150ms;            /* link, button, row feedback (colour, background, inset bar) */
  --t-swap: 160ms;            /* quote expand crossfade, opacity only */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

:root, :root[data-theme="light"] {
  color-scheme: light;
  --paper: #f9faf9; --tint: #eef1ef;
  --ink: #14181b; --ink2: #363d42; --muted: #566067;
  --accent: #0b6558; --on-accent: #f9faf9;
  --rule: #98a2a8; --rule-soft: #dbe0de; --warn: #a3262a;
  --mark: #f4df94; --mark-ink: var(--ink); --focus: var(--accent);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1417; --tint: #182025;
  --ink: #e4e9eb; --ink2: #c2cbd0; --muted: #9aa6ad;
  --accent: #4cc2ab; --on-accent: #0f1417;
  --rule: #616e76; --rule-soft: #263137; --warn: #ff9a94;
  --mark: #5c4e0f; --mark-ink: var(--ink); --focus: var(--accent);
}

/* Print is always the light palette: browsers drop backgrounds when printing, so dark-theme text (light on white
   paper) would all but vanish. Same values as the light block above; keep them in sync. */
@media print {
  :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #f9faf9; --tint: #eef1ef;
    --ink: #14181b; --ink2: #363d42; --muted: #566067;
    --accent: #0b6558; --on-accent: #f9faf9;
    --rule: #98a2a8; --rule-soft: #dbe0de; --warn: #a3262a;
    --mark: #f4df94;
  }
}
