/* ============================================================
   tokens.css — design system: type, color, space, motion
   One source of truth. Per-chapter accents live in scenes.css.
   ============================================================ */

:root {
  /* ---- Type families (2026 editorial pairing) ---- */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Cascadia Mono", monospace;
  --font-hebrew: "Frank Ruhl Libre", "Frank Ruehl", serif;

  /* ---- Fluid type scale (clamps tuned 360px -> 1600px) ---- */
  --fs-mega:    clamp(3.6rem, 1.1rem + 11.2vw, 13rem);
  --fs-hero:    clamp(3rem,   1.4rem + 7.2vw, 8.5rem);
  --fs-h1:      clamp(2.5rem, 1.4rem + 5vw,   6rem);
  --fs-h2:      clamp(2rem,   1.3rem + 3.2vw, 4.25rem);
  --fs-h3:      clamp(1.35rem, 1rem + 1.6vw,  2.15rem);
  --fs-lead:    clamp(1.12rem, 0.98rem + 0.7vw, 1.55rem);
  --fs-body:    clamp(1rem,   0.96rem + 0.22vw, 1.18rem);
  --fs-small:   clamp(0.82rem, 0.78rem + 0.18vw, 0.95rem);
  --fs-eyebrow: clamp(0.72rem, 0.68rem + 0.14vw, 0.86rem);

  --lh-tight: 0.96;
  --lh-snug: 1.12;
  --lh-body: 1.72;

  --tracking-eyebrow: 0.34em;
  --tracking-tight: -0.02em;
  --tracking-mega: -0.035em;

  /* ---- Core palette (warm cinematic ink + paper) ---- */
  --ink-900: #060608;
  --ink-850: #0a0a0f;
  --ink-800: #0f0f16;
  --ink-700: #16161f;
  --ink-600: #1e1e2a;

  --paper:       #f5f0e7;
  --paper-dim:   rgba(245, 240, 231, 0.74);
  --paper-faint: rgba(245, 240, 231, 0.46);
  --paper-ghost: rgba(245, 240, 231, 0.12);
  --line:        rgba(245, 240, 231, 0.14);
  --line-soft:   rgba(245, 240, 231, 0.08);

  --gold:      #ecc178;
  --gold-soft: #f3d39a;
  --gold-deep: #c4923f;

  /* Default accents (overridden per chapter) */
  --accent:   var(--gold);
  --accent-2: #8fd4ff;
  --accent-ink: #0b0a07;
  --glow: rgba(236, 193, 120, 0.5);
  --scene-tint: rgba(236, 193, 120, 0.05);

  /* ---- Spacing & layout ---- */
  --gutter:      clamp(1.25rem, 4.5vw, 4.5rem);
  --section-pad: clamp(6rem, 13vh, 12rem);
  --content-max: 1320px;
  --wide-max:    1640px;
  --measure:     62ch;

  --radius-xs: 4px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* ---- Elevation ---- */
  --shadow-1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 30px 70px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 50px 120px rgba(0, 0, 0, 0.55);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.25s;
  --dur: 0.55s;
  --dur-slow: 0.9s;

  /* ---- Stacking layers ---- */
  --z-canvas: 0;
  --z-scene-bg: 1;
  --z-scene-mid: 2;
  --z-scene-fg: 4;
  --z-content: 5;
  --z-chrome: 40;
  --z-overlay: 90;
  --z-loader: 100;
}

/* Light, paper-forward variant for the contact close (optional hook) */
.is-paper {
  --accent-ink: #0b0a07;
}
