/* ============================================================
   EPS Black-Box Budget — scrollytelling lander
   Visual identity: redacted / FOIA-declassified.
   Near-black paper, off-white ink, one red stamp accent,
   black redaction bars that wipe away on scroll.
   Self-contained, offline. System monospace only.
   ============================================================ */

:root {
  --paper:      #0b0b0c;   /* near-black background */
  --paper-2:    #131315;   /* raised panel */
  --ink:        #ece7db;   /* off-white text */
  --ink-dim:    #8a877e;   /* muted / caveat text */
  --ink-faint:  #55534d;   /* hairlines, low-confidence */
  --red:        #c81e1e;   /* the single stamp accent */
  --red-deep:   #8f1414;
  --redact:     #050505;   /* redaction bar fill */
  --line:       #26262a;   /* borders */
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Menlo", Consolas, "DejaVu Sans Mono", monospace;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(15px, 1rem + 0.2vw, 18px);
  line-height: 1.65;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  /* faint document grain so the "paper" reads as a scanned file */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.015), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(200,30,30,0.03), transparent 45%);
  background-attachment: fixed;
}

a {
  color: var(--ink);
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}
a:hover { color: var(--red); }

strong { color: #fff; font-weight: 700; }
em { color: var(--ink); font-style: italic; }

/* ---------- scroll progress rail ---------- */
.scroll-rail {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
}
.scroll-rail__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--red);
  box-shadow: 0 0 10px rgba(200,30,30,0.7);
  transition: width 0.05s linear;
}

/* ---------- shared stamp ---------- */
.stamp {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.22em 0.6em;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(-3deg);
}
.stamp--red {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(200,30,30,0.25) inset;
}
.stamp--small {
  font-size: 0.7rem;
  transform: rotate(-2deg);
  color: var(--red);
  border-color: var(--red);
}

/* ============================= HERO ============================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem var(--gutter);
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}
.hero__stamp {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.hero__file {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
}
.hero__kicker {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--ink-dim);
  margin: 0 0 0.5rem;
  max-width: var(--measure);
}
.hero__figure {
  font-size: clamp(4.5rem, 20vw, 13rem);
  line-height: 0.9;
  margin: 0.2em 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero__sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--ink);
  max-width: var(--measure);
  margin: 1.5rem 0 0;
}
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: var(--gutter);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ---------- redaction bar (the un-redacting device) ---------- */
.redact {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.redact__value {
  position: relative;
  z-index: 1;
}
/* the black bar sits over the value, then wipes away left→right */
.redact::after {
  content: "";
  position: absolute;
  inset: -0.06em -0.15em;
  background: var(--redact);
  border: 1px solid #1c1c1e;
  z-index: 2;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}
.redact.is-open::after {
  transform: scaleX(0);
}
.redact--hero::after {
  border-radius: 3px;
}

/* ============================= ACTS ============================= */
.act {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem var(--gutter) 4rem;
}
.act__marker {
  margin-bottom: 2rem;
  border-top: 2px solid var(--red);
  padding-top: 1rem;
}
.act__num {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--red);
  font-weight: 700;
}
.act__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.05;
  margin: 0.3rem 0 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- prose panels ---------- */
.panel {
  max-width: var(--measure);
  margin: 2.5rem 0;
}
.panel p { margin: 0 0 1.1rem; }
.panel p:last-child { margin-bottom: 0; }

.panel--pull {
  max-width: 46ch;
  border-left: 3px solid var(--red);
  padding-left: 1.4rem;
}
.pull {
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  line-height: 1.3;
  color: var(--ink);
}
.pull__caveat {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-top: 1rem !important;
}

.panel__label {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--red);
  font-weight: 700;
  margin: 0 0 0.6rem !important;
}
.panel--fairness {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.8rem;
  max-width: var(--measure);
}

.panel--closing { margin-top: 4rem; }
.closing {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.3;
  color: #fff;
  border-left: 3px solid var(--red);
  padding-left: 1.4rem;
}
.closing__anchor {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-top: 1.5rem;
  padding-left: 1.4rem;
}

/* ============================= CHARTS ============================= */
.chart-block {
  margin: 3rem 0;
}
.chart-block__cap {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.chart-block__label {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--red);
  font-weight: 700;
  border: 1px solid var(--red);
  padding: 0.15em 0.5em;
  border-radius: 2px;
}
.chart-block__note {
  font-size: 0.8rem;
  color: var(--ink-dim);
  max-width: var(--measure);
  margin: 1rem 0 0;
}
.chart {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.2rem;
  overflow: hidden;
}
.chart svg { display: block; width: 100%; height: auto; }

/* SVG element styling (charts drawn by main.js) */
.axis-line { stroke: var(--ink-faint); stroke-width: 1; }
.grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.axis-label { fill: var(--ink-dim); font-family: var(--mono); font-size: 12px; }
.axis-label--dim { fill: var(--ink-faint); }
.series-area { fill: rgba(200,30,30,0.12); }
.series-line { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.series-line--est { stroke: var(--ink-faint); stroke-dasharray: 5 4; stroke-width: 2; }
.series-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.series-dot--anchor { fill: var(--red); stroke: var(--red); }
.point-label { fill: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.callout-line { stroke: var(--red); stroke-width: 1; stroke-dasharray: 3 3; }
.callout-text { fill: var(--red); font-family: var(--mono); font-size: 11px; }

.bar-track { fill: rgba(255,255,255,0.03); }
.bar-fill { fill: var(--ink-faint); }
.bar-fill--eps { fill: var(--red); }
.bar-label { fill: var(--ink); font-family: var(--mono); font-size: 13px; }
.bar-value { fill: var(--ink-dim); font-family: var(--mono); font-size: 12px; }
.bar-mult { fill: var(--red); font-family: var(--mono); font-size: 12px; font-weight: 700; }

/* animated draw-in: charts start hidden, main.js adds .is-drawn */
.chart .draw { opacity: 0; transition: opacity 0.6s ease; }
.chart.is-drawn .draw { opacity: 1; }

/* ============================= BLACK BOX ============================= */
.blackbox {
  margin: 2.5rem 0 3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  overflow: hidden;
}
.bb-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.bb-row:last-child { border-bottom: 0; }
.bb-row__head {
  font-weight: 700;
  color: #fff;
  font-size: 1.02rem;
  margin: 0 0 0.3rem;
}
.bb-row__note {
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin: 0;
  max-width: 52ch;
}
.bb-row__conf {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 0.12em 0.5em;
  border-radius: 2px;
  border: 1px solid var(--ink-faint);
  color: var(--ink-dim);
  margin-left: 0.6rem;
  vertical-align: middle;
}
.bb-row__conf[data-conf="HIGH"] { color: var(--ink); border-color: var(--ink-dim); }
.bb-row__conf[data-conf="MED"]  { color: var(--ink-dim); }
.bb-row__conf[data-conf="LOW"]  { color: var(--ink-faint); border-color: var(--ink-faint); }

/* the redacted figure column */
.bb-row__figure {
  justify-self: end;
  text-align: right;
  min-width: 8ch;
}
.bb-fig {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}
.bb-row__sub {
  font-size: 0.75rem;
  color: var(--ink-dim);
  margin-top: 0.2rem;
}

/* ============================= SOURCES ============================= */
.sources {
  max-width: 1100px;
  margin: 4rem auto 0;
  padding: 3rem var(--gutter) 5rem;
  border-top: 1px solid var(--line);
}
.sources__head {
  font-size: 1rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.sources__body { color: var(--ink-dim); max-width: var(--measure); margin: 0 0 1rem; }
.sources__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}
.sources__list li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-dim);
}
.sources__list a { font-weight: 700; }
.sources__caveat {
  font-size: 0.8rem;
  color: var(--ink-faint);
  max-width: var(--measure);
  margin: 0;
}
.sources__cta {
  margin: 0 0 1.75rem;
  font-size: 1.02rem;
}
.sources__cta a { font-weight: 700; }
.sources__group-h {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin: 1.4rem 0 0.5rem;
}

/* ---------- inline source references ---------- */
.ref {
  font-size: 0.62em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  color: var(--red);
  font-weight: 700;
  margin-left: 0.12em;
  white-space: nowrap;
}
.ref:hover { text-decoration: underline; }

/* ============================= SCROLL REVEAL ============================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Respect users who ask for less motion: everything just appears. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .redact::after { transition: none; }
  .scroll-cue { animation: none; }
  .chart .draw { opacity: 1; transition: none; }
}

/* ============================= RESPONSIVE ============================= */
@media (max-width: 640px) {
  .bb-row {
    grid-template-columns: 1fr;
  }
  .bb-row__figure {
    justify-self: start;
    text-align: left;
  }
  .hero__stamp { gap: 0.6rem; }
  .pull { font-size: 1.3rem; }
}
