/* ============================================================================
   TOKENS — the whole visual language in one place.
   ========================================================================== */

:root{
  /* ── Paper & ground ─────────────────────────────────────────────────── */
  --ivory:        #FAF7F2;
  --ivory-warm:   #F7F1E8;
  --cream:        #F3EADD;
  --beige:        #EADFCD;
  --sand:         #DFCFB7;
  --linen:        #D6C3A8;

  /* ── Rose family ────────────────────────────────────────────────────── */
  --blush:        #F4DCD7;
  --blush-deep:   #EBC4BC;
  --rose:         #DFA098;
  --rose-mid:     #D28C83;
  --rose-deep:    #B9736A;
  --rose-ink:     #94564E;

  /* ── Earth & ink ────────────────────────────────────────────────────── */
  --brown:        #7A5B4B;
  --brown-soft:   #9A7C68;
  --ink:          #40302A;
  --ink-soft:     #6A574D;
  --ink-faint:    #9C8A80;

  /* ── Accents ────────────────────────────────────────────────────────── */
  --sage:         #A9B79C;
  --sage-deep:    #869473;
  --gold:         #C2A06A;
  --gold-soft:    #E0CBA4;

  /* ── Night ──────────────────────────────────────────────────────────── */
  --night:        #131A30;
  --night-deep:   #0B1020;
  --night-soft:   #23305A;
  --star:         #FFF4E2;

  /* ── Semantic ───────────────────────────────────────────────────────── */
  --bg:           var(--ivory);
  --fg:           var(--ink);
  --muted:        var(--ink-soft);
  --rule:         color-mix(in oklab, var(--linen) 62%, transparent);

  /* ── Type ───────────────────────────────────────────────────────────── */
  --f-script: 'Parisienne', 'Segoe Script', cursive;
  --f-hand:   'Caveat', 'Segoe Script', cursive;
  --f-serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-sans:   'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;

  /* Fluid display scale. Parisienne runs tall and loose, so the display
     sizes are held well below what a serif could take at the same measure. */
  --t-mega:   clamp(3.1rem, 6.6vw,   7.4rem);
  --t-xl:     clamp(2.3rem, 4.1vw,   4.4rem);
  --t-lg:     clamp(1.9rem, 3.1vw,   3.2rem);
  --t-md:     clamp(1.4rem, 2.0vw,   2.0rem);
  --t-body:   clamp(0.95rem, 1.02vw, 1.08rem);
  --t-small:  0.8rem;
  --t-eyebrow:0.68rem;

  /* ── Space ──────────────────────────────────────────────────────────── */
  --gut:      clamp(1.25rem, 4vw, 4.5rem);
  --sect:     clamp(4.5rem, 9vh, 7.5rem);
  --maxw:     1440px;
  --rail:     190px;                 /* right-hand chapter index width */

  /* ── Depth — soft, warm, never grey ─────────────────────────────────── */
  --sh-xs:  0 1px 2px rgba(84,58,44,.06);
  --sh-sm:  0 2px 6px rgba(84,58,44,.07), 0 1px 2px rgba(84,58,44,.05);
  --sh-md:  0 10px 24px -10px rgba(84,58,44,.20), 0 3px 8px rgba(84,58,44,.07);
  --sh-lg:  0 26px 60px -22px rgba(84,58,44,.30), 0 8px 20px -10px rgba(84,58,44,.14);
  --sh-xl:  0 50px 100px -34px rgba(84,58,44,.38), 0 14px 34px -16px rgba(84,58,44,.18);
  --sh-lift:0 40px 80px -26px rgba(84,58,44,.34), 0 10px 24px -12px rgba(84,58,44,.16);
  --glow-rose: 0 0 0 1px rgba(223,160,152,.22), 0 18px 44px -20px rgba(185,115,106,.45);

  /* ── Motion ─────────────────────────────────────────────────────────── */
  --e-out:  cubic-bezier(.16,1,.3,1);
  --e-soft: cubic-bezier(.32,.72,.22,1);
  --e-back: cubic-bezier(.34,1.56,.44,1);
  --d-fast: .28s;
  --d-mid:  .55s;
  --d-slow: 1.05s;

  /* ── Radius ─────────────────────────────────────────────────────────── */
  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 34px;
  --r-pill: 999px;
}

/* Sections can locally re-theme; everything inherits from these two. */
[data-theme="night"]{
  --bg: var(--night);
  --fg: #EDE3D4;
  --muted: #A9B3CE;
  --rule: rgba(190,205,240,.16);
}
