/* ============= RESET / BASE ============= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.7;
  color: #1f2933;
  background: #fafaf7;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #b04a3e; text-decoration: none; }
a:hover { text-decoration: underline; }
sup a { color: #b04a3e; font-weight: bold; text-decoration: none; padding: 0 2px; }

/* ============= NAV ============= */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(20, 25, 40, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.brand {
  color: #fff; font-weight: bold; font-size: 1.05rem;
  letter-spacing: 0.5px;
}
#navbar ul { list-style: none; display: flex; gap: 1.3rem; }
#navbar a {
  color: #d8dde6; font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.88rem;
  transition: color 0.2s;
}
#navbar a:hover { color: #f4a896; text-decoration: none; }

/* ============= HERO ============= */
#hero {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 20, 35, 0.85), rgba(80, 30, 60, 0.85)),
    radial-gradient(circle at 20% 30%, #b04a3e22 0%, transparent 50%),
    #0f1423;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 100px 1.5rem 60px;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px);
  pointer-events: none;
}
.hero-inner {
  max-width: 1000px; text-align: center;
  position: relative; z-index: 2;
  animation: fadeUp 1s ease-out;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.8rem;
  color: #f4a896;
  margin-bottom: 1.5rem;
}
.hero-inner h1 {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  font-weight: normal;
}
.byline {
  font-style: italic;
  color: #c8cfdd;
  margin-bottom: 3rem;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}
.stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 1.5rem;
  border-radius: 8px;
  backdrop-filter: blur(5px);
}
.stat .num {
  display: block;
  font-size: 2.8rem;
  font-weight: bold;
  color: #f4a896;
  font-family: 'Helvetica Neue', sans-serif;
}
.stat .lbl {
  display: block;
  font-size: 0.9rem;
  color: #d8dde6;
  margin-top: 0.4rem;
}
.stat sup a { color: #f4a896; }
.cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.9rem 2rem;
  background: #b04a3e;
  color: #fff;
  border-radius: 4px;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 1px;
  transition: transform 0.2s, background 0.2s;
}
.cta:hover { background: #c75a4d; transform: translateY(-2px); text-decoration: none; }
.cta-arrow {
  width: 14px; height: 14px;
  margin-left: 0.4rem;
  vertical-align: middle;
  transition: transform 0.2s;
}
.cta:hover .cta-arrow { transform: translateY(2px); }

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

/* ============= LAYOUT ============= */
.container { max-width: 1000px; margin: 0 auto; padding: 4rem 1.5rem; }
.section { scroll-margin-top: 80px; }
.alt-bg { background: #f0ece3; }

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 1.8rem;
  position: relative;
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 3px solid #b04a3e;
  padding-bottom: 0.8rem;
}
.num-marker {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.9rem;
  color: #b04a3e;
  letter-spacing: 2px;
}
h3 {
  font-size: 1.4rem;
  color: #2d3748;
  margin: 2rem 0 0.8rem;
}
h4 {
  font-size: 1.1rem;
  color: #2d3748;
  margin-bottom: 0.5rem;
}
p { margin-bottom: 1.2rem; font-size: 1.05rem; }
q {
  font-style: italic;
  color: #4a5568;
  quotes: "“" "”";
}
ul, ol { margin: 0.5rem 0 1.5rem 2rem; }
li { margin-bottom: 0.4rem; }
.lead { font-size: 1.15rem; color: #4a5568; margin-bottom: 2rem; }

/* ============= NARRATIVE ============= */
#story { padding-top: 3rem; }
.narrative {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  padding: 2.5rem;
  border-left: 4px solid #b04a3e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border-radius: 4px;
}
.tick {
  font-size: 1.5rem;
  color: #b04a3e;
  text-align: center;
  margin-bottom: 1.5rem;
}
.narrative .note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #718096;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

/* ============= CARDS / INTERACTIVE ============= */
.card.interactive {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin: 2rem 0;
}
.card.interactive h3 { margin-top: 0; }
.hint {
  font-size: 0.9rem;
  color: #718096;
  font-style: italic;
  margin-bottom: 1rem;
}
.chart-wrap {
  position: relative;
  height: 360px;
  margin: 1.5rem 0;
}
.caption {
  font-size: 0.9rem;
  color: #4a5568;
  font-style: italic;
  margin-top: 1rem;
  text-align: center;
}

.metric-buttons {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1rem;
}
.metric-buttons button {
  padding: 0.5rem 1.1rem;
  background: #e2e8f0;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.85rem;
  color: #2d3748;
  transition: all 0.2s;
}
.metric-buttons button:hover { background: #cbd5e0; }
.metric-buttons button.active {
  background: #b04a3e;
  color: #fff;
}

/* ============= EFFECT GRID ============= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.effect-card {
  background: #fff;
  padding: 1.8rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform 0.2s;
}
.effect-card:hover { transform: translateY(-4px); }
.effect-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #f0ece3;
  color: #b04a3e;
  margin-bottom: 1rem;
}
.effect-card .icon svg { width: 28px; height: 28px; }

/* ============= COUNTERARGUMENT ============= */
.counter {
  background: #fff8e8;
  border-left: 4px solid #d4a017;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}
.counter summary {
  cursor: pointer;
  font-weight: bold;
  font-family: 'Helvetica Neue', sans-serif;
  color: #8a6d00;
}
.counter[open] summary { margin-bottom: 1rem; }

/* ============= RESEARCH SECTION ============= */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin: 2rem 0;
}
.research-img img {
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
@media (max-width: 800px) {
  .research-grid { grid-template-columns: 1fr; }
}

.finding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.finding {
  background: linear-gradient(135deg, #fff 0%, #f7f3eb 100%);
  padding: 1.8rem;
  border-radius: 8px;
  border-top: 4px solid #b04a3e;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.finding .big {
  display: block;
  font-size: 2.6rem;
  font-weight: bold;
  color: #b04a3e;
  font-family: 'Helvetica Neue', sans-serif;
  margin-bottom: 0.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.gallery figure {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.gallery img {
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.3s;
}
.gallery img:hover { transform: scale(1.02); }
.gallery figcaption {
  font-size: 0.9rem;
  color: #4a5568;
  font-style: italic;
  margin-top: 0.8rem;
  text-align: center;
}

/* ============= LAWS ============= */
.laws {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.law {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #4a7ba7;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.law h4 { display: flex; align-items: center; gap: 0.6rem; }
.law-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: #eaf1f8;
  color: #4a7ba7;
  flex-shrink: 0;
}
.law-marker svg { width: 18px; height: 18px; }
@media (max-width: 700px) { .laws { grid-template-columns: 1fr; } }

/* ============= WORKS CITED ============= */
.cites, .footnotes {
  font-size: 0.92rem;
  line-height: 1.6;
}
.cites li, .footnotes li {
  margin-bottom: 0.9rem;
  padding-left: 0.4rem;
}
.cites li:target, .footnotes li:target {
  background: #fff8e8;
  padding: 0.5rem;
  border-radius: 4px;
  animation: highlight 1.5s ease-out;
}
@keyframes highlight {
  from { background: #ffe08a; }
  to   { background: #fff8e8; }
}

/* ============= FOOTER ============= */
footer {
  background: #1a2030;
  color: #c8cfdd;
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.9rem;
}
footer p { margin-bottom: 0.4rem; }

/* ============= TOP BUTTON ============= */
#topBtn {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: #b04a3e;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.3s, transform 0.2s;
  pointer-events: none;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#topBtn svg { width: 22px; height: 22px; }
#topBtn.visible {
  opacity: 1;
  pointer-events: auto;
}
#topBtn:hover { transform: translateY(-3px); }

/* ============= REVEAL ON SCROLL ============= */
.section { opacity: 0; transform: translateY(30px); transition: opacity 0.8s, transform 0.8s; }
.section.visible { opacity: 1; transform: translateY(0); }

/* ============= PROXY SIMULATION ============= */
.proxy-sim {
  background: linear-gradient(180deg, #fff 0%, #f5efe6 100%);
  border: 1px solid #e2d5c2;
  border-left: 4px solid #b04a3e;
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  margin: 1.8rem 0 2.2rem;
  box-shadow: 0 4px 14px rgba(20, 25, 40, 0.06);
}
.proxy-head h4 {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 1.15rem;
  color: #141928;
  margin-bottom: 0.4rem;
}
.proxy-sub {
  font-size: 0.95rem;
  color: #4a525e;
  margin-bottom: 1.2rem;
}
.proxy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 1.2rem;
  margin-bottom: 1.1rem;
}
.proxy-grid label {
  display: flex;
  flex-direction: column;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  color: #1f2933;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.proxy-grid label span { margin-bottom: 0.3rem; }
.proxy-lbl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.proxy-omit-btn {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c9bca7;
  border-radius: 999px;
  background: #fff;
  color: #5b6470;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.proxy-omit-btn:hover { border-color: #8a2f25; color: #8a2f25; }
.proxy-omit-btn[aria-pressed="true"] {
  background: #8a2f25;
  border-color: #8a2f25;
  color: #fff;
}
.proxy-grid select:disabled {
  background: #f1ece2;
  color: #9aa0a6;
  cursor: not-allowed;
  text-decoration: line-through;
}
.proxy-grid select {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c9bca7;
  border-radius: 4px;
  background: #fff;
  color: #1f2933;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.proxy-grid select:focus {
  outline: none;
  border-color: #b04a3e;
  box-shadow: 0 0 0 3px rgba(176, 74, 62, 0.15);
}
.proxy-actions {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.proxy-btn {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 0.65rem 1.3rem;
  border: 1px solid #b04a3e;
  border-radius: 4px;
  background: #b04a3e;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.proxy-btn:hover { background: #963f34; }
.proxy-btn:active { transform: translateY(1px); }
.proxy-btn-ghost {
  background: transparent;
  color: #b04a3e;
}
.proxy-btn-ghost:hover { background: rgba(176, 74, 62, 0.08); }
.proxy-output {
  background: #fff;
  border: 1px solid #e2d5c2;
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
  min-height: 90px;
}
.proxy-hint {
  font-size: 0.92rem;
  color: #6b7280;
  font-style: italic;
  margin: 0;
}
.proxy-result-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #141928;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.proxy-bars { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.9rem; }
.proxy-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 55px;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.88rem;
}
.proxy-bar-label { color: #1f2933; font-weight: 500; }
.proxy-bar-track {
  background: #efe7d8;
  border-radius: 3px;
  height: 14px;
  overflow: hidden;
}
.proxy-bar-fill {
  height: 100%;
  background: #b04a3e;
  border-radius: 3px;
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.proxy-bar-row.top .proxy-bar-fill { background: #8a2f25; }
.proxy-bar-row.top .proxy-bar-label { font-weight: 700; color: #8a2f25; }
.proxy-bar-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #4a525e;
  text-align: right;
}
.proxy-verdict {
  font-size: 0.93rem;
  color: #1f2933;
  background: #fdf6ec;
  border-left: 3px solid #b04a3e;
  padding: 0.7rem 0.9rem;
  border-radius: 0 3px 3px 0;
}
.proxy-verdict strong { color: #8a2f25; }
.proxy-note {
  font-size: 0.88rem;
  color: #4a525e;
  font-style: italic;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed #d4c5af;
}

/* ============= REVEAL ON SCROLL ============= */
.section { opacity: 0; transform: translateY(30px); transition: opacity 0.8s, transform 0.8s; }
.section.visible { opacity: 1; transform: translateY(0); }

/* ============= RESPONSIVE NAV ============= */
@media (max-width: 700px) {
  #navbar ul { gap: 0.7rem; }
  #navbar a { font-size: 0.78rem; }
  .brand { display: none; }
  .hero-inner h1 { font-size: 1.6rem; }
  .proxy-grid { grid-template-columns: 1fr; }
  .proxy-bar-row { grid-template-columns: 90px 1fr 45px; font-size: 0.82rem; }
}

/* ============= U.S. AUDIT-LAW MAP (research-figure styling) ============= */
.us-map-sim {
  background: #fffdf9;
  border: 1px solid #d6cdb9;
  border-radius: 3px;
  padding: 1.1rem 1.3rem 1.2rem;
  margin: 1.6rem 0 1.8rem;
  box-shadow: none;
  position: relative;
}
.us-map-sim::before {
  content: attr(data-figure);
  display: block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8a2f25;
  margin-bottom: 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #ece4d4;
}
.us-map-sim .proxy-head h4 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2933;
  letter-spacing: 0;
  margin-bottom: 0.25rem;
}
.us-map-sim .proxy-sub {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.86rem;
  color: #4a525e;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.7rem;
  background: #faf6ee;
  border: 1px solid #ece4d4;
  border-radius: 2px;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  color: #2d3748;
}
.map-legend .lgd { display: inline-flex; align-items: center; gap: 0.35rem; }
.map-legend .sw {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.15);
}
.cat-comp   { background: #8a2f25; }
.cat-target { background: #d97757; }
.cat-trans  { background: #e7b76b; }
.cat-pend   { background: #b8c8d4; }
.cat-none   { background: #ece4d4; }
.us-grid { display: none; }

.us-map-svg-wrap {
  position: relative;
  max-width: 620px;
  margin: 0 auto 0.8rem;
  background: transparent;
  border: none;
  padding: 0;
}
#us-map-svg {
  display: block;
  width: 100%;
  height: auto;
}
#us-map-svg .state {
  fill: #ece4d4;
  stroke: #fffdf9;
  stroke-width: 0.6;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.15s, filter 0.15s, stroke 0.15s;
}
#us-map-svg .state.cat-comp   { fill: #8a2f25; }
#us-map-svg .state.cat-target { fill: #d97757; }
#us-map-svg .state.cat-trans  { fill: #e7b76b; }
#us-map-svg .state.cat-pend   { fill: #b8c8d4; }
#us-map-svg .state.cat-none   { fill: #ece4d4; }
#us-map-svg .state:hover {
  filter: brightness(1.10);
  stroke: #1f2933;
  stroke-width: 1.1;
}
#us-map-svg .state.selected {
  stroke: #1f2933;
  stroke-width: 1.4;
  filter: drop-shadow(0 1px 2px rgba(20, 25, 40, 0.25));
}
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  color: #6b7280;
  background: rgba(255,253,249,0.9);
}
.map-loading.hidden { display: none; }

.map-tooltip {
  position: fixed;
  pointer-events: none;
  background: #1f2933;
  color: #fff;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 1500;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.map-tooltip.visible { opacity: 1; }
.map-tooltip .tip-cat {
  display: block;
  font-weight: 400;
  font-size: 0.66rem;
  color: #cbd2db;
  margin-top: 1px;
}

.map-detail {
  background: transparent;
  border: none;
  border-top: 1px solid #ece4d4;
  border-radius: 0;
  padding: 0.85rem 0.2rem 0.3rem;
  min-height: 80px;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.detail-state {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #141928;
}
.detail-tag {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
}
.detail-tag.cat-comp   { background: #8a2f25; color: #fff; }
.detail-tag.cat-target { background: #d97757; color: #fff; }
.detail-tag.cat-trans  { background: #e7b76b; color: #1f2933; }
.detail-tag.cat-pend   { background: #b8c8d4; color: #1f2933; }
.detail-tag.cat-none   { background: #ece4d4; color: #5a6270; }
.detail-body {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #1f2933;
  margin-bottom: 0.45rem;
}
.detail-source {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.76rem;
  color: #6b7280;
}
.detail-source a { color: #8a2f25; font-weight: 600; }

.us-map-sim .proxy-note {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.74rem;
  font-style: normal;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #d6cdb9;
}
@media (max-width: 700px) {
  .map-legend { font-size: 0.68rem; gap: 0.3rem 0.7rem; }
  .us-map-sim { padding: 0.9rem 1rem 1rem; }
}

/* ============= MAP TIMELINE SCRUBBER ============= */
.map-timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem 0.9rem;
  align-items: center;
  background: #faf6ee;
  border: 1px solid #ece4d4;
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
}
.map-timeline .proxy-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.76rem;
  letter-spacing: 0.3px;
}
.map-timeline #map-year-scrub {
  width: 100%;
  accent-color: #8a2f25;
  cursor: pointer;
}
.map-year-info {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  color: #6b7280;
  white-space: nowrap;
}
.map-year-label {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  font-size: 0.62rem;
}
.map-year-readout {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #8a2f25;
  font-variant-numeric: tabular-nums;
}
.map-year-counts {
  grid-column: 1 / -1;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  color: #4a525e;
  border-top: 1px dashed #ece4d4;
  padding-top: 0.45rem;
  margin-top: 0.05rem;
}
.map-year-counts strong { color: #1f2933; font-variant-numeric: tabular-nums; }
/* Smooth color transition as years advance */
#us-map-svg .state { transition: fill 0.5s ease, stroke 0.15s, filter 0.15s; }

@media (max-width: 560px) {
  .map-timeline { grid-template-columns: 1fr; }
  .map-timeline .proxy-btn { width: 100%; }
}

/* ============= WEALTH-GAP FIGURE ============= */
.wealth-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  margin-bottom: 0.7rem;
}
.wealth-controls .proxy-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}
.wealth-controls #wealth-scrub {
  flex: 1 1 180px;
  min-width: 140px;
  accent-color: #8a2f25;
  cursor: pointer;
}
.wealth-readout {
  flex: 1 1 100%;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem;
  color: #4a525e;
  border-top: 1px dashed #ece4d4;
  padding-top: 0.5rem;
  margin-top: 0.1rem;
}
.wr-year {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #8a2f25;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.wr-stat { color: #1f2933; }
.wr-stat strong { color: #8a2f25; font-variant-numeric: tabular-nums; }
.wealth-chart-wrap {
  height: 320px;
  background: #fff;
  border: 1px solid #ece4d4;
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
}

/* ============= ZOOMABLE CHART ============= */
.chart-wrap.zoomable {
  position: relative;
  cursor: zoom-in;
  border-radius: 6px;
  transition: box-shadow 0.2s, transform 0.2s;
  height: 480px;
  background: #fff;
  padding: 0.6rem;
  border: 1px solid #e2d5c2;
}
.chart-wrap.zoomable:hover {
  box-shadow: 0 6px 18px rgba(20, 25, 40, 0.14);
  transform: translateY(-2px);
}
.chart-wrap.zoomable:focus {
  outline: 2px solid #b04a3e;
  outline-offset: 3px;
}
.chart-wrap.zoomable .zoom-hint {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(20, 25, 40, 0.78);
  color: #fff;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 0.32rem 0.6rem;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.chart-wrap.zoomable .zoom-hint svg {
  width: 14px; height: 14px;
}
.chart-wrap.zoomable:hover .zoom-hint { opacity: 1; }

/* Modal overlay for enlarged chart */
.chart-modal {
  position: fixed; inset: 0;
  background: rgba(10, 15, 25, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 2rem;
  cursor: zoom-out;
  animation: chartFade 0.18s ease-out;
}
@keyframes chartFade { from { opacity: 0; } to { opacity: 1; } }
.chart-modal-inner {
  background: #fff;
  border-radius: 8px;
  padding: 1.4rem 1.6rem 1.6rem;
  width: min(1100px, 96vw);
  height: min(78vh, 720px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  cursor: default;
  position: relative;
}
.chart-modal-close {
  position: absolute;
  top: 0.7rem; right: 0.9rem;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #4a525e;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.chart-modal-close:hover { background: #f0e7d6; color: #1f2933; }
.chart-modal-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #141928;
  margin-bottom: 0.6rem;
  padding-right: 2rem;
}
.chart-modal-canvas {
  flex: 1;
  position: relative;
  min-height: 0;
}

/* ============= GLOSSARY TOOLTIPS ============= */
.glossary {
  border-bottom: 1px dotted #b04a3e;
  cursor: help;
  position: relative;
  color: inherit;
  outline: none;
}
.glossary:hover,
.glossary:focus { border-bottom-style: solid; }
.glossary::after {
  content: attr(data-def);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1f2933;
  color: #fff;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.55rem 0.75rem;
  border-radius: 3px;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 5px 14px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 1200;
}
.glossary::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #1f2933;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 1200;
}
.glossary:hover::after,
.glossary:focus::after,
.glossary:hover::before,
.glossary:focus::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* If the tooltip would overflow viewport, fall back to flipping below.
   (Pure-CSS narrow-viewport adjustment) */
@media (max-width: 520px) {
  .glossary::after { max-width: 220px; font-size: 0.74rem; }
}

/* ============= SECTION REVEALS =============
   Sections fade + slide in the first time they enter the viewport.
   Child headings/figures stagger slightly behind. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger heading and first figure/paragraph */
.reveal > h2,
.reveal > h3,
.reveal > p,
.reveal > .us-map-sim,
.reveal > .proxy-sim,
.reveal > .chart-frame,
.reveal > .research-figure {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-visible > h2          { transition-delay: 0.05s; opacity: 1; transform: none; }
.reveal.is-visible > h3          { transition-delay: 0.12s; opacity: 1; transform: none; }
.reveal.is-visible > p           { transition-delay: 0.18s; opacity: 1; transform: none; }
.reveal.is-visible > .us-map-sim,
.reveal.is-visible > .proxy-sim,
.reveal.is-visible > .chart-frame,
.reveal.is-visible > .research-figure { transition-delay: 0.28s; opacity: 1; transform: none; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============= FIGURE 4 · DATASET REPRESENTATION PIE ============= */
.rep-fig { margin: 1.3rem 0 1.5rem; }
.rep-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.3rem;
  align-items: center;
  background: #fffdf9;
  border: 1px solid #ece4d4;
  padding: 1rem 1.1rem;
  border-radius: 2px;
}
.rep-chart-wrap {
  height: 240px;
  position: relative;
}
.rep-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: 'Helvetica Neue', sans-serif;
}
.rep-lgd-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px dashed #ece4d4;
}
.rep-lgd-row:last-child { border-bottom: 0; }
.rep-lgd-sw {
  width: 14px; height: 14px;
  border-radius: 2px;
  border: 1px solid #fffdf9;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.rep-lgd-lbl { color: #1f2933; font-weight: 600; }
.rep-lgd-pct {
  color: #8a2f25;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Georgia', 'Times New Roman', serif;
  min-width: 52px;
  text-align: right;
}
.rep-lgd-n {
  color: #6b7280;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  min-width: 92px;
  text-align: right;
}

@media (max-width: 640px) {
  .rep-grid { grid-template-columns: 1fr; }
  .rep-chart-wrap { height: 220px; }
}

/* ============= FIGURE 3 · ADOPTION GROWTH ============= */
.adoption-fig { margin: 1.3rem 0 1.5rem; }
.adoption-readout {
  display: flex; align-items: baseline; gap: 0.7rem;
  margin-bottom: 0.7rem;
  border-left: 3px solid #8a2f25;
  padding-left: 0.8rem;
}
.adoption-num {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 2.4rem; font-weight: 700; color: #8a2f25;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.adoption-label {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem; color: #4a525e;
}
.adoption-label strong { color: #1f2933; font-variant-numeric: tabular-nums; }
.adoption-chart-wrap {
  height: 240px;
  background: #fffdf9;
  border: 1px solid #ece4d4;
  padding: 0.6rem 0.8rem 0.4rem;
  border-radius: 2px;
}
.adoption-controls {
  display: flex; align-items: center; gap: 0.7rem;
  margin-top: 0.55rem;
}
.adoption-delta {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.74rem; color: #6b7280;
  letter-spacing: 0.3px;
}

/* ============= FIGURE 4 · BIAS MIRROR ============= */
.bias-mirror { margin: 1.3rem 0 1.5rem; }
.bias-mirror .proxy-sub {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem; color: #4a525e;
  margin: 0 0 0.9rem;
}
.mirror-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  background: #fffdf9;
  border: 1px solid #ece4d4;
  padding: 1rem 1.1rem;
  border-radius: 2px;
}
.mirror-panel { min-width: 0; }
.mirror-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4a525e;
  margin: 0 0 0.55rem;
  font-weight: 700;
}
.mirror-sub {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #8b94a3;
  font-size: 0.7rem;
  margin-left: 0.35rem;
}
.mirror-bar {
  display: flex;
  width: 100%;
  height: 38px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #d6cdb9;
}
.mirror-seg {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem; font-weight: 600; color: #fffdf9;
  transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  white-space: nowrap; overflow: hidden;
}
.mirror-seg-white { background: #8a2f25; }
.mirror-seg-black { background: #d97757; color: #1f2933; }
.mirror-arrow {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
  color: #8a2f25;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-align: center;
  white-space: nowrap;
}
.mirror-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.mirror-row {
  display: grid;
  grid-template-columns: 56px 1fr 46px;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
}
.mirror-grp { color: #4a525e; font-weight: 600; }
.mirror-bar2 {
  height: 16px;
  background: #f1ead9;
  border-radius: 2px;
  overflow: hidden;
}
.mirror-fill2 {
  height: 100%;
  transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mirror-fill2.white { background: #8a2f25; }
.mirror-fill2.black { background: #d97757; }
.mirror-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #1f2933;
  font-weight: 700;
}
.mirror-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem 0.9rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #faf6ee;
  border: 1px solid #ece4d4;
  border-radius: 2px;
}
.mirror-ctrl-label {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4a525e;
  font-weight: 700;
}
#mirror-skew { width: 100%; accent-color: #8a2f25; cursor: pointer; }
.mirror-readout {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.78rem;
  color: #1f2933;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#mirror-note strong { color: #8a2f25; }

@media (max-width: 720px) {
  .mirror-grid { grid-template-columns: 1fr; }
  .mirror-arrow { transform: rotate(90deg); padding: 0.3rem 0; }
  .mirror-controls { grid-template-columns: 1fr; }
}

/* ============= FIGURE 5 · HISTORICAL TIMELINE ============= */
.history-fig { margin: 1.3rem 0 1.5rem; }
.history-fig .proxy-sub {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.82rem; color: #4a525e;
  margin: 0 0 1rem;
}
.timeline-track {
  position: relative;
  height: 180px;
  margin: 0 1.2rem 0.8rem;
  padding: 0;
}
.timeline-line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, #d6cdb9, #8a2f25 30%, #d97757 70%, #8a2f25);
}
.timeline-dots {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
}
.timeline-dot {
  position: absolute;
  top: 0;
  height: 100%;
  width: 84px;             /* horizontal slot reserved for the label */
  transform: translateX(-50%);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: 'Helvetica Neue', sans-serif;
  color: #4a525e;
}
.timeline-dot .td-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -8px 0 0 -8px;    /* center on line, account for border */
  background: #fffdf9;
  border: 2px solid #8a2f25;
  border-radius: 50%;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s;
  z-index: 2;
}
.timeline-dot .td-stem {
  position: absolute;
  left: 50%;
  width: 1px;
  background: #d6cdb9;
  transform: translateX(-50%);
  z-index: 1;
}
.timeline-dot.pos-top .td-stem { top: calc(50% - 30px); height: 22px; }
.timeline-dot.pos-bot .td-stem { top: calc(50% +  8px); height: 22px; }
.timeline-dot .td-label {
  position: absolute;
  left: 50%;
  width: 84px;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.64rem;
  line-height: 1.15;
  color: #4a525e;
  white-space: normal;
  letter-spacing: 0.2px;
  pointer-events: none;     /* clicks should hit the button, not the label */
}
.timeline-dot.pos-top .td-label { top: 6px; }
.timeline-dot.pos-bot .td-label { bottom: 6px; }
.timeline-dot .td-label em {
  display: block;
  font-style: normal;
  color: #8b94a3;
  font-variant-numeric: tabular-nums;
  font-size: 0.62rem;
  margin-top: 1px;
}
.timeline-dot:hover .td-dot,
.timeline-dot:focus-visible .td-dot {
  transform: scale(1.25);
  background: #d97757;
  outline: none;
  box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.18);
  margin: -10px 0 0 -10px;
}
.timeline-dot.active .td-dot {
  background: #8a2f25;
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(138, 47, 37, 0.2);
  margin: -10px 0 0 -10px;
}
.timeline-dot.active .td-label { color: #1f2933; font-weight: 700; }
.timeline-dot.active .td-stem  { background: #8a2f25; width: 2px; }
.timeline-axis {
  position: absolute;
  left: 0; right: 0; bottom: -18px;
  display: flex;
  justify-content: space-between;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.62rem;
  color: #8b94a3;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
.timeline-detail {
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  background: #fffdf9;
  border: 1px solid #ece4d4;
  border-left: 3px solid #8a2f25;
  border-radius: 2px;
  min-height: 90px;
}
.td-head {
  display: flex; align-items: baseline; gap: 0.7rem;
  margin-bottom: 0.45rem;
}
.td-year {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #8a2f25;
  font-variant-numeric: tabular-nums;
}
.td-title {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2933;
  line-height: 1.3;
}
.td-body {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #1f2933;
  margin: 0;
}

@media (max-width: 720px) {
  .timeline-track { margin: 0 0.4rem 1rem; height: 200px; }
  .timeline-dot { width: 70px; }
  .timeline-dot .td-label { width: 70px; font-size: 0.6rem; }
  .timeline-dot .td-label em { font-size: 0.58rem; }
}

