/* ==========================================================================
   Design tokens — editorial system
   Neutral paper, single accent, wide typographic range, deliberate spacing.
   The layout must read correctly with the accent removed entirely.
   ========================================================================== */

:root {
  /* —— Surfaces —— */
  --color-bg: #f5f3ee;
  --color-paper: #fbfaf7;
  --color-ink: #30312d;
  --color-graphite: #201f1c;
  --color-muted: #77786f;
  --color-line: rgba(48, 49, 45, 0.16);
  --color-line-strong: rgba(48, 49, 45, 0.32);
  --color-on-dark: #f3f1ec;
  --color-muted-on-dark: rgba(243, 241, 236, 0.62);
  --color-line-on-dark: rgba(243, 241, 236, 0.2);

  /* —— Accent —— */
  --color-accent: #fd802e;
  --color-accent-ink: #30312d;
  --color-accent-secondary: #bcd0ce;

  /* —— Semantic aliases —— */
  --bg-page: var(--color-bg);
  --text-primary: var(--color-ink);
  --text-muted: var(--color-muted);

  /* —— Type scale (few steps; body is the reading floor) —— */
  --font-sans: 'Onest', 'Onest Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-display-xl: clamp(3rem, 0.65rem + 9.4vw, 7rem);
  --fs-display: clamp(2.35rem, 0.95rem + 5.6vw, 4.75rem);
  --fs-h2: clamp(1.85rem, 1.15rem + 2.8vw, 3.25rem);
  --fs-h3: clamp(1.4rem, 1.15rem + 1vw, 2rem);
  --fs-lead: clamp(1.1875rem, 1.08rem + 0.45vw, 1.375rem);
  --fs-body: clamp(1.0625rem, 1.01rem + 0.22vw, 1.125rem);
  --fs-meta: 1rem;
  --fs-label: 0.8125rem;

  --lh-display: 0.9;
  --lh-heading: 1.02;
  --lh-lead: 1.4;
  --lh-body: 1.55;

  --ls-display: -0.035em;
  --ls-heading: -0.028em;
  --ls-label: -0.01em;

  /* —— Spacing scale —— */
  --space-4xs: 0.375rem;
  --space-3xs: 0.625rem;
  --space-2xs: 1rem;
  --space-xs: clamp(1.25rem, 1rem + 0.9vw, 2rem);
  --space-s: clamp(1.75rem, 1.4rem + 1.3vw, 2.75rem);
  --space-m: clamp(2.75rem, 1.9rem + 3.2vw, 4.5rem);
  --space-l: clamp(5rem, 2.9rem + 7.8vw, 10rem);
  --space-xl: clamp(7rem, 3.4rem + 13vw, 15rem);

  /* —— Grid —— */
  --page-pad: clamp(1.25rem, 0.55rem + 2.8vw, 3rem);
  --container: 96rem;
  --gutter: clamp(1rem, 0.7rem + 1.2vw, 1.5rem);
  --measure: 34rem;
  --measure-narrow: 26rem;
  --header-height: 4.75rem;

  /* —— Shape: images and chapters are flat; only controls get a hint —— */
  --radius-ui: 2px;

  /* —— Motion —— */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration-base: 380ms;
  --duration-slow: 680ms;
}
