/* Design tokens: the palette, the type stack, and the three theme states.
 *
 * The viewer has three, not two: an explicit choice stamps data-theme on the root, and the
 * default "system" setting stamps nothing — so the bare :root carries the complete light palette,
 * and both dark rules redefine only tokens, never component colours.
 */

:root {
  --ground: #E9E7E2;
  --surface: #F8F7F4;
  --raised: #FFFFFF;
  --ink: #15181B;
  --muted: #63676A;
  --line: #CFCCC5;
  --line-soft: #DEDBD5;
  --accent: #C8451A;
  --accent-ink: #FFF6F2;
  --accent-btn: #C8451A;
  --good: #2F6B4F;

  /* the four grounds the demo tiles cycle through */
  --stage-1: #243049;
  --stage-2: #3A2740;
  --stage-3: #1E3A38;
  --stage-4: #402A22;

  --shadow: 0 1px 2px rgba(21, 24, 27, .06), 0 8px 24px rgba(21, 24, 27, .05);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* system dark, unless the viewer has explicitly chosen light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121417;
    --surface: #1A1D21;
    --raised: #21252A;
    --ink: #EDEBE6;
    --muted: #9DA0A2;
    --line: #2E3339;
    --line-soft: #262B30;
    --accent: #FF6B3D;
    --accent-ink: #1A0E08;
    --accent-btn: #D2481C;
    --good: #74C393;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

/* an explicit dark choice, which must also win over a light OS */
:root[data-theme="dark"] {
  --ground: #121417;
  --surface: #1A1D21;
  --raised: #21252A;
  --ink: #EDEBE6;
  --muted: #9DA0A2;
  --line: #2E3339;
  --line-soft: #262B30;
  --accent: #FF6B3D;
  --accent-ink: #1A0E08;
  --accent-btn: #D2481C;
  --good: #74C393;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}
