:root {
  --ink: #151512;
  --paper: #f0ebdf;
  --paper-deep: #ddd5c4;
  --signal: #ed5d2f;
  --acid: #d7f246;
  --muted: #6c695f;
  --line: rgba(21, 21, 18, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 2%, rgba(237, 93, 47, .13), transparent 26rem),
    var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

button, input { font: inherit; }
button { color: inherit; }

.masthead {
  height: 64px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--paper); background: var(--ink); }
.live { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.live span { width: 8px; height: 8px; background: var(--signal); border-radius: 50%; box-shadow: 0 0 0 5px rgba(237,93,47,.15); }

main { padding: 0 clamp(20px, 4vw, 64px) 80px; }

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 34%);
  align-items: end;
  gap: 48px;
  padding: 72px 0 52px;
  border-bottom: 1px solid var(--ink);
}

.eyebrow, .rail-title {
  margin: 0 0 18px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(52px, 7.5vw, 112px); line-height: .86; letter-spacing: -.065em; font-weight: 400; }
h1 em { color: var(--signal); font-weight: 400; }
.dek { max-width: 680px; margin: 32px 0 0; font-size: clamp(17px, 2vw, 23px); line-height: 1.45; }

.hero-stats { align-self: end; border-top: 6px solid var(--ink); }
.hero-stats div { display: flex; align-items: baseline; justify-content: space-between; padding: 17px 0 13px; border-bottom: 1px solid var(--ink); }
.hero-stats strong { font-family: "Courier New", monospace; font-size: clamp(34px, 5vw, 64px); line-height: 1; }
.hero-stats span { font-size: 13px; }

.control-deck {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  padding: 16px 0;
  background: rgba(240,235,223,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink);
}

.search-wrap { display: flex; align-items: center; gap: 10px; min-width: 250px; font-family: "Courier New", monospace; font-size: 11px; font-weight: 700; }
.search-wrap input { width: min(380px, 35vw); border: 0; border-bottom: 1px solid var(--muted); outline: none; background: transparent; padding: 7px 2px; }
.search-wrap input:focus { border-color: var(--signal); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.filters button { cursor: pointer; border: 1px solid var(--ink); background: transparent; padding: 8px 13px; font-family: "Courier New", monospace; font-size: 11px; }
.filters button:hover, .filters button.active { color: var(--paper); background: var(--ink); }

.archive-layout { display: grid; grid-template-columns: 150px 1fr; gap: clamp(30px, 5vw, 76px); padding-top: 46px; }
.timeline { position: sticky; top: 88px; align-self: start; }
.timeline nav { border-left: 1px solid var(--line); }
.timeline button { display: block; width: 100%; cursor: pointer; border: 0; background: none; padding: 10px 0 10px 16px; text-align: left; font-family: "Courier New", monospace; font-size: 11px; color: var(--muted); }
.timeline button.active { color: var(--ink); font-weight: 700; border-left: 4px solid var(--signal); transform: translateX(-2px); }

.report-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.report-head h2 { margin: 0; max-width: 820px; font-size: clamp(30px, 4vw, 58px); line-height: 1.02; letter-spacing: -.035em; font-weight: 400; }
.result-count { margin: 0 0 6px; white-space: nowrap; font: 700 11px/1 "Courier New", monospace; }

.top-signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 34px; background: var(--ink); border: 1px solid var(--ink); }
.top-card { position: relative; min-height: 260px; padding: 22px; background: var(--acid); display: flex; flex-direction: column; animation: rise .55s both; }
.top-card:nth-child(2) { background: var(--signal); color: #fff9eb; animation-delay: .07s; }
.top-card:nth-child(3) { background: var(--ink); color: var(--paper); animation-delay: .14s; }
.rank { font: 700 11px/1 "Courier New", monospace; }
.top-card h3 { margin: auto 0 18px; font-size: clamp(23px, 2.4vw, 36px); line-height: 1; font-weight: 400; letter-spacing: -.03em; }
.top-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.top-open { width: max-content; cursor: pointer; margin-top: 18px; padding: 0 0 3px; border: 0; border-bottom: 1px solid currentColor; color: inherit; background: transparent; font: 700 10px/1.2 "Courier New", monospace; text-transform: uppercase; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.signal-card { position: relative; overflow: hidden; min-height: 310px; padding: 24px; border: 1px solid var(--ink); background: rgba(255,255,255,.18); display: flex; flex-direction: column; transition: transform .22s ease, box-shadow .22s ease; animation: rise .45s both; }
.signal-card:hover { transform: translate(-4px,-4px); box-shadow: 8px 8px 0 var(--ink); }
.card-meta { display: flex; justify-content: space-between; gap: 16px; font: 700 10px/1.3 "Courier New", monospace; text-transform: uppercase; letter-spacing: .08em; }
.tag { display: inline-block; padding: 5px 7px; color: var(--paper); background: var(--ink); }
.signal-card h3 { margin: 28px 0 13px; font-size: clamp(25px, 2.7vw, 39px); line-height: 1.03; letter-spacing: -.035em; font-weight: 400; }
.signal-card .summary { margin: 0 0 24px; color: #3f3e38; font-size: 15px; line-height: 1.55; }
.evidence { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence div { padding: 12px 8px 10px 0; }
.evidence div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.evidence small { display: block; margin-bottom: 5px; color: var(--muted); font: 10px/1 "Courier New", monospace; }
.evidence strong { font-size: 13px; font-weight: 400; }
.takeaway { margin: 18px 0 0; padding-left: 13px; border-left: 4px solid var(--signal); font-size: 13px; line-height: 1.5; }
.detail-toggle { position: relative; z-index: 1; width: 100%; cursor: pointer; margin-top: 20px; padding: 13px 0 5px; border: 0; border-top: 1px solid var(--ink); color: inherit; background: transparent; display: flex; justify-content: space-between; text-align: left; font: 700 11px/1.3 "Courier New", monospace; }
.detail-toggle:hover { color: var(--signal); }
.detail-toggle b { font-size: 17px; line-height: .8; }
.stance { align-self: start; padding: 5px 4px; color: var(--ink); background: var(--paper); text-align: center; font: 700 9px/1 "Courier New", monospace; }
.stance.positive { background: var(--acid); }
.stance.negative { color: var(--paper); background: var(--signal); }
.stance.question { background: #f2bf46; }
.muted-note { color: #b9b3a5; }

body.reader-open { overflow: hidden; }
.reader { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); background: var(--paper); }
.reader::backdrop { background: var(--paper); }
.reader-shell { height: 100%; display: grid; grid-template-rows: 62px minmax(0,1fr) 64px; }
.reader-bar, .reader-nav { padding: 0 clamp(22px, 4vw, 48px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); font: 700 10px/1 "Courier New", monospace; letter-spacing: .08em; text-transform: uppercase; }
.reader-bar > div { display: flex; gap: 24px; }
.reader-close { cursor: pointer; padding: 9px 12px; border: 1px solid var(--ink); background: transparent; font: inherit; }
.reader-close:hover { color: var(--paper); background: var(--ink); }
.reader-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--signal) var(--paper-deep); }
.reader-article { width: min(880px, calc(100% - 64px)); margin: 0 auto; padding: clamp(52px, 7vw, 96px) 0 110px; }
.reader-category, .reader-label { margin: 0 0 18px; color: var(--signal); font: 700 10px/1.3 "Courier New", monospace; letter-spacing: .13em; text-transform: uppercase; }
.reader-article h2 { margin: 0; font-size: clamp(43px, 6.2vw, 76px); line-height: .98; letter-spacing: -.055em; font-weight: 400; }
.reader-lead { margin: 30px 0 0; font-size: clamp(18px, 2.4vw, 25px); line-height: 1.5; color: #3f3e38; }
.reader-facts { display: grid; grid-template-columns: repeat(3,1fr); margin: 46px 0 0; border-top: 5px solid var(--ink); border-bottom: 1px solid var(--ink); }
.reader-facts div { padding: 18px 14px 18px 0; }
.reader-facts div + div { padding-left: 18px; border-left: 1px solid var(--ink); }
.reader-facts span { display: block; margin-bottom: 9px; color: var(--muted); font: 10px/1 "Courier New", monospace; }
.reader-facts strong { font-size: 15px; font-weight: 400; }
.reader-section { margin-top: 70px; padding-top: 24px; border-top: 1px solid var(--ink); }
.reader-prose { font-size: clamp(18px, 2vw, 22px); line-height: 1.85; text-align: justify; }
.reader-discussion { border-top: 1px solid var(--line); }
.reader-comment { display: grid; grid-template-columns: 105px 1fr; gap: 26px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.reader-comment > div { display: flex; align-items: flex-start; gap: 10px; font: 700 10px/1 "Courier New", monospace; }
.reader-comment p { margin: 0; font-size: 17px; line-height: 1.65; }
.confidence-section { padding: 34px; color: var(--ink); background: var(--acid); border-top: 0; }
.confidence-section .reader-label { color: var(--ink); }
.reader-confidence-score { display: flex; align-items: baseline; gap: 7px; }
.reader-confidence-score strong { font: 700 clamp(64px, 10vw, 112px)/.85 "Courier New", monospace; letter-spacing: -.09em; }
.reader-confidence-score span { font: 700 14px/1 "Courier New", monospace; }
.reader-confidence-score em { margin-left: auto; padding: 7px 9px; color: var(--paper); background: var(--ink); font: 700 11px/1 "Courier New", monospace; font-style: normal; }
.reader-meter { height: 8px; margin: 24px 0 18px; background: rgba(21,21,18,.18); }
.reader-meter i { display: block; height: 100%; background: var(--ink); transition: width .4s ease; }
.reader-confidence-reason { margin: 0; max-width: 620px; font-size: 15px; line-height: 1.65; }
.source-section p { color: var(--muted); line-height: 1.6; }
.source-section a { display: flex; justify-content: space-between; margin-top: 24px; padding: 22px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); text-decoration: none; font: 700 12px/1 "Courier New", monospace; }
.source-section a:hover { color: var(--ink); background: var(--acid); }
.reader-nav { border-top: 1px solid var(--ink); border-bottom: 0; }
.reader-nav button { cursor: pointer; border: 0; background: transparent; font: inherit; }
.reader-nav button:hover:not(:disabled) { color: var(--signal); }
.reader-nav button:disabled { opacity: .25; cursor: default; }

.insights { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--ink); background: var(--ink); }
.insight-panel { padding: 26px; background: var(--paper-deep); }
.insight-panel:last-child { background: var(--ink); color: var(--paper); }
.insight-panel h3 { margin: 0 0 20px; font: 700 11px/1 "Courier New", monospace; letter-spacing: .12em; }
.insight-panel ol { margin: 0; padding-left: 20px; }
.insight-panel li { margin: 10px 0; padding-left: 7px; line-height: 1.45; }
.empty-state { padding: 100px 20px; text-align: center; border: 1px dashed var(--muted); }
.empty-state span { font: 700 clamp(32px, 8vw, 100px)/1 "Courier New", monospace; color: var(--paper-deep); }

footer { padding: 28px clamp(20px, 4vw, 64px); border-top: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 20px; font: 10px/1.4 "Courier New", monospace; text-transform: uppercase; letter-spacing: .08em; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3,1fr); }
  .hero-stats div { display: block; }
  .hero-stats span { display: block; margin-top: 6px; }
  .control-deck { position: static; display: block; }
  .search-wrap input { width: 100%; }
  .filters { justify-content: flex-start; margin-top: 12px; }
  .archive-layout { grid-template-columns: 1fr; }
  .timeline { position: static; }
  .timeline nav { display: flex; overflow-x: auto; border: 0; }
  .timeline button { min-width: max-content; border-bottom: 1px solid var(--line); }
  .timeline button.active { border-left: 0; border-bottom: 4px solid var(--signal); transform: none; }
  .top-signals, .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .masthead { padding: 0 16px; }
  .brand > span:last-child { display: none; }
  main { padding-left: 16px; padding-right: 16px; }
  .hero { min-height: auto; }
  h1 { font-size: 52px; }
  .report-head { display: block; }
  .result-count { margin-top: 12px; }
  .insights { grid-template-columns: 1fr; }
  footer { display: block; }
  footer span { display: block; margin: 8px 0; }
  .reader { width: 100vw; height: 100vh; border: 0; box-shadow: none; }
  .reader-shell { grid-template-rows: 54px minmax(0,1fr) 58px; }
  .reader-bar, .reader-nav { padding: 0 16px; }
  .reader-bar > div span:last-child { display: none; }
  .reader-article { width: calc(100% - 32px); padding-top: 42px; }
  .reader-article h2 { font-size: 42px; }
  .reader-facts { grid-template-columns: 1fr; }
  .reader-facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .reader-comment { grid-template-columns: 1fr; gap: 12px; }
  .confidence-section { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
