/* Design tokens: the single source of colour, type, spacing and shape for the whole site.
   Change a value here and every page follows. Light is the default; dark applies when the
   visitor's system prefers it, unless they chose a theme with the toggle (data-theme). */

:root {
  color-scheme: light;

  /* Colour */
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #e8eef2;
  --line: #d3dce4;
  --text: #17222e;
  --text-muted: #4f5b67;
  --accent: #0b7a85;
  --accent-strong: #085e67;
  --on-accent: #ffffff;
  --focus: #0b7a85;
  --danger: #b42334;
  --danger-bg: #fbe8ea;
  --warn: #8f5200;
  --warn-bg: #fff0d6;
  --success: #17703f;
  --success-bg: #e2f3e9;

  /* Type */
  /* Numbers that must read at a glance (timer, results) use the system font, whose zero is not slashed. */
  --font-numbers: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Atkinson Hyperlegible", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.4rem, 1.1rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
  --text-hero: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);

  /* Space (4px steps) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Shape */
  --radius-sm: 4px;
  --radius-md: 8px;
  --container: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1621;
    --surface: #151f2d;
    --surface-2: #1c2839;
    --line: #2b394c;
    --text: #e6edf5;
    --text-muted: #9fadbd;
    --accent: #4cc3cf;
    --accent-strong: #7ad6df;
    --on-accent: #06242a;
    --focus: #7ad6df;
    --danger: #ff8a95;
    --danger-bg: #3a1a20;
    --warn: #f2b04c;
    --warn-bg: #3a2d14;
    --success: #5cd197;
    --success-bg: #14301f;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1621;
  --surface: #151f2d;
  --surface-2: #1c2839;
  --line: #2b394c;
  --text: #e6edf5;
  --text-muted: #9fadbd;
  --accent: #4cc3cf;
  --accent-strong: #7ad6df;
  --on-accent: #06242a;
  --focus: #7ad6df;
  --danger: #ff8a95;
  --danger-bg: #3a1a20;
  --warn: #f2b04c;
  --warn-bg: #3a2d14;
  --success: #5cd197;
  --success-bg: #14301f;
}
