/* Design tokens (ADR 0002, NFR-UX-02). Every colour, size and space in site.css and chat.css comes from here.
   Colour design "Dusk + Paper" (B-0116; DECISIONS 3 Dec 2026; hub resources/brand/zero_doubt/gradient_digits.html,
   take `paper`): Dusk (navy night, orange dawn) when the device is dark, Paper (warm paper, navy ink, orange marks)
   when it is light, following prefers-color-scheme. The chrome (header, home hero) stays Dusk navy in both. Orange
   #FF5B1F, Barlow Condensed for the name and headings, Barlow for text (DECISIONS 27 Nov 2026). Pairs are WCAG AA
   or better in both themes (tests/web/test_styles.py). */

:root {
  color-scheme: dark light;

  /* Colour: Dusk (dark) */
  --color-bg: #0b1222;
  --color-surface: #141e35;
  --color-fg: #f1eee7;
  --color-fg-muted: #a6afc0;
  --color-rule: #26324d;          /* the mockup's line: decorative rules and edges */
  --color-border: #6b7794;        /* form controls and buttons: 3:1 or more on bg and surface (WCAG 1.4.11) */
  --color-brand: #ff5b1f;         /* the logo's orange: focus rings and bars (6.02:1 on navy) */
  --color-accent: #ff5b1f;        /* links: orange text is fine on navy */
  --color-accent-hover: #ff7a45;
  --color-focus: #ff5b1f;          /* focus ring: the brand orange */
  --color-placeholder-bg: #3a3320;
  --color-placeholder-fg: #f0dca8;

  /* Chrome: header and home hero are Dusk navy in both themes, so these never change with the theme */
  --color-deep: #0b1222;
  --color-on-deep: #f3efe6;       /* the logo's light lines */
  /* "Register interest" (B-0119): the mockup's orange button in both themes. White on it is 3.1:1 (fails AA), so
     the text is the mockup's near-black: 6.3:1 */
  --color-cta: #ff5b1f;
  --color-on-cta: #0c0d0e;
  /* The signature: night into dawn, navy through violet and ember to our orange. Text only in the dark top 60%. */
  --sig: linear-gradient(180deg, #0b1222 0%, #162444 52%, #3e2d4a 74%, #b0452a 90%, #ff5b1f 100%);

  /* Type: self-hosted Barlow (SIL OFL), see site.css */
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;  /* the name, headings, labels */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --weight-body: 400;
  --weight-heading: 600;
  --weight-bold: 600;
  --weight-wordmark: 700;

  /* Type scale (ratio 1.2, base 1rem) */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.44rem;
  --step-3: 1.728rem;
  --step-4: clamp(1.728rem, 1.4rem + 1.6vw, 2.488rem);
  --leading-tight: 1.2;
  --leading-body: 1.55;
  --tracking-caps: 0.1em;
  --tracking-wordmark: 0.07em;

  /* Space (multiples of 0.25rem) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Layout */
  --width-page: 64rem;
  --width-prose: 68ch;
  --width-chat: 34rem;           /* about 70 Barlow characters a line (ch is the wide "0") */
  --gutter: clamp(1rem, 4vw, 2rem);
  --logo-size: 2.75rem;
  --radius: 3px;
  --rule-width: 1px;
  --bar-width: 3px;              /* left bars on messages and notices */
  --focus-width: 3px;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Colour: Paper (light) */
    --color-bg: #f6f2e9;
    --color-surface: #fffdf8;
    --color-fg: #14213d;          /* navy ink */
    --color-fg-muted: #4a5670;
    --color-rule: #ddd6c8;
    --color-border: #7d8597;      /* form controls: 3:1 or more on paper and surface */
    --color-brand: #e04a14;       /* #ff5b1f is 2.78:1 on paper; this keeps focus and bars over 3:1 */
    --color-accent: #a33a0b;      /* orange text on light pages (brand rule) */
    --color-accent-hover: #7a2b08;
    --color-focus: #e04a14;
    --color-placeholder-bg: #fbefc9;
    --color-placeholder-fg: #4d3b00;
  }
}
