:root {
  --ink: var(--cd-text);
  --muted: var(--cd-muted);
  --paper: var(--cd-bg);
  --panel: var(--cd-surface-1);
  --line: var(--cd-border);
  --hot: var(--cd-accent);
  --acid: var(--cd-accent-2);
  --shadow: color-mix(in srgb, #000 48%, transparent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, color-mix(in srgb, var(--hot) 10%, transparent), transparent 26rem),
    linear-gradient(var(--cd-bg-grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--cd-bg-grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--paper) !important;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: .045;
  pointer-events: none;
  z-index: 20;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

a { color: inherit; }
button { font: inherit; }
.skip { position: fixed; left: 1rem; top: -5rem; background: var(--acid); color: #111; padding: .8rem; z-index: 50; }
.skip:focus { top: 1rem; }

.masthead {
  height: 76px;
  padding: 0 clamp(1rem, 3vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--cd-site-shell-height, 54px);
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}

.brand { text-decoration: none; display: flex; gap: .8rem; align-items: center; font-weight: 900; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--hot) 72%, var(--ink)); background: color-mix(in srgb, var(--hot) 9%, transparent); transform: rotate(45deg); }
.brand-mark i { width: 12px; height: 12px; border: 1px solid var(--acid); background: var(--hot); }
.brand small { display: block; color: var(--muted); font-size: .58rem; letter-spacing: .24em; margin-top: .2rem; }
.mast-meta { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem); color: var(--muted); font-size: .7rem; letter-spacing: .1em; }
.live-dot { color: var(--acid); }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .5rem; background: currentColor; border-radius: 50%; box-shadow: 0 0 12px currentColor; }

main { overflow: hidden; }
.hero { min-height: 720px; padding: clamp(4rem, 9vw, 9rem) clamp(1rem, 6vw, 7rem); display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 5vw; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--hot); letter-spacing: .18em; font-size: .75rem; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; margin: 0; letter-spacing: -.055em; line-height: .88; }
h1 { font-size: clamp(4.7rem, 11vw, 10rem); }
h1 em, h2 em { color: var(--hot); font-weight: 400; }
.dek { max-width: 44rem; color: var(--muted); line-height: 1.7; margin-top: 2rem; font-size: clamp(.9rem, 1.2vw, 1.08rem); }

.machine-dial { justify-self: center; width: min(100%, 430px); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; padding: 4rem; background: radial-gradient(circle, color-mix(in srgb, var(--hot) 10%, transparent), transparent 60%); }
.dial-orbit { position: absolute; inset: -14px; border: 1px dashed var(--line); border-radius: 50%; animation: orbit 24s linear infinite; }
.dial-orbit span { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--acid); margin: 7%; box-shadow: 0 0 18px var(--acid); }
@keyframes orbit { to { transform: rotate(360deg); } }
.machine-dial p { font-size: .7rem; color: var(--muted); letter-spacing: .12em; }
.machine-dial strong { font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.07em; color: var(--acid); margin: 1.2rem 0 .2rem; }
.machine-dial small { color: var(--muted); }
.dial-foot { position: absolute; bottom: 20%; left: 15%; right: 15%; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: .62rem; color: var(--muted); }

.truth-strip { display: grid; grid-template-columns: auto 1fr auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem clamp(1rem, 3vw, 3.5rem); border-bottom: 1px solid var(--line); font-size: .68rem; letter-spacing: .05em; }
.truth-strip b:first-child { color: var(--acid); }
.truth-strip b:nth-of-type(2) { color: var(--hot); }
.truth-strip p { margin: 0; color: var(--muted); }
.truth-strip > span { border-left: 1px solid var(--line); padding-left: 1rem; }

.ledger-section { padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 6vw, 7rem); border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 1fr 2fr; align-items: end; margin-bottom: clamp(3rem, 6vw, 6rem); }
.section-head > div { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .72rem; letter-spacing: .16em; }
.section-head > div span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); color: var(--hot); }
.section-head h2 { font-size: clamp(3.2rem, 7vw, 7rem); }
.section-head.compact { grid-template-columns: 1fr; gap: 3rem; }

.score-grid { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.score { min-height: 230px; padding: 2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.score:nth-child(even) { border-right: 0; }
.score p { color: var(--muted); font-size: .68rem; letter-spacing: .12em; }
.score strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 6vw, 6rem); font-weight: 700; letter-spacing: -.06em; }
.score small { color: var(--muted); }
.score-major strong { color: var(--ink); }
.score-accent { background: var(--hot); color: var(--cd-accent-contrast); }
.score-accent p, .score-accent small { color: color-mix(in srgb, var(--cd-accent-contrast) 76%, transparent); }

.split-section { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(240px, 1fr); gap: clamp(2rem, 5vw, 6rem); }
.split-section .section-head { grid-column: 1 / -1; }
.chart-panel { min-width: 0; }
.chart-tabs { display: flex; gap: .5rem; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.chart-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: .5rem 0; margin-right: 1rem; cursor: pointer; }
.chart-tabs button.active { color: var(--acid); border-color: var(--acid); }
.chart-tabs span { margin-left: auto; color: var(--muted); font-size: .65rem; }
#trendChart { width: 100%; min-height: 300px; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.bar { fill: var(--hot); transition: opacity .2s, transform .2s; transform-origin: bottom; }
.bar:hover { opacity: .72; }
.chart-label { fill: var(--muted); font-family: monospace; font-size: 20px; }
.chart-value { fill: var(--ink); font-family: monospace; font-size: 24px; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .65rem; }
.definition-rail { border-left: 1px solid var(--line); padding-left: 2rem; }
.definition-rail > p, .coverage-stamp > p { color: var(--hot); font-size: .7rem; letter-spacing: .15em; }
.definition-rail h3 { font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; font-weight: 700; }
.definition-rail ol { list-style: none; margin: 2rem 0; padding: 0; }
.definition-rail li { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.definition-rail li b, .definition-rail li span { display: block; }
.definition-rail li span { color: var(--muted); margin-top: .45rem; font-size: .72rem; }
code { color: var(--acid); }

.machine-ledger { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.machine-big { padding: clamp(2rem, 5vw, 5rem); min-height: 420px; background: var(--acid); color: var(--cd-accent-contrast); display: flex; flex-direction: column; justify-content: center; }
.machine-big p { letter-spacing: .15em; font-size: .7rem; }
.machine-big strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.2rem, 7vw, 7rem); font-weight: 700; letter-spacing: -.07em; line-height: .9; }
.machine-ledger dl { margin: 0; padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.machine-ledger dl div { border-top: 1px solid var(--line); padding: 1.5rem 0; }
.machine-ledger dt { color: var(--muted); font-size: .65rem; letter-spacing: .1em; }
.machine-ledger dd { margin: .6rem 0 0; font-size: 1.1rem; }
.machine-note { max-width: 55rem; color: var(--muted); line-height: 1.7; margin: 2rem 0 0 auto; }

.table-wrap { min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: .63rem; letter-spacing: .1em; text-align: left; }
th, td { padding: 1rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:nth-child(2), td:nth-child(3), td:nth-child(4), th:nth-child(2), th:nth-child(3), th:nth-child(4) { text-align: right; }
.price-state { font-size: .62rem; color: var(--muted); }
.coverage-stamp { position: relative; border: 1px solid var(--line); padding: 2rem; min-height: 280px; overflow: hidden; }
.coverage-stamp strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 5rem; color: var(--acid); margin-top: 2rem; }
.coverage-stamp span { color: var(--muted); }
.stamp-ring { position: absolute; width: 150px; height: 150px; border: 2px dashed var(--hot); color: var(--hot); border-radius: 50%; display: grid; place-items: center; text-align: center; right: -25px; bottom: -25px; transform: rotate(-14deg); font-weight: 900; font-size: 1.2rem; }

.batch-tape { border-top: 1px solid var(--line); }
.batch { display: grid; grid-template-columns: 130px 1fr 1fr auto; gap: 1rem; padding: 1.3rem .8rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.batch time, .batch span { color: var(--muted); }
.batch strong { font-size: 1.15rem; color: var(--acid); }
.batch a { color: var(--hot); text-decoration: none; }

.methodology { background: color-mix(in srgb, var(--panel) 75%, transparent); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.method-grid article { padding: 2rem; min-height: 220px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1.5rem; }
.method-grid article:last-child { border: 0; }
.method-grid article p { color: var(--hot); letter-spacing: .14em; font-size: .7rem; }
.method-grid code { font-size: 1.05rem; line-height: 1.5; }
.method-grid span { margin-top: auto; color: var(--muted); font-size: .72rem; }
.proof-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-top: 4rem; }
.proof-columns h3 { font-size: .72rem; color: var(--hot); letter-spacing: .14em; }
.proof-columns ul { list-style: none; padding: 0; }
.proof-columns li { padding: .7rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; line-height: 1.5; word-break: break-word; }
.proof-columns a { color: var(--ink); }

footer { padding: 2rem clamp(1rem, 3vw, 3.5rem); display: flex; justify-content: space-between; color: var(--muted); font-size: .65rem; letter-spacing: .08em; }
.error-state { position: fixed; inset: auto 1rem 1rem; background: #5d1400; color: white; border: 1px solid #ff6b19; padding: 1rem; z-index: 30; display: flex; justify-content: space-between; }
.error-state[hidden] { display: none; }

@media (max-width: 820px) {
  .mast-meta > span:not(.live-dot) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 6rem; }
  h1 { font-size: clamp(4.2rem, 20vw, 7rem); }
  .machine-dial { width: min(84vw, 390px); margin: 4rem 0; }
  .truth-strip { grid-template-columns: auto 1fr; }
  .truth-strip > span { grid-column: 1 / -1; border-left: 0; padding: .5rem 0 0; }
  .section-head { grid-template-columns: 1fr; gap: 2.5rem; }
  .section-head h2 { font-size: clamp(3.2rem, 16vw, 5.5rem); }
  .split-section { grid-template-columns: 1fr; }
  .definition-rail { border-left: 0; border-top: 1px solid var(--line); padding: 2rem 0 0; }
  .machine-ledger { grid-template-columns: 1fr; }
  .machine-big { min-height: 300px; }
  .method-grid, .proof-columns { grid-template-columns: 1fr; }
  .method-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .batch { grid-template-columns: 1fr 1fr; }
  .batch span { display: none; }
  footer { flex-direction: column; gap: .7rem; }
}

@media (max-width: 540px) {
  .masthead { height: 64px; }
  .brand small { display: none; }
  .score-grid { grid-template-columns: 1fr; }
  .score, .score:nth-child(even) { border-right: 0; }
  .score { min-height: 190px; padding: 1.5rem 0; }
  .score-accent { padding: 1.5rem; }
  .machine-dial { padding: 2.5rem; }
  .dial-foot { bottom: 16%; }
  .chart-tabs span { display: none; }
  .batch { grid-template-columns: 1fr; }
  .batch a { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dial-orbit { animation: none; }
  * { transition-duration: .01ms !important; }
}
