/* ═══════════════════════════════════════════════════════════════════════
   THE PUBLIC TRUST ACT — Shared Design System
   Editorial / Civic Press aesthetic
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Ink palette */
  --ink:          #0a1428;
  --ink-2:        #142340;
  --ink-3:        #1f2d4d;

  /* Paper palette */
  --paper:        #f4ead4;
  --paper-2:      #ebe0c5;
  --paper-3:      #ddd1b1;
  --cream:        #faf4e6;
  --bone:         #fdf9ee;

  /* Accents — values verified WCAG 2.2 AA on each intended surface */
  --brass:        #b08838;   /* ONLY use on dark surfaces (5.62:1 on ink) — fails on paper */
  --brass-bright: #d4a943;   /* For dark surfaces (8.36:1 on ink) — use sparingly: gold accent only on statistics */
  --brass-deep:   #735420;   /* For text/emphasis on paper (5.82:1 on paper) */
  --rust:         #8b3a1e;
  --blood:        #6b1216;
  --sage:         #5a6b3e;

  /* Action — American red (Old Glory Red family). Replaces former rust-orange CTA color. */
  --action:        #c8102e;   /* CTA backgrounds on paper (5.74:1 on paper) and on dark */
  --action-bright: #e63946;   /* CTA text on dark surfaces (5.82:1 on ink) */
  --action-deep:   #9b0e26;   /* Body-size red text on paper (7.91:1, AAA) */

  /* Civic blue — Old Glory Blue family. Use on equal footing with --action for R/W/B structure. */
  --civic-navy:        #002868;   /* Old Glory Blue — body text on paper, 13.46:1 (AAA) */
  --civic-navy-bright: #4d76a8;   /* For dark surfaces, 4.6:1 on ink */
  --civic-navy-deep:   #001845;   /* Deepest emphasis on paper, 17:1 (AAA) */

  /* Civic crimson — reserved for rare in-text emphasis only. Most "red" uses --action. */
  --civic-crimson:      #8b2632;  /* Body text on paper, 7.84:1 (AAA) */
  --civic-crimson-deep: #6b1c25;  /* Heavier emphasis, 10:1 on paper */

  /* UI */
  --rule:         #d6c8a8;
  --rule-soft:    #e4d8b9;
  --muted:        #6a6356;
  --muted-deep:   #4a4538;

  /* Type scale */
  --fs-eyebrow:   11px;
  --fs-caption:   13px;
  --fs-body:      19px;
  --fs-lead:      22px;

  /* Spacing */
  --col:          720px;
  --col-wide:     1080px;
  --col-narrow:   620px;

  /* Status palette — used by admin dashboard + any workflow UI */
  --status-new:        #002868;   /* === civic-navy */
  --status-review:     #735420;   /* === brass-deep */
  --status-done:       #3e7a4a;   /* civic green, AA on paper */

  /* Surface elevation */
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --shadow-sm:   0 4px 12px -6px rgba(10, 20, 40, 0.12);
  --shadow-md:   0 12px 32px -16px rgba(10, 20, 40, 0.22);
  --shadow-lg:   0 24px 64px -24px rgba(10, 20, 40, 0.32);

  /* Font families — assignment is centralized here so a theme swap is one edit */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: var(--fs-body);
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--ink); color: var(--brass-bright); }
::-moz-selection { background: var(--ink); color: var(--brass-bright); }

/* ─── Paper Texture ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(74, 69, 56, 0.06) 1px, transparent 0);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

/* ─── Containers ─── */
.col       { max-width: var(--col);        margin: 0 auto; padding: 0 28px; }
.col-wide  { max-width: var(--col-wide);   margin: 0 auto; padding: 0 28px; }
.col-narrow{ max-width: var(--col-narrow); margin: 0 auto; padding: 0 28px; }

/* ─── Typography Utilities ─── */
.display {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 144;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 0.96;
}

.display-italic {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-deep);
  font-weight: 500;
}

.caption {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-caption);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.smallcaps {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 28px;
  background: rgba(244, 234, 212, 0.85);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.nav.nav-on-dark {
  background: rgba(10, 20, 40, 0.85);
  border-bottom-color: rgba(212, 169, 67, 0.15);
}

.nav-mark {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "SOFT" 30, "opsz" 32;
  display: flex; align-items: center; gap: 10px;
}
.nav.nav-on-dark .nav-mark { color: var(--bone); }
.nav-mark .seal {
  width: 22px; height: 22px;
  background: var(--ink);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brass-bright);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fraunces', serif;
}
.nav.nav-on-dark .nav-mark .seal { background: var(--brass-bright); color: var(--ink); }
.nav-mark em {
  font-style: italic;
  font-weight: 400;
  color: var(--brass-deep);
}
.nav.nav-on-dark .nav-mark em { color: var(--brass-bright); }

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
  justify-self: center;
}
.nav-links a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-deep);
  text-decoration: none;
  transition: color 0.18s ease;
  position: relative;
  padding: 4px 0;
}
.nav.nav-on-dark .nav-links a { color: rgba(250, 244, 230, 0.65); }
.nav-links a:hover { color: var(--ink); }
.nav.nav-on-dark .nav-links a:hover { color: var(--brass-bright); }
.nav-links a.active { color: var(--ink); }
.nav.nav-on-dark .nav-links a.active { color: var(--brass-bright); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  justify-self: end;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bone);
  padding: 9px 16px;
  text-decoration: none;
  border-radius: 1px;
  transition: background 0.18s ease;
}
.nav.nav-on-dark .nav-cta {
  background: var(--brass-bright);
  color: var(--ink);
}
.nav-cta:hover { background: var(--blood); }
.nav.nav-on-dark .nav-cta:hover { background: var(--bone); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav { grid-template-columns: 1fr auto; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
}
.btn-primary {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass);
}
.btn-primary:hover {
  background: var(--brass-bright);
  border-color: var(--brass-bright);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: rgba(250, 244, 230, 0.3);
}
.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass-bright);
}
.btn-ghost-dark {
  background: transparent;
  color: var(--ink);
  border-color: rgba(10, 20, 40, 0.3);
}
.btn-ghost-dark:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bone);
}
.btn-dark {
  background: var(--ink);
  color: var(--bone);
}
.btn-dark:hover {
  background: var(--blood);
}
.btn .arrow {
  width: 16px; height: 1px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease;
}
.btn .arrow::after {
  content: '';
  position: absolute;
  right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ─── Section base ─── */
section { padding: 130px 0; position: relative; z-index: 2; }

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.section-eyebrow::before {
  content: '';
  width: 36px; height: 1px;
  background: var(--brass);
}
.section-eyebrow span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

.section-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 500;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 920px;
}
.section-title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  color: var(--brass-deep);
}

.section-deck {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--muted-deep);
  max-width: 640px;
  margin-bottom: 56px;
}

/* Dark section variants */
.section-dark { background: var(--ink); color: var(--bone); }
.section-dark .section-eyebrow span { color: var(--brass-bright); }
.section-dark .section-title { color: var(--bone); }
.section-dark .section-title em { color: var(--brass-bright); }
.section-dark .section-deck { color: rgba(250, 244, 230, 0.7); }

.section-paper { background: var(--paper); }
.section-cream { background: var(--cream); }

/* ─── Page Header (for sub-pages) ─── */
.page-header {
  background: var(--ink);
  color: var(--bone);
  padding: 180px 0 100px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(212, 169, 67, 0.2);
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(212, 169, 67, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(31, 45, 77, 0.5) 0%, transparent 60%);
  pointer-events: none;
}
.page-header-content { position: relative; z-index: 2; }
.page-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 28px;
}
.page-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.028em;
  color: var(--bone);
  margin-bottom: 24px;
  max-width: 980px;
}
.page-title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  color: var(--brass-bright);
}
.page-deck {
  font-family: 'Source Serif 4', serif;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: rgba(250, 244, 230, 0.7);
  max-width: 680px;
  font-weight: 300;
}
.page-meta {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(212, 169, 67, 0.2);
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.page-meta-item {
  display: flex; flex-direction: column; gap: 6px;
}
.page-meta-label { color: rgba(250, 244, 230, 0.4); }
.page-meta-value { color: var(--brass-bright); font-size: 12px; letter-spacing: 0.1em; }

/* ─── Pull Quote (shared) ─── */
.pullquote {
  position: relative;
  margin: 64px -20px;
  padding: 36px 36px 36px 56px;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 50, "opsz" 96;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.32;
  color: var(--ink);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  letter-spacing: -0.01em;
}
.pullquote::before {
  content: '"';
  position: absolute;
  left: 16px; top: 22px;
  font-family: 'Fraunces', serif;
  font-size: 96px;
  line-height: 1;
  color: var(--brass);
  font-style: italic;
}

/* ─── Footer (shared) ─── */
footer {
  background: var(--ink);
  color: rgba(250, 244, 230, 0.4);
  padding: 56px 28px;
  text-align: center;
  font-size: 13px;
  position: relative;
  z-index: 2;
}
footer p { margin-bottom: 12px; line-height: 1.55; }
footer p:last-child { margin-bottom: 0; opacity: 0.6; font-size: 11px; }
.footer-rule {
  width: 56px; height: 1px;
  background: var(--brass);
  margin: 0 auto 32px;
}
.footer-nav {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 244, 230, 0.55);
  text-decoration: none;
  transition: color 0.18s ease;
}
.footer-nav a:hover { color: var(--brass-bright); }

/* ─── Reveal Animation ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ─── Pagination / Next Page Cards ─── */
.next-page {
  background: var(--ink);
  color: var(--bone);
  padding: 100px 0;
  text-align: center;
  position: relative;
  border-top: 1px solid rgba(212, 169, 67, 0.2);
}
.next-page-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 24px;
}
.next-page-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--bone);
  margin-bottom: 16px;
}
.next-page-title em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--brass-bright);
}
.next-page-deck {
  font-size: 17px;
  color: rgba(250, 244, 230, 0.65);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ─── In-page TOC ─── */
.toc {
  position: sticky;
  top: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
}
.toc-label {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 10px;
  position: relative;
  padding-left: 28px;
}
.toc li::before {
  content: counter(toc, upper-roman);
  position: absolute;
  left: 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--brass-deep);
  font-size: 12px;
}
.toc a {
  color: var(--muted-deep);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  transition: color 0.2s ease;
}
.toc a:hover, .toc a.active { color: var(--ink); }
