/* PowerMate design tokens.
   Every foreground/background pair used together in the UI is asserted against
   WCAG AA by tests/test_contrast.py, in BOTH themes. Changing a value here
   without running that test can ship unreadable text -- the exact defect this
   overhaul was commissioned to fix. */

:root{
  /* Surfaces: page, raised card, recessed panel. */
  --paper:#f7f3ea;
  --surface:#fffdf8;
  --sunken:#efe9dc;

  /* Ink: primary, secondary, tertiary (hints//captions). */
  --ink:#1b2b30;
  --ink-2:#405056;
  --ink-3:#556569;

  /* Rules. */
  --line:#ded4c1;
  --line-2:#c8bca4;

  /* Semantic accents. */
  --accent:#b03f27;
  --accent-soft:#f3e2dc;
  --ok:#2f6b3a;
  --ok-soft:#e3eedb;
  --warn:#8a6212;
  --warn-soft:#f7ecd2;

  /* Type. Self-hosted; see fonts.css. */
  --serif:"Source Serif 4","Palatino Linotype",Palatino,Georgia,serif;
  --sans:"Source Sans 3","Trebuchet MS",Verdana,sans-serif;

  /* Scale. */
  --r:3px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:36px; --s7:56px;

  color-scheme:light;
}

/* Dark theme. Applied by an explicit user choice (data-theme) or by the OS
   preference when the user has not chosen. The explicit choice must win in
   BOTH directions -- a user on a dark OS who picks light gets light. */
:root[data-theme=dark]{
  --paper:#12191c;
  --surface:#182126;
  --sunken:#0e1417;
  --ink:#eef2f0;
  --ink-2:#b8c6c9;
  --ink-3:#8b9a9e;
  --line:#2c3a40;
  --line-2:#3d4f56;
  --accent:#e8795c;
  --accent-soft:#3a231d;
  --ok:#8fce9b;
  --ok-soft:#1d2f22;
  --warn:#e3b969;
  --warn-soft:#33280f;
  color-scheme:dark;
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    --paper:#12191c;
    --surface:#182126;
    --sunken:#0e1417;
    --ink:#eef2f0;
    --ink-2:#b8c6c9;
    --ink-3:#8b9a9e;
    --line:#2c3a40;
    --line-2:#3d4f56;
    --accent:#e8795c;
    --accent-soft:#3a231d;
    --ok:#8fce9b;
    --ok-soft:#1d2f22;
    --warn:#e3b969;
    --warn-soft:#33280f;
    color-scheme:dark;
  }
}
