/* ==========================================================================
   Design tokens — the single source of truth for the visual language.
   Neutrals dominate; the accent (#00508b) is reserved for actions and
   moments of emphasis. Nothing in component CSS may hardcode a value
   that exists here.
   ========================================================================== */

:root {
  /* ---- Type families ---- */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;

  /* ---- Fluid type scale ---- */
  --text-mega: clamp(3rem, 1.6rem + 6vw, 7.25rem);
  --text-display: clamp(2.75rem, 1.9rem + 3.4vw, 4.75rem);
  --text-h1: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  --text-h2: clamp(1.75rem, 1.45rem + 1.2vw, 2.5rem);
  --text-h3: clamp(1.3rem, 1.18rem + 0.5vw, 1.625rem);
  --text-h4: 1.125rem;
  --text-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.8125rem;

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-normal: 1.65;
  --tracking-tight: -0.021em;
  --tracking-wide: 0.09em;

  /* ---- Neutrals (faintly warm — paper and ink, not screen gray) ---- */
  --paper: #faf9f7;
  --surface: #ffffff;
  --gray-100: #f1efec;
  --gray-200: #e5e2dd;
  --gray-300: #d1cdc6;
  --gray-400: #a9a49b;
  --gray-500: #7c776e;
  --gray-600: #5a564e;
  --gray-700: #423f39;
  --gray-800: #2a2825;
  --gray-900: #1b1a18;

  --color-text: var(--gray-900);
  --color-text-secondary: var(--gray-600);
  --color-text-muted: var(--gray-500);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);

  /* ---- Primary accent (actions, links, brand) — used sparingly ---- */
  --accent: #00508b;
  --accent-strong: #003e6d;
  --accent-soft: #edf3f8;
  --accent-border: #c7d8e6;
  /* Legible accent for dark (ink) sections only */
  --accent-air: #9cc3e5;

  /* ---- Warm heritage accent (editorial highlight: numerals, marks,
     rules, tags). Non-interactive emphasis — never used for links or
     buttons, so the two accents never compete. ---- */
  --warm: #bd7d2c;
  --warm-strong: #9a6320;   /* small text on light — meets AA */
  --warm-soft: #f6efe2;     /* warm cream tint */
  --warm-air: #e0b06a;      /* legible on dark ink sections */
  --warm-faint: #efe6d6;    /* ghost numerals, faint fills */

  /* Warm paper surface for tint sections */
  --surface-warm: #f8f2e9;

  /* ---- Hairlines — the site's primary drawing tool ---- */
  --hairline: 1px solid var(--gray-200);
  --hairline-dark: 1px solid var(--gray-700);

  /* ---- Feedback ---- */
  --danger: #a4262c;
  --danger-soft: #fbf0f0;
  --success: #1a6b45;
  --success-soft: #eef6f1;

  /* ---- Space scale (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Fluid vertical rhythm for page sections */
  --section-y: clamp(4.5rem, 3.2rem + 5vw, 8.5rem);
  --section-y-sm: clamp(3rem, 2.4rem + 2.5vw, 5rem);

  /* ---- Layout ---- */
  --container: 72.5rem;        /* 1160px — default measure */
  --container-wide: 82rem;     /* 1312px — full grids, imagery */
  --container-prose: 42rem;    /* long-form reading measure */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* ---- Shape, elevation, motion ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(27 26 24 / 0.06);
  --shadow-md: 0 12px 32px -16px rgb(27 26 24 / 0.18);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 600ms;
}
