/* ============================================================
   TOKENS - the single source of truth for the visual language.
   Palette: the Hamptons coastline across one day.
   ============================================================ */

:root {
  /* Canvas - heavy linen paper, never pure white */
  --ivory: #fbf9f4;
  --linen: #f4f1e9;
  --mist: #e8e5dd;

  /* Ink */
  --navy: #14212e;
  --navy-soft: #2c3e50;
  --driftwood: #7d746d;

  /* Atmosphere */
  --seaglass: #a9bdb1;
  --champagne: #d9c7a7;
  --gold-hour: #e8b07d; /* rare: CTAs and focus moments only */

  /* Edge feather - supporting figures dissolve at the edges instead of
     sitting in a hard rectangle. Hero/full-bleed media never uses this. */
  --fig-mask: radial-gradient(ellipse farthest-corner at 50% 50%, #000 86%, transparent 100%);

  /* Theme slots - chapters flip these (see [data-theme="dusk"]) */
  --canvas: var(--ivory);
  --canvas-deep: var(--linen);
  --ink: var(--navy);
  --ink-soft: var(--navy-soft);
  --ink-faint: var(--driftwood);
  --hairline: rgba(20, 33, 46, 0.18);
  --ghost: rgba(20, 33, 46, 0.05);
  --veil: rgba(251, 249, 244, 0.72);

  /* Type - architectural scale contrast */
  --font-display: "Playfair Display", "Georgia", serif;
  --font-text: "Hanken Grotesk", "Helvetica Neue", sans-serif;

  --type-colossal: clamp(4.8rem, 13.5vw, 14rem);  /* one-word chapter titles */
  --type-display: clamp(3.25rem, 7.8vw, 7rem); /* chapter headlines */
  --type-headline: clamp(2.1rem, 4vw, 3.2rem);
  --type-quote: clamp(2rem, 4.6vw, 3.8rem);
  --type-body: clamp(1.125rem, 1.35vw, 1.375rem);
  --type-label: 0.875rem;

  /* Space - silence between beats */
  --beat: clamp(4rem, 10vh, 7.5rem);
  --margin-safe: clamp(1.5rem, 6vw, 5rem);
  --gutter: 2rem;

  /* Motion - everything glides, nothing snaps */
  --glide: cubic-bezier(0.22, 0.08, 0.14, 1);
  --drift: cubic-bezier(0.33, 0, 0.15, 1);
  --dur-breath: 700ms;
  --dur-settle: 500ms;
  --dur-whisper: 300ms;

  /* Scroll progress (0 → 1 per chapter), driven by js/progress.js */
  --p: 0;
}

/* Dusk - Chapter IV and the Invitation invert to night */
[data-theme="dusk"] {
  --canvas: #101c28;
  --canvas-deep: #0b1520;
  --ink: #f3efe6;
  --ink-soft: #d8d2c4;
  --ink-faint: #97a1ab;
  --hairline: rgba(243, 239, 230, 0.22);
  --ghost: rgba(243, 239, 230, 0.05);
  --veil: rgba(16, 28, 40, 0.66);
}
