:root {
  --paper: #edf2ea;
  --ink: #1b2a20;
  --red: #9e2b20;
  --green: #2e6b44;
  --muted: #5f7264;
  --rule: #c9d6c6;
  --bar-track: #dde6da;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main, .masthead, .methodology {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.masthead { padding-top: 1.75rem; }

.site-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.site-sub {
  margin: 0.2rem 0 0;
  font-family: 'Spectral', serif;
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 0; }

.hero-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35em;
  flex-wrap: wrap;
}

.hero-num {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-word {
  font-weight: 600;
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
  color: var(--muted);
}

.hero-punch {
  margin: 0.9rem 0 0;
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  color: var(--red);
}

/* ---------- intro ---------- */

.intro {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  max-width: 60ch;
  font-family: 'Spectral', serif;
  font-size: 1.08rem;
  line-height: 1.75;
}

.intro p { margin: 0 0 1em; }

/* ---------- stat strip (ledger) ---------- */

.stat-strip {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  padding: 1.4rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.2rem 2rem;
}

.stat { display: grid; gap: 0.15rem; align-content: start; }

.stat-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.7rem;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- sections ---------- */

section { margin-top: clamp(3.5rem, 9vw, 6rem); }

h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: -0.01em;
}

.section-note {
  margin: 0.45rem 0 1.6rem;
  max-width: 58ch;
  font-family: 'Spectral', serif;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- bar charts ---------- */

.bars { display: grid; gap: 0.65rem; }

.bar-row {
  display: grid;
  grid-template-columns: 11.5rem 1fr 11rem;
  align-items: center;
  gap: 0.9rem;
}

.bar-label {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
  hyphens: none;
}

.bar-track {
  display: block;
  background: var(--bar-track);
  height: 1.45rem;
}

.bar-fill {
  display: block;
  background: var(--green);
  height: 100%;
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.bar-value strong { color: var(--ink); font-weight: 700; }

/* ---------- record table ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.control { display: grid; gap: 0.3rem; }

.control-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.control input[type="search"],
.control select {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule);
  background: #f6f9f4;
  color: var(--ink);
  border-radius: 0;
  min-width: 14rem;
}

.control.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
}

.control.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--green); }

.control.check .control-label { color: var(--ink); font-size: 0.95rem; font-weight: 500; }

:is(input, select, button):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--paper);
  text-align: left;
  border-bottom: 2px solid var(--ink);
  padding: 0.5rem 0.75rem 0.5rem 0;
  white-space: nowrap;
}

thead button {
  all: unset;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

thead button:hover { color: var(--green); }

th[aria-sort="ascending"] button::after { content: " ↑"; }
th[aria-sort="descending"] button::after { content: " ↓"; }

tbody td {
  border-bottom: 1px solid var(--rule);
  padding: 0.48rem 0.75rem 0.48rem 0;
  vertical-align: top;
}

tbody tr:hover td { background: #e3ebe0; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

td.company { font-weight: 600; }

td .tags {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

td .undisclosed {
  font-family: 'Spectral', serif;
  font-style: italic;
  color: var(--muted);
}

.ai-flag {
  color: var(--red);
  font-weight: 700;
  font-size: 0.8rem;
}

.row-count {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.empty td {
  padding: 2rem 0;
  text-align: center;
  font-family: 'Spectral', serif;
  font-style: italic;
  color: var(--muted);
}

/* ---------- methodology ---------- */

.methodology {
  margin-top: clamp(3.5rem, 9vw, 6rem);
  border-top: 3px double var(--ink);
  padding-top: 1.6rem;
  padding-bottom: 3.5rem;
}

.methodology h2 { font-size: 1.05rem; }

.methodology ul {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  max-width: 62ch;
  font-family: 'Spectral', serif;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.methodology li { margin-bottom: 0.45rem; }

/* ---------- motion & small screens ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-fill { transition: none; }
}

@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .bar-label { text-align: left; }
  .bar-value { justify-self: end; margin-top: -0.3rem; }
  .bar-track { height: 1.1rem; }
  .control input[type="search"], .control select { min-width: 100%; }
  .control { width: 100%; }
}
