/* The Union Trilogy — Color · v2.1
   Board and paper carry every layout. RED IS THE ONLY TRUE ACCENT:
   one line, one marker headline, one call to action at a time. Never flood a layout with red.
   Carbon is the WORKING colour, not a voice and not a second accent — it takes the routine
   jobs red was being asked to do (labels, links, quiet fills, document type) so that red
   stays rare enough to still mean something. */
:root {
  /* ---- Core: surfaces & ink ---- */
  --board-black: #1B1612;   /* primary site background (warm near-black) */
  --charcoal:    #2C2520;   /* panels, cards, form fields, raised surfaces */
  --charcoal-deep:#241E1A;  /* recessed card wells on the board */
  --map-cream:   #ECE2CD;   /* paper fields, light cards, the "map" */
  --chalk-bone:  #F3EEE2;   /* headlines & ink on dark */
  --signal-red:  #C33027;   /* the line, marker headlines, button fills — LARGE ONLY, never <24px */
  --bright-red:  #E4594C;   /* SMALL red text on DARK only — bold. 5.0:1 on board-black */
  --deep-red:    #8A241C;   /* SMALL red text on CREAM only — bold. 6.9:1. Also "Out Now" fill */

  /* ---- The three book boards (v2.0) — sampled from the finished artwork ----
     Each book's page, section, and any marketing carrying that book uses ITS OWN board.
     The field is per book, NOT board-black. The board warms and lightens fracture -> repair. */
  --board-slate: #233136;   /* Divided Houses  · Book One */
  --board-blue:  #414953;   /* Silent Tables   · Book Two */
  --board-olive: #464E40;   /* Open Doors      · Book Three */

  /* ---- The case file: document surfaces & the working colour (v2.0, § 02.5) ----
     Extension, not a cover sample: carbon violet comes from the period, not the artwork. */
  --manila:        #C9B283; /* document surfaces: exhibits, folders, tape labels */
  --kraft:         #B08A5A; /* torn paper, folder edges, stacked-document underside. NEVER text */
  --carbon-violet: #4A4E6E; /* the working fill: buttons that aren't THE button, wells, document type on cream. 6.96:1 under bone */
  --carbon-ribbon: #8B90B8; /* the working text colour on DARK — labels, kickers, links. 4.87:1 on charcoal */

  /* ---- Ransom: the cut-letter palette (TITLES ONLY) ----
     Superseded wherever real scanned cut letters exist. Whole word or nothing. */
  --slate-gray:  #8F8A83;
  --faded-blue:  #6E8FAD;
  --navy-ink:    #283443;
  /* deep-red and cut-white(=chalk-bone) also participate in ransom titles */
  --cut-white:   #F3EEE2;

  /* ---- Material & text tones ---- */
  --masking-tan: #C4A06A;   /* tape / kraft band patches */
  --rule-blue:   #BCCAD8;   /* notebook horizontal rules */
  --faded-cream: #C9BDA4;   /* body copy on dark */
  --muted-tan:   #9B9079;   /* meta / secondary captions — nothing under 14px */

  /* ---- Semantic aliases (build components from these, not raw hex) ---- */
  --bg:               var(--board-black);
  --surface-card:     var(--charcoal);
  --surface-well:     var(--charcoal-deep);
  --surface-paper:    var(--map-cream);
  --surface-document: var(--manila);             /* a thing lying ON the board, not a page field */
  --surface-input:    #F6F0E2;                   /* cream input field */

  --text-heading:     var(--chalk-bone);
  --text-body:        var(--faded-cream);
  --text-body-muted:  #B6AA91;
  --text-meta:        var(--muted-tan);
  --text-on-paper:    #2C2520;
  --text-on-paper-muted:#5A4F40;
  --text-on-document: var(--charcoal);           /* 7.31:1 on manila */
  --text-on-board:    var(--map-cream);          /* the ONLY safe ink on slate/blue/olive */

  --accent:           var(--signal-red);         /* large red: line / headline / CTA */
  --accent-text:      var(--bright-red);         /* small red text on dark (bold) */
  --accent-text-paper:var(--deep-red);           /* small red text on cream (bold) */
  --accent-fill-deep: var(--deep-red);           /* status fill */

  --accent-secondary:      var(--carbon-violet); /* carbon fills/wells on light */
  --accent-secondary-text: var(--carbon-ribbon); /* small carbon text on dark */

  /* Routine UI colour (v2.1) — use these, not red, for anything that is not
     the line, the marker headline, the one call to action, or the Out Now stamp. */
  --text-label:  var(--carbon-ribbon);           /* section labels, kickers, meta on dark */
  --text-link:   var(--carbon-ribbon);           /* inline & nav links on dark */
  --fill-quiet:  var(--carbon-violet);           /* secondary buttons, wells, tags */

  --line-section:     rgba(201,189,164,0.16);    /* 1px section divider */
  --line-hairline:    rgba(201,189,164,0.18);    /* card / panel hairline */
  --line-soft:        rgba(201,189,164,0.45);    /* secondary-button border */
  --border-input:     #B3A684;                   /* cream-input border */

  --selection-bg:     var(--signal-red);
  --selection-fg:     var(--chalk-bone);
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* ---- Per-book board scoping ----
   Put one of these on the section or page that carries a book. It swaps the field and
   forces ink to cream, because SMALL RED IS ILLEGIBLE on board-blue (2.5:1) and
   board-olive (2.3:1) — on those two fields the red is the LINE and only the line,
   and the line must never be thinner than 4px or the sole carrier of information. */
.us-board--slate { background: var(--board-slate); color: var(--text-on-board); }
.us-board--blue  { background: var(--board-blue);  color: var(--text-on-board); }
.us-board--olive { background: var(--board-olive); color: var(--text-on-board); }
.us-board--blue  .us-small-red,
.us-board--olive .us-small-red { color: var(--chalk-bone); }

/* Contrast floor, verified against WCAG 2.2 AA — do not re-derive by eye:
   map-cream/board-black 15.0 · /slate 10.4 · /blue 6.8 · /olive 6.5
   bright-red/board-black 5.0 (use) · /slate 3.8 (large) · /blue 2.5 FAIL · /olive 2.3 FAIL
   signal-red/board-black 3.2 (large display only) · /map-cream 4.3 (large only) · /manila 2.70 FAIL
   deep-red/map-cream 6.9 (use) · /manila 4.33 (stamp only — large by definition)
   chalk-bone/signal-red 5.4 (how a red button is built)
   chalk-bone/carbon-violet 6.96 (how a carbon button is built)
   carbon-violet/map-cream 6.26 · /manila 3.91 (large only) · /kraft 2.54 FAIL
   carbon-ribbon/charcoal 4.87 · /board-black 5.79
   charcoal/manila 7.31 · manila/board-black 8.70 */
