/* ============================================================================
   Mentrel site palette: the one place the public site's colour tokens live.
   Linked by the homepage and every guide (before article.css), so a colour fix
   lands once and the two surfaces can't drift apart. Page-specific layout and
   components stay in each page / in article.css; only shared tokens go here.

   Identity from CLAUDE.md: accent green #7edf75, ink #0E1014, off-white #ECEEF1,
   muted #9298A3. The accent is a FILL colour: on the light ground it fails
   contrast as text, so green text uses --link, which is tuned per theme.

   Theme resolution (theme.js owns the toggle): the OS preference applies unless
   the viewer picked one, which theme.js stamps on <html> as data-theme. Hence
   the dark block appears twice: once under the media query (guarded so a saved
   "light" wins), once for an explicit data-theme="dark".
   ============================================================================ */

:root {
  /* light palette (also the un-stamped default) */
  color-scheme: light;     /* native scrollbars and controls follow the theme */
  --bg:        #F4F6F2;   /* page ground, faint green-neutral bias */
  --surface:   #FFFFFF;   /* raised cards, callouts */
  --surface-2: #EEF1EB;   /* inset tint */
  --text:      #171A1F;
  --text-soft: #4C525C;
  --muted:     #6B7280;
  --line:      rgba(14,16,20,.13);
  --line-soft: rgba(14,16,20,.07);
  --accent:    #7edf75;   /* brand green, used as fill / rule / highlight */
  --accent-ink:#0E1014;   /* text on the accent */
  --link:      #1C7A45;   /* deep green, accessible link text on light */
  --redact:    rgba(14,16,20,.16);  /* redacted-name bars in illustrations */
  --term-bg:   #0E1014;   /* terminal / log blocks stay dark on light paper */
  --term-text: #E7EBE6;
  --term-dim:  #7f8a86;
  --code-bg:   #EAEEE6;
  --code-text: #22321f;
  --shadow:    0 1px 2px rgba(14,16,20,.05), 0 8px 30px rgba(14,16,20,.06);
  --measure:   39rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0E1014;
    --surface:   #161A20;
    --surface-2: #1B2027;
    --text:      #ECEEF1;
    --text-soft: #BAC0CA;
    --muted:     #9298A3;
    --line:      rgba(255,255,255,.13);
    --line-soft: rgba(255,255,255,.07);
    --accent:    #7edf75;
    --accent-ink:#0E1014;
    --link:      #8fe486;
    --redact:    rgba(255,255,255,.2);
    --term-bg:   #05070A;
    --term-text: #E7EBE6;
    --term-dim:  #6f7a76;
    --code-bg:   #1D232B;
    --code-text: #cfe9cb;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 34px rgba(0,0,0,.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0E1014;
  --surface:   #161A20;
  --surface-2: #1B2027;
  --text:      #ECEEF1;
  --text-soft: #BAC0CA;
  --muted:     #9298A3;
  --line:      rgba(255,255,255,.13);
  --line-soft: rgba(255,255,255,.07);
  --accent:    #7edf75;
  --accent-ink:#0E1014;
  --link:      #8fe486;
  --redact:    rgba(255,255,255,.2);
  --term-bg:   #05070A;
  --term-text: #E7EBE6;
  --term-dim:  #6f7a76;
  --code-bg:   #1D232B;
  --code-text: #cfe9cb;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 34px rgba(0,0,0,.35);
}
