/* BeargrassPublishing tokens.
   3-mode toggle (paper / night / open). Locked 2026-05-03.
   Dawn was retired (accessibility floor unworkable).

   Paper = solid cream paper, ink type, sunrise-only-behind-hero.
   Night = SAME card structure as Paper, dark palette (lamplight),
           cream type. AAA contrast verified per swatch.
   Open  = no cards, cinematic full-bleed scenes, cream + warm type
           with text-shadow. The "showcase" mode.

   Token names stay the same across palettes so CSS rules reference
   tokens generically; only :root[data-mode="night"] swaps the values.
*/

:root,
:root[data-mode="paper"],
:root[data-mode="morning"] {
  --paper: #f4ebd7;
  --paper-elev: #efe4ca;
  --paper-tint: #ecdfc3;
  --ink: #231f1a;
  --ink-sec: #4d453c;
  --ink-ter: #776e62;
  --indigo: #2b4563;
  --barn: #a64b3b;
  --olive: #859160;
  --warm: #b88a3a;
  --rule: rgba(35, 31, 26, 0.14);
  --focus: #2b4563;
  color-scheme: light;
}

/* Night palette. Card surface darker than the page bg (#0a1024) so
   cards still read as elevated. Type and accent values lifted from
   the brand for AAA contrast against the dark surface. */
:root[data-mode="night"],
:root[data-mode="lamplight"] {
  --paper: #16212e;
  --paper-elev: #1d2a3a;
  --paper-tint: #0e1722;
  --ink: #f0e6cf;
  --ink-sec: #c9bea4;
  --ink-ter: #8a8170;
  --indigo: #87a8cf;
  --barn: #d77361;
  --olive: #aab98b;
  --warm: #d4a25a;
  --rule: rgba(240, 230, 207, 0.18);
  --focus: #d4a25a;
  color-scheme: dark;
}

/* Open mode reuses Paper tokens for any card-style content that does
   appear inside (tier cards, form panels, conversation bubbles), so
   structured content stays readable. Hero-band content treatment is
   handled in sunrise.css per .hero-band[data-mode="open"]. */
:root[data-mode="open"] {
  --paper: #f4ebd7;
  --paper-elev: #efe4ca;
  --paper-tint: #ecdfc3;
  --ink: #231f1a;
  --ink-sec: #4d453c;
  --ink-ter: #776e62;
  --indigo: #2b4563;
  --barn: #a64b3b;
  --olive: #859160;
  --warm: #b88a3a;
  --rule: rgba(35, 31, 26, 0.14);
  --focus: #2b4563;
  color-scheme: light;
}

:root {
  /* Cream that NEVER swaps with mode. Use this for surfaces that
     must stay cream regardless of palette (chrome wordmark/nav over
     dark sky, hero text over sunrise, conversation bubbles, scroll
     cue). var(--paper) flips to dark in Night mode and would render
     these invisible. */
  --cream-fixed: #f0e6cf;
  --ink-fixed: #231f1a;

  --sheen-duration: 8s;
  --type-display: "Fraunces", "Georgia", serif;
  --type-body: "Libre Caslon Text", "Georgia", serif;
  --type-ui: "Public Sans", system-ui, sans-serif;
  --serif: "Libre Caslon Text", Georgia, serif;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --fraunces: "Fraunces", Georgia, serif;
  --ui: "Public Sans", system-ui, sans-serif;

  /* Single grid for the whole site. */
  --w-read: 720px;
  --w-wide: 960px;
  --w-plate: 1200px;
  --w-chrome: var(--w-wide);
  --pad-x: clamp(1rem, 4vw, 2rem);

  /* Type scale. */
  --fs-xxs: 0.75rem;
  --fs-xs:  0.85rem;
  --fs-sm:  0.95rem;
  --fs-base: 1rem;
  --fs-md:  1.05rem;
  --fs-lg:  1.15rem;
  --fs-xl:  1.3rem;
  --fs-2xl: 1.45rem;
  --fs-3xl: 1.6rem;
  --fs-disp-sm: clamp(1.4rem, 3.2vw, 2.1rem);
  --fs-disp-md: clamp(1.8rem, 4.4vw, 3rem);
  --fs-disp-lg: clamp(2rem, 5vw, 3.4rem);

  /* Block spacing scale. */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.4rem;
  --sp-xs:  0.5rem;
  --sp-sm:  0.75rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 2.5rem;
  --sp-3xl: 3rem;
  --sp-4xl: 4rem;
  --sp-5xl: 6rem;

  /* Grid gap scale. */
  --gap-sm: 0.5rem;
  --gap-md: 1rem;
  --gap-lg: 1.5rem;
  --gap-xl: 2rem;

  /* Line-height scale. */
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-loose: 1.65;

  /* Tracking scale. */
  --ls-tight: -0.02em;
  --ls-none: 0;
  --ls-ui: 0.1em;
  --ls-wide: 0.2em;
  --ls-2xl: 0.22em;
}
