/* Worklore colour tokens — the single source for the SPA and the static pages.
   Anchored to favicon.svg: ink #33302a, folder fold #555046, paper #faf8f3,
   check green #4caf7d. Neutrals all sit on hue 95; warn and star stay warmer
   (hue 62–78) because they are accents, not neutrals.

   Contrast: every foreground token clears 4.5:1 on the surface it is used on,
   including the small mono text (11px labels, 11.5px pill counters) — those are
   the sizes that actually fail, so the accents are darker in light mode than
   the raw brand green would be. Verified with WCAG ratios, not by eye. */

:root {
  --bg: #faf8f3;                       /* paper */
  --panel: #ffffff;
  --sunk: oklch(0.955 0.009 95);
  --fg: #33302a;                       /* ink */
  --fg-2: #555046;                     /* folder fold */
  --fg-3: oklch(0.54 0.016 95);        /* 4.8:1 — carries 11px mono labels */
  --rule: oklch(0.89 0.012 95);
  --rule-2: oklch(0.82 0.015 95);
  --ok: oklch(0.50 0.115 155);         /* 4.7:1 on --ok-soft (SUCCESS badge) */
  --ok-soft: oklch(0.93 0.04 155);
  --warn: oklch(0.52 0.115 68);        /* 4.7:1 on --warn-soft (FAIL badge) */
  --warn-soft: oklch(0.94 0.04 78);
  --star: oklch(0.52 0.145 62);        /* 4.9:1 on --star-soft (star count) */
  --star-soft: oklch(0.95 0.045 72);
  --stripe: oklch(0.90 0.012 95);
  --bar-off: oklch(0.66 0.012 95);     /* chart bar next to --ok: 3.1:1 on --panel */
}

/* Tell the browser which scheme is on, so its own UI (scrollbars, inputs,
   checkboxes, selects, the canvas before paint) matches our colours. Without
   this they stay light on dark pages. Default follows the OS; the footer's
   manual choice (data-theme) pins it. */
:root { color-scheme: light dark; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* Static pages follow the OS; the SPA sets data-theme explicitly and wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #33302a;
    --panel: #3d3931;
    --sunk: #2b2823;
    --fg: #faf8f3;
    --fg-2: oklch(0.78 0.014 95);
    --fg-3: oklch(0.68 0.014 95);
    --rule: #4a453c;
    --rule-2: #555046;
    --ok: #4caf7d;
    --ok-soft: oklch(0.30 0.05 155);
    --warn: oklch(0.78 0.11 72);
    --warn-soft: oklch(0.30 0.05 72);
    --star: oklch(0.82 0.13 78);
    --star-soft: oklch(0.31 0.05 72);
    --stripe: oklch(0.36 0.012 95);
    --bar-off: oklch(0.80 0.01 95);
  }
}

html[data-theme="dark"] {
  --bg: #33302a;
  --panel: #3d3931;
  --sunk: #2b2823;
  --fg: #faf8f3;
  --fg-2: oklch(0.78 0.014 95);
  --fg-3: oklch(0.68 0.014 95);
  --rule: #4a453c;
  --rule-2: #555046;
  --ok: #4caf7d;                       /* the mark's green, verbatim */
  --ok-soft: oklch(0.30 0.05 155);
  --warn: oklch(0.78 0.11 72);
  --warn-soft: oklch(0.30 0.05 72);
  --star: oklch(0.82 0.13 78);
  --star-soft: oklch(0.31 0.05 72);
  --stripe: oklch(0.36 0.012 95);      /* hatch must read against #33302a */
  --bar-off: oklch(0.80 0.01 95);
}
