/* Self-hosted type under the SIL Open Font License (see /assets/fonts/FONT-LICENSES.txt).
   Source Serif 4 sets the wordmark, headings and figures; Hanken Grotesk sets reading, labels and navigation. */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/source-serif.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;

  /* A 13/15px interface, a 16px reading voice, and serif headings no larger than they need to be. */
  --text-xs: 0.8125rem; --text-sm: 0.9375rem; --text-md: 1rem; --text-read: 1rem; --text-lg: 1.1875rem; --text-xl: 1.375rem; --text-2xl: 1.75rem;
  --text-display: clamp(2.375rem, 2.6vw + 1rem, 3.75rem);
  --text-section: clamp(1.75rem, 1.4vw + 1rem, 2.5rem);
  --text-lead: clamp(1.0625rem, 0.3vw + 1rem, 1.25rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;

  --container: 1200px; --narrow: 46rem; --gutter: 56px; --gap-columns: 32px; --section-gap-s: 80px; --section-gap: 112px;
  --band: clamp(96px, 8vw, 128px); --tile-pad: 24px; --tile-gap: 8px;
  --measure: 36rem;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100;

  /* White paper and the brand's deep plum (#3A1137, from the Countless Lab scribble). The plum carries the header,
     the opening band and the footer, marks the measured value in every chart, and nothing else. */
  --color-brand: oklch(26.2% 0.085 331); --color-brand-2: oklch(30% 0.083 331); --color-brand-3: oklch(34% 0.08 331); --color-brand-rule: oklch(38.5% 0.07 331);
  --color-paper: oklch(100% 0 0);
  --color-paper-2: oklch(97.4% 0.007 331);
  --color-paper-3: oklch(94.6% 0.011 331);
  --color-ink: oklch(26.2% 0.085 331);
  --color-ink-2: oklch(34% 0.075 331);
  --color-muted: oklch(45% 0.055 331);
  --color-faint: oklch(63% 0.04 331);
  --color-rule: oklch(90.5% 0.018 331);
  --color-dot: oklch(70% 0.035 331);
  --color-accent: oklch(26.2% 0.085 331);
  --color-accent-soft: oklch(26.2% 0.085 331 / 0.08);
  --color-accent-ink: oklch(100% 0 0);
  --color-focus: oklch(40% 0.12 331);
  --color-button: var(--color-brand); --color-button-ink: oklch(100% 0 0);
  --color-error: oklch(52% 0.19 27);
  /* Charts: the measured or chosen value in plum, context in a quiet grey-plum, labels in ink. */
  --color-chart: oklch(38% 0.11 331);
  --color-chart-context: oklch(80% 0.03 331);
  --color-chart-band: oklch(38% 0.11 331 / 0.12);

  --font-display: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-outlier: var(--font-display);

  --radius-card: 4px; --radius-pill: var(--radius-card); --rule-hair: 1px; --shadow-card: none;
  --tracking-display: -0.015em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-brand: oklch(25.5% 0.075 331); --color-brand-2: oklch(29% 0.073 331); --color-brand-3: oklch(32.5% 0.07 331); --color-brand-rule: oklch(36.5% 0.062 331);
    --color-paper: oklch(20% 0.055 331);
    --color-paper-2: oklch(23.5% 0.058 331);
    --color-paper-3: oklch(27% 0.06 331);
    --color-ink: oklch(96.5% 0.006 331);
    --color-ink-2: oklch(88% 0.012 331);
    --color-muted: oklch(75% 0.02 331);
    --color-faint: oklch(58% 0.025 331);
    --color-rule: oklch(29% 0.04 331);
    --color-dot: oklch(52% 0.03 331);
    --color-accent: oklch(82% 0.09 331);
    --color-accent-soft: oklch(82% 0.09 331 / 0.12);
    --color-accent-ink: oklch(20% 0.055 331);
    --color-focus: oklch(82% 0.09 331);
    --color-button: oklch(96.5% 0.006 331); --color-button-ink: oklch(20% 0.055 331);
    --color-chart: oklch(78% 0.11 331);
    --color-chart-context: oklch(48% 0.025 331);
    --color-chart-band: oklch(78% 0.11 331 / 0.14);
  }
}

/* A deep plum surface with white type. Components inside read the same tokens, so they need no variants. */
.plum {
  --color-paper: var(--color-brand);
  --color-paper-2: var(--color-brand-2);
  --color-paper-3: var(--color-brand-3);
  --color-ink: oklch(100% 0 0);
  --color-ink-2: oklch(95% 0.018 331);
  --color-muted: oklch(88% 0.04 331);
  --color-faint: oklch(74% 0.06 331);
  --color-rule: var(--color-brand-rule);
  --color-dot: oklch(70% 0.03 331);
  --color-accent: oklch(100% 0 0);
  --color-accent-soft: oklch(100% 0 0 / 0.12);
  --color-accent-ink: var(--color-brand);
  --color-focus: oklch(100% 0 0);
  --color-button: oklch(100% 0 0); --color-button-ink: var(--color-brand);
  --color-chart: oklch(87% 0.09 335);
  --color-chart-context: oklch(58% 0.045 331);
  background: var(--color-paper);
  color: var(--color-ink);
}
