/* Workweek Check design tokens: the one source for colour, type, spacing and shape.
   site/tokens.css is the original. app/src/wwc_app/static/wwc/tokens.css is an exact copy (a test checks it), and
   the printable outputs (outputs/print.css) use the light values. See docs/design/revamp-plan.md, "Design system".
   No web fonts: system stacks only, so the pages load nothing from third parties. */

:root {
  color-scheme: light dark;

  /* Colour, light. Every text pair is WCAG AA or better (scripts/check_contrast.py). */
  --paper: #f9f8f4;          /* page background */
  --surface: #ffffff;        /* cards, inputs */
  --sunken: #f1efe8;         /* table heads, code, quiet panels */
  --ink: #1b1e22;            /* body text */
  --ink-2: #545a61;          /* secondary text */
  --line: #e1ddd3;           /* hairlines, dividers */
  --line-strong: #858a91;    /* input and control borders (3:1) */
  --accent: #1b5a45;         /* links, primary buttons, the "computed" state */
  --accent-hover: #144535;
  --on-accent: #ffffff;
  --accent-soft: #e3eee8;
  --flag: #7a4d00;           /* flags, premium differences, "needs review" */
  --flag-soft: #fbf0d8;
  --bad: #9a2a24;            /* refusals of input, errors, destructive actions */
  --bad-soft: #fbe7e4;
  --focus: #1d5fd1;

  /* Type. System stacks: no downloads. Serif for headings gives the editorial, paper-document voice. */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Noto Serif",
    "DejaVu Serif", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono",
    monospace;
  --text-xs: 0.8125rem;   /* 13 */
  --text-sm: 0.875rem;    /* 14 */
  --text-base: 1rem;      /* 16 */
  --text-md: 1.0625rem;   /* 17, landing body */
  --text-lg: 1.25rem;     /* 20 */
  --text-xl: 1.5rem;      /* 24 */
  --text-2xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);  /* 26-34, section heads */
  --text-3xl: clamp(2.125rem, 1.4rem + 3.2vw, 3.5rem);    /* 34-56, the landing headline */
  --leading-tight: 1.15;
  --leading: 1.6;

  /* Space: a 4px base. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Shape. Small radii and almost no shadow: paper, not plastic. */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgb(20 20 10 / 0.06), 0 8px 24px -16px rgb(20 20 10 / 0.18);
  --measure: 38em;
  --page: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121416;
    --surface: #191c20;
    --sunken: #20242a;
    --ink: #ebe8e1;
    --ink-2: #a8adb3;
    --line: #2f343b;
    --line-strong: #6b737c;
    --accent: #79c9a7;
    --accent-hover: #9ad8bd;
    --on-accent: #0b1a14;
    --accent-soft: #19302a;
    --flag: #f0c46a;
    --flag-soft: #2e2511;
    --bad: #f3a39b;
    --bad-soft: #3a1d1b;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

:root[data-theme="dark"] {
  --paper: #121416;
  --surface: #191c20;
  --sunken: #20242a;
  --ink: #ebe8e1;
  --ink-2: #a8adb3;
  --line: #2f343b;
  --line-strong: #6b737c;
  --accent: #79c9a7;
  --accent-hover: #9ad8bd;
  --on-accent: #0b1a14;
  --accent-soft: #19302a;
  --flag: #f0c46a;
  --flag-soft: #2e2511;
  --bad: #f3a39b;
  --bad-soft: #3a1d1b;
  --focus: #8ab4ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
}
