/* Design tokens, variation v3 "Workshop": a heavy display grotesk on cream paper, deep green, amber for highlights.
   Pages use these custom properties and no raw values. DESIGN.md records where each value came from. */

:root {
  /* Colour: light (cream paper, green ink) */
  --color-bg: #f3ede0;
  --color-surface: #fbf8f0;
  --color-text: #18241d;
  --color-muted: #58604f;
  --color-border: #d9cfb9;
  --color-accent: #1e5136;
  --color-accent-text: #fbf8f0;
  --color-accent-soft: #dde6d3;
  --color-highlight: #efb841;
  --color-highlight-text: #18241d;
  --color-highlight-ink: #9a6609;
  --color-block: #1e4a33;
  --color-block-text: #f1ead8;
  --color-block-muted: #a9c2ab;
  --color-code-keyword: #f2bf55;
  --color-code-string: #bfe0b4;
  --color-block-line: #2b543d;
  --color-code-error: #ffa79c;
  --color-error: #b3261e;
  --color-code-inline: #d5e1c8;
  --color-code-inline-border: #a9bd99;

  /* Type */
  --font-display: "Cabinet Grotesk", "Arial Black", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-display: 800;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: clamp(2.75rem, 4vw + 1.25rem, 4.75rem);
  --leading-display: 0.98;
  --leading-tight: 1.1;
  --leading-code: 1.65;
  --leading-body: 1.6;
  --tracking-display: -0.025em;
  --tracking-caps: 0.06em;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --measure: 65ch;
  --page-max: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Layout: the minimum width of a column before a grid stacks */
  --column-min: 22rem;
  --card-min: 16rem;
  --fact-min: 16rem;
  --swatch-min: 10rem;
  --label-width: 7rem;
  --form-max: 28rem;

  /* Shape */
  --line: 1px;
  --line-strong: 2px;
  --focus-ring: 3px;
  --radius-xs: 4px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 0 rgb(30 81 54 / 0.08), 0 12px 28px -16px rgb(30 81 54 / 0.35);
  --mark-size: 2rem;
  --mark-stroke: 2.6; /* the stroke of the mark in its 32 x 32 box; keep it */
  --logo-height: 32px;
  --swatch-height: 4.5rem;
  --bar-height: 0.75rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0e1913;
    --color-surface: #15241b;
    --color-text: #ede6d4;
    --color-muted: #a4ad9b;
    --color-border: #2b3d31;
    --color-accent: #86cfa0;
    --color-accent-text: #0e1913;
    --color-accent-soft: #1c3527;
    --color-highlight: #e8b03c;
    --color-highlight-text: #18170f;
    --color-highlight-ink: #f0bb4e;
    --color-block: #1a3527;
    --color-block-text: #ede6d4;
    --color-block-muted: #9db7a3;
    --color-code-keyword: #f0bb4e;
    --color-code-string: #a9d9b4;
    --color-block-line: #274031;
    --color-code-error: #ff9a8f;
    --color-error: #ff8a80;
    --color-code-inline: #253f2f;
    --color-code-inline-border: #3d5e48;
    --shadow-card: 0 1px 0 rgb(0 0 0 / 0.4), 0 12px 28px -16px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme="dark"] {
  --color-bg: #0e1913;
  --color-surface: #15241b;
  --color-text: #ede6d4;
  --color-muted: #a4ad9b;
  --color-border: #2b3d31;
  --color-accent: #86cfa0;
  --color-accent-text: #0e1913;
  --color-accent-soft: #1c3527;
  --color-highlight: #e8b03c;
  --color-highlight-text: #18170f;
  --color-highlight-ink: #f0bb4e;
  --color-block: #1a3527;
  --color-block-text: #ede6d4;
  --color-block-muted: #9db7a3;
  --color-code-keyword: #f0bb4e;
  --color-code-string: #a9d9b4;
  --color-block-line: #274031;
  --color-code-error: #ff9a8f;
  --color-error: #ff8a80;
  --color-code-inline: #253f2f;
  --color-code-inline-border: #3d5e48;
  --shadow-card: 0 1px 0 rgb(0 0 0 / 0.4), 0 12px 28px -16px rgb(0 0 0 / 0.7);
}
