/* Loggad — theme overrides.
   The app resolves the user's choice (light | dark | system) BEFORE writing the DOM:
   it always sets data-theme to the resolved value ("light" or "dark") on <html>,
   so this file never needs a prefers-color-scheme branch.

   IMPORTANT: the semantic aliases are declared once at :root in colors.css as
   var(--paper-*) / var(--ink-*). If a theme override lived on a DESCENDANT element,
   those aliases would stay frozen against :root's light values (custom-property
   substitution happens where the alias is declared) — so every alias is explicitly
   re-pointed here with literal values. Values from the prototype's DARK_BASE. */

:root[data-theme='dark'] {
  /* ---- base scales ---- */
  --paper-0: oklch(16% 0.012 55);
  --paper-1: oklch(22% 0.014 55);
  --paper-2: oklch(27% 0.016 55);
  --line-1: oklch(34% 0.014 55);
  --line-2: oklch(44% 0.016 55);

  --ink-0: oklch(96% 0.004 90);
  --ink-1: oklch(85% 0.006 88);
  --ink-2: oklch(68% 0.008 80);
  --ink-3: oklch(50% 0.008 75);

  /* ---- semantic aliases, explicitly re-pointed ---- */
  --bg-page: oklch(16% 0.012 55);
  --bg-surface: oklch(22% 0.014 55);
  --bg-surface-sunken: oklch(27% 0.016 55);
  --bg-inverse: oklch(96% 0.004 90);

  --border-default: oklch(34% 0.014 55);
  --border-strong: oklch(44% 0.016 55);

  --text-primary: oklch(96% 0.004 90);
  --text-secondary: oklch(85% 0.006 88);
  --text-tertiary: oklch(68% 0.008 80);
  --text-disabled: oklch(50% 0.008 75);
  --text-inverse: oklch(16% 0.012 55);

  /* Accent TEXT needs a LIGHT step on the dark surface to clear WCAG AA
     (the scale itself isn't re-pointed for dark). accent-300 gives ~7.9:1 on
     both bg-surface and bg-page. See colors.css --text-accent. */
  --text-accent: var(--accent-300);

  /* Accent-tinted surfaces containing theme-aware text flip from the light
     tint to a dark hue-matched surface (same rule as --verified-surface). */
  --accent-surface: oklch(25% 0.04 142);

  /* Progress meters are non-text information: use the light accent step so
     the fill clears 3:1 against the dark sunken track. */
  --progress-fill: var(--accent-300);

  /* Verified green as a foreground on the dark surface needs a LIGHT step —
     the raw ramp (verified-500/600) is dark and drops to ~2.6:1 / 1.9:1
     there. This lifts it to ~7.9:1. The tint-chip uses keep the light ramp
     (they're light-on-light, unchanged). See colors.css --verified-fg. */
  --verified-fg: oklch(74% 0.12 142);
  --verified-on-inverse: var(--verified-600);
  --verified-surface: oklch(25% 0.04 142);

  /* Destructive callouts need the same chip-vs-surface split as warnings:
     a dark warm-red panel for theme-aware copy, plus a light red foreground
     for error text and accessible form-control boundaries. */
  --danger-surface: oklch(25% 0.045 27);
  --danger-fg: oklch(84% 0.11 27);
  --danger-on-inverse: var(--danger-600);

  /* Warning callout surface + its amber foreground on the dark theme. The
     surface flips from the light cream (--warning-100) to a dark warm surface
     so the normal theme-aware text tokens read on it (this is the dark-mode
     light-on-light fix); --warning-fg lifts to a light amber step (the raw
     --warning-700 is a DARK amber and would vanish here). The theme-independent
     --warning-tint CHIP keeps the light ramp (light-on-light, unchanged). See
     colors.css --warning-surface / --warning-fg. */
  --warning-surface: oklch(25% 0.045 74);
  --warning-fg: oklch(84% 0.11 82);

  /* Form-control boundary at >=3:1 on the dark surface (1.4.11); the neutral
     hairline is ~1.5:1 there. */
  --border-input: oklch(54% 0.016 55);

  --focus-ring: oklch(96% 0.004 90);
}
