/*
  help desk tokens. none (company desk): the palette is the record's, not a family's.
  light is the record palette and the primary theme; dark is derived from it and keeps the blue accent.

  measured contrast (wcag 2.x relative luminance), asserted by scripts/lib/contrast.test.mjs:
    light  ink on bg 14.43, ink on surface 15.63
    light  muted on bg 5.81, muted on surface 6.29
    light  accent on bg 4.87, accent on surface 5.28, accent-ink on accent 5.49
    light  open on bg 6.08, open on surface 6.59, fixed on bg 5.79, fixed on surface 6.27
    dark   ink on bg 15.40, ink on surface 13.84
    dark   muted on bg 8.19, muted on surface 7.37
    dark   accent on bg 8.34, accent on surface 7.49, accent-ink on accent 7.90
    dark   open on bg 9.73, open on surface 8.75, fixed on bg 10.04, fixed on surface 9.03
  every record pair clears 4.5:1 as given, so no canonical value is replaced.
  --open and --fixed are the two derived tokens, for the status line on an article.
*/

:root {
  color-scheme: light;
  --bg: #E8F3F9;
  --surface: #F7FBFD;
  --ink: #10222E;
  --muted: #47616F;
  --accent: #0B6FA4;
  --accent-ink: #FFFFFF;
  --hairline: #C9DDE8;
  --open: #8A4A06;
  --fixed: #1D6B3A;

  --radius: 10px;
  --font-display: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tap: 44px;
  /* comfortable density: one step between airy and tight */
  --space: 20px;
}

/* system preference, unless the visitor has explicitly chosen light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0C1A23;
    --surface: #13242F;
    --ink: #E6F1F7;
    --muted: #9DB4C1;
    --accent: #62BCEA;
    --accent-ink: #06202E;
    --hairline: #24394A;
    --open: #F2B560;
    --fixed: #7BD69A;
  }
}

/* explicit choices win over the system preference */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C1A23;
  --surface: #13242F;
  --ink: #E6F1F7;
  --muted: #9DB4C1;
  --accent: #62BCEA;
  --accent-ink: #06202E;
  --hairline: #24394A;
  --open: #F2B560;
  --fixed: #7BD69A;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E8F3F9;
  --surface: #F7FBFD;
  --ink: #10222E;
  --muted: #47616F;
  --accent: #0B6FA4;
  --accent-ink: #FFFFFF;
  --hairline: #C9DDE8;
  --open: #8A4A06;
  --fixed: #1D6B3A;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* one visible focus ring everywhere, never removed */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* every interactive target clears 44px on touch, per the house mobile rule */
button, [role="button"], input[type="search"], summary {
  min-height: var(--tap);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
