/* Investigative / newspaper palette: dark ink on warm cream, one charged red. */
:root {
  --bg: #f6f1e7;
  --bg-tinted: #ece6d7;
  --ink: #1b1a17;
  --ink-soft: #49463f;
  --ink-mute: #7b776d;
  --rule: #d9d2bf;
  --red: #b1302a;
  --red-soft: #d8574f;
  --blue: #2d4a68;
  --accent: #826a2a;
  --radar-bg: #1b1a17;
  --radar-ink: #f6f1e7;
  --radar-grid: #3c3933;
  --radar-fill: rgba(177, 48, 42, 0.35);
  --radar-line: #e08b85;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-family: "Iowan Old Style", "Source Serif Pro", "Georgia", serif;
  font-size: 18px;
  line-height: 1.55;
}

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 720px; }

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  font-family: "Iowan Old Style", "Source Serif Pro", Georgia, serif;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.brand-alt { color: var(--ink-mute); font-weight: 400; font-style: italic; }
.site-nav a {
  margin-left: 24px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--red); text-decoration: underline; }

/* --- hero --- */
.hero { padding: 72px 0 40px; border-bottom: 1px solid var(--rule); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-size: 13px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.015em;
}
.hero-sub { font-size: 20px; color: var(--ink-soft); max-width: 760px; margin: 0 0 32px; }
.hero-cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
}
.hero-cta:hover { background: var(--red); color: var(--bg); }

/* --- stats band --- */
.stats { background: var(--ink); color: var(--bg); padding: 36px 0; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}
@media (max-width: 960px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--bg);
}
.stat-num.stat-red { color: var(--red-soft); }
.stat-label {
  margin-top: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: #b8b2a3;
  line-height: 1.4;
}
.stat-label em { color: var(--red-soft); font-style: normal; }

/* --- panels --- */
.panel { padding: 72px 0; border-bottom: 1px solid var(--rule); }
.panel.tinted { background: var(--bg-tinted); }
.panel h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.lede { font-size: 19px; color: var(--ink-soft); max-width: 760px; margin: 0 0 32px; }
.caption {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 16px;
  max-width: 760px;
}

/* --- toggle row --- */
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.toggle-row:last-of-type { margin-bottom: 20px; }
.toggle-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  min-width: 84px;
  padding-right: 4px;
}
@media (max-width: 520px) {
  .toggle-label { min-width: 100%; margin-bottom: 2px; }
}
.toggle {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 8px 14px;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.toggle:hover { border-color: var(--ink); color: var(--ink); }
.toggle[aria-selected="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* --- radar --- */
.radar {
  width: 100%;
  height: 640px;
  background: var(--radar-bg);
  border-radius: 4px;
  overflow: hidden;
}
@media (max-width: 700px) { .radar { height: 480px; } }

/* --- hallmark list --- */
.hallmark-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.hallmark {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 18px 18px 16px;
  transition: border-color 0.12s, transform 0.12s;
}
.hallmark:hover { border-color: var(--ink); transform: translateY(-1px); }
.hallmark h3 {
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 6px;
  font-weight: 700;
}
.hallmark p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  line-height: 1.45;
}
.hallmark .counts {
  display: flex;
  gap: 14px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  color: var(--ink-mute);
}
.hallmark .count-num { font-size: 16px; display: block; color: var(--ink); font-weight: 700; }
.hallmark .count-ref .count-num { color: var(--red); }

/* --- method / footer --- */
.panel code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  background: var(--bg-tinted);
  padding: 1px 6px;
  border-radius: 2px;
}
.panel.tinted code { background: var(--bg); }
.sources { font-size: 14px; color: var(--ink-mute); margin-top: 24px; }

.coming-soon { background: var(--ink); color: var(--bg); }
.coming-soon h2 { color: var(--bg); }
.coming-soon .teasers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .coming-soon .teasers { grid-template-columns: 1fr; } }
.coming-soon .teasers li { font-size: 17px; color: #d7d1c2; line-height: 1.5; }
.coming-soon .teasers strong { color: var(--bg); display: block; margin-bottom: 4px; letter-spacing: 0.02em; }

.site-footer {
  padding: 32px 0 48px;
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
}

.site-header .brand a { color: inherit; text-decoration: none; }
.site-header .brand a:hover { color: var(--red); }

/* --- Hallmark detail page --- */
.hero-sub-page { padding-top: 40px; padding-bottom: 28px; }
.hero-sub-page h1 {
  font-size: clamp(32px, 4.5vw, 54px);
  margin-top: 8px;
}
.crumb {
  margin: 0 0 20px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.crumb a { color: var(--ink-mute); text-decoration: none; }
.crumb a:hover { color: var(--red); }
.hero-sub-page .sources {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 12px;
  max-width: 760px;
}

.stat-grid.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .stat-grid.stat-grid-3 { grid-template-columns: 1fr; } }

.timeline {
  width: 100%;
  height: 360px;
  background: var(--bg-tinted);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 8px 4px;
}
.panel.tinted .timeline { background: var(--bg); }

/* --- Article list --- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}
.article-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.panel.tinted .article-row { background: var(--bg-tinted); }
@media (max-width: 640px) { .article-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; } }

.article-meta {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
  padding-top: 2px;
}
.article-title {
  font-size: 19px;
  margin: 0 0 10px;
  line-height: 1.3;
  font-weight: 700;
}
.article-title a { color: var(--ink); text-decoration: none; }
.article-title a:hover { color: var(--red); text-decoration: underline; }
.article-evidence {
  margin: 0;
  padding: 6px 0 0 14px;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
}
.empty-list {
  font-style: italic;
  color: var(--ink-mute);
  padding: 16px 0;
}
.link-button {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 6px 12px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
}
.link-button:hover { border-color: var(--ink); color: var(--ink); }
.show-more-caption { margin-top: 16px; }

/* Landing hallmark cards get the link affordance */
a.hallmark {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.hallmark:hover { color: inherit; }
a.hallmark:hover h3 { color: var(--red); }
.hallmark h3 { transition: color 0.1s; }

.site-nav a.current { color: var(--ink); border-bottom: 2px solid var(--red); padding-bottom: 4px; }
.coming-soon a { color: #d7d1c2; text-decoration: none; }
.coming-soon a:hover strong { color: var(--red-soft); }
.coming-soon a strong { transition: color 0.1s; }

/* --- Overview --- */
.timeline.timeline-tall { height: 480px; }
.timeline.timeline-short { height: 280px; }

.lolly-controls,
.entity-controls,
.art-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}
.lolly-controls select,
.entity-controls select,
.art-controls select,
.lolly-controls input,
.entity-controls input,
.art-controls input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 2px;
  font: inherit;
}
.entity-controls input[type="number"] { width: 80px; }
.panel.tinted select,
.panel.tinted input[type="number"] { background: var(--bg); }

.lolly {
  width: 100%;
  min-height: 520px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 6px;
}
.panel.tinted .lolly { background: var(--bg-tinted); }

/* --- Entities grid --- */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px 14px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, transform 0.12s;
  min-height: 130px;
}
.tile:hover { border-color: var(--ink); transform: translateY(-1px); color: inherit; }
.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.tile-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.tile-mean {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tile-mid { margin: 4px 0 8px; }
.tile-mid .spark { display: block; }
.tile-bot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

/* --- Entity detail: co-occurring narratives, tiers --- */
.cooc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cooc-row {
  display: grid;
  grid-template-columns: 240px 1fr 110px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
}
.panel.tinted .cooc-row { background: var(--bg-tinted); }
.cooc-row:hover { border-color: var(--ink); color: inherit; }
.cooc-row:hover .cooc-label { color: var(--red); }
.cooc-label { font-weight: 600; transition: color 0.1s; }
.cooc-bar-wrap {
  height: 8px;
  background: var(--rule);
  border-radius: 99px;
  overflow: hidden;
}
.cooc-bar { display: block; height: 100%; background: var(--red); }
.cooc-val {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cooc-n { color: var(--ink-mute); font-size: 11px; }
@media (max-width: 640px) {
  .cooc-row { grid-template-columns: 1fr auto; }
  .cooc-row .cooc-bar-wrap { grid-column: 1 / -1; order: 3; }
}

.tier-list { display: flex; flex-direction: column; gap: 30px; }
.tier-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}
.tier-chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 99px;
}
.tier-head h3 { font-size: 18px; margin: 0; flex: 1; font-weight: 700; }
.tier-count { color: var(--ink-mute); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 13px; }

/* --- Articles explorer --- */
.art-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.art-row input[type="search"] {
  flex: 1;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 2px;
  font: inherit;
  font-size: 15px;
}
.art-row input[type="search"]:focus {
  outline: none;
  border-color: var(--ink);
}
.art-count {
  margin-top: 6px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
}
#art-count-num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.art-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.art-results .art-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin: 0;
}
.art-results .art-row:hover { border-color: var(--ink); }
@media (max-width: 640px) { .art-results .art-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 16px; } }
.art-date {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
  padding-top: 2px;
}
.art-title {
  font-size: 19px;
  margin: 0 0 8px;
  line-height: 1.3;
  font-weight: 700;
}
.art-title a { color: var(--ink); text-decoration: none; }
.art-title a:hover { color: var(--red); text-decoration: underline; }
.art-snippet {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 15px;
}
.art-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.chip {
  display: inline-block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.chip-narr { background: rgba(177, 48, 42, 0.12); color: var(--red); border: 1px solid rgba(177, 48, 42, 0.2); }
.chip-narr:hover { background: rgba(177, 48, 42, 0.2); }
.chip-narr.chip-refute { background: rgba(45, 74, 104, 0.12); color: var(--blue); border: 1px solid rgba(45, 74, 104, 0.2); }
.chip-narr.chip-refute:hover { background: rgba(45, 74, 104, 0.2); }
.chip-ent { background: var(--bg-tinted); color: var(--ink-soft); border: 1px solid var(--rule); }
.chip-ent:hover { border-color: var(--ink); color: var(--ink); }
.chip-more { color: var(--ink-mute); background: transparent; border: 1px dashed var(--rule); }
.art-links {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}
.art-links a { color: var(--ink-mute); text-decoration: none; }
.art-links a:hover { color: var(--red); text-decoration: underline; }

/* --- Article detail: score rows --- */
.score-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.score-row {
  display: grid;
  grid-template-columns: 90px 180px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
}
.panel.tinted .score-row { background: var(--bg-tinted); }
.score-row:hover { border-color: var(--ink); color: inherit; }
.score-row:hover .score-label { color: var(--red); }
.score-chip {
  display: inline-block;
  color: var(--bg);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 4px 10px;
  border-radius: 99px;
}
.score-label { font-weight: 600; transition: color 0.1s; }
.score-evidence {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 700px) {
  .score-row { grid-template-columns: 90px 1fr; }
  .score-evidence { grid-column: 1 / -1; padding-left: 8px; border-left: 3px solid var(--rule); }
}
