/* Design tokens (spec §12). Single source of truth for marketing + app.
   Colours and typefaces are a PROPOSAL. "Paper & Forest" is the working direction; nothing is
   final until the owner confirms. Components use only semantic tokens, so a change lands here. */

/* Both faces are SIL OFL 1.1, self-hosted (licences sit next to the files). */
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/static/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Two families: a reading serif for headlines and page titles, a humanist sans for the interface. */
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* keys and IDs only */

  /* Use as `font: var(--text-body)`. */
  --text-meta: 400 12px/16px var(--font-sans);
  --text-label: 500 14px/20px var(--font-sans);
  --text-body: 400 16px/24px var(--font-sans);
  --text-heading: 600 20px/28px var(--font-sans);
  --text-title: 500 28px/36px var(--font-display);
  --text-section: 450 clamp(26px, 1.25rem + 1.5vw, 40px) / 1.14 var(--font-display);
  --text-display: 430 clamp(34px, 1.4rem + 3.6vw, 64px) / 1.03 var(--font-display);
  --tracking-display: -0.022em;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --space-96: 96px;
  --gutter: clamp(16px, 4vw, 32px);

  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-frame: 16px;
  --control-height: 40px;
  --touch-target: 44px;
  /* Elevation is borders. Shadow is reserved for things that float: toast, dialog. */
  --shadow-float: 0 2px 4px rgb(27 26 23 / 0.06), 0 12px 28px rgb(27 26 23 / 0.12);
  --motion: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Status: each text colour is >= 4.5:1 on its tint. Shared by every palette. */
  --success: #17663d;
  --success-bg: #e4f2e9;
  --warning: #855600;
  --warning-bg: #fbf0d3;
  --error: #ab2a1f;
  --error-bg: #fbe9e5;

  /* Paper & Forest — working direction */
  --bg: #fbfaf7;
  --surface: #f3f1ec;
  --surface-raised: #ffffff;
  --text: #1b1a17;
  --text-secondary: #5f5b52;
  --border: #e4e0d7;
  --border-strong: #8d887c; /* control outlines, >= 3:1 on --bg */
  --accent: #1f6f4a;
  --accent-hover: #17573a;
  --accent-subtle: #e3efe8;
  --on-accent: #ffffff;
  --focus: #1f6f4a;
}

/* Alternatives kept switchable until the colour decision is confirmed. */
[data-palette="indigo"] {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #16181d;
  --text-secondary: #5b616e;
  --border: #e3e5ea;
  --border-strong: #8b919d;
  --accent: #3b4cca;
  --accent-hover: #2f3da6;
  --accent-subtle: #eceefb;
  --focus: #3b4cca;
}
[data-palette="ember"] {
  --bg: #ffffff;
  --surface: #f4f5f6;
  --text: #14171a;
  --text-secondary: #566069;
  --border: #dfe3e6;
  --border-strong: #87909a;
  --accent: #b4451f;
  --accent-hover: #933718;
  --accent-subtle: #fbece6;
  --focus: #b4451f;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion: 0ms;
  }
}
