/* Real State by MBCO - the one token sheet, shared by the landing (/) and the map (/map).
   backsolve's ink, bone and type with MBCO red #e71f1f as the single accent.

   Four theme blocks, both directions: :root is the light default, the OS block is
   guarded so an explicit light choice beats it, and both data-theme blocks re-assert
   their full set. Every theme-varying token is declared in every block.

   The names are a contract: app.js, map.js, gl.js and hybrid.js read about 25 of them
   with getComputedStyle, and gl.js parses colours by hand, so every colour a script
   reads stays a literal hex or rgb() value (no color-mix, oklch or light-dark here).

   Text contrast, WCAG 2.x, on the darkest ground each colour sits on:
     light  fg-muted #5f5e5a 5.38:1, fg-faint #686765 4.68:1, accent-tint #b81616 5.50:1
     dark   fg-muted #8f8d84 5.08:1, fg-faint #98958d 5.65:1, accent-tint #ff6b6b 6.09:1
   MBCO red itself is 4.10:1 on bone: it is paint (fills, marks, rules, the focus ring,
   display type at 24 px and up), never small text; text on it is #fff (4.55:1). */
:root{
  /* ground */
  --bg:#f4f3ee; --bg-card:#fbfaf6; --bg-raised:#eceae0; --bg-inset:#eceae0;
  /* text */
  --fg:#0a0a0a; --fg-muted:#5f5e5a; --fg-faint:#686765;
  /* line: strong is ink in light and a dark grey in dark, never a bright cage */
  --border-strong:#0a0a0a; --border-soft:#d8d6cd; --border-hair:#e6e4da;
  /* decoration and data hues that are not status */
  --ghost:#cbc8bb; --steel:#4a6f94; --mark:#9a978d;
  /* the accent as TEXT needs its own value; the paint never changes */
  --accent-tint:#b81616; --accent-wash:rgb(231 31 31 / .06);
  /* status: paint is constant, the tint is what survives on the ground */
  --good-tint:#1d7a52; --warn-tint:#8a6508; --danger-tint:#930000;
  --status-neutral:#5f5e5a;
  /* density ramp. Data colour: barred from interactive states. */
  --density-0:#c2e2ff; --density-1:#a5c5fe; --density-2:#a3a0f3;
  --density-3:#a975ce; --density-4:#af4791; --density-5:#a41b3b;
  --scrim:rgb(10 10 10 / .40);
  /* resting elements carry no elevation in light; floats cast, nothing else */
  --shadow-rest:none;
  --shadow-float:0 10px 40px -10px rgb(0 0 0 / .25);
  --shadow-modal:0 10px 40px -10px rgb(0 0 0 / .25);
  /* pill skin, as scalars: the mix itself is written on .pill, where --_h exists */
  --pill-line-a:100%; --pill-fill-a:6%;
  /* map count labels */
  --label-bg:rgb(244 243 238 / .86); --label-line:rgb(10 10 10 / .30);
  /* glass: the landing's nav and exhibits */
  --glass-bg:rgb(251 250 246 / .82); --glass-line:rgb(255 255 255 / .92);
  --sheet-shadow:0 30px 80px rgb(0 0 0 / .35);

  /* constant across themes */
  --accent:#e71f1f; --accent-hover:#c81a1a; --on-accent:#fff;
  --ink:#0a0a0a; --bone:#f4f3ee;
  --good:#1d7a52; --warn:#b8860b; --danger:#930000; --info:#4a6f94;
  --focus-ring:0 0 0 2px var(--bg),0 0 0 4px var(--accent);

  /* derived aliases; these names are the contract with app.js and gl.js */
  --bg-inverse:var(--fg); --fg-on-inverse:var(--bg);
  --map-mask:var(--bg);

  --dur-fast:120ms; --dur-base:150ms; --dur-slow:180ms;
  --ease-out:cubic-bezier(.22,1,.36,1);

  /* Bebas Neue is capitals only and one weight: display at 20 px and up, weight 400.
     IBM Plex Mono ships one weight (500, the type ruling's floor) to hold the first-paint font budget. */
  --font-display:'Bebas Neue',Impact,'Arial Narrow',sans-serif;
  --font-body:'Inter',system-ui,-apple-system,sans-serif;
  --font-data:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;

  --t-9:9px; --t-10:10px; --t-105:10.5px; --t-11:11px; --t-12:12px; --t-13:13px;
  --t-15:15px; --t-16:16px; --t-18:18px; --t-22:22px; --t-28:28px;
  --track:-0.16px;          /* the page tracking, absolute, exactly as inherited */
  --track-display:0.025em;  /* Bebas, backsolve's display tracking */
  --track-hero:0.025em;     /* the one figure of record */
  --track-kicker:0.22em;    /* 10px uppercase labels */
  --track-pill:0.08em;      /* the pill skeleton */
  --lh:1.5;
  --radius-pill:999px;
  /* native controls and scrollbars follow the chosen theme, not only the OS one */
  color-scheme:light dark;
}
:root[data-theme="light"]{ color-scheme:light; }
:root[data-theme="dark"]{ color-scheme:dark; }
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#10100e; --bg-card:#161613; --bg-raised:#1d1d19; --bg-inset:#0b0b09;
    --fg:#f4f3ee; --fg-muted:#8f8d84; --fg-faint:#98958d;
    --border-strong:#3a3833; --border-soft:#2b2a25; --border-hair:#23221e;
    --ghost:#3d3c36; --steel:#7aa0c4; --mark:#8a887f;
    --accent-tint:#ff6b6b; --accent-wash:rgb(231 31 31 / .08);
    --good-tint:#4fd99a; --warn-tint:#d9a94b; --danger-tint:#f79a99;
    --status-neutral:#8f8d84;
    --density-0:#233d53; --density-1:#324a76; --density-2:#555095;
    --density-3:#814ea4; --density-4:#b54696; --density-5:#dc4269;
    --scrim:rgb(0 0 0 / .72);
    --shadow-rest:inset 0 1px 0 rgb(255 255 255 / .03);
    --shadow-float:0 8px 24px rgb(0 0 0 / .45);
    --shadow-modal:0 16px 48px rgb(0 0 0 / .6);
    --pill-line-a:40%; --pill-fill-a:7%;
    --label-bg:rgb(16 16 14 / .85); --label-line:rgb(244 243 238 / .18);
    --glass-bg:rgb(22 22 19 / .6); --glass-line:rgb(244 243 238 / .12);
    --sheet-shadow:0 30px 80px rgb(0 0 0 / .8);
  }
}
:root[data-theme="dark"]{
  --bg:#10100e; --bg-card:#161613; --bg-raised:#1d1d19; --bg-inset:#0b0b09;
  --fg:#f4f3ee; --fg-muted:#8f8d84; --fg-faint:#98958d;
  --border-strong:#3a3833; --border-soft:#2b2a25; --border-hair:#23221e;
  --ghost:#3d3c36; --steel:#7aa0c4; --mark:#8a887f;
  --accent-tint:#ff6b6b; --accent-wash:rgb(231 31 31 / .08);
  --good-tint:#4fd99a; --warn-tint:#d9a94b; --danger-tint:#f79a99;
  --status-neutral:#8f8d84;
  --density-0:#233d53; --density-1:#324a76; --density-2:#555095;
  --density-3:#814ea4; --density-4:#b54696; --density-5:#dc4269;
  --scrim:rgb(0 0 0 / .72);
  --shadow-rest:inset 0 1px 0 rgb(255 255 255 / .03);
  --shadow-float:0 8px 24px rgb(0 0 0 / .45);
  --shadow-modal:0 16px 48px rgb(0 0 0 / .6);
  --pill-line-a:40%; --pill-fill-a:7%;
  --label-bg:rgb(16 16 14 / .85); --label-line:rgb(244 243 238 / .18);
  --glass-bg:rgb(22 22 19 / .6); --glass-line:rgb(244 243 238 / .12);
  --sheet-shadow:0 30px 80px rgb(0 0 0 / .8);
}
:root[data-theme="light"]{
  --bg:#f4f3ee; --bg-card:#fbfaf6; --bg-raised:#eceae0; --bg-inset:#eceae0;
  --fg:#0a0a0a; --fg-muted:#5f5e5a; --fg-faint:#686765;
  --border-strong:#0a0a0a; --border-soft:#d8d6cd; --border-hair:#e6e4da;
  --ghost:#cbc8bb; --steel:#4a6f94; --mark:#9a978d;
  --accent-tint:#b81616; --accent-wash:rgb(231 31 31 / .06);
  --good-tint:#1d7a52; --warn-tint:#8a6508; --danger-tint:#930000;
  --status-neutral:#5f5e5a;
  --density-0:#c2e2ff; --density-1:#a5c5fe; --density-2:#a3a0f3;
  --density-3:#a975ce; --density-4:#af4791; --density-5:#a41b3b;
  --scrim:rgb(10 10 10 / .40);
  --shadow-rest:none;
  --shadow-float:0 10px 40px -10px rgb(0 0 0 / .25);
  --shadow-modal:0 10px 40px -10px rgb(0 0 0 / .25);
  --pill-line-a:100%; --pill-fill-a:6%;
  --label-bg:rgb(244 243 238 / .86); --label-line:rgb(10 10 10 / .30);
  --glass-bg:rgb(251 250 246 / .82); --glass-line:rgb(255 255 255 / .92);
  --sheet-shadow:0 30px 80px rgb(0 0 0 / .35);
}
