/* Habitat — Color system
   Independent Brief: paper, ink and a restrained gold accent.
   Existing token names remain compatible; chart ramps and scrims remain available. */
:root {
  /* ---- Base ink scale ---- */
  --ink: #17212B;        /* Headlines, rules, footer bars, full-bleed chapter fields */
  --ink-90: #353234;     /* Secondary panels within a dark spread */
  --ink-70: #58616A;     /* Captions, source lines, page numbers */
  --ink-50: #8A8687;     /* Footnotes, marginalia, eyebrows */
  --ink-25: #C7C4C3;     /* Muted strokes, disabled text */
  --ink-12: rgba(23, 33, 43, 0.12);  /* Hairline rules, dividers */
  --ink-07: rgba(23, 33, 43, 0.07);  /* Ledger row striping, subtle fills */
  --ink-04: rgba(23, 33, 43, 0.04);  /* Faintest wash */

  /* ---- Paper / surfaces ---- */
  --bg: #F6F5F0;            /* Default page background */
  --bg-surface: var(--gold-050); /* Warm sidebar / pull-quote / panel background */
  --bg-sunken: #E8E1D5;    /* Recessed wells, input fields */
  --print-paper: #FFFFFF;  /* White surface and print stock; compatibility name */

  /* ---- On dark (chapter openers, footer colophon) ---- */
  --on-dark: #F6F5F0;          /* Primary text on --ink */
  --on-dark-sec: #C7C4C3;      /* Secondary text on --ink */
  --on-dark-muted: #8A8687;    /* Eyebrows / captions on --ink */
  --on-dark-line: rgba(246, 245, 240, 0.16); /* Hairlines on --ink */

  /* ---- Borders ---- */
  --border: #C9CCC8;   /* Default hairline */
  --border-strong: var(--ink);         /* 1–2px structural rules */
  --border-faint: rgba(23, 33, 43, 0.08);

  /* ---- Gold ramp and action aliases ---- */
  --gold-900: #5A3C15; /* Deep gold for strong emphasis on light surfaces */
  --gold-700: #8A5D1F; /* Accessible links, active navigation and focus borders */
  --gold-500: #D1A056; /* Signal Gold: primary filled actions and small accents */
  --gold-200: #E9C991; /* Soft gold highlight */
  --gold-050: #FBF7EE; /* Warmest panel wash */
  --accent: var(--gold-500);
  --accent-strong: var(--gold-700);
  --accent-subtle: rgba(209, 160, 86, 0.10); /* Faint gold wash behind a stat/row */
  --accent-line: rgba(138, 93, 31, 0.5); /* Gold hairline, e.g. an active tab */
  --on-accent: var(--ink); /* Dark text/icon on solid Signal Gold */

  /* ---- Data viz ramp (solid grays, light → dark — stat circles, pie/donut slices, bar fills) ---- */
  --viz-1: #E4E1DE;   /* Lightest step */
  --viz-2: #C7C4C3;
  --viz-3: #9C9899;
  --viz-4: #706C6D;
  --viz-5: var(--ink); /* Darkest step — same ink as text, closes the ramp */

  /* ---- Image scrim (gradient overlay for text sitting over a photo) ---- */
  --scrim-bottom: linear-gradient(180deg, rgba(23,33,43,0) 45%, rgba(23,33,43,0.82) 100%); /* @kind color */
  --scrim-top: linear-gradient(0deg, rgba(23,33,43,0) 45%, rgba(23,33,43,0.7) 100%); /* @kind color */
  --scrim-full: linear-gradient(180deg, rgba(23,33,43,0.35) 0%, rgba(23,33,43,0.15) 40%, rgba(23,33,43,0.55) 100%); /* @kind color */

  /* ---- Semantic aliases ---- */
  --text-display: var(--ink);
  --text-body: var(--ink);
  --text-muted: var(--ink-70);
  --text-subtle: var(--ink-70);
  --surface-page: var(--bg);
  --surface-card: var(--bg);
  --surface-panel: var(--bg-surface);
  --surface-feature: var(--bg-sunken);
  --surface-white: var(--print-paper);
  --surface-dark: var(--ink);
  --rule: var(--border);
  --rule-strong: var(--border-strong);
}
