:root {
  --truth-ink: #17233a;
  --truth-paper: #fffdf7;
  --truth-paper-warm: #f5efe2;
  --truth-pearl: #e9edf3;
  --truth-chrome: #b9c7d9;
  --truth-graphite: #354151;
  --truth-blue-deep: #102c63;
  --truth-blue: #315fae;
  --truth-blue-bright: #6d9cf0;
  --truth-coral: #d8696f;
  --truth-amber: #e5ac43;
  --truth-teal: #36766b;
  --truth-line: #40516b;
  --truth-shadow: rgba(20, 34, 58, .22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--truth-ink);
  background:
    linear-gradient(rgba(58, 79, 109, .09) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(58, 79, 109, .09) 1px, transparent 1px) 0 0 / 24px 24px,
    #dce3ed;
  font-family: Tahoma, Calibri, Arial, sans-serif;
}

button, input { font: inherit; }
button, input[type="range"], .kind-options label { cursor: pointer; }

.truth-page {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  overflow: hidden;
  background: var(--truth-paper);
  border: 1px solid #32435f;
  box-shadow: 0 2px 0 rgba(255,255,255,.85) inset, 0 28px 70px var(--truth-shadow);
}

.truth-hero {
  position: relative;
  min-height: 500px;
  padding: clamp(24px, 5vw, 64px);
  overflow: hidden;
  color: #f9fbff;
  background:
    radial-gradient(circle at 79% 48%, rgba(255,210,122,.98) 0 2px, transparent 3px),
    radial-gradient(circle at 79% 48%, transparent 0 88px, rgba(139,175,238,.34) 89px 90px, transparent 91px 150px, rgba(139,175,238,.2) 151px 152px, transparent 153px),
    linear-gradient(115deg, rgba(216,105,111,.36), transparent 32%),
    linear-gradient(137deg, #13275b 0%, #254f9f 56%, #183a72 100%);
}

.truth-hero::before,
.truth-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.truth-hero::before {
  inset: 0;
  opacity: .22;
  background:
    linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px) 0 0 / 48px 48px;
}

.truth-hero::after {
  right: -50px;
  bottom: -120px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgba(255,255,255,.025), 0 0 0 116px rgba(255,255,255,.02);
}

.hierarchy-nav,
.truth-hero-copy,
.truth-hero-key { position: relative; z-index: 1; }
.hierarchy-nav { color: #dce8ff; }
.hierarchy-nav a { color: inherit; }

.truth-hero-copy { margin-top: clamp(100px, 16vw, 180px); }
.truth-hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(60px, 10vw, 126px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .84;
  text-wrap: balance;
}

.truth-hero-copy > p {
  max-width: 690px;
  margin: 28px 0 0;
  color: #e3ecfc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.15vw, 27px);
  line-height: 1.38;
}

.truth-hero-key {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: 720px;
  margin: 42px 0 0;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.28);
}

.truth-hero-key div { padding: 14px 16px; background: rgba(10,28,72,.72); }
.truth-hero-key dt {
  color: #ffd27a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.truth-hero-key dd { margin: 5px 0 0; color: #e6edfa; font-size: 13px; line-height: 1.42; }

.detector-shell { padding: clamp(32px, 5vw, 64px); }
.detector-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .86fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--truth-line);
}

.detector-heading h2,
.epistemic-intro h2,
.reading-main h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.detector-heading p,
.epistemic-intro p,
.reading-main p,
.exclusion-note p {
  line-height: 1.65;
}
.detector-heading p { max-width: 590px; margin: 17px 0 0; color: #526176; }

.claim-field { display: grid; gap: 8px; }
.claim-field span,
.claim-kind legend,
.radar-copy > label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.claim-field input {
  width: 100%;
  padding: 13px 12px;
  color: var(--truth-ink);
  background: #fff;
  border: 1px solid #8996aa;
  border-top-color: #5f6c80;
  box-shadow: 1px 1px 0 rgba(255,255,255,.8), 0 2px 5px rgba(30,43,64,.09) inset;
  border-radius: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.claim-field input:focus-visible,
button:focus-visible,
input[type="range"]:focus-visible,
.kind-options input:focus-visible + span,
.position:focus-visible .planet {
  outline: 3px solid rgba(49,95,174,.35);
  outline-offset: 3px;
}

.claim-kind {
  margin: 30px 0 0;
  padding: 0;
  border: 0;
}
.claim-kind legend { margin-bottom: 10px; }
.kind-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid #7b899e;
  background: var(--truth-chrome);
}
.kind-options label { min-width: 0; }
.kind-options input { position: absolute; opacity: 0; pointer-events: none; }
.kind-options span {
  display: block;
  padding: 11px 8px;
  color: #26364f;
  background: linear-gradient(#f8f9fc, #e3e8ef);
  border-right: 1px solid #a3afc0;
  border-bottom: 2px solid #9aa6b8;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.kind-options label:last-child span { border-right: 0; }
.kind-options input:checked + span {
  color: #fff;
  background: var(--truth-blue);
  border-bottom-color: #183b7a;
  box-shadow: 0 2px 4px rgba(0,0,0,.2) inset;
}
.claim-kind > p { min-height: 20px; margin: 9px 0 0; color: #5c697c; font-family: Georgia, serif; font-size: 13px; }

.instrument-grid {
  display: grid;
  grid-template-columns: minmax(230px, .76fr) minmax(360px, 1.2fr) minmax(220px, .7fr);
  margin-top: 28px;
  border: 1px solid #3e4d62;
  box-shadow: 0 12px 28px rgba(34,48,71,.13);
}

.instrument-controls {
  padding: 24px;
  background: linear-gradient(90deg, rgba(255,255,255,.6), transparent), var(--truth-paper-warm);
  border-right: 1px solid #7d8898;
}
.axis-control { display: block; padding: 0 0 23px; }
.axis-control + .axis-control { padding-top: 23px; border-top: 1px solid #b1a994; }
.axis-control:last-child { padding-bottom: 0; }
.axis-control > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.axis-control b { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.axis-control output { color: var(--truth-blue); font-family: Georgia, serif; font-size: 25px; }
.axis-control small { display: block; min-height: 33px; margin: 5px 0 8px; color: #697382; line-height: 1.35; }
.axis-control input { width: 100%; margin: 6px 0 1px; accent-color: var(--truth-blue); }
.axis-control i { display: flex; justify-content: space-between; color: #6c7583; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.gauge-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 18px 25px;
  background:
    linear-gradient(rgba(40,64,97,.055) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(40,64,97,.055) 1px, transparent 1px) 0 0 / 28px 28px,
    #fffefa;
}
.gauge { display: block; width: min(520px, 100%); overflow: visible; }
.gauge-track,
.gauge-zone {
  fill: none;
  stroke-linecap: butt;
  stroke-width: 34;
}
.gauge-track { stroke: #cad1d8; }
.gauge-zone { stroke: url(#gauge-gradient); }
.gauge-zone-a {
  stroke: var(--truth-coral);
  stroke-dasharray: 24 0;
  filter: drop-shadow(0 2px 0 rgba(255,255,255,.7));
}
.gauge-ticks line { stroke: #fff; stroke-width: 2; }
.gauge-ticks line.major { stroke: #17233a; stroke-width: 3; }
.needle {
  transform: rotate(-90deg);
  transform-origin: 260px 246px;
  transition: transform .42s cubic-bezier(.2,.8,.2,1);
}
.needle path { fill: var(--truth-ink); filter: drop-shadow(2px 2px 1px rgba(0,0,0,.25)); }
.needle circle:first-of-type { fill: #f8fafc; stroke: var(--truth-ink); stroke-width: 4; }
.needle circle:last-of-type { fill: var(--truth-amber); stroke: var(--truth-ink); stroke-width: 2; }
.gauge > text { fill: #455469; font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.verdict { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 10px; margin-top: -8px; text-align: center; }
.verdict p { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 4.5vw, 56px); }
.verdict span { color: #647084; font-size: 11px; font-weight: 800; }
.gauge-note { max-width: 440px; min-height: 42px; margin: 7px 0 0; color: #59677a; font-family: Georgia, serif; font-size: 13px; font-style: italic; line-height: 1.5; text-align: center; }

.readout {
  padding: 28px 24px;
  color: #f0f5ff;
  background:
    linear-gradient(130deg, rgba(109,156,240,.12), transparent 65%),
    var(--truth-graphite);
}
.readout h3 { margin: 0; color: #ffd27a; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.readout dl { margin: 24px 0 0; }
.readout dl > div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.2); }
.readout dt { color: #b8c8dc; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.readout dd { margin: 0; font-family: Georgia, serif; font-size: 13px; text-align: right; }
.readout > p { margin: 28px 0 0; padding: 14px; color: #dce6f2; background: rgba(8,18,31,.24); border: 1px solid rgba(255,255,255,.2); font-family: Georgia, serif; font-size: 12px; line-height: 1.55; }
.instrument-rule { margin: 13px 0 0; color: #5c6879; font-family: Georgia, serif; font-size: 13px; line-height: 1.5; }

.epistemic-section {
  border-top: 1px solid #34455f;
  background: #e8edf4;
}
.epistemic-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
  padding: clamp(38px, 5vw, 64px);
  color: #f7f9ff;
  background:
    linear-gradient(115deg, rgba(216,105,111,.15), transparent 38%),
    var(--truth-blue-deep);
}
.epistemic-intro p { max-width: 770px; margin: 17px 0 0; color: #cedbf0; }
.map-mode { display: flex; align-items: stretch; border: 1px solid #8098c5; }
.map-mode button,
.phase-actions button {
  padding: 10px 13px;
  color: #f5f7fc;
  background: #263f70;
  border: 0;
  border-right: 1px solid #8098c5;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 -2px 0 rgba(0,0,0,.2) inset;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.map-mode button:last-child { border-right: 0; }
.map-mode button[aria-pressed="true"],
.map-mode button:hover,
.phase-actions button:hover { color: #17233a; background: #d9e5fb; }

.radar-shell {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(540px, 1.28fr);
  min-height: 690px;
}
.radar-copy {
  padding: clamp(34px, 5vw, 58px);
  color: #f2f6fe;
  background: #29374b;
  border-right: 1px solid #182233;
}
.radar-copy > label { color: #a8c2f2; }
#phase { width: 100%; margin: 18px 0 0; accent-color: var(--truth-amber); }
.phase-ticks { display: flex; justify-content: space-between; margin-top: 4px; color: #aebed1; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.phase-readout { min-height: 230px; margin-top: 30px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.22); }
.phase-readout > span { color: #ffd27a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.phase-readout h3 { margin: 8px 0 10px; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 52px); font-weight: 400; letter-spacing: -.03em; }
.phase-readout p { margin: 0; color: #d0dbe9; line-height: 1.6; }
.neighbor-readout { margin: 10px 0 0; border-top: 1px solid rgba(255,255,255,.2); }
.neighbor-readout div { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.neighbor-readout dt { color: #a8b7ca; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.neighbor-readout dd { margin: 0; font-family: Georgia, serif; }
.phase-actions { display: flex; gap: 8px; margin-top: 22px; }
.phase-actions button { border: 1px solid #7c91b8; }

.plot-card { min-width: 0; margin: 0; padding: clamp(24px, 4vw, 48px); background: linear-gradient(135deg, #f8faff, #e8edf5); }
.plot-stage {
  display: grid;
  overflow: hidden;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at center, rgba(49,95,174,.05), transparent 58%),
    #fff;
  border: 1px solid #8090aa;
  box-shadow: 0 18px 42px rgba(28,47,78,.18), 0 0 0 7px rgba(255,255,255,.55);
}
.plot-stage svg { display: block; width: 100%; height: 100%; }
.outer-halo { fill: none; stroke: #96aada; stroke-width: 2; stroke-dasharray: 3 8; }
.orbit { fill: none; stroke: #4f73bc; stroke-width: 2; opacity: .22; vector-effect: non-scaling-stroke; }
.orbit-condition { stroke: #244f9f; stroke-width: 5; opacity: .65; }
.orbit-threshold { stroke: var(--truth-amber); stroke-width: 4; stroke-dasharray: 4 7; opacity: .7; }
.orbit.is-neighbor { opacity: .52; }
.orbit.is-active { stroke-width: 5; opacity: 1; }
.trajectory { fill: none; stroke: #99a8bf; stroke-width: 2; stroke-dasharray: 3 7; vector-effect: non-scaling-stroke; }
.position { cursor: pointer; }
.planet { fill: #fff; stroke: var(--truth-blue); stroke-width: 4; vector-effect: non-scaling-stroke; filter: drop-shadow(2px 3px 2px rgba(24,48,89,.18)); }
.position-condition .planet { fill: var(--truth-blue); stroke: #fff; }
.position-threshold .planet { fill: var(--truth-amber); stroke: #6c4c15; }
.planet-label {
  fill: #243a64;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255,255,255,.96);
  stroke-width: 7px;
  stroke-linejoin: round;
}
.position:not(.is-active):not(.is-neighbor) { opacity: .14; }
.plot-stage:not(.whole-view) .position:not(.is-active):not(.is-neighbor) .planet-label { display: none; }
.whole-view .position { opacity: 1 !important; }
.whole-view .planet-label { font-size: 13px; }
.position.is-active .planet { fill: var(--truth-coral); stroke: #fff; stroke-width: 6; filter: drop-shadow(0 0 10px rgba(216,105,111,.75)); }
.position-threshold.is-active .planet { fill: var(--truth-amber); stroke: #fff; }
.position.is-active .planet-label { fill: #a33f4c; font-size: 17px; }
.position-threshold.is-active .planet-label { fill: #805915; }
.origin-letter,
.end-letter { fill: var(--truth-blue-deep); font-family: Georgia, serif; font-size: 42px; }
.end-letter { fill: var(--truth-coral); font-size: 34px; }
.plot-card figcaption { margin-top: 16px; color: #56657c; font-family: Georgia, serif; font-size: 13px; font-style: italic; line-height: 1.5; }

.reading-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(34px, 6vw, 72px);
  padding: clamp(40px, 6vw, 74px);
  background: var(--truth-paper);
  border-top: 1px solid #aeb7c4;
}
.reading-main p { max-width: 710px; margin: 20px 0 0; color: #48576c; font-family: Georgia, serif; font-size: 17px; }
.exclusion-note { align-self: start; padding: 24px; background: var(--truth-paper-warm); border: 1px solid #aaa38f; border-top: 4px solid var(--truth-teal); box-shadow: 0 10px 24px rgba(39,52,70,.1); }
.exclusion-note h3 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.exclusion-note p { margin: 13px 0 0; color: #556252; }

@media (max-width: 980px) {
  .detector-heading { grid-template-columns: 1fr; align-items: start; }
  .instrument-grid { grid-template-columns: minmax(240px, .8fr) 1.2fr; }
  .readout { grid-column: 1 / -1; }
  .readout dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .readout dl > div { display: block; }
  .readout dd { margin-top: 6px; text-align: left; }
  .readout > p { max-width: 650px; }
  .epistemic-intro { grid-template-columns: 1fr; align-items: start; }
  .map-mode { width: max-content; }
  .radar-shell { grid-template-columns: 1fr; }
  .radar-copy { border-right: 0; }
  .phase-readout { min-height: 180px; }
  .plot-card { order: -1; }
  .plot-stage { max-width: 760px; margin: 0 auto; }
}

@media (max-width: 700px) {
  .truth-page { width: 100%; margin: 0; border-right: 0; border-left: 0; }
  .truth-hero { min-height: 520px; }
  .truth-hero-key { grid-template-columns: 1fr; }
  .kind-options { grid-template-columns: repeat(3, 1fr); }
  .kind-options span { border-bottom: 1px solid #9aa6b8; }
  .instrument-grid { display: block; }
  .instrument-controls { border-right: 0; border-bottom: 1px solid #7d8898; }
  .gauge-card { border-bottom: 1px solid #526176; }
  .readout dl { grid-template-columns: 1fr; gap: 0; }
  .epistemic-intro { padding-inline: 24px; }
  .radar-copy { padding-inline: 24px; }
  .plot-card { padding: 18px; }
  .reading-section { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .detector-shell { padding-inline: 18px; }
  .kind-options { grid-template-columns: repeat(2, 1fr); }
  .gauge > text { font-size: 9px; }
  .map-mode { width: 100%; }
  .map-mode button { flex: 1; }
  .phase-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

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

@media (prefers-contrast: more) {
  .orbit { opacity: .55; }
  .position:not(.is-active):not(.is-neighbor) { opacity: .45; }
  .readout, .radar-copy { background: #17233a; }
}
