/* styles/tokens.css - redesign design tokens (custom properties only; inert until used). */

/* Monocraft (OFL, IdreesInc) - vendored for the hidden "tribute" font mode. See
   assets/fonts/OFL.txt. Only renders where applied (the footer tag, and the whole
   site when tribute mode is on via theme.js). */
@font-face {
  font-family: 'Monocraft';
  src: url('../assets/fonts/Monocraft.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* fonts (substitutable; single source of truth) */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* neutrals (graphite) */
  --bg: #0c0c0d;
  --text: #fafafa;
  --text-2: #cfd1d8;   /* secondary content text (values, table cells, list items) */
  --text-body: #8b8d96;
  --text-muted: #5d5f68;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.22);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.06);
  --surface-strong: #141418;
  --surface-strong-border: rgba(255, 255, 255, 0.10);
  --figure-edge: rgba(255, 255, 255, 0.10);

  /* accent (user-overridable) */
  --accent: #6b7cff;
  --accent-rgb: 107, 124, 255; /* same color as --accent, as an r,g,b triplet for rgba() */
  --accent-muted: rgba(var(--accent-rgb), 0.14);
  --accent-link: #9aa6ff;
  --link-ul: 0px; /* link underline width; the settings toggle sets it to 1px */
  --focus-ring: 2px solid rgba(var(--accent-rgb), 0.60);

  /* status */
  --warning: #e0b341;
  --warning-bg: rgba(224, 179, 65, 0.10);
  --warning-text: #f0c460;

  /* radii */
  --radius-xs: 3px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --radius-xl: 12px; --radius-pill: 999px;

  /* spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  /* motion */
  --dur-instant: 80ms; --dur-hover: 140ms; --dur-state: 200ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1); --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* containers */
  --container-narrow: 1100px; --container-default: 1200px;
  --container-wide: 1400px; --container-xl: 1560px;

  /* type scale (default = Balanced; density overrides below switch these) */
  --h1-size: 33px;   --h1-lh: 1.1;   --h1-track: -0.025em;
  --h2-size: 19px;   --h2-lh: 1.25;  --h2-track: -0.014em;
  --h3-size: 15px;   --h3-lh: 1.35;
  --body-size: 14.5px; --body-lh: 1.7;
  --lede-size: 15px; --lede-lh: 1.6;
}

/* Density overrides (user setting). Default (no attribute) = Balanced. Values from
   docs/design/mockups/type-scale.html. */
html[data-density="compact"] {
  --h1-size: 27px;   --h1-lh: 1.12;  --h1-track: -0.02em;
  --h2-size: 16px;   --h2-lh: 1.25;  --h2-track: -0.01em;
  --h3-size: 13.5px; --h3-lh: 1.3;
  --body-size: 13.5px; --body-lh: 1.6;
  --lede-size: 14px; --lede-lh: 1.55;
}
html[data-density="generous"] {
  --h1-size: 41px;   --h1-lh: 1.06;  --h1-track: -0.03em;
  --h2-size: 23px;   --h2-lh: 1.25;  --h2-track: -0.018em;
  --h3-size: 17px;   --h3-lh: 1.4;
  --body-size: 15.5px; --body-lh: 1.75;
  --lede-size: 16px; --lede-lh: 1.6;
}

/* On phones the 0.08 hairlines are hard to make out (smaller screen, glare). Strengthen the
   hairline tokens at phone widths so section rules, table borders, and figure edges stay legible. */
@media (max-width: 640px) {
  :root {
    --hairline: rgba(255, 255, 255, 0.14);
    --hairline-strong: rgba(255, 255, 255, 0.30);
  }
}

/* Tribute (Monocraft) mode: a pixel font reads better without the tightened heading
   tracking the sans scale uses. theme.js sets data-font when the mode is on. */
html[data-font="monocraft"] { --h1-track: 0; --h2-track: 0; }
