/* Dropnet: a number range is the unit. Red = reported, teal = faked caller ID (owner innocent), grey = clean. */
:root {
  --paper: #f2f4f1; --raise: #fafbf9; --ink: #15212c; --muted: #5a6772; --rule: #cdd5d2;
  --signal: #cf2e1d; --clear: #1b7a66; --dim: #dde3e0; --focus: #2f5fd0;
  --warn-bg: #fbeee0; --warn-ink: #6b3a0d;
  --c-block: #15212c; --c-number: #cf2e1d; --c-state: #2f5fd0; --c-subject: #8a5a00;
  --wide: "wdth" 125; --narrow: "wdth" 80;
  --code: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10171c; --raise: #162027; --ink: #e3e9e6; --muted: #93a1a9; --rule: #2a3740;
    --signal: #ff5a43; --clear: #4fc1a7; --dim: #1a242b; --focus: #8fb0ff;
    --warn-bg: #2e2316; --warn-ink: #f3c99a; --c-block: #e3e9e6; --c-number: #ff5a43; --c-state: #8fb0ff; --c-subject: #e0b45c;
  }
}
:root[data-theme="dark"] {
  --paper: #10171c; --raise: #162027; --ink: #e3e9e6; --muted: #93a1a9; --rule: #2a3740;
  --signal: #ff5a43; --clear: #4fc1a7; --dim: #1a242b; --focus: #8fb0ff;
  --warn-bg: #2e2316; --warn-ink: #f3c99a; --c-block: #e3e9e6; --c-number: #ff5a43; --c-state: #8fb0ff; --c-subject: #e0b45c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 Archivo, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.quiet { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2 { font-variation-settings: var(--wide); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 750; line-height: 1.2; margin: 0 0 .4rem; max-width: 30ch; }
section > p.quiet, .evidence p.quiet { max-width: 68ch; margin: 0 0 1rem; }

/* header */
.top { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto;
  padding: 18px 24px 0; }
.brand { font-size: 1.25rem; font-weight: 850; font-variation-settings: var(--wide); text-decoration: none;
  margin-right: auto; }
.engine { font-size: .82rem; color: var(--muted); }
.repo { font-size: .82rem; }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
main > section { padding: 48px 0; border-top: 1px solid var(--rule); }
main > section.hero { border-top: 0; padding-top: 40px; }

/* hero: the question on the left, the range itself on the right */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 56px; align-items: start; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); line-height: .98; font-weight: 850; margin: 0 0 28px; max-width: 11ch; }
.dial { display: flex; gap: 0; border: 2px solid var(--ink); border-radius: 4px; background: var(--raise); max-width: 560px; }
.dial input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 14px 16px;
  font: 800 clamp(1.5rem, 3.4vw, 2.3rem)/1 Archivo, sans-serif; font-variation-settings: var(--wide);
  font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.dial input::placeholder { color: var(--rule); }
.dial input:focus { outline: none; }
.dial:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
.go { border: 0; background: var(--ink); color: var(--paper); font-weight: 750; padding: 0 26px; font-size: 1.05rem;
  border-radius: 0 1px 1px 0; }
.go:hover { background: var(--signal); }
.go.small { padding: 9px 18px; font-size: .95rem; border-radius: 3px; }
#num-out { margin-top: 22px; max-width: 560px; min-height: 9rem; }
#num-out p { margin: 0 0 .6rem; }
.verdict { font-size: 1.45rem; font-weight: 800; line-height: 1.2; font-variation-settings: var(--wide); margin-bottom: .5rem !important; }
.verdict.pool { color: var(--signal); }
.verdict.likely_spoofed { color: var(--clear); }
.links { font-size: .9rem; }
.caution { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: 3px; font-size: .9rem;
  margin-top: 12px; }

.range { margin: 0; position: relative; }
#grid { width: 100%; height: auto; aspect-ratio: 1; display: block; cursor: crosshair; image-rendering: pixelated;
  background: var(--dim); }
.range figcaption { margin-top: 12px; font-size: .95rem; }
.range figcaption b { font-weight: 800; font-variation-settings: var(--wide); }
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.key i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.k-rep { background: var(--signal); } .k-spoof { background: var(--clear); } .k-none { background: var(--dim); outline: 1px solid var(--rule); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: .8rem;
  padding: 4px 8px; border-radius: 2px; white-space: nowrap; transform: translate(-50%, -130%); }

/* the thesis: the one sentence the whole page argues */
.thesis p { font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.3; font-weight: 500; max-width: 34ch; margin: 0; }
.thesis b { font-weight: 800; font-variation-settings: var(--wide); }

/* evidence: plain bars, no boxes */
.evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.hbar { display: grid; grid-template-columns: minmax(0, 15rem) 1fr 3.6rem; gap: 12px; align-items: center; margin: 10px 0;
  font-size: .9rem; }
.hbar .track { height: 12px; background: var(--dim); }
.hbar .fill { height: 100%; background: var(--muted); }
.hbar.ours .fill { background: var(--signal); }
.hbar.ours span:first-child { font-weight: 700; }
.hbar .v { text-align: right; font-weight: 700; }
#spoof-bars .fill { background: var(--clear); }

/* early warning: one range on a timeline */
.early { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.early-text p { max-width: 52ch; margin: 0 0 1rem; }
.early-text #early-story { font-size: 1.1rem; }
.early-text b { font-weight: 800; }
.early-chart { margin: 0; }
#early-svg { width: 100%; height: auto; display: block; overflow: visible; }
#early-svg .before { fill: var(--muted); }
#early-svg .after { fill: var(--signal); }
#early-svg .axis { stroke: var(--rule); }
#early-svg .flag { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
#early-svg .flag-label { fill: var(--ink); font-size: 13px; font-weight: 750; }
#early-svg .first { fill: var(--ink); }
#early-svg .tick { fill: var(--muted); font-size: 12px; }
.early-chart figcaption { font-size: .85rem; margin-top: 8px; }

/* pre-registered forward test */
.prereg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; margin: 8px 0 18px; }
.prereg-facts { margin: 0; }
.prereg-facts div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--rule); font-size: .92rem; }
.prereg-facts dt { color: var(--muted); }
.prereg-facts dd { margin: 0; font-weight: 600; }
.prereg-tests { margin: 0; padding-left: 1.3rem; }
.prereg-tests li { padding: 8px 0 8px 4px; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.prereg-tests li span { display: block; }
.status { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 750; padding: 2px 8px; border-radius: 2px; }
.status.pending { background: var(--dim); color: var(--muted); }
.status.pass { background: var(--clear); color: var(--paper); }
.status.fail { background: var(--signal); color: var(--paper); }
#prereg-proof code { font-family: var(--code); font-size: .85em; }

/* network and what-if */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; padding: 0; list-style: none; }
.chips button, .chips label { border: 1px solid var(--rule); background: var(--raise); padding: 5px 10px; border-radius: 3px;
  font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.chips button:hover, .chips label:hover { border-color: var(--ink); }
.chips b { font-variation-settings: var(--wide); }
.chips input { accent-color: var(--signal); margin: 0; }
#wi-out { margin-top: 14px; max-width: 68ch; font-size: 1.05rem; }

/* pool explorer */
.camp-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; margin-top: 18px; }
.camp-list { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow: auto; border-top: 1px solid var(--rule); }
.camp-card { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none;
  padding: 10px 8px; }
.camp-card:hover { background: var(--raise); }
.camp-card.active { background: var(--raise); box-shadow: inset 3px 0 0 var(--signal); }
.camp-card .id { font-weight: 800; font-variation-settings: var(--wide); }
.camp-card .meta { color: var(--muted); font-size: .82rem; }
.camp-head { display: flex; gap: 6px 18px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; font-size: .9rem; color: var(--muted); }
.camp-head h3 { margin: 0; font-size: 1.6rem; font-weight: 850; font-variation-settings: var(--wide); color: var(--ink); }
.graph-wrap { position: relative; background: var(--raise); border: 1px solid var(--rule); }
#ftc-graph { height: 520px; }
.legend { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem;
  color: var(--muted); background: color-mix(in srgb, var(--raise) 88%, transparent); padding: 4px 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* Cypher console */
.samples { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.samples button { border: 1px solid var(--rule); background: var(--raise); padding: 5px 10px; border-radius: 3px; font-size: .88rem; }
.samples button:hover { border-color: var(--ink); }
textarea { width: 100%; font: .9rem/1.5 var(--code); color: var(--ink); background: var(--raise); border: 1px solid var(--rule);
  border-radius: 3px; padding: 12px; resize: vertical; }
.row { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; font-size: .88rem; }
#q-out { margin-top: 14px; overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: .88rem; }
.grid th, .grid td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); }
.grid th { color: var(--muted); font-weight: 600; }
.err { color: var(--signal); font-family: var(--code); white-space: pre-wrap; }

footer { max-width: 1180px; margin: 0 auto; padding: 24px 24px 48px; border-top: 1px solid var(--rule); color: var(--muted);
  font-size: .82rem; }
footer p { max-width: 90ch; margin: 0 0 6px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .range { max-width: min(470px, 100%); }
  .evidence, .early, .prereg-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .camp-layout { grid-template-columns: 1fr; }
  .camp-list { max-height: 220px; }
  #ftc-graph { height: 420px; }
}
@media (max-width: 600px) {
  .top, main, footer { padding-left: 16px; padding-right: 16px; }
  main > section { padding: 36px 0; }
  .hbar { grid-template-columns: minmax(0, 1fr) 3.2rem; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .go { padding: 0 16px; }
  .go.small { padding: 9px 16px; }
  .prereg-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
