/* Cairn design system tokens, generated from the design system artifact's tokens.json.
   Artifact: https://claude.ai/artifact/VmpWZHmLdkyCyddhuwXDLh   Guide: docs/design-system.md
   Load this before app.css. Names match the artifact one to one. Do not hand-edit: change the value in
   scripts/design-tokens.py, run it, and publish the new tokens.json to the artifact (docs/design-system.md).

   Themes: light (whiteboard) by default, dark (blackboard) from prefers-color-scheme,
   and either can be forced with data-theme="light" | "dark" on <html>.
   Trust layer: data-trust="<slug>" on <html> overrides only --trust-accent, --trust-ink, --trust-soft. */

:root, [data-theme="light"] {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-sunken: #eef1f3;
  --ink: #1a1f26;
  --ink-muted: #525c67;
  --rule: #dfe3e7;
  --border: #7d8792;
  --accent: #1f3f6b;
  --accent-hover: #16304f;
  --accent-soft: #e6ecf4;
  --on-accent: #ffffff;
  --logo-accent: #2a5c9e;
  --focus: #1f3f6b;
  --scrim: rgba(16, 20, 26, 0.40);
  --before-you-teach: #b3261e;
  --before-you-teach-soft: #fcebe9;
  --worth-doing: #8f5400;
  --if-time: #5b6672;
  --on-marker: #ffffff;
  --met: #1c7340;
  --met-soft: #e3f1e7;
  --partly: var(--worth-doing);
  --missing: var(--before-you-teach);
  --error: var(--before-you-teach);
  --trust-accent: #3e6b6e;
  --trust-ink: #2f5a5d;
  --trust-soft: #e4eeee;
  --source-trust: var(--trust-ink);
  --source-national: var(--accent);
  --shadow-raised: 0 1px 2px rgba(26, 31, 38, 0.08), 0 6px 20px rgba(26, 31, 38, 0.06);
  --shadow-overlay: 0 12px 40px rgba(16, 20, 26, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18211f;
    --surface: #202b28;
    --surface-sunken: #283531;
    --ink: #e8eeea;
    --ink-muted: #a6b4ae;
    --rule: #34433e;
    --border: #74847e;
    --accent: #a9c4ea;
    --accent-hover: #c6d8f2;
    --accent-soft: #263645;
    --on-accent: #10201b;
    --logo-accent: #8fb6ec;
    --focus: #e8eeea;
    --scrim: rgba(0, 0, 0, 0.55);
    --before-you-teach: #f2948a;
    --before-you-teach-soft: #42231f;
    --worth-doing: #e8b964;
    --if-time: #a6b4ae;
    --on-marker: #10201b;
    --met: #8fd3a6;
    --met-soft: #1d3426;
    --trust-accent: #7fb5b8;
    --trust-ink: #9ccbcd;
    --trust-soft: #1f3536;
    --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.40), 0 6px 20px rgba(0, 0, 0, 0.30);
    --shadow-overlay: 0 12px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg: #18211f;
  --surface: #202b28;
  --surface-sunken: #283531;
  --ink: #e8eeea;
  --ink-muted: #a6b4ae;
  --rule: #34433e;
  --border: #74847e;
  --accent: #a9c4ea;
  --accent-hover: #c6d8f2;
  --accent-soft: #263645;
  --on-accent: #10201b;
  --logo-accent: #8fb6ec;
  --focus: #e8eeea;
  --scrim: rgba(0, 0, 0, 0.55);
  --before-you-teach: #f2948a;
  --before-you-teach-soft: #42231f;
  --worth-doing: #e8b964;
  --if-time: #a6b4ae;
  --on-marker: #10201b;
  --met: #8fd3a6;
  --met-soft: #1d3426;
  --trust-accent: #7fb5b8;
  --trust-ink: #9ccbcd;
  --trust-soft: #1f3536;
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.40), 0 6px 20px rgba(0, 0, 0, 0.30);
  --shadow-overlay: 0 12px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root {
  /* type */
  --font-sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-display: 32px; --leading-display: 40px; --weight-display: 700;
  --text-title: 24px; --leading-title: 32px; --weight-title: 700;
  --text-heading: 20px; --leading-heading: 28px; --weight-heading: 700;
  --text-body: 16px; --leading-body: 24px; --weight-body: 400;
  --text-body-strong: 16px; --leading-body-strong: 24px; --weight-body-strong: 700;
  --text-small: 14px; --leading-small: 20px; --weight-small: 400;
  --text-numeral: 14px; --leading-numeral: 20px; --weight-numeral: 500;

  /* spacing (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;

  /* radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* motion */
  --duration-quick: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.3, 0, 1, 1);

  /* layout (breakpoints are documentation: write the px literal in media queries) */
  --bp-tablet: 600px;
  --bp-desktop: 960px;
  --bp-wide: 1200px;
  --content-max: 1040px;
  --measure: 68ch;
  --target-min: 44px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-quick: 0ms; --duration-base: 0ms; --duration-slow: 0ms; }
}

/* ---- Trust layer. One block per trust; only these three tokens change. ---- */
[data-trust="ark"] {
  --trust-accent: #0093b8;   /* Ark accent-1: marks only, 3.3:1 on bg */
  --trust-ink: #045f76;      /* Ark accent-1-dark: trust source text, 6.7:1 on bg */
  --trust-soft: #e3f4f9;     /* Ark info-bg */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-trust="ark"] { --trust-accent: #5aaec4; --trust-ink: #9fd0dd; --trust-soft: #1b3338; }
}
[data-theme="dark"][data-trust="ark"] { --trust-accent: #5aaec4; --trust-ink: #9fd0dd; --trust-soft: #1b3338; }
