/* "Overshoot Path" design tokens. Dark-first: :root is the "field green"
   night theme; the "Passport" light theme overrides it
   under [data-theme="light"]. index.html resolves the
   theme before first paint (saved choice, else prefers-color-scheme) and always
   sets data-theme on <html>; js/theme.js keeps it in sync and fires
   "themechange".
   Scale: type 1.25 from 16px; spacing on a 4px grid; radii 6/10/16.
   Data colours (Crameri ramps, methods, pathways A/B/C) live in js/palettes.js
   and are injected as --m-* / --pw-* custom properties by js/theme.js.
   Contrast of every text/background pair: website/tests/contrast.mjs. */
:root {
  color-scheme: dark;
  /* type */
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --t-2xs: .64rem;   /* 10.2px  tick labels only */
  --t-xs: .8rem;     /* 12.8px  captions, method notes */
  --t-sm: .875rem;   /* 14px    UI controls (off-scale UI step) */
  --t-md: 1rem;      /* 16px    body */
  --t-lg: 1.25rem;   /* 20px */
  --t-xl: 1.563rem;  /* 25px */
  --t-2xl: 1.953rem; /* 31px */
  --t-3xl: 2.441rem; /* 39px */
  --t-4xl: 3.052rem; /* 49px */
  --t-5xl: 3.815rem; /* 61px    hero */
  --lh-tight: 1.15; --lh-snug: 1.3; --lh-body: 1.6;
  /* space (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --maxw: 1200px; --maxw-text: 70ch;
  --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 180ms;

  /* brand: the overshoot path. Brand marks and pathway lines only; never
     used to encode data values. --brand-1/2 are the theme's two brand hues
     (decorative washes); --brand-a/b are the stroke and fill colours of the
     brand path, chosen per theme for >= 3:1 on the page and >= 4.5:1 under
     --fg-on-brand text. */
  --brand-1: #C9A86A;   /* brass */
  --brand-2: #6B7F4A;   /* army green */
  --brand-a: #C9A86A;
  --brand-b: #B5C98E;   /* pale green */
  --brand-grad: linear-gradient(90deg, var(--brand-a), var(--brand-b));

  /* surfaces ("field green" night) */
  --bg: #151A12;
  --bg-sunken: #10140D;
  --surface: #1F271A;
  --surface-2: #252F20;
  --surface-3: #2C3826;
  --raise: #36432F;
  --line: #2F3A28;
  --line-strong: #4A5A3C;
  --scrim: rgba(8, 10, 6, .72);
  /* text */
  --fg: #E8E6D9;
  --fg-2: #C4C6B3;
  --fg-3: #A0A48E;
  --fg-on-brand: #151A12;
  /* interactive */
  --accent: #B5C98E;
  --accent-strong: #D0DEB2;
  --accent-soft: rgba(181, 201, 142, .14);
  --on-accent: #151A12;
  --focus: #C9A86A;
  /* status */
  --warn: #E9BE68;   --warn-soft: rgba(233, 190, 104, .12);
  --danger: #F2937F; --danger-soft: rgba(242, 147, 127, .12);
  --ok: #9ED07F;     --ok-soft: rgba(158, 208, 127, .12);
  --info: #9DC3DC;   --info-soft: rgba(157, 195, 220, .12);
  /* maps and charts */
  --nodata: #1C2317;
  --hatch: #4A5A3C;
  --sphere: #182014;
  --graticule: #232C1D;
  --land: #2A3424;
  --unit-line: #3E4C34;   /* country borders: visible on the darkest ramp end too */
  --grid: rgba(196, 198, 179, .12);
  --axis: #A0A48E;
  --ref-line: rgba(232, 230, 217, .38);
  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 48px rgba(0, 0, 0, .38);
  --glow: 0 0 0 1px rgba(181, 201, 142, .25), 0 8px 32px rgba(107, 127, 74, .14);
}

/* "Passport": paper, tan, olive, travel blue, ink. */
:root[data-theme="light"] {
  color-scheme: light;
  --brand-1: #C2A878;   /* tan */
  --brand-2: #5E6A35;   /* olive */
  --brand-a: #8A6D3B;   /* tan, darkened to 3:1 on paper */
  --brand-b: #5E6A35;
  --bg: #F3EBDD;
  --bg-sunken: #EBE1CF;
  --surface: #FBF7EF;
  --surface-2: #F6EFE3;
  --surface-3: #EEE5D4;
  --raise: #E5D9C3;
  --line: #E0D3BC;
  --line-strong: #C2A878;
  --scrim: rgba(46, 38, 32, .45);
  --fg: #2E2620;
  --fg-2: #4F443A;
  --fg-3: #675A4B;
  --fg-on-brand: #FFFFFF;
  --accent: #2F5F7F;
  --accent-strong: #1F4561;
  --accent-soft: rgba(47, 95, 127, .10);
  --on-accent: #FFFFFF;
  --focus: #2F5F7F;
  --warn: #855000;   --warn-soft: rgba(176, 112, 0, .10);
  --danger: #A8261B; --danger-soft: rgba(168, 38, 27, .08);
  --ok: #3E6A1F;     --ok-soft: rgba(62, 106, 31, .09);
  --info: #2F5F7F;   --info-soft: rgba(47, 95, 127, .08);
  --nodata: #E9DFCC;
  --hatch: #C7B48E;
  --sphere: #EFE7D8;
  --graticule: #E3D8C3;
  --land: #E2D6C0;
  --unit-line: #FBF7EF;
  --grid: rgba(46, 38, 32, .08);
  --axis: #675A4B;
  --ref-line: rgba(46, 38, 32, .35);
  --shadow-sm: 0 1px 2px rgba(46, 38, 32, .07);
  --shadow: 0 1px 2px rgba(46, 38, 32, .06), 0 8px 24px rgba(46, 38, 32, .08);
  --shadow-lg: 0 2px 6px rgba(46, 38, 32, .07), 0 18px 48px rgba(46, 38, 32, .13);
  --glow: 0 0 0 1px rgba(94, 106, 53, .22), 0 8px 32px rgba(94, 106, 53, .10);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}
