/* tokens.css: single source of truth for Reinforced Knowledge.
   All other CSS references these custom properties. Never hardcode a color,
   spacing value, font size, radius, shadow, or motion timing outside this file. */

:root {

  /* COLOR */

  /* Neutrals (hue ~340°, very low chroma) */
  --bg-0:     oklch(14% 0.012 340);
  --bg-1:       oklch(19% 0.014 340);
  --bg-2:  oklch(24% 0.016 340);
  --fg-0:        oklch(92% 0.006 340);
  --fg-1:   oklch(78% 0.008 340);
  --fg-2:     oklch(58% 0.012 340);
  --border-0:  oklch(28% 0.014 340);

  /* Warm accent (hue ~340°) */
  --accent-warm:        oklch(70% 0.18 340);
  --accent-warm-soft:   oklch(78% 0.12 340);
  --accent-warm-deep:   oklch(55% 0.20 340);

  /* Cool accent (hue ~155°) */
  --accent-cool:        oklch(82% 0.17 155);
  --accent-cool-soft:   oklch(88% 0.10 155);
  --accent-cool-deep:   oklch(68% 0.18 155);

  /* ELEVATION: colored glows (no grey drop shadows) */

  --glow-warm-low:  0 0 16px 0 oklch(70% 0.18 340 / 0.45);
  --glow-warm:      0 0 32px 0 oklch(70% 0.18 340 / 0.65);
  --glow-cool-low:     0 0 16px 0 oklch(82% 0.17 155 / 0.40);
  --glow-cool:         0 0 32px 0 oklch(82% 0.17 155 / 0.55);

  --focus-ring-color:  var(--accent-warm);
  --focus-ring-width:  2px;
  --focus-ring-offset: 3px;

  /* TYPOGRAPHY */

  --font-display: "Departure Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif:   "IBM Plex Serif", "Iowan Old Style", "Source Serif Pro", Georgia, serif;

  /* Type scale (perceptual; ~1.25 ratio between adjacent steps) */
  --fs-display:   clamp(2.25rem, 4vw + 0.75rem, 3.5rem);
  --fs-headline:  clamp(1.5rem, 2vw + 0.75rem, 2rem);
  --fs-title:     clamp(1.125rem, 0.75vw + 0.9375rem, 1.375rem);
  --fs-body:      clamp(1rem, 0.25vw + 0.9375rem, 1.0625rem);
  --fs-label:     0.8125rem;
  --fs-caption:   0.75rem;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;

  --lh-tight:  1.1;
  --lh-snug:   1.25;
  --lh-prose:  1.7;
  --lh-loose:  1.85;

  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-loose:   0.08em;

  /* Measure (line length caps) */
  --measure-narrow: 60ch;
  --measure-prose:  68ch;
  --measure-wide:   78ch;

  /* LAYOUT */

  /* Spacing scale (~1.5 ratio for rhythm) */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.25rem;
  --space-xl:  3.5rem;
  --space-2xl: 5.5rem;
  --space-3xl: 8rem;

  /* Radii: subtle, geometric */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* MOTION (ease-out curves only; no bounce, no elastic) */

  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

  --duration-instant: 80ms;
  --duration-fast:    160ms;
  --duration-base:    240ms;
  --duration-slow:    400ms;

  /* Z-INDEX (named, not magic numbers) */

  --z-base:    1;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   1000;
  --z-toast:   10000;
}

/* Honor reduced motion at the token level so durations collapse globally */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast:    0ms;
    --duration-base:    0ms;
    --duration-slow:    0ms;
  }
}
