/* gdr-tokens.css: the GDR surface palette and type scale, in one place.
 *
 * Derived 2026-08-25 from pulsefund.com, measured in a rendered browser rather
 * than eyeballed: a warm bone ground (#F4F3F3), a single clay accent used
 * almost everywhere (#95625A, 1244 occurrences on their home page), near-black
 * text (#333), light-weight display type, uppercase micro-kickers, and a
 * twelve-word lede. The Institute sits alongside Pulse, so the surfaces should
 * read as relatives.
 *
 * Two deliberate departures, both measured:
 *
 *   1. Their accent scores 4.54 against their own ground, which is under the
 *      4.5 floor once it sits on a tinted panel. They use it large and at
 *      weight 300, where the graphical 3:1 floor applies instead. Ours has to
 *      survive an 11px link, so the day accent is darkened to #8A4F44, which
 *      clears 4.5 on every surface in the set.
 *   2. Pulse is light only. This carries a night palette built from the same
 *      hues inverted, because a gated working surface gets read at night.
 *
 * Token names match what the GDR pages already use, so a surface adopts this
 * by linking it and deleting its own :root and [data-theme="day"] blocks.
 * Nothing else has to change.
 *
 * Theme contract, shared with nav.js and theme-toggle.js: data-theme on the
 * documentElement, "day" or "dark", persisted at astraeus.pm.theme. Night is
 * the default so an unstyled first paint is never white.
 */

:root {
  /* night, the default */
  --abyss:#17130F; --mid:#211B17; --deep:#2C2420;
  --signal:#D9A08E; --model:#93B0C7; --life:#E0B36B; --loss:#D98BA4;
  --eco:#D9A08E; --soc:#E0B36B; --cap:#93B0C7;
  --text:#F2ECE7; --muted:#B3A49C; --faint:#978880;
  --line:rgba(217,160,142,0.16); --line-strong:rgba(217,160,142,0.32);

  /* Their pairing is a light transitional SERIF for statements (TT
     Rationalist) against a neo-grotesque for everything else (Atlas Grotesk).
     Both are licensed. Newsreader is the nearest serif on Google Fonts with a
     300 weight; Inter carries the grotesque role. Mono stays for data labels,
     which are our vocabulary rather than theirs. */
  --display:'Newsreader',Georgia,'Times New Roman',serif;
  --sans:'Inter',system-ui,-apple-system,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  --serif:var(--display);

  --maxw:1080px;

  /* the type scale, from their measurements: a light large headline, a
     generous lede, and a kicker that is bigger and looser than ours was */
  --t-h1:clamp(34px,5.2vw,54px);
  --t-h2:27px;
  --t-lede:19px;
  --t-body:15.5px;
  --t-kicker:11.5px;
  --ls-kicker:0.14em;
  --w-display:300;
}

[data-theme="day"] {
  /* Deepened 2026-08-25. The first cut sat at #F4F3F3 / #ECEAE9 / #E2DEDC,
     which put a card at 1.08 against its own page: technically correct
     against Pulse's ground and visually shallow, because on their site the
     weight comes from dark clay tiles, not from the panels. These surfaces
     are warmer and further apart (1.16 and 1.36), the rules are heavier, and
     the accent is deeper so it still clears 4.5 on the deepest panel. */
  --abyss:#F5F2F0; --mid:#E9E1DC; --deep:#DCD0C8;
  --signal:#7E4740; --model:#41566A; --life:#6F5017; --loss:#7F384F;
  --eco:#7E4740; --soc:#6F5017; --cap:#41566A;
  --text:#2E2A28; --muted:#5F5552; --faint:#635955;
  --line:rgba(60,42,34,0.20); --line-strong:rgba(60,42,34,0.40);
}

/* The Institute palette, added 2026-09-26 for pages the GDR Institute shows
   in its own colours (gdrinstitute.org, direction E: forest ground, sand
   text, forest-2 panels). A page opts in with data-palette="institute" on
   <html>; it overrides both themes and prints as the day theme. */
:root[data-palette="institute"], :root[data-palette="institute"][data-theme="day"] {
  --abyss:#0E3128; --mid:#1E464F; --deep:#0B2620;
  --signal:#CEC1A6; --model:#B9A98B; --life:#E4D9C2; --loss:#9A4A38;
  --eco:#3F6A4C; --soc:#8A6520; --cap:#3F5E7D;
  --text:#E4D9C2; --muted:#B9A98B; --faint:rgba(185,169,139,0.72);
  --line:rgba(185,169,139,0.26); --line-strong:rgba(185,169,139,0.5);
}

/* The Island Lab palette, added 2026-10-03 for kit pages that are Island
   Lab's own (first case: /bellingham). The grounds, text and accents are the
   platform hub's dark-ocean tokens (hub.html); muted and faint are lifted so
   small labels clear 4.5 on the deepest panel, and the day accents are
   deepened for the same reason. A page opts in with data-palette="islandlab"
   on <html>; both themes are defined, and print falls to ink on white. */
:root[data-palette="islandlab"] {
  --abyss:#06151A; --mid:#091F24; --deep:#0C2A30;
  --signal:#5EE6C8; --model:#8AA9C2; --life:#E6B567; --loss:#E88A9A;
  --eco:#5EE6C8; --soc:#E6B567; --cap:#8AA9C2;
  --text:#E8F0EE; --muted:#9DB5B3; --faint:#7F9998;
  --line:rgba(133,170,168,0.16); --line-strong:rgba(133,170,168,0.32);
}
:root[data-palette="islandlab"][data-theme="day"] {
  --abyss:#E6EBEA; --mid:#DDE4E2; --deep:#D4DCDB;
  --signal:#086453; --model:#3A5A72; --life:#7A5510; --loss:#8E3348;
  --eco:#086453; --soc:#7A5510; --cap:#3A5A72;
  --text:#0E2227; --muted:#3D5957; --faint:#48625F;
  --line:rgba(20,60,58,0.18); --line-strong:rgba(20,60,58,0.36);
}
@media print {
  :root[data-palette="islandlab"], :root[data-palette="islandlab"][data-theme="day"] {
    --abyss:#fff; --mid:#fff; --deep:#fff;
    --signal:#086453; --model:#3A5A72; --life:#7A5510; --loss:#8E3348;
    --eco:#086453; --soc:#7A5510; --cap:#3A5A72;
    --text:#111417; --muted:#3d4a48; --faint:#5a6a68;
    --line:rgba(0,0,0,0.22); --line-strong:rgba(0,0,0,0.4);
  }
}

@media print {
  :root {
    --abyss:#fff; --mid:#fff; --deep:#fff;
    --signal:#8A4F44; --model:#4A5F72; --life:#8A6520; --loss:#8C3F58;
    --eco:#8A4F44; --soc:#8A6520; --cap:#4A5F72;
    --text:#111417; --muted:#3d4a48; --faint:#5a6a68;
    --line:rgba(0,0,0,0.22); --line-strong:rgba(0,0,0,0.4);
  }
}
