/*
 * MEM Design 01 — one shared token system, three appearance modes (Theme +
 * Daylight Readability 01). Dark remains the frozen-baseline character
 * (graphite + warm-white) and is the unconditional default declared on
 * bare :root — this is deliberate, not an oversight: it means "Dark"
 * requires no rule of its own (nothing overrides the default), and
 * "System" on a dark OS also falls straight through to it.
 *
 * Mode resolution (see src/components/theme-control.js for the JS side):
 * - System (default, no [data-theme] attribute): OS-driven via the
 *   `prefers-color-scheme: light` block below. Live — the browser
 *   re-evaluates it immediately if the OS appearance changes, no reload.
 * - Light ([data-theme="light"]): unconditional override, wins regardless
 *   of OS. Same token values as the System-light block below by
 *   necessity (CSS has no mixins) — keep the two in sync if either changes.
 * - Dark ([data-theme="dark"]): no rule needed — see above.
 *
 * `--line` (dark) was retuned in this pass: the prior value measured
 * ~1.3–1.5:1 against --bg/--surface, well under the 3:1 non-text UI
 * boundary target — real borders/dividers were reading as almost
 * invisible in bright light. New value verified ≥3.5:1 against both.
 */
:root {
  color-scheme: dark;
  --bg: #161819;
  --outside: #101213;
  --surface: #202324;
  --raised: #292d2e;
  --text: #f1f2eb;
  --muted: #a3aaa8;
  --line: #6b7272;
  --accent: #d9ed9a;
  --ink: #202817;
  --detail: #9bbdce;
  --warning: #e3c08a;
  --danger: #f6aba1;
  --voice-idle: #b9c899;
  --ask-focus-line: #758077;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/*
 * Light theme — a proper counterpart, not an inversion: warm off-white
 * surfaces (mirrors dark's warm-white --text), dark neutral text, citron
 * accent darkened for on-light legibility (a light chartreuse text color
 * would be close to invisible), --detail's cool-blue identity preserved
 * just darkened the same way. All pairs measured — see task report for
 * the exact ratios. Written twice on purpose (see note above): once as
 * an unconditional override for the explicit "Light" choice, once scoped
 * to System-without-an-explicit-choice under the OS media query.
 */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f3e9;
  --outside: #ece7d8;
  --surface: #efe8d8;
  --raised: #e6ddc8;
  --text: #211f19;
  --muted: #6b6558;
  --line: #8c8571;
  --accent: #547318;
  --ink: #fbf9f1;
  --detail: #2f5f78;
  --warning: #8a5a12;
  --danger: #a3392b;
  --voice-idle: #6f7d54;
  --ask-focus-line: #5c6a5f;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f7f3e9;
    --outside: #ece7d8;
    --surface: #efe8d8;
    --raised: #e6ddc8;
    --text: #211f19;
    --muted: #6b6558;
    --line: #8c8571;
    --accent: #547318;
    --ink: #fbf9f1;
    --detail: #2f5f78;
    --warning: #8a5a12;
    --danger: #a3392b;
    --voice-idle: #6f7d54;
    --ask-focus-line: #5c6a5f;
  }
}
