:root {
  color-scheme: light dark;

  --font-sans: ui-sans-serif, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", "Source Serif 4", Georgia, Cambria, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.833rem, 0.81rem + 0.12vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.36vw, 1.406rem);
  --step-2: clamp(1.44rem, 1.33rem + 0.55vw, 1.758rem);
  --step-3: clamp(1.728rem, 1.56rem + 0.82vw, 2.197rem);
  --step-4: clamp(2.074rem, 1.84rem + 1.17vw, 2.746rem);
  --step-display: clamp(2.4rem, 0.55rem + 9.9vw, 5.5rem);

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-section: clamp(3rem, 2rem + 5vw, 6rem);

  --measure: 68ch;
  --wide: 72rem;
  --gutter: var(--space-m);

  --leading-body: 1.6;
  --leading-dense: 1.45;
  --leading-tight: 1.15;
  --leading-display: 0.95;
  --rule: 1px;
  --radius-s: 0.375rem;
  --radius-m: 0.75rem;

  --surface: #fbfaf8;
  --ink: #1a1a17;
  --ink-muted: #6a5558;
  --accent: #ad324a;
  --border: #e0d7d5;
}

/* the toggle writes data-theme; without it the system decides */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #171011;
    --ink: #f1eae9;
    --ink-muted: #b09699;
    --accent: #dc8e9c;
    --border: #3a2a2c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #171011;
  --ink: #f1eae9;
  --ink-muted: #b09699;
  --accent: #dc8e9c;
  --border: #3a2a2c;
}

:root[data-theme="light"] {
  color-scheme: light;
}
