/* ══ Dark layer for the token-only landing pages ═══════════════════════════
 * NEXUS-VIS-UNPAINTED-PAGES
 *
 * index.html and about.html are styled entirely through the semantic --bq-*
 * tokens in tokens.css, and they do not load landing.css (whose 43 `html.dark`
 * rules are written against the subpages' Tailwind-ish utility vocabulary —
 * .bg-white, .text-ink, .glass-nav — none of which these two pages use). So
 * loading landing.css would not have painted them, and would have imported a
 * second styling system to collide with their own.
 *
 * The honest fix is at the layer they actually consume: flip the semantic tokens.
 * This file contains NO literal colours — every value resolves to the dark
 * palette in tokens.css — so there is no second palette to drift.
 *
 * It is opt-in per page on purpose. The eight subpages already paint dark through
 * landing.css; giving them this flip as well would double-paint elements that use
 * --bq-surface / --bq-text today (9 and 3 occurrences). A page that loads this file
 * is a page whose dark state is this token flip and nothing else.
 *
 * Guard: tests/unit/test_visual_stability.py asserts every landing page that loads
 * landing-ui.js (the script that applies html.dark) has at least one reachable
 * stylesheet containing `html.dark` rules. Do not remove this link from a page that
 * applies the class.
 */

html.dark {
  /* Native scrollbars, form controls and highlight colours follow the paint,
     so a dark page never shows a light UA chrome beside a dark surface. */
  color-scheme: dark;

  /* Page and card surfaces. --bq-brand-soft-off-white is used only as a
     background on these two pages (measured: 2 background + 1 hover-background
     occurrences, no text use), so flipping it is contained. */
  --bq-brand-soft-off-white: var(--surface-dark);
  --bq-surface: var(--surface-card-dark);

  /* Text. --bq-text is Ink Blue in light mode (tokens.css: "primary text is Ink
     Blue"); on a dark surface that is unreadable, so it takes the same value the
     subpages use for strong text on dark. */
  --bq-text: var(--text-strong-dark);
  --bq-text-muted: var(--text-muted-dark);

  /* Hairlines. Kept as the dark border token rather than a translucent white so
     the value matches what the subpages already ship. */
  --bq-border: var(--border-strong-dark);
}

/* ── Utility-class paint for the two pages ────────────────────────────────
 * The token flip above cannot reach colour that arrives through a Tailwind
 * utility on the element itself, and both pages carry three of them: `text-ink`
 * on <body> (which is where every inherited text colour on about.html comes
 * from — measured live: the skip-link computed rgb(25,57,98) in both states
 * until this block existed), plus about.html's skip-link focus pair.
 *
 * These selectors and values are copied from landing.css rather than invented,
 * so the two pages and the eight subpages paint the same dark. The duplication is
 * of *rules*, not of the palette: every value resolves to tokens.css, which holds
 * the only literal hexes. test_a_duplicated_dark_rule_matches_landing_css pins
 * the copies equal, which is what makes the duplication safe to keep.
 */
html.dark body { background-color: var(--surface-dark); color: var(--text-muted-dark); }
html.dark .text-ink { color: var(--text-strong-dark); }
/* Same :not([class*="bg-"]) guard landing.css uses: an element that also sets its
   own background token (the skip-link's focus:bg-white) must keep dark text. */
html.dark .text-brand-700:not([class*="bg-"]) { color: var(--text-strong-dark); }
