/* base.css: design tokens, reset, typography, themes */
:root {
  --bg: #f4f6fa;
  --bg-alt: #e9edf5;
  --surface: #ffffff;
  --ink: #172033;
  --ink-soft: #4a5570;
  --line: #d3d9e6;
  --accent: #2b5bd7;
  --accent-ink: #ffffff;
  --learning: #8a5a00;
  --learning-bg: #fbefd2;

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.75rem, 3vw, 2.25rem);
  --step-3: clamp(2.5rem, 7vw, 4.5rem);

  --space: clamp(3.5rem, 8vw, 6rem);
  --radius: 10px;
  --header-h: 64px;
}
:root[data-theme="dark"] {
  --bg: #0f1526; --bg-alt: #151d33; --surface: #1a2340;
  --ink: #e8ecf7; --ink-soft: #a9b3cf; --line: #2c3757;
  --accent: #8fb0ff; --accent-ink: #0f1526;
  --learning: #f2c46d; --learning-bg: #3a2f14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1526; --bg-alt: #151d33; --surface: #1a2340;
    --ink: #e8ecf7; --ink-soft: #a9b3cf; --line: #2c3757;
    --accent: #8fb0ff; --accent-ink: #0f1526;
    --learning: #f2c46d; --learning-bg: #3a2f14;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); font-weight: 700; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
