/* ============================================================
   The Cumulative Case — mockup stylesheet
   Editorial / print-scholarship aesthetic
   ============================================================ */

:root {
  --paper: #f7f2e7;
  --paper-deep: #efe7d5;
  --ink: #241f16;
  --ink-soft: #52493a;
  --ink-faint: #8a7f6c;
  --madder: #96402a;        /* terracotta — the Arabian trail */
  --madder-deep: #6e2e1e;
  --slate: #3b566b;         /* criticisms & counterpoint */
  --gold: #b98a2f;
  --line: #d9cdb4;
  --line-soft: #e6dcc6;
  --card: #fbf8f0;
  --serif-display: "Fraunces", serif;
  --serif-body: "Newsreader", serif;
  --mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(185, 138, 47, 0.07), transparent),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(36, 31, 22, 0.012) 2px 4px);
}

::selection { background: rgba(150, 64, 42, 0.18); }

.measure { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* ---------- masthead ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 242, 231, 0.92);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}

.topbar-inner {
  display: flex; align-items: baseline; gap: 28px;
  padding: 14px 32px; max-width: 1100px; margin: 0 auto;
}

.wordmark {
  font-family: var(--serif-display);
  font-weight: 600; font-size: 19px; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark .amp { color: var(--madder); font-style: italic; }

.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.topnav a:hover { color: var(--madder); border-color: var(--madder); }
.topnav a.active { color: var(--madder); border-color: var(--madder); }

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

.hero { padding: 84px 0 64px; position: relative; overflow: hidden; }

.hero-kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--madder); margin-bottom: 26px;
  display: flex; align-items: center; gap: 14px;
}
.hero-kicker::after { content: ""; height: 1px; width: 72px; background: var(--madder); opacity: .5; }

.hero h1 {
  font-family: var(--serif-display);
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500; line-height: 1.04; letter-spacing: -0.015em;
  max-width: 15ch;
}
.hero h1 em {
  font-style: italic; font-weight: 400; color: var(--madder);
}

.hero-sub {
  margin-top: 30px; max-width: 58ch; font-size: 19.5px; line-height: 1.6;
  color: var(--ink-soft);
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-actions { margin-top: 38px; display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.07em;
  text-transform: uppercase; text-decoration: none; padding: 13px 24px;
  border: 1px solid var(--ink); color: var(--ink);
  transition: all .18s ease; display: inline-block;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--madder); border-color: var(--madder); color: #fdf9f0; }
.btn.primary:hover { background: var(--madder-deep); border-color: var(--madder-deep); }

/* faint compass rose ornament */
.hero-ornament {
  position: absolute; right: -60px; top: 40px; width: 380px; height: 380px;
  opacity: 0.09; pointer-events: none;
}

/* ---------- stat strip ---------- */

.statstrip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.statstrip-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat { padding: 26px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat b {
  display: block; font-family: var(--serif-display); font-weight: 500;
  font-size: 34px; line-height: 1.1; color: var(--ink);
}
.stat span {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}
.stat.corrections b { color: var(--madder); }

/* ---------- section scaffolding ---------- */

section.block { padding: 76px 0; }
section.block.tinted { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 14px; }
.section-num {
  font-family: var(--mono); font-size: 12px; color: var(--madder); letter-spacing: .1em;
}
.section-head h2 {
  font-family: var(--serif-display); font-weight: 500;
  font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.01em;
}
.section-lede { max-width: 62ch; color: var(--ink-soft); margin-bottom: 44px; font-size: 18px; }

/* ---------- rating meters ---------- */

.rating-pair { display: flex; gap: 18px; align-items: center; }

.meter { display: flex; flex-direction: column; gap: 5px; }
.meter-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.meter-cells { display: flex; gap: 3px; }
.meter-cells i {
  width: 15px; height: 7px; background: var(--line);
  display: block;
}
.meter.fact i.on { background: var(--ink); }
.meter.inference i.on { background: var(--madder); }
.meter-value {
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
}

/* ---------- evidence cards ---------- */

.cardgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }

.ecard {
  background: var(--card); padding: 30px 28px 26px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 16px; position: relative;
  transition: background .2s;
}
.ecard:hover { background: #fffdf6; }
.ecard:hover .ecard-title { color: var(--madder); }

.ecard-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.ecard-title {
  font-family: var(--serif-display); font-weight: 500; font-size: 22px;
  line-height: 1.22; letter-spacing: -0.005em; transition: color .18s;
}
.ecard-sum { font-size: 15px; line-height: 1.55; color: var(--ink-soft); flex: 1; }
.ecard-foot { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.ecard-year { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.ecard-year b { color: var(--ink); font-weight: 500; }

/* ---------- criticism cards ---------- */

.ccard { border-left: 3px solid var(--slate); }
.status-chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid;
}
.status-chip.unresolved { color: #8a4a12; border-color: #c9954d; background: rgba(185,138,47,.08); }
.status-chip.contested { color: var(--slate); border-color: #90a7b8; background: rgba(59,86,107,.07); }
.status-chip.partial { color: #4c6b3c; border-color: #93ac85; background: rgba(92,125,74,.08); }

/* ---------- timeline ---------- */

.timeline-wrap { position: relative; padding: 46px 0 12px; }
.timeline-axis { position: relative; height: 1px; background: var(--ink-soft); margin: 74px 0 10px; }
.timeline-axis::before, .timeline-axis::after {
  content: ""; position: absolute; top: -3px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--ink-soft);
}
.timeline-axis::before { left: 0; } .timeline-axis::after { right: 0; }

.tl-event { position: absolute; bottom: 10px; transform: translateX(-50%); text-align: center; }
.tl-event .dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--madder);
  margin: 8px auto 0; border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--madder);
}
.tl-event.small .dot { width: 8px; height: 8px; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tl-event .lbl {
  font-family: var(--mono); font-size: 10px; line-height: 1.4; color: var(--ink-soft);
  white-space: nowrap;
}
.tl-event .lbl b { display: block; color: var(--ink); font-weight: 500; font-size: 11px; }
.tl-years { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* ---------- entry paths ---------- */

.paths { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.path {
  background: var(--paper); padding: 26px 22px; text-decoration: none; color: inherit;
  transition: background .2s;
}
.path:hover { background: var(--card); }
.path .glyph { font-family: var(--serif-display); font-size: 30px; color: var(--madder); font-style: italic; }
.path h3 { font-family: var(--serif-display); font-weight: 500; font-size: 18px; margin: 12px 0 6px; }
.path p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- principles ---------- */

.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; counter-reset: p; }
.principle { padding: 26px 0; border-top: 1px solid var(--line); display: flex; gap: 22px; }
.principle::before {
  counter-increment: p; content: "0" counter(p);
  font-family: var(--mono); font-size: 12px; color: var(--madder); padding-top: 5px;
}
.principle h3 { font-family: var(--serif-display); font-weight: 500; font-size: 19px; margin-bottom: 6px; }
.principle p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }

/* ---------- scoreboard & claims table ---------- */

.scoreboard { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 40px; }
.score { flex: 1; background: var(--card); padding: 22px 24px; }
.score b { display: block; font-family: var(--serif-display); font-weight: 500; font-size: 40px; line-height: 1.05; }
.score span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.score.total b { color: var(--ink); }
.score.found b { color: #4c6b3c; }
.score.partial b { color: #8a4a12; }
.score.open b { color: var(--slate); }

.claims-table { width: 100%; border-collapse: collapse; margin-top: 40px; border: 1px solid var(--line); background: var(--card); }
.claims-table th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); text-align: left; padding: 14px 16px; border-bottom: 2px solid var(--ink);
  background: var(--paper-deep);
}
.claims-table td { padding: 18px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-size: 14px; line-height: 1.55; }
.claims-table tr:last-child td { border-bottom: none; }
.claims-table tr:hover td { background: #fffdf6; }
.claims-table td b { font-family: var(--serif-display); font-weight: 500; font-size: 16px; }
.claims-table .vref { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--madder); margin-top: 5px; }
.claims-table .src { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 7px; line-height: 1.5; }
.claims-table tr.tgroup td {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--madder); background: var(--paper-deep); padding: 12px 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.claims-table tr.tgroup:hover td { background: var(--paper-deep); }
.claims-table td:nth-child(1) { width: 17%; }
.claims-table td:nth-child(2) { width: 22%; }
.claims-table td:nth-child(4) { width: 10%; white-space: nowrap; }

.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border: 1px solid; display: inline-block;
}
.chip-found { color: #3d5a30; border-color: #7f9a70; background: rgba(92,125,74,.10); }
.chip-partial { color: #8a4a12; border-color: #c9954d; background: rgba(185,138,47,.10); }
.chip-open { color: var(--slate); border-color: #90a7b8; background: rgba(59,86,107,.08); }

.investigating {
  display: block; margin-top: 10px; padding: 10px 12px;
  border-left: 2px solid var(--gold); background: rgba(185,138,47,.06);
  font-size: 13.5px; line-height: 1.55;
}
.investigating .tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #8a4a12; display: block; margin-bottom: 4px;
}

@media (max-width: 900px) {
  .claims-table thead { display: none; }
  .claims-table, .claims-table tbody, .claims-table tr, .claims-table td { display: block; width: 100% !important; }
  .claims-table td { border-bottom: none; padding: 8px 16px; }
  .claims-table tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .scoreboard { flex-direction: column; }
}

/* ---------- more-row & trust band ---------- */

.more-row { margin-top: 26px; text-align: right; }
.more-row a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--madder); text-decoration: none; border-bottom: 1px solid transparent;
}
.more-row a:hover { border-color: var(--madder); }
.more-row span {
  font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint);
}

.wip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 4px;
}
a.ecard .wip { color: var(--madder); }

.trustband { padding: 64px 0; border-top: 1px solid var(--line); }
.trustband p {
  font-family: var(--serif-display); font-weight: 400; font-style: italic;
  font-size: clamp(19px, 2.4vw, 24px); line-height: 1.5; max-width: 34em; color: var(--ink-soft);
}
.trustband .hero-actions { margin-top: 30px; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); background: var(--paper-deep); padding: 54px 0 40px; margin-top: 40px; }
.foot-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-brand { font-family: var(--serif-display); font-size: 20px; font-weight: 600; }
.foot-note { max-width: 52ch; font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; line-height: 1.6; }
.foot-links { display: flex; gap: 40px; }
.foot-links div { display: flex; flex-direction: column; gap: 8px; }
.foot-links b { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.foot-links a { font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--madder); }
.foot-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-faint); }

/* ============================================================
   ARTICLE (evidence page)
   ============================================================ */

.article-head { padding: 56px 0 0; }
.crumbs {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 30px;
}
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--madder); }
.crumbs span { color: var(--madder); }

.article-title {
  font-family: var(--serif-display); font-weight: 500;
  font-size: clamp(36px, 5vw, 56px); line-height: 1.06; letter-spacing: -0.015em; max-width: 18ch;
}

.article-standfirst {
  font-size: 20px; line-height: 1.6; color: var(--ink-soft); max-width: 60ch; margin-top: 24px;
  font-style: italic;
}

.article-databar {
  margin-top: 40px; border: 1px solid var(--line); background: var(--card);
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 36px; align-items: center;
  padding: 20px 26px;
}
.databar-item { display: flex; flex-direction: column; gap: 4px; }
.databar-item .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.databar-item .v { font-family: var(--serif-display); font-size: 17px; font-weight: 500; }
.databar-item .v a { color: var(--madder); text-decoration: none; }

/* depth toggle */
.depth-toggle {
  display: inline-flex; border: 1px solid var(--ink); margin-top: 44px;
}
.depth-toggle button {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  background: none; border: none; padding: 11px 20px; cursor: pointer; color: var(--ink-soft);
  border-left: 1px solid var(--line);
}
.depth-toggle button:first-child { border-left: none; }
.depth-toggle button.on { background: var(--ink); color: var(--paper); }

/* article body */
.article-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; padding: 56px 0 80px; }

.prose h2 {
  font-family: var(--serif-display); font-weight: 500; font-size: 27px;
  margin: 52px 0 18px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 16px;
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h2 .sn { font-family: var(--mono); font-size: 12px; color: var(--madder); }
.prose p { margin-bottom: 18px; max-width: 65ch; }
.prose .lede-p { font-size: 19px; }
.prose sup { font-family: var(--mono); font-size: 11px; color: var(--madder); }
.prose blockquote {
  border-left: 2px solid var(--madder); padding: 6px 0 6px 24px; margin: 26px 0;
  font-style: italic; color: var(--ink-soft); font-size: 18px; max-width: 58ch;
}

.callout {
  border: 1px solid var(--line); background: var(--card); padding: 24px 26px; margin: 28px 0;
  max-width: 65ch;
}
.callout .k {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--madder); display: block; margin-bottom: 10px;
}
.callout p { font-size: 15px; margin-bottom: 0; color: var(--ink-soft); }

.counterpoint { border-left: 3px solid var(--slate); }
.counterpoint .k { color: var(--slate); }

/* sidebar */
.sidebar { font-size: 14px; }
.side-box { border: 1px solid var(--line); background: var(--card); padding: 22px; margin-bottom: 22px; }
.side-box .k {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); display: block; margin-bottom: 14px;
}
.side-box .rating-pair { flex-direction: column; align-items: flex-start; gap: 14px; }
.side-rationale { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-top: 12px; }

.src-item { padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.5; }
.src-item:first-of-type { border-top: none; padding-top: 0; }
.src-tier {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; padding: 2px 6px;
  border: 1px solid var(--line); color: var(--ink-faint); margin-right: 6px;
}
.src-tier.p1 { color: var(--madder); border-color: var(--madder); }
.src-item a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.src-item a:hover { color: var(--madder); border-color: var(--madder); }

.changelog-item { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.changelog-item:first-of-type { border-top: none; padding-top: 0; }
.changelog-item .d { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; padding-top: 2px; }

.export-row { display: flex; gap: 10px; margin-top: 6px; }
.export-row a {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); padding: 6px 10px; color: var(--ink-soft); text-decoration: none;
}
.export-row a:hover { border-color: var(--madder); color: var(--madder); }

/* footnotes */
.footnotes { border-top: 1px solid var(--line); margin-top: 60px; padding-top: 26px; max-width: 65ch; }
.footnotes .k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 14px; }
.footnotes ol { padding-left: 20px; }
.footnotes li { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; line-height: 1.55; }

/* reveal animation */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .7s cubic-bezier(.2,.7,.3,1) both; }
.rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; }
.rise.d3 { animation-delay: .24s; } .rise.d4 { animation-delay: .32s; }

@media (max-width: 900px) {
  .statstrip-inner { grid-template-columns: repeat(2, 1fr); }
  .cardgrid { grid-template-columns: 1fr; }
  .paths { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
  .article-body { grid-template-columns: 1fr; }
  .article-databar { grid-template-columns: 1fr 1fr; }
}
