/* Design tokens: exactly DESIGN.md section 4. Color first, then type, space and motion.
   Dark values are declared twice so the theme toggle wins both ways:
   under prefers-color-scheme (unless the page is forced light) and under data-theme="dark". */

:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #fcfcfb;
  --ink: #161614;
  --ink-2: #4f4d48;
  --ink-3: #6e6b64;
  --hairline: #e2e0d8;
  --axis: #c2bfb4;
  --range: #cfc8b8;
  --range-edge: #857b68;
  --brand: #7b2230;
  --gain: #00897d;
  --loss: #c9541a;
  --neutral: #a29f98;
  --focus: #2457c5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e;
    --surface: #181817;
    --ink: #f0efea;
    --ink-2: #c4c2b8;
    --ink-3: #9a978e;
    --hairline: #2b2b29;
    --axis: #3a3a37;
    --range: #4d4840;
    --range-edge: #9c9484;
    --brand: #c06a74;
    --gain: #1aa393;
    --loss: #dc6a2e;
    --neutral: #62605a;
    --focus: #7fa8ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e;
  --surface: #181817;
  --ink: #f0efea;
  --ink-2: #c4c2b8;
  --ink-3: #9a978e;
  --hairline: #2b2b29;
  --axis: #3a3a37;
  --range: #4d4840;
  --range-edge: #9c9484;
  --brand: #c06a74;
  --gain: #1aa393;
  --loss: #dc6a2e;
  --neutral: #62605a;
  --focus: #7fa8ff;
}

:root {
  /* Faces */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale, phone values; desktop values swap in at 768px (base.css). size / line height */
  --t-display: 30px;  --lh-display: 34px;
  --t-h1: 24px;       --lh-h1: 30px;
  --t-h2: 20px;       --lh-h2: 26px;
  --t-body: 16px;     --lh-body: 24px;
  --t-small: 14px;    --lh-small: 20px;
  --t-micro: 12px;    --lh-micro: 16px;
  --track-micro: 0.06em;

  /* Space: 4px base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: 16px;
  --column: 1200px;
  --touch: 44px;

  /* Shape */
  --r-chip: 4px;
  --r-band: 4px;
  --r-card: 8px;

  /* Motion */
  --motion: 160ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 768px) {
  :root {
    --t-display: 46px;  --lh-display: 50px;
    --t-h1: 32px;       --lh-h1: 38px;
    --t-h2: 24px;       --lh-h2: 30px;
    --gutter: 32px;
  }
}

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