/* ===================================================================
   TOKENS — "Beechwood, last light"
   Every colour was contrast-checked. Ratios noted against the
   surface each token is actually used on.
   =================================================================== */

:root {
  /* --- Canopy & shadow -------------------------------------------- */
  --hollow:        #080C09;   /* deepest shadow, the forest floor at dusk */
  --canopy-deep:   #0E1A12;   /* primary page ground */
  --canopy:        #16281B;   /* raised surfaces, clearing floors */
  --moss:          #2C4A2E;   /* borders, dividers, inactive */
  --fern:          #4A7A46;   /* 3.90:1 — DECORATIVE / DISPLAY >=24px ONLY */

  /* --- Bark & earth ----------------------------------------------- */
  --loam:          #241B14;
  --bark-umber:    #3B2E22;
  --bark-silver:   #8B8578;   /* 4.87:1 on canopy-deep — AA body */

  /* --- Shafts of light -------------------------------------------- */
  --sun-core:      #FFE9B8;
  --sun:           #F2C46A;   /* 10.96:1 on canopy-deep — AAA */
  --amber:         #D99A3E;   /*  7.35:1 on canopy-deep — AAA */
  --ember:         #B06A2C;   /* non-text */

  /* --- Bioluminescence: the interactive accents -------------------- */
  --firefly:       #C8F05A;   /* 13.67:1 — Photinus flash, yellow-green */
  --foxfire:       #7BE8C4;   /* 12.07:1 — Panellus stipticus, foxfire */

  /* --- Ink --------------------------------------------------------- */
  --paper:         #F4EDE0;   /* 15.35:1 on canopy-deep */
  --paper-dim:     #C9C0AE;   /*  9.90:1 on canopy-deep — still AAA */

  /* --- THE KEYSTONE ------------------------------------------------
     One scalar, 0 → 1, written once per frame by engine.js.
     0 = low golden sun.  1 = blue hour, fireflies out.
     Everything below is a pure function of it.
     ---------------------------------------------------------------- */
  --dusk: 0;

  /* Ground colour walks from canopy-deep to hollow as the sun sets.
     oklab so the greens do not swing through mud on the way down. */
  --ground: color-mix(in oklab, var(--canopy-deep), var(--hollow) calc(var(--dusk) * 100%));


  /* Interactive accent warms up as the fireflies come out */
  --live: color-mix(in oklab, var(--amber), var(--firefly) calc(var(--dusk) * 100%));

  /* --- Type -------------------------------------------------------- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body:    "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-guide:   "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Fluid scale, perfect fourth at desktop, compressing to ~1.2 on mobile */
  --t-hero:  clamp(2.5rem, 1.1rem + 4.6vw, 6rem);
  --t-h2:    clamp(2rem,   1.25rem + 3.2vw, 4.25rem);
  --t-h3:    clamp(1.35rem, 1.1rem + 1.1vw, 2rem);
  --t-lead:  clamp(1.125rem, 1.02rem + 0.5vw, 1.5rem);
  --t-body:  clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem); /* never below 17px */
  --t-small: 0.9375rem;
  --t-guide: 0.6875rem;

  /* --- Space ------------------------------------------------------- */
  --gutter: clamp(1.25rem, 0.6rem + 3vw, 5rem);
  --measure: 62ch;
  --section-pad: clamp(6rem, 3rem + 14vw, 16rem);

  /* --- Motion ------------------------------------------------------ */
  --ease-settle: cubic-bezier(.16,.84,.28,1);   /* springy arrival */
  --ease-part:   cubic-bezier(.22,1,.28,1);     /* foliage parting */
  --dur-reveal: 1100ms;
}

/* Reduced motion: the sun simply stops moving. The site keeps its
   atmosphere, it just holds still at a good-looking hour. */
@media (prefers-reduced-motion: reduce) {
  :root { --dusk: 0.42; }
}
