/* assets/theme/tokens.css: the portfolio's design tokens, the single source of every color.
   build_pages.py copies these blocks into site.css, the Quarto token files, the inline copies
   in the self-contained tool pages and assets/theme/theme.R. Edit here, then run
   `python3 build_pages.py`; `python3 build_pages.py --check` fails when a copy has drifted.
   Dark is the default. Light applies when the system asks for it and no choice is saved, or when
   the toggle sets <html data-theme="light">. Print always uses light.
   Every text color passes WCAG 2.2 AA (4.5:1) on every surface in its theme; --control passes 3:1. */

/* dark:begin */
:root {
  color-scheme: dark;
  --bg: #0b0f15; --bg-2: #080b10; --surface: #111721; --surface-2: #161e2a; --surface-3: #1c2533;
  --line: #222c3b; --line-2: #2e3a4d; --control: #62718a;
  --ink: #e8eef6; --text: #c9d3e1; --muted: #98a5b8; --faint: #8593a8;
  --accent: #3ad7c8; --accent-ink: #8ff0e6; --accent-soft: rgba(58,215,200,.12); --accent-ring: rgba(58,215,200,.35); --on-accent: #06231f;
  --blue: #7aa4ff; --green: #4fd394; --amber: #f0b450; --red: #ff7a7a; --violet: #c4a7f5;
  --blue-soft: rgba(122,164,255,.14); --green-soft: rgba(79,211,148,.14); --amber-soft: rgba(240,180,80,.14); --red-soft: rgba(255,122,122,.14);
  --led-fg: #93dbae; --led-bg: #17301f; --led-line: #2f6b45;
  --sup-fg: #a9ccff; --sup-bg: #1a2b40; --sup-line: #36557d;
  --tools-fg: #d3bcf7; --tools-bg: #2a2140; --tools-line: #57457f;
  --gap-fg: #f5b48a; --gap-bg: #3a2416; --gap-line: #7a4b2c;
  --note-bg: #2a2119; --note-line: #e0935f;
  --grid: rgba(58,215,200,.022); --glow: rgba(122,164,255,.10); --bar-bg: rgba(11,15,21,.82);
  --shadow-1: inset 0 1px 0 rgba(255,255,255,.035), 0 1px 2px rgba(0,0,0,.45);
  --shadow-2: 0 0 0 1px var(--accent-ring), 0 12px 28px rgba(0,0,0,.45);
}
/* dark:end */

/* static:begin (type, space, radius and motion: the same in both themes) */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-label: 12px; --fs-small: 13px; --fs-card: 14px; --fs-body: 16px; --fs-lede: 18px;
  --fs-h3: 17px; --fs-h2: 22px; --fs-h1: clamp(28px, 1.1rem + 2vw, 36px); --fs-display: clamp(36px, 1.4rem + 3.2vw, 52px); --fs-kpi: 26px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-lg: 12px; --r-md: 8px; --r-sm: 6px; --r-pill: 999px;
  --ease: cubic-bezier(.2,.7,.2,1); --dur: 140ms;
  --bar-h: 56px; --measure: 70ch; --wrap: 1200px;
}
/* static:end */

/* light:begin (the source of the light theme; the two copies below are generated from it) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f6f9; --bg-2: #eef1f5; --surface: #ffffff; --surface-2: #eef2f6; --surface-3: #e4e9ef;
    --line: #d7dee7; --line-2: #c3ccd8; --control: #7d8a9b;
    --ink: #121a24; --text: #1f2a37; --muted: #4d5a69; --faint: #5b6878;
    --accent: #0b7268; --accent-ink: #075b53; --accent-soft: rgba(11,114,104,.08); --accent-ring: rgba(11,114,104,.30); --on-accent: #ffffff;
    --blue: #0757bf; --green: #1d6b3c; --amber: #8a5300; --red: #b42318; --violet: #6b48a8;
    --blue-soft: rgba(7,87,191,.10); --green-soft: rgba(29,107,60,.10); --amber-soft: rgba(138,83,0,.10); --red-soft: rgba(180,35,24,.10);
    --led-fg: #1d5e35; --led-bg: #e3f2e8; --led-line: #9ccbad;
    --sup-fg: #0b4f9c; --sup-bg: #e5eefa; --sup-line: #a7c3e8;
    --tools-fg: #5b3a8e; --tools-bg: #efe9f8; --tools-line: #c6b5e3;
    --gap-fg: #8a3a10; --gap-bg: #fbebdf; --gap-line: #e3b796;
    --note-bg: #fbf3e9; --note-line: #b5561f;
    --grid: rgba(18,26,36,.035); --glow: rgba(11,114,104,.06); --bar-bg: rgba(244,246,249,.85);
    --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
    --shadow-2: 0 0 0 1px var(--accent-ring), 0 10px 24px rgba(16,24,40,.12);
  }
}
/* light:end */

/* light-copy:begin (generated by build_pages.py from the light block above; do not edit) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9; --bg-2: #eef1f5; --surface: #ffffff; --surface-2: #eef2f6; --surface-3: #e4e9ef;
  --line: #d7dee7; --line-2: #c3ccd8; --control: #7d8a9b;
  --ink: #121a24; --text: #1f2a37; --muted: #4d5a69; --faint: #5b6878;
  --accent: #0b7268; --accent-ink: #075b53; --accent-soft: rgba(11,114,104,.08); --accent-ring: rgba(11,114,104,.30); --on-accent: #ffffff;
  --blue: #0757bf; --green: #1d6b3c; --amber: #8a5300; --red: #b42318; --violet: #6b48a8;
  --blue-soft: rgba(7,87,191,.10); --green-soft: rgba(29,107,60,.10); --amber-soft: rgba(138,83,0,.10); --red-soft: rgba(180,35,24,.10);
  --led-fg: #1d5e35; --led-bg: #e3f2e8; --led-line: #9ccbad;
  --sup-fg: #0b4f9c; --sup-bg: #e5eefa; --sup-line: #a7c3e8;
  --tools-fg: #5b3a8e; --tools-bg: #efe9f8; --tools-line: #c6b5e3;
  --gap-fg: #8a3a10; --gap-bg: #fbebdf; --gap-line: #e3b796;
  --note-bg: #fbf3e9; --note-line: #b5561f;
  --grid: rgba(18,26,36,.035); --glow: rgba(11,114,104,.06); --bar-bg: rgba(244,246,249,.85);
  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-2: 0 0 0 1px var(--accent-ring), 0 10px 24px rgba(16,24,40,.12);
}
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #f4f6f9; --bg-2: #eef1f5; --surface: #ffffff; --surface-2: #eef2f6; --surface-3: #e4e9ef;
    --line: #d7dee7; --line-2: #c3ccd8; --control: #7d8a9b;
    --ink: #121a24; --text: #1f2a37; --muted: #4d5a69; --faint: #5b6878;
    --accent: #0b7268; --accent-ink: #075b53; --accent-soft: rgba(11,114,104,.08); --accent-ring: rgba(11,114,104,.30); --on-accent: #ffffff;
    --blue: #0757bf; --green: #1d6b3c; --amber: #8a5300; --red: #b42318; --violet: #6b48a8;
    --blue-soft: rgba(7,87,191,.10); --green-soft: rgba(29,107,60,.10); --amber-soft: rgba(138,83,0,.10); --red-soft: rgba(180,35,24,.10);
    --led-fg: #1d5e35; --led-bg: #e3f2e8; --led-line: #9ccbad;
    --sup-fg: #0b4f9c; --sup-bg: #e5eefa; --sup-line: #a7c3e8;
    --tools-fg: #5b3a8e; --tools-bg: #efe9f8; --tools-line: #c6b5e3;
    --gap-fg: #8a3a10; --gap-bg: #fbebdf; --gap-line: #e3b796;
    --note-bg: #fbf3e9; --note-line: #b5561f;
    --grid: rgba(18,26,36,.035); --glow: rgba(11,114,104,.06); --bar-bg: rgba(244,246,249,.85);
    --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
    --shadow-2: 0 0 0 1px var(--accent-ring), 0 10px 24px rgba(16,24,40,.12);
  }
}
/* light-copy:end */
