:root {
  --ink: #17221d;
  --forest: #11201b;
  --deep: #0a1511;
  --paper: #f1ecdd;
  --paper-2: #e3ddca;
  --line: #a8aa96;
  --lime: #d8ff65;
  --mint: #74d8a4;
  --coral: #f07555;
  --fog: #a9b8af;
  --mono: "Martian Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.52;
}

button, input, select { font: inherit; }
button, select, input[type="range"], input[type="checkbox"], input[type="radio"] { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--lime);
  color: var(--deep);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.wrap { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.hero {
  min-height: 860px;
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 29%, rgba(116, 216, 164, 0.13), transparent 24rem),
    linear-gradient(135deg, #142921, var(--deep) 62%);
  color: var(--paper);
  position: relative;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 118px;
  background: var(--paper);
  clip-path: polygon(0 58%, 14% 68%, 28% 36%, 44% 71%, 59% 49%, 75% 72%, 89% 43%, 100% 61%, 100% 100%, 0 100%);
}
.site-nav {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid rgba(241, 236, 221, 0.22);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a { color: var(--lime); font-size: 0.76rem; font-weight: 500; }
.site-nav span { color: var(--fog); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: clamp(30px, 6vw, 100px);
  align-items: center;
  min-height: 570px;
  padding: 62px 0 128px;
}
.kicker, .eyebrow {
  margin: 0 0 20px;
  color: var(--coral);
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hero h1, h2, h3, p { overflow-wrap: break-word; }
.hero h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(3.1rem, 7.5vw, 7.9rem);
  font-weight: 300;
  line-height: 0.91;
  letter-spacing: -0.052em;
}
.hero h1 span { color: var(--lime); font-style: italic; }
.dek {
  max-width: 770px;
  margin: 35px 0 0;
  color: #d1d8cf;
  font-size: clamp(1.05rem, 1.55vw, 1.32rem);
  line-height: 1.55;
}
.dek strong { color: white; font-weight: 500; }
.wing-field { align-self: center; }
.wing-field svg { display: block; width: 100%; height: auto; color: var(--lime); }
.wing-field .bird-shape { fill: rgba(216, 255, 101, 0.08); stroke: var(--lime); stroke-width: 2; }
.wing-field .feather, .wing-field .wind { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.5; }
.wing-field .wind { stroke-dasharray: 8 12; animation: drift 15s linear infinite; }
.wing-field .wind-b { animation-duration: 21s; animation-direction: reverse; opacity: 0.22; }
.wing-field circle { fill: var(--coral); stroke: none; }
.wing-field p {
  margin: 12px 0 0;
  text-align: center;
  color: var(--fog);
  font: 0.64rem/1.5 var(--mono);
}
.wing-field p b { color: var(--lime); }
@keyframes drift { to { stroke-dashoffset: -200; } }

.headline-result {
  position: absolute;
  z-index: 2;
  left: max(24px, calc((100vw - 1240px) / 2));
  right: max(24px, calc((100vw - 1240px) / 2));
  bottom: 37px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  background: #f8f3e4;
  color: var(--ink);
  box-shadow: 0 18px 55px rgba(5, 12, 9, 0.3);
}
.result-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; padding: 25px 32px; }
.result-number { font: 300 clamp(3.2rem, 7vw, 6.4rem)/0.8 var(--serif); letter-spacing: -0.06em; }
.result-cell span:last-child { font: 500 0.67rem/1.5 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
.result-cell.empty .result-number { color: var(--coral); }
.result-cell.occupied .result-number { color: #24714e; }
.result-vs { display: grid; place-items: center; padding: 0 22px; border-inline: 1px solid #c9c5b6; font: 0.62rem var(--mono); text-transform: uppercase; color: #6d746c; }

.certificate, .instrument-section, .boundary-section, .sources { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 34px; }
.certificate { padding-top: 132px; padding-bottom: 110px; }
.section-number { padding-top: 9px; font: 500 0.7rem var(--mono); color: #777e74; }
.section-number::after { content: ""; display: block; width: 28px; height: 1px; margin-top: 12px; background: currentColor; }
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.042em;
  font-weight: 300;
}
.cert-grid { margin: 50px 0 0; border-top: 2px solid var(--ink); }
.cert-grid > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 25px; padding: 15px 8px; border-bottom: 1px solid var(--line); }
.cert-grid dt { font: 500 0.63rem/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #666d65; }
.cert-grid dd { margin: 0; font-size: 1.02rem; }
.action-row dd { display: flex; justify-content: space-between; gap: 22px; align-items: baseline; }
.text-button { padding: 2px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: #1f704c; font: 500 0.66rem var(--mono); text-transform: uppercase; }
.empty-set { color: #b8452e; font-style: italic; font-size: 1.12rem !important; }
.cert-status { margin: 18px 0 0 223px; color: #626c64; font: 0.67rem/1.55 var(--mono); }

.honesty-line { background: var(--coral); color: var(--deep); }
.honesty-inner { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 54px; padding-block: 33px; align-items: start; }
.honesty-inner > span { font: 500 0.65rem var(--mono); letter-spacing: 0.07em; text-transform: uppercase; }
.honesty-inner p { margin: 0; max-width: 970px; font-size: 1.18rem; line-height: 1.46; }

.instrument-section { padding-top: 130px; padding-bottom: 140px; }
.split-heading { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr); gap: 60px; align-items: end; }
.split-heading > p { margin: 0; color: #58635c; }
.controls { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin: 60px 0 32px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.segmented { display: flex; gap: 7px; padding: 0; border: 0; margin: 0; }
.segmented legend { margin-bottom: 9px; font: 500 0.62rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 10px 16px; border: 1px solid #8f958a; font: 0.68rem var(--mono); }
.segmented input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.segmented input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 3px; }
.switch-control { display: flex; align-items: center; gap: 12px; }
.switch-control input { position: absolute; opacity: 0; }
.switch-track { width: 48px; height: 26px; padding: 3px; border-radius: 20px; background: #adb0a2; transition: background 180ms ease; }
.switch-track::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform 180ms ease; }
.switch-control input:checked + .switch-track { background: #277b56; }
.switch-control input:checked + .switch-track::after { transform: translateX(22px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid var(--coral); outline-offset: 3px; }
.switch-control b, .switch-control small { display: block; }
.switch-control b { font: 500 0.68rem var(--mono); }
.switch-control small { color: #687068; font-size: 0.75rem; }
.live-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.live-summary > div { min-width: 0; padding: 21px 20px; border-right: 1px solid var(--line); }
.live-summary > div:last-child { border-right: 0; }
.live-summary span { display: block; font-size: clamp(1.75rem, 4vw, 3rem); line-height: 1; letter-spacing: -0.04em; }
.live-summary small { display: block; min-height: 2.8em; margin-top: 9px; color: #656d65; font: 0.57rem/1.4 var(--mono); text-transform: uppercase; }
.distribution-card { margin: 26px 0 0; padding: 25px 25px 19px; background: var(--deep); color: var(--paper); }
.distribution-card figcaption { display: flex; justify-content: space-between; gap: 20px; font: 0.62rem var(--mono); text-transform: uppercase; color: var(--fog); }
.legend { display: flex; gap: 10px; align-items: center; }
.key { width: 11px; height: 11px; display: inline-block; }
.key.other { background: var(--coral); }
.key.migrant { background: var(--lime); }
.plot-wrap { width: 100%; overflow: hidden; }
#distribution { display: block; width: 100%; height: auto; min-height: 260px; }
#distribution .grid-line { stroke: #506058; stroke-width: 1; opacity: 0.42; }
#distribution .axis-label { fill: #9cac9f; font: 16px var(--mono); }
#distribution .bar-other { fill: var(--coral); opacity: 0.75; }
#distribution .bar-migrant { fill: var(--lime); }
#distribution .empty-band { fill: rgba(216, 255, 101, 0.07); stroke: var(--lime); stroke-width: 1; stroke-dasharray: 5 5; }
#distribution .band-label { fill: var(--lime); font: 500 14px var(--mono); letter-spacing: 0.04em; }
.axis-note { display: flex; justify-content: space-between; gap: 12px; color: #86978d; font: 0.55rem var(--mono); text-transform: uppercase; }
.axis-note b { color: var(--paper); font-weight: 400; }
.evidence-drawer { margin-top: 20px; border: 1px solid var(--line); }
.evidence-drawer summary { display: flex; justify-content: space-between; gap: 18px; padding: 18px 20px; font-size: 1.02rem; cursor: pointer; }
.evidence-drawer summary span { font: 0.59rem var(--mono); text-transform: uppercase; color: #6d756e; }
.evidence-content { padding: 0 20px 22px; }
.evidence-content > p { max-width: 820px; color: #5a645c; font-size: 0.92rem; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font: 0.67rem/1.45 var(--mono); }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #687169; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em; }
td:first-child { font-style: italic; font-family: var(--serif); font-size: 0.95rem; }

.null-section { background: var(--forest); color: var(--paper); padding: 130px 0; }
.null-grid { display: grid; grid-template-columns: 74px minmax(0, 0.7fr) minmax(360px, 1fr); gap: 34px 64px; align-items: start; }
.null-section .section-number { color: #7c9185; }
.null-copy h2 { margin: 0; color: var(--lime); font-size: clamp(2.7rem, 5vw, 5.4rem); line-height: 0.95; letter-spacing: -0.05em; font-weight: 300; }
.null-copy > p:not(.eyebrow) { color: #c3cec6; }
.model-limit { margin-top: 42px; padding-top: 22px; border-top: 1px solid #415048; font-size: 0.92rem; }
.model-limit b { color: var(--coral); }
.null-machine { min-width: 0; padding: 30px; border: 1px solid #53635a; background: #0b1713; }
.null-observed { display: flex; align-items: baseline; gap: 13px; }
.null-observed span { font: 0.61rem var(--mono); text-transform: uppercase; color: #9aaba1; }
.null-observed strong { color: var(--lime); font: 300 5rem/1 var(--serif); letter-spacing: -0.05em; }
.null-observed small { font: 0.6rem var(--mono); color: #9aaba1; }
.shuffle-field { display: grid; grid-template-columns: repeat(40, 1fr); gap: 3px; height: 55px; margin: 25px 0; overflow: hidden; }
.shuffle-field i { display: block; background: #415148; opacity: 0.8; }
.shuffle-field i.migrant { background: var(--lime); }
.shuffle-field.running i.migrant { animation: pulse 450ms alternate infinite; }
@keyframes pulse { to { opacity: 0.22; transform: translateY(4px); } }
.null-readouts { border-top: 1px solid #415048; }
.null-readouts > div { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid #415048; }
.null-readouts span { color: #9aaba1; font: 0.58rem/1.4 var(--mono); text-transform: uppercase; }
.null-readouts strong { color: var(--paper); font: 400 0.9rem var(--mono); text-align: right; }
.null-readouts .exact strong { color: var(--lime); font-size: 1.04rem; }
.null-verdict { margin: 19px 0 0; padding: 14px 16px; border-left: 3px solid var(--coral); background: #13241d; color: #d6ded8; font-size: 0.83rem; }
.null-verdict sup { color: var(--lime); }
.permutation-controls { display: grid; grid-template-columns: auto minmax(80px, 120px) minmax(130px, 1fr); gap: 12px; align-items: center; margin-top: 24px; }
.permutation-controls label { font: 0.59rem var(--mono); text-transform: uppercase; color: #9aaba1; }
.permutation-controls input { min-width: 0; width: 100%; padding: 10px; border: 1px solid #68786f; background: transparent; color: white; font: 0.72rem var(--mono); }
.solid-button { border: 0; padding: 12px 16px; background: var(--lime); color: var(--deep); font: 500 0.65rem var(--mono); text-transform: uppercase; }
.solid-button:disabled { opacity: 0.55; cursor: wait; }
.machine-status { min-height: 3em; margin: 15px 0 0; color: #8fa096; font: 0.57rem/1.5 var(--mono); }

.boundary-section { padding-top: 130px; padding-bottom: 140px; }
.boundary-machine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr); margin-top: 52px; border: 1px solid var(--ink); }
.boundary-controls { padding: 32px; }
.boundary-controls > label { display: block; margin: 20px 0 10px; font: 500 0.64rem var(--mono); text-transform: uppercase; }
.boundary-controls > label:first-child { margin-top: 0; }
.boundary-controls select { width: 100%; padding: 11px; border: 1px solid var(--line); background: #faf6e9; color: var(--ink); font-size: 0.82rem; }
.boundary-controls output { color: #b6462f; }
#hwi-ceiling { width: 100%; accent-color: #277b56; }
.quick-values { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.quick-values button { padding: 7px 10px; border: 1px solid #92998e; background: transparent; font: 0.56rem var(--mono); }
.quick-values button:hover { background: var(--ink); color: var(--paper); }
.boundary-readout { min-width: 0; padding: 32px; background: var(--ink); color: var(--paper); }
.boundary-readout > span { display: block; color: var(--lime); font: 300 5rem/0.85 var(--serif); }
.boundary-readout > p { color: #aab8b0; font: 0.61rem/1.5 var(--mono); text-transform: uppercase; }
.boundary-readout ul { margin: 24px 0 0; padding: 0; list-style: none; max-height: 210px; overflow-y: auto; }
.boundary-readout li { padding: 7px 0; border-top: 1px solid #4d5b54; font-style: italic; }

.check-section { padding: 130px 0; background: #dcd6c2; }
.check-grid { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 34px; }
.check-ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 55px; border-top: 1px solid #969889; border-left: 1px solid #969889; }
.check-ledger article { min-width: 0; padding: 28px; border-right: 1px solid #969889; border-bottom: 1px solid #969889; }
.check-ledger h3, .taxonomy-ledger h3 { margin: 0 0 20px; font: 500 0.7rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
.check-ledger p { font-size: 0.92rem; color: #4d584f; }
.check-ledger dl { margin: 0; }
.check-ledger dl div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; border-bottom: 1px dotted #a4a797; }
.check-ledger dt { color: #5d675f; font-size: 0.84rem; }
.check-ledger dd { margin: 0; font: 500 0.68rem var(--mono); }
.taxonomy-ledger { margin-top: 45px; }
.verdict-line { display: flex; justify-content: space-between; gap: 30px; margin: 44px 0 0; padding: 20px 0; border-block: 2px solid var(--ink); font: 0.66rem var(--mono); text-transform: uppercase; }
.verdict-line b { color: #24714e; }

.sources { padding-top: 130px; padding-bottom: 120px; }
.sources ol { margin: 50px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.sources li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 28px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.sources li > span { padding-top: 5px; color: #707870; font: 0.63rem var(--mono); }
.sources li p { margin: 0; }
.sources a { overflow-wrap: anywhere; }
footer { background: var(--deep); color: var(--paper); }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding-block: 50px; }
.footer-inner p { margin: 0; color: #a8b7ae; font-size: 0.9rem; }
.footer-inner p:first-child { color: var(--lime); font-style: italic; }

@media (max-width: 900px) {
  .hero { min-height: 1040px; }
  .hero-grid { grid-template-columns: 1fr; padding-top: 50px; }
  .wing-field { width: min(520px, 80%); justify-self: center; margin-top: -40px; }
  .headline-result { grid-template-columns: 1fr 1fr; }
  .result-vs { display: none; }
  .result-cell { grid-template-columns: 1fr; gap: 12px; }
  .result-cell + .result-cell { border-left: 1px solid #c9c5b6; }
  .null-grid { grid-template-columns: 55px minmax(0, 1fr); }
  .null-machine { grid-column: 2; }
  .live-summary { grid-template-columns: repeat(2, 1fr); }
  .live-summary > div:nth-child(2) { border-right: 0; }
  .live-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .split-heading { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 28px, 1240px); }
  .hero { min-height: 960px; padding-inline: 14px; }
  .site-nav { min-height: 62px; }
  .site-nav span { max-width: 160px; text-align: right; }
  .hero-grid { min-height: 610px; padding-bottom: 140px; }
  .hero h1 { font-size: clamp(2.8rem, 15vw, 4.7rem); }
  .dek { margin-top: 25px; }
  .wing-field { width: 92%; margin-top: -60px; }
  .headline-result { left: 14px; right: 14px; bottom: 30px; }
  .result-cell { padding: 18px 15px; }
  .result-number { font-size: 3.1rem; }
  .result-cell span:last-child { font-size: 0.52rem; }
  .certificate, .instrument-section, .boundary-section, .sources, .check-grid { grid-template-columns: 1fr; gap: 15px; }
  .certificate { padding-top: 95px; }
  .section-number { display: flex; align-items: center; gap: 10px; padding: 0; }
  .section-number::after { margin: 0; }
  .cert-grid > div { grid-template-columns: 1fr; gap: 4px; }
  .action-row dd { align-items: flex-start; }
  .cert-status { margin-left: 0; }
  .honesty-inner { grid-template-columns: 1fr; gap: 10px; }
  .instrument-section, .boundary-section, .sources { padding-block: 95px; }
  .controls { display: grid; align-items: start; }
  .segmented { flex-wrap: wrap; }
  .segmented span { padding: 9px 11px; }
  .live-summary { grid-template-columns: 1fr 1fr; }
  .live-summary > div { padding: 15px 13px; }
  .distribution-card { padding: 17px 12px 13px; }
  .distribution-card figcaption { align-items: flex-start; flex-direction: column; }
  #distribution { min-height: 215px; }
  .axis-note span { display: none; }
  .axis-note b { margin-inline: auto; }
  .evidence-drawer summary { font-size: 0.9rem; }
  .null-section { padding: 95px 0; }
  .null-grid { grid-template-columns: 1fr; }
  .null-machine { grid-column: 1; padding: 20px 15px; }
  .null-observed strong { font-size: 4.4rem; }
  .null-readouts > div { align-items: flex-start; flex-direction: column; gap: 7px; }
  .null-readouts strong { text-align: left; overflow-wrap: anywhere; }
  .permutation-controls { grid-template-columns: 1fr 1fr; }
  .permutation-controls .solid-button { grid-column: 1 / -1; }
  .boundary-machine { grid-template-columns: 1fr; }
  .boundary-controls, .boundary-readout { padding: 24px 18px; }
  .check-section { padding: 95px 0; }
  .check-ledger { grid-template-columns: 1fr; }
  .check-ledger article { padding: 23px 18px; }
  .verdict-line { flex-direction: column; gap: 8px; }
  .sources li { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
