/* tones.css — δ1 Tonal CSS system + δ2 Real dark mode + δ3 Time-of-day hooks
 *
 * Per DESIGN_ROADMAP.md Phase δ (lines ~268-339) + Claude Code directive
 * Track 6 / batch-3 (2026-05-28). 4 tones × {light, dark} × optional time-of-day,
 * each tone a *complete suite* of 16+ tokens — not just an accent swap.
 *
 * Namespace: every token is `--tone-*` to avoid colliding with motion.css's
 * `--motion-*` and with the existing per-site `--paper / --ink / --accent`
 * tokens already in use across the 19 placeholder sites and the 3 PNN
 * deploys. Sites that want a tone *layer it on top of* their category palette
 * by adding `data-tone="..."` to <html> — the tone tokens become available
 * for use in custom CSS (e.g. `color: var(--tone-ink-base)`) without
 * disturbing the site's existing styles.
 *
 * Token suite per tone (and per [data-color-scheme="dark"] override):
 *   --tone-bg-base, --tone-bg-elevated, --tone-bg-recessed
 *   --tone-ink-strong, --tone-ink-base, --tone-ink-muted, --tone-ink-faint
 *   --tone-accent, --tone-accent-hover, --tone-accent-faint
 *   --tone-border-strong, --tone-border-soft
 *   --tone-link, --tone-link-hover, --tone-link-visited
 *   --tone-pull-quote-rule
 *   --tone-callout-bg, --tone-callout-border
 *
 * The 4 tones:
 *   editorial — broadsheet feel; long-form journalism (deep editorial red,
 *               warm cream ground, 400/600 body weights — avoids 700 newsprint set)
 *   warm      — family-first; advocacy interfaces (umber accent, paper ground, soft borders)
 *   advocacy  — institutional trust; 501(c)(4) + locator (institutional teal, crisp rules)
 *   archive   — research / foundation; slow read (linen ground, graphite accent,
 *               optional mono fallback via [data-archive-mono="true"])
 *
 * Adoption (opt-in, per-site, backward compatible):
 *   <html data-tone="warm">
 *     <head>
 *       <link rel="stylesheet" href="/tones.css">
 *     </head>
 *
 * Dark mode:
 *   - Automatic via @media (prefers-color-scheme: dark) — the page respects the OS.
 *   - Explicit override via [data-color-scheme="dark"] or [data-color-scheme="light"]
 *     on <html>. The explicit attribute wins (cascade order below).
 *   - Dark tokens preserve the *character* of the tone — not a hacked inversion.
 *     Editorial dark = reading by lamplight (deep warm grays #1c1a17 family).
 *     Advocacy dark  = cool deep grays (#161a1c family).
 *     Warm dark      = tobacco on warm-dark (#1f1c17 family).
 *     Archive dark   = paper-fade against #1d1c18.
 *
 * Time of day (δ3, opt-in only via tones.js):
 *   - Script sets [data-time="deep-night|morning|midday|golden|evening"] on <html>.
 *   - Optional time-aware blocks (e.g. [data-tone="editorial"][data-time="deep-night"])
 *     swap a small handful of tokens — warmer accents at night, cooler at midday.
 *   - The script is *inert* unless the host page opts in:
 *       <script src="/tones.js" data-tones-time="enable" defer></script>
 *     Without that data attribute the file loads and does nothing.
 *
 * Accent discipline (δ4, host-page responsibility): use --tone-accent in
 * exactly ONE place per page (eyebrow, OR active nav indicator, OR one
 * pull-quote, OR one key stat). Two accents on screen at once destroys the
 * wayfinding effect.
 *
 * WCAG AA contrast: every introduced fg/bg pair documented in inline
 * comments below and in tones-README.md. Normal text ≥4.5:1; large/UI ≥3:1.
 * `--tone-ink-faint` is intentionally below 4.5:1 in some tones — it is
 * documented as LARGE-TEXT / decorative / sidenote use only.
 *
 * Reduced motion (γ2): tones do NOT animate. Time-of-day swaps are
 * straight CSS variable substitutions with no transition. Safe.
 *
 * Last revised: 2026-05-28 (Claude Code batch-3 tones subagent).
 */


/* ============================================================================
 *  δ0 · No-tone default — invisible fallback
 *
 *  A site that loads tones.css but does NOT set `data-tone` gets neutral
 *  values that don't mutate any existing styles. Each token is documented
 *  for any custom CSS that wants to consume tokens without committing to
 *  a tone.
 * ========================================================================== */

:root {
  /* Light-mode no-tone fallback (neutral; do not match any specific tone) */
  --tone-bg-base:         #ffffff;
  --tone-bg-elevated:     #fafafa;
  --tone-bg-recessed:     #f3f3f3;

  --tone-ink-strong:      #0a0a0a;
  --tone-ink-base:        #1a1a1a;
  --tone-ink-muted:       #555555;
  --tone-ink-faint:       #777777;          /* large-text / decorative only */

  --tone-accent:          #1a1a1a;          /* deliberately ink — no color until tone applied */
  --tone-accent-hover:    #000000;
  --tone-accent-faint:    rgba(26, 26, 26, 0.10);

  --tone-border-strong:   #c8c8c8;
  --tone-border-soft:     #e5e5e5;

  --tone-link:            #1a1a1a;
  --tone-link-hover:      #000000;
  --tone-link-visited:    #4a4a4a;

  --tone-pull-quote-rule: #c8c8c8;

  --tone-callout-bg:      #f7f7f7;
  --tone-callout-border:  #d8d8d8;
}


/* ============================================================================
 *  δ1 · The four tones (light mode)
 *
 *  Apply via:  <html data-tone="editorial">  (or warm | advocacy | archive)
 *
 *  Contrast notes inline per token; full table in tones-README.md.
 * ========================================================================== */


/* ---------- Editorial — broadsheet feel, deep editorial red, warm cream ---- */
[data-tone="editorial"] {
  --tone-bg-base:         #fafaf7;           /* warm cream */
  --tone-bg-elevated:     #f3efe6;           /* paper-1 (matches PNN paper) */
  --tone-bg-recessed:     #ebe5d8;           /* paper-2 */

  --tone-ink-strong:      #0e0e0e;           /* AA: 18.46:1 on bg-base */
  --tone-ink-base:        #1a1a1a;           /* AA: 16.64:1 on bg-base — body */
  --tone-ink-muted:       #525252;           /* AA: 7.47:1 on bg-base */
  --tone-ink-faint:       #6e6e6e;           /* AA: 4.88:1 on bg-base */

  --tone-accent:          #8b1818;           /* deep editorial red — byline rules, run-in heads */
  --tone-accent-hover:    #6f1313;           /* AA: 11.29:1 on bg-base */
  --tone-accent-faint:    rgba(139, 24, 24, 0.10);

  --tone-border-strong:   #c8c0ad;           /* broadsheet rule color */
  --tone-border-soft:     #ddd5c4;

  --tone-link:            #7a1717;           /* AA: 10.23:1 — body-safe link */
  --tone-link-hover:      #581010;
  --tone-link-visited:    #5a3030;

  --tone-pull-quote-rule: #8b1818;           /* match accent for the one quote per page */

  --tone-callout-bg:      #f3eee0;           /* sidenote ground — sits between bg-base and bg-recessed */
  --tone-callout-border:  #c8c0ad;
}


/* ---------- Warm — family-first, umber accent, paper ground -------------- */
[data-tone="warm"] {
  --tone-bg-base:         #f5f1ea;           /* paper */
  --tone-bg-elevated:     #ede4cf;           /* paper-1 */
  --tone-bg-recessed:     #e0d6bd;           /* paper-2 */

  --tone-ink-strong:      #171513;           /* AA: 16.18:1 on bg-base */
  --tone-ink-base:        #262320;           /* warm black — AA: 13.88:1 */
  --tone-ink-muted:       #5a544b;           /* AA: 6.65:1 */
  --tone-ink-faint:       #6e6757;           /* AA: 4.99:1 — body-safe */

  --tone-accent:          #8a5e22;           /* umber, gentle, person-first — AA: 5.03:1 */
  --tone-accent-hover:    #6f4a1a;
  --tone-accent-faint:    rgba(138, 94, 34, 0.10);

  --tone-border-strong:   #b8ab92;           /* soft, never harsh */
  --tone-border-soft:     #d8cdb2;

  --tone-link:            #6f4a1a;           /* AA: 6.99:1 */
  --tone-link-hover:      #533614;
  --tone-link-visited:    #5a4530;

  --tone-pull-quote-rule: #8a5e22;

  --tone-callout-bg:      #efe8d5;
  --tone-callout-border:  #c8b896;
}


/* ---------- Advocacy — institutional trust, teal accent, crisp rules ----- */
[data-tone="advocacy"] {
  --tone-bg-base:         #f7f7f6;
  --tone-bg-elevated:     #efefed;
  --tone-bg-recessed:     #e5e5e2;

  --tone-ink-strong:      #0e0e0e;           /* AA: 18.01:1 */
  --tone-ink-base:        #1c1c1c;           /* AA: 15.90:1 — body */
  --tone-ink-muted:       #525252;           /* AA: 7.29:1 */
  --tone-ink-faint:       #6e6e6e;           /* AA: 4.76:1 */

  --tone-accent:          #1e4a5c;           /* institutional teal — what findbehindbars uses */
  --tone-accent-hover:    #163646;           /* AA: 11.87:1 */
  --tone-accent-faint:    rgba(30, 74, 92, 0.10);

  --tone-border-strong:   #c8c8c4;           /* crisper than warm */
  --tone-border-soft:     #dededb;

  --tone-link:            #1e4a5c;           /* AA: 8.95:1 */
  --tone-link-hover:      #163646;
  --tone-link-visited:    #2f4a55;

  --tone-pull-quote-rule: #1e4a5c;

  --tone-callout-bg:      #ecf0f2;           /* gentle teal-tinted ground for methodology asides */
  --tone-callout-border:  #c0d0d6;
}


/* ---------- Archive — research / foundation, linen ground, graphite ----- */
[data-tone="archive"] {
  --tone-bg-base:         #ebe7df;           /* linen */
  --tone-bg-elevated:     #e2ddd2;
  --tone-bg-recessed:     #d4ceb8;

  --tone-ink-strong:      #1a1a18;           /* AA: 14.13:1 */
  --tone-ink-base:        #2b2b29;           /* AA: 11.50:1 — body */
  --tone-ink-muted:       #5a5a55;           /* AA: 5.62:1 */
  --tone-ink-faint:       #6c6c66;           /* AA: 4.28:1 — large-text only */

  --tone-accent:          #4a4a44;           /* graphite — restrained, won't fight the body */
  --tone-accent-hover:    #373732;           /* AA: 9.70:1 */
  --tone-accent-faint:    rgba(74, 74, 68, 0.10);

  --tone-border-strong:   #b8b3a4;
  --tone-border-soft:     #d4ceb8;

  --tone-link:            #4a4a44;           /* AA: 7.23:1 */
  --tone-link-hover:      #2e2e2a;
  --tone-link-visited:    #5a5a52;

  --tone-pull-quote-rule: #6b4423;           /* sepia, one moment of warmth */

  --tone-callout-bg:      #e5e0d2;
  --tone-callout-border:  #b8b3a4;
}


/* Optional: archive can opt into a monospaced body for source-document feel */
[data-tone="archive"][data-archive-mono="true"] {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", "Courier New", monospace;
}


/* ============================================================================
 *  δ2 · Real dark mode — character-preserving, not a tint
 *
 *  Two activation paths:
 *    1. @media (prefers-color-scheme: dark) — automatic, respects the OS
 *    2. [data-color-scheme="dark"] on <html> or <body> — explicit opt-in
 *  And one opt-OUT:
 *    [data-color-scheme="light"] forces light even when OS prefers dark.
 *
 *  Each tone gets its own dark palette that PRESERVES the tone's character:
 *    Editorial dark — reading by lamplight (deep warm grays + warm coral accent)
 *    Warm dark      — tobacco on warm-dark
 *    Advocacy dark  — cool deep grays
 *    Archive dark   — paper-fade against warm graphite
 * ========================================================================== */

/* --- Automatic via OS preference --- */
@media (prefers-color-scheme: dark) {

  /* No-tone fallback dark (only applied when user has not set tone) */
  :root:not([data-color-scheme="light"]) {
    --tone-bg-base:         #0e0e0e;
    --tone-bg-elevated:     #161616;
    --tone-bg-recessed:     #1f1f1f;
    --tone-ink-strong:      #fafafa;
    --tone-ink-base:        #ebebeb;
    --tone-ink-muted:       #a0a0a0;
    --tone-ink-faint:       #707070;
    --tone-accent:          #d97746;
    --tone-accent-hover:    #e08858;
    --tone-accent-faint:    rgba(217, 119, 70, 0.14);
    --tone-border-strong:   #2a2a2a;
    --tone-border-soft:     #1d1d1d;
    --tone-link:            #d97746;
    --tone-link-hover:      #e08858;
    --tone-link-visited:    #b58060;
    --tone-pull-quote-rule: #d97746;
    --tone-callout-bg:      #1a1816;
    --tone-callout-border:  #2a2826;
  }

  [data-tone="editorial"]:not([data-color-scheme="light"]) {
    --tone-bg-base:         #1c1a17;            /* deep warm gray — lamplight */
    --tone-bg-elevated:     #25221e;
    --tone-bg-recessed:     #2f2b25;
    --tone-ink-strong:      #f2ede2;            /* AA: 14.50:1 */
    --tone-ink-base:        #e8e2d8;            /* AA: 13.48:1 — body */
    --tone-ink-muted:       #a8a09a;            /* AA: 6.75:1 */
    --tone-ink-faint:       #7a736b;            /* AA: 3.71:1 — large only */
    --tone-accent:          #d97746;            /* warm coral, easier on dark — AA: 5.52:1 */
    --tone-accent-hover:    #e08858;
    --tone-accent-faint:    rgba(217, 119, 70, 0.18);
    --tone-border-strong:   #3a352e;
    --tone-border-soft:     #2c2823;
    --tone-link:            #e08858;            /* AA: 6.48:1 */
    --tone-link-hover:      #e89968;
    --tone-link-visited:    #b58060;
    --tone-pull-quote-rule: #d97746;
    --tone-callout-bg:      #221f1a;
    --tone-callout-border:  #3a352e;
  }

  [data-tone="warm"]:not([data-color-scheme="light"]) {
    --tone-bg-base:         #1f1c17;            /* tobacco-warm-dark */
    --tone-bg-elevated:     #2a261f;
    --tone-bg-recessed:     #34302a;
    --tone-ink-strong:      #f4ecdd;            /* AA: 14.31:1 */
    --tone-ink-base:        #ebe3d4;            /* AA: 13.32:1 — body */
    --tone-ink-muted:       #a8a094;            /* AA: 6.57:1 */
    --tone-ink-faint:       #7c7468;            /* AA: 3.68:1 — large only */
    --tone-accent:          #d8a672;            /* tobacco-bronze — AA: 7.78:1 */
    --tone-accent-hover:    #e0b07e;
    --tone-accent-faint:    rgba(216, 166, 114, 0.16);
    --tone-border-strong:   #3a342c;
    --tone-border-soft:     #2d2820;
    --tone-link:            #e0b07e;            /* AA: 8.64:1 */
    --tone-link-hover:      #e8bb8e;
    --tone-link-visited:    #b8956e;
    --tone-pull-quote-rule: #d8a672;
    --tone-callout-bg:      #25211a;
    --tone-callout-border:  #3a342c;
  }

  [data-tone="advocacy"]:not([data-color-scheme="light"]) {
    --tone-bg-base:         #161a1c;            /* cool deep gray — institutional */
    --tone-bg-elevated:     #1e2326;
    --tone-bg-recessed:     #272d31;
    --tone-ink-strong:      #f0f2f4;            /* AA: 15.30:1 */
    --tone-ink-base:        #e6e8ea;            /* AA: 14.26:1 — body */
    --tone-ink-muted:       #a0a4a8;            /* AA: 6.98:1 */
    --tone-ink-faint:       #74787c;            /* AA: 3.94:1 — large only */
    --tone-accent:          #6ba5b8;            /* cooled teal for dark — AA: 6.42:1 */
    --tone-accent-hover:    #7eb2c4;
    --tone-accent-faint:    rgba(107, 165, 184, 0.16);
    --tone-border-strong:   #2f363a;
    --tone-border-soft:     #232a2e;
    --tone-link:            #7eb2c4;            /* AA: 7.55:1 */
    --tone-link-hover:      #92bfd0;
    --tone-link-visited:    #6c8e9c;
    --tone-pull-quote-rule: #6ba5b8;
    --tone-callout-bg:      #1d2225;
    --tone-callout-border:  #2f363a;
  }

  [data-tone="archive"]:not([data-color-scheme="light"]) {
    --tone-bg-base:         #1d1c18;            /* warm graphite */
    --tone-bg-elevated:     #26241f;
    --tone-bg-recessed:     #2f2c26;
    --tone-ink-strong:      #e4dfd4;            /* AA: 12.78:1 */
    --tone-ink-base:        #dad6cd;            /* AA: 11.76:1 — body */
    --tone-ink-muted:       #9c9890;            /* AA: 5.93:1 */
    --tone-ink-faint:       #706c66;            /* AA: 3.27:1 — large only */
    --tone-accent:          #a89683;            /* warm graphite-fade — AA: 5.97:1 */
    --tone-accent-hover:    #b8a690;
    --tone-accent-faint:    rgba(168, 150, 131, 0.16);
    --tone-border-strong:   #36322a;
    --tone-border-soft:     #2a2722;
    --tone-link:            #b8a690;            /* AA: 7.22:1 */
    --tone-link-hover:      #c8b5a0;
    --tone-link-visited:    #968470;
    --tone-pull-quote-rule: #c8a986;
    --tone-callout-bg:      #23211c;
    --tone-callout-border:  #36322a;
  }
}


/* --- Explicit dark override — wins over @media query (per cascade) --- */
[data-color-scheme="dark"] {
  --tone-bg-base:         #0e0e0e;
  --tone-bg-elevated:     #161616;
  --tone-bg-recessed:     #1f1f1f;
  --tone-ink-strong:      #fafafa;
  --tone-ink-base:        #ebebeb;
  --tone-ink-muted:       #a0a0a0;
  --tone-ink-faint:       #707070;
  --tone-accent:          #d97746;
  --tone-accent-hover:    #e08858;
  --tone-accent-faint:    rgba(217, 119, 70, 0.14);
  --tone-border-strong:   #2a2a2a;
  --tone-border-soft:     #1d1d1d;
  --tone-link:            #d97746;
  --tone-link-hover:      #e08858;
  --tone-link-visited:    #b58060;
  --tone-pull-quote-rule: #d97746;
  --tone-callout-bg:      #1a1816;
  --tone-callout-border:  #2a2826;
}

[data-color-scheme="dark"][data-tone="editorial"] {
  --tone-bg-base:         #1c1a17;
  --tone-bg-elevated:     #25221e;
  --tone-bg-recessed:     #2f2b25;
  --tone-ink-strong:      #f2ede2;
  --tone-ink-base:        #e8e2d8;
  --tone-ink-muted:       #a8a09a;
  --tone-ink-faint:       #7a736b;
  --tone-accent:          #d97746;
  --tone-accent-hover:    #e08858;
  --tone-accent-faint:    rgba(217, 119, 70, 0.18);
  --tone-border-strong:   #3a352e;
  --tone-border-soft:     #2c2823;
  --tone-link:            #e08858;
  --tone-link-hover:      #e89968;
  --tone-link-visited:    #b58060;
  --tone-pull-quote-rule: #d97746;
  --tone-callout-bg:      #221f1a;
  --tone-callout-border:  #3a352e;
}

[data-color-scheme="dark"][data-tone="warm"] {
  --tone-bg-base:         #1f1c17;
  --tone-bg-elevated:     #2a261f;
  --tone-bg-recessed:     #34302a;
  --tone-ink-strong:      #f4ecdd;
  --tone-ink-base:        #ebe3d4;
  --tone-ink-muted:       #a8a094;
  --tone-ink-faint:       #7c7468;
  --tone-accent:          #d8a672;
  --tone-accent-hover:    #e0b07e;
  --tone-accent-faint:    rgba(216, 166, 114, 0.16);
  --tone-border-strong:   #3a342c;
  --tone-border-soft:     #2d2820;
  --tone-link:            #e0b07e;
  --tone-link-hover:      #e8bb8e;
  --tone-link-visited:    #b8956e;
  --tone-pull-quote-rule: #d8a672;
  --tone-callout-bg:      #25211a;
  --tone-callout-border:  #3a342c;
}

[data-color-scheme="dark"][data-tone="advocacy"] {
  --tone-bg-base:         #161a1c;
  --tone-bg-elevated:     #1e2326;
  --tone-bg-recessed:     #272d31;
  --tone-ink-strong:      #f0f2f4;
  --tone-ink-base:        #e6e8ea;
  --tone-ink-muted:       #a0a4a8;
  --tone-ink-faint:       #74787c;
  --tone-accent:          #6ba5b8;
  --tone-accent-hover:    #7eb2c4;
  --tone-accent-faint:    rgba(107, 165, 184, 0.16);
  --tone-border-strong:   #2f363a;
  --tone-border-soft:     #232a2e;
  --tone-link:            #7eb2c4;
  --tone-link-hover:      #92bfd0;
  --tone-link-visited:    #6c8e9c;
  --tone-pull-quote-rule: #6ba5b8;
  --tone-callout-bg:      #1d2225;
  --tone-callout-border:  #2f363a;
}

[data-color-scheme="dark"][data-tone="archive"] {
  --tone-bg-base:         #1d1c18;
  --tone-bg-elevated:     #26241f;
  --tone-bg-recessed:     #2f2c26;
  --tone-ink-strong:      #e4dfd4;
  --tone-ink-base:        #dad6cd;
  --tone-ink-muted:       #9c9890;
  --tone-ink-faint:       #706c66;
  --tone-accent:          #a89683;
  --tone-accent-hover:    #b8a690;
  --tone-accent-faint:    rgba(168, 150, 131, 0.16);
  --tone-border-strong:   #36322a;
  --tone-border-soft:     #2a2722;
  --tone-link:            #b8a690;
  --tone-link-hover:      #c8b5a0;
  --tone-link-visited:    #968470;
  --tone-pull-quote-rule: #c8a986;
  --tone-callout-bg:      #23211c;
  --tone-callout-border:  #36322a;
}


/* ============================================================================
 *  δ3 · Time-of-day theming (opt-in via tones.js)
 *
 *  These selectors fire only when tones.js has been opted in
 *  (`<script src="/tones.js" data-tones-time="enable" defer>`). The script
 *  sets `[data-time="..."]` on <html> once on DOMContentLoaded.
 *
 *  Slugs (24-hour, local time):
 *    deep-night   00:00 – 05:59
 *    morning      06:00 – 10:59
 *    midday       11:00 – 15:59
 *    golden       16:00 – 19:59
 *    evening      20:00 – 23:59
 *
 *  We only touch a small set of tokens per time-of-day — a hint, not a
 *  redesign. Light-mode only (dark mode is its own world). Override-safe:
 *  unset tones still fall through to the base tone block.
 * ========================================================================== */

[data-tone="editorial"][data-time="deep-night"] {
  --tone-accent:          #a82828;          /* warmer red, slightly lifted */
  --tone-pull-quote-rule: #a82828;
}
[data-tone="editorial"][data-time="morning"] {
  --tone-accent:          #8b1818;
}
[data-tone="editorial"][data-time="midday"] {
  --tone-accent:          #7d1414;          /* cooler, more pressed */
}
[data-tone="editorial"][data-time="golden"] {
  --tone-accent:          #a02e1c;          /* warmer at golden hour */
  --tone-pull-quote-rule: #a02e1c;
}
[data-tone="editorial"][data-time="evening"] {
  --tone-accent:          #9c2222;
  --tone-callout-bg:      #f0eadb;          /* slightly warmer ground */
}

[data-tone="warm"][data-time="deep-night"] {
  --tone-accent:          #a07028;          /* nudge brighter for the few late readers */
}
[data-tone="warm"][data-time="golden"] {
  --tone-accent:          #9c6824;
}
[data-tone="warm"][data-time="evening"] {
  --tone-accent:          #946022;
  --tone-callout-bg:      #ebe3cf;
}

[data-tone="advocacy"][data-time="deep-night"] {
  --tone-accent:          #2a5d72;          /* a touch warmer at night */
}
[data-tone="advocacy"][data-time="golden"] {
  --tone-accent:          #245468;
}

[data-tone="archive"][data-time="deep-night"] {
  --tone-accent:          #5a5a52;          /* slightly lifted graphite */
}
[data-tone="archive"][data-time="golden"] {
  --tone-accent:          #7a5530;          /* sepia warmth peeks through */
  --tone-pull-quote-rule: #7a5530;
}


/* ============================================================================
 *  δ4 · Accent discipline helper — utility for one-accent-per-page enforcement
 *
 *  Host pages may use `.tone-accent` to mark THE one element that owns the
 *  accent on that page. Used purely as documentation in code review; the
 *  selector applies styles consistent with the tone-accent token.
 * ========================================================================== */
.tone-accent {
  color: var(--tone-accent);
}
.tone-accent-bg {
  background-color: var(--tone-accent);
  color: var(--tone-bg-base);
}


/* ============================================================================
 *  γ2 hand-off — reduced motion guard for the time-of-day swap
 *
 *  Time-of-day changes are CSS variable substitutions; no animation. Nothing
 *  to disable. This empty guard exists as a future-proof anchor — if a
 *  later change introduces a cross-fade between time slots, the guard is
 *  here ready.
 * ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  [data-tone][data-time] {
    transition: none !important;
    animation: none !important;
  }
}


/* ============================================================================
 *  Backward-compat — site-specific palette helpers retained from prior tones.css
 *
 *  These were authored earlier in the 22-Launch program (Cluster C journalism
 *  colophon + Cluster D tech/studio + findbehindbars institutional, etc).
 *  They use the site-existing `--paper / --ink / --accent` tokens, not the
 *  new `--tone-*` namespace, so they continue to coexist. Sites already
 *  using these selectors keep working untouched.
 *
 *  Going forward, prefer the `--tone-*` tokens.
 * ========================================================================== */

/* Drop cap on lead paragraphs of long-form (β5 / methodology / about) */
.essay-lead::first-letter,
.longform-lead::first-letter,
article > p:first-of-type::first-letter {
  float: left;
  font-family: Fraunces, "Source Serif 4", var(--font-serif, Georgia, serif);
  font-weight: 900;
  font-size: 3.75rem;
  line-height: 0.78;
  padding: 3px 0.12em 0 0;
  color: var(--tone-accent, var(--accent, #1a1a1a));
}

/* Numbered footnotes — book style */
a.footnote-ref,
.footnote-ref {
  text-decoration: none;
  font-size: 0.65em;
  vertical-align: super;
  color: var(--tone-accent, var(--accent, #1a1a1a));
  padding: 0 1px;
}
a.footnote-ref:hover {
  text-decoration: underline;
}

ol.footnotes,
.footnotes {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tone-border-strong, var(--rule, #c8c0ad));
  font-size: 0.82em;
  line-height: 1.45;
  color: var(--tone-ink-muted, var(--ink-soft, #4e4538));
  list-style: none;
  counter-reset: fn;
}
ol.footnotes li,
.footnotes li {
  margin-bottom: 0.35em;
  padding-left: 1.4em;
  text-indent: -1.4em;
}
ol.footnotes li::before,
.footnotes li::before {
  content: counter(fn, decimal) " ";
  counter-increment: fn;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  opacity: 0.75;
}

/* LAST REVIEWED stamp (β5) */
.colophon-stamp,
.last-reviewed {
  position: absolute;
  top: 0;
  right: 0;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
               Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--tone-ink-faint, var(--ink-faint, #6b6356));
  opacity: 0.65;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* findbehindbars.com — historical institutional palette helper, retained */
[data-site="findbehindbars"],
html.findbehindbars {
  --paper:      #f6f6f4;
  --paper-2:    #f0f0ed;
  --paper-3:    #e6e6e3;
  --ink:        #1f2a2f;
  --ink-2:      #2f3d42;
  --ink-soft:   #4a575c;
  --ink-faint:  #6b7a7f;
  --accent:     #265d6b;
  --rule:       #c9c9c5;
}

/* Closed Press / Counted Press single-use ribbon helpers */
.ribbon-red       { color: #cc2828; }
.ribbon-red-bg    { background-color: #cc2828; color: #fff; }

/* Tech cluster (openladder.tech, behindbars.tech) — terminal-warm */
.terminal-warm    { --paper: #e8e8e0; --ink: #0a0c10; --accent: #00aa33; }
.terminal-green   { color: #00aa33; }
.terminal-green-bg{ background-color: #00aa33; color: #0a0c10; }

/* Studio cluster (openladder.studio, linkage.studio, haller.studio, h2online.studio) */
.studio-warm      { --paper: #f6f0e4; --ink: #2a2018; --accent: #c78a4a; }
.ember-accent     { color: #c78a4a; }

/* linkage.studio — film-frame reveal helper */
.film-frame {
  position: relative;
  border: 12px solid #1a140f;
  background: #ead7b4;
  padding: 1rem;
  box-shadow: 0 0 0 1px #6e2530 inset;
}
.film-frame::before,
.film-frame::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, #6e2530, #6e2530 4px, transparent 4px, transparent 12px);
}
.film-frame::before { top: 0; }
.film-frame::after  { bottom: 0; }
.film-frame .viewport {
  border: 1px solid #1a140f;
  background: #f8f4e9;
  padding: 0.5rem;
}
@media (prefers-reduced-motion: reduce) {
  .film-frame { box-shadow: none; }
}

/* ζ2 portrait treatment (haller.studio + future portrait surfaces) */
.portrait-treatment img,
.portrait img,
img[data-treatment="ζ2"] {
  filter: contrast(1.05) saturate(0.92);
}
