/* Shared theme (Chess Lab and Think Ahead): every colour of the chess site's look (suhaasnarayanan.com/chess), light,
   dark, and "auto" (= match the device). Pages set <html data-theme> to light / dark / auto; only these variables change
   between themes, so CSS uses them, never literal colours.
   Home: chess-lab-open/site/shared/ (MIT). The private kit pulls a pinned copy; edit it here, never there.

   Colour direction A, "Navy & Maple, tidied" (18 Nov 2026). Tokens are named by their job (as Radix and Material 3 do),
   and every background has its text colour checked against it (WCAG 2.2 ratio and APCA Lc):
     --bg page · --surface cards, panels, nav · --surface-2 callouts, chips, hover · --border dividers, card edges ·
     --border-strong edges of form fields (3:1, WCAG 1.4.11) · --text body · --text-head headings, button labels ·
     --text-2 secondary text · --accent links, focus ring, selected tab · --accent-solid primary button and pressed chip
     fill, --accent-solid-hover, --on-accent text on it, --on-accent-2 softer text on it (hero subtitle) ·
     --success / --success-soft right, solved · --warn / --warn-soft partly, not first try · --error / --error-soft wrong,
     missed, --on-error text on a solid error fill · --scrim behind a modal.
   Right and wrong differ in lightness as well as hue (a teal and an orange, after Okabe and Ito), so they stay apart for
   colour-blind eyes; on the board a ✓ / ✗ badge says it too (WCAG 1.4.1). The board's own colours (Lichess's square
   highlights, the right / wrong flash, the hint ring, eval greys) are the same in both themes, because the wood is.
   The older names (--navy, --white, --blue, --good, …) stay as aliases of the roles, so existing rules keep working. */
:root{
  color-scheme:light;
  --bg:#f2f5f9; --surface:#ffffff; --surface-2:#e6ecf5; --border:#d9e1ec; --border-strong:#7f8ca0;
  --text:#1b2636; --text-head:#13284a; --text-2:#526073;
  --accent:#1f4e8c; --accent-solid:#13284a; --accent-solid-hover:#1f4e8c; --on-accent:#ffffff; --on-accent-2:#a9c4ec;
  --success:#0b5a52; --success-soft:#e1f1ea; --warn:#855f12; --warn-soft:#f6eedd;
  --error:#a64b00; --error-soft:#f9e5df; --on-error:#ffffff;
  --brass:#b08d57; --brass-light:#cfb27e; --brass-text:#8a6a35;
  --side:#6a3d9a; --side-soft:#efe7f8;   /* side lines in the reader (Chessable's purple) */
  --tree:#b7c3d4; --chart:#13284a; --hero-bg:#13284a;
  --lv1:#c9d8ee; --lv2:#8fb0dc; --lv3:#3f6fae;
  --shadow:rgba(19,40,74,.22); --scrim:rgba(19,40,74,.45);
  --eval-white:#f1efe9; --eval-black:#2a3442; --eval-draw:#a7b2c2;
  /* the board: the same in both themes */
  --sq-last:rgba(155,199,0,.41); --sq-sel:rgba(20,85,30,.5); --sq-dest:rgba(20,85,30,.5); --sq-dest-cap:rgba(20,85,0,.3);
  --sq-dest-hover:rgba(20,85,30,.3); --sq-hint:rgba(31,78,140,.9);
  --sq-good:rgba(10,80,90,.6); --sq-bad:rgba(240,120,30,.62); --mark-good:#0b5a52; --mark-bad:#a64b00;
  --serif:'Libre Caslon Text',Georgia,'Times New Roman',serif;
  --sans:'Source Sans 3','Segoe UI',system-ui,-apple-system,sans-serif;
  --radius:4px;
  /* older names, kept as aliases of the roles above */
  --band:var(--bg); --white:var(--surface); --callout:var(--surface-2); --line:var(--border);
  --ink:var(--text); --head:var(--text-head); --muted:var(--text-2);
  --blue:var(--accent); --navy:var(--accent-solid); --blue-bg:var(--accent-solid-hover); --on-navy:var(--on-accent);
  --blue-on-navy:var(--on-accent-2); --accent-soft:var(--surface-2); --heroBg:var(--hero-bg);
  --good:var(--success); --good-soft:var(--success-soft); --bad:var(--error); --bad-soft:var(--error-soft);
  --ok-bg:var(--success-soft); --ok-text:var(--success); --ok-line:var(--success);
}
/* Dark: the same roles with dark values (also under Match device when the device is dark). */
:root[data-theme="dark"]{color-scheme:dark;
  --bg:#0f1722;--surface:#172231;--surface-2:#1e2b3d;--border:#2a394e;--border-strong:#6b7f9c;
  --text:#e2e7ee;--text-head:#e3eaf5;--text-2:#b0bccc;
  --accent:#9fc2f2;--accent-solid:#2f5590;--accent-solid-hover:#3a66a8;--on-accent:#ffffff;--on-accent-2:#b9d0f2;
  --success:#7fd6c8;--success-soft:#13302a;--warn:#e8cc66;--warn-soft:#33290f;--error:#f59e7e;--error-soft:#3a1e1a;--on-error:#1f0d07;
  --brass:#c4a26a;--brass-light:#d8bd8c;--brass-text:#d2b27a;--side:#c6a6ef;--side-soft:#2c2140;
  --tree:#4a5d78;--chart:#9fc2f2;--hero-bg:#0c1420;--lv1:#22385a;--lv2:#2f5287;--lv3:#5b86c4;
  --shadow:rgba(0,0,0,.5);--scrim:rgba(0,0,0,.55);--eval-draw:#6b7787}
@media (prefers-color-scheme:dark){:root[data-theme="auto"]{color-scheme:dark;
  --bg:#0f1722;--surface:#172231;--surface-2:#1e2b3d;--border:#2a394e;--border-strong:#6b7f9c;
  --text:#e2e7ee;--text-head:#e3eaf5;--text-2:#b0bccc;
  --accent:#9fc2f2;--accent-solid:#2f5590;--accent-solid-hover:#3a66a8;--on-accent:#ffffff;--on-accent-2:#b9d0f2;
  --success:#7fd6c8;--success-soft:#13302a;--warn:#e8cc66;--warn-soft:#33290f;--error:#f59e7e;--error-soft:#3a1e1a;--on-error:#1f0d07;
  --brass:#c4a26a;--brass-light:#d8bd8c;--brass-text:#d2b27a;--side:#c6a6ef;--side-soft:#2c2140;
  --tree:#4a5d78;--chart:#9fc2f2;--hero-bg:#0c1420;--lv1:#22385a;--lv2:#2f5287;--lv3:#5b86c4;
  --shadow:rgba(0,0,0,.5);--scrim:rgba(0,0,0,.55);--eval-draw:#6b7787}}
