/* Design tokens. Every colour is defined once here and redefined for dark. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-raised: #f4f6f9;
  --bg-sunken: #e9edf3;
  --ink: #14171c;
  --ink-soft: #4a5261;
  --ink-faint: #6b7280;
  --rule: #dde2e9;
  --rule-strong: #c2cad4;
  /* The warm note: links, hovers, a contested flag, the things worth
     looking at twice. Dark enough that white text on it clears 4.5:1. */
  --accent: #a4660f;

  /* The interaction colour: what is selected, what is open, what has
     focus, and the wash behind selected text. Kept off the amber accent,
     which stays on content, because a selected control and an emphasised
     word are different claims - and because an amber pill reads as a
     warning. Hue 194 against amber's 35 is nearly the opposite side of
     the wheel, so the two never look like a near-miss of each other.
     5.2:1 on the sunken field the date pill sits on. */
  --select: #116b86;

  /* Lane hues. Spaced around the wheel and kept separable under protanopia
     and deuteranopia, which is why the three warm earth tones - India,
     Africa and Central Asia - are pulled apart by saturation as well as hue
     rather than sitting together as three oranges. */
  --lane-earth-life: #55803c;
  --lane-americas: #1f7d5c;
  --lane-west-asia: #17798c;
  --lane-science: #1f6bb0;
  --lane-europe: #4a53ad;
  --lane-oceania: #7a4aa8;
  --lane-philosophy: #a33f96;
  --lane-east-asia: #bf3350;
  --lane-art-culture: #b0522f;
  --lane-india: #a4611a;
  --lane-africa: #8a6a12;
  --lane-central-asia: #7d6a4a;
  --lane-global: #5f6773;

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: ui-serif, Georgia, "Times New Roman", serif;

  --step-1: 4px;
  --step-2: 8px;
  --step-3: 12px;
  --step-4: 16px;
  --step-5: 24px;
  --step-6: 32px;

  --radius: 6px;
  --header-h: 52px;
  --axis-h: 34px;
  --minimap-h: 38px;
  /* Height of a stacked control strip below the header on narrow screens. */
  --strip-h: 33px;
  /* One height for every control in the top bar. Search, the date fields and
     the date summary were 32, 28 and 30px, which reads as misalignment rather
     than hierarchy. Raised to 44 for touch, below. */
  --control-h: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --bg-raised: #161a20;
    --bg-sunken: #1b212a;
    --ink: #e6e9ee;
    --ink-soft: #a3acba;
    --ink-faint: #7d8796;
    --rule: #262c35;
    --rule-strong: #3a424e;
    --accent: #f0a94c;
    --select: #5cc9e6;

    --lane-earth-life: #8fb56e;
    --lane-americas: #5ec79b;
    --lane-west-asia: #58bccd;
    --lane-science: #6aaef2;
    --lane-europe: #8e9bf2;
    --lane-oceania: #b78ce4;
    --lane-philosophy: #d98fd0;
    --lane-east-asia: #ef7f97;
    --lane-art-culture: #e8896b;
    --lane-india: #f0a552;
    --lane-africa: #ddc158;
    --lane-central-asia: #b9a481;
    --lane-global: #9aa3b0;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1014;
  --bg-raised: #161a20;
  --bg-sunken: #1b212a;
  --ink: #e6e9ee;
  --ink-soft: #a3acba;
  --ink-faint: #7d8796;
  --rule: #262c35;
  --rule-strong: #3a424e;
  --accent: #f0a94c;
  --select: #5cc9e6;

  --lane-earth-life: #8fb56e;
  --lane-americas: #5ec79b;
  --lane-west-asia: #58bccd;
  --lane-science: #6aaef2;
  --lane-europe: #8e9bf2;
  --lane-oceania: #b78ce4;
  --lane-philosophy: #d98fd0;
  --lane-east-asia: #ef7f97;
  --lane-art-culture: #e8896b;
  --lane-india: #f0a552;
  --lane-africa: #ddc158;
  --lane-central-asia: #b9a481;
  --lane-global: #9aa3b0;
}
