:root {
  --paper: #F4F6F8; --paper-2: #E9EDF1; --ink: #17202B; --ink-2: #4A5563; --ink-3: #7C8794;
  --line: #D5DBE2; --floor: #1B2431; --floor-2: #232E3D; --floor-line: #2E3A4A;
  --idle: #4B5666; --prefill: #F0A43A; --decode: #35C4CF; --alarm: #E5533C; --ok: #3FB27F;
  --base: #8E98A6; --opt: #1FA3B0; --opt-ink: #147F8A;
  --w: 1180px; --prose: 66ch;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
a { color: var(--opt-ink); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 4.6vw, 56px); letter-spacing: -0.02em; max-width: 20ch; }
h2 { font-size: clamp(26px, 3vw, 36px); max-width: 24ch; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; max-width: var(--prose); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--w); margin: 0 auto; padding-inline: 20px; }
section { padding-block: 72px; }
section + section { border-top: 1px solid var(--line); }
.lead { font-size: 20px; color: var(--ink-2); }
.note { color: var(--ink-3); font-size: 14px; }
.caption { font-size: 15px; color: var(--ink-2); max-width: var(--prose); }
.caption b { color: var(--ink); font-weight: 600; }

/* top bar */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.wordmark small { font-weight: 400; color: var(--ink-3); margin-left: 10px; font-size: 15px; }
.top nav { display: flex; gap: 22px; font-size: 15px; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* hero */
.hero { padding-block: 56px 40px; border-top: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: end; }
.hero .lead { margin-top: 18px; }
.impact { border-left: 3px solid var(--opt); padding-left: 20px; }
.impact .big { font-size: clamp(44px, 6vw, 72px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--opt-ink); }
.impact .big small { font-size: 0.4em; color: var(--ink-2); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.impact .row { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.impact .row div { font-size: 15px; color: var(--ink-2); }
.impact .row b { display: block; font-size: 22px; color: var(--ink); font-weight: 600; }

/* controls */
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 34px 0 14px; }
.controls .lbl { color: var(--ink-2); font-size: 15px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font: inherit; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 15px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.clock { margin-left: auto; color: var(--ink-3); font-size: 14px; }

/* twin halls */
.twin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hall, .rack, .panel, .scene .row { min-width: 0; }
.hall { background: var(--floor); border-radius: 12px; padding: 16px 16px 14px; color: #E6ECF2; position: relative; }
.hall header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.hall header h3 { font-size: 17px; font-weight: 600; color: #fff; }
.hall header .tag { font-size: 13px; color: #9AA7B6; }
.hall.opt header h3::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--decode); margin-right: 8px; vertical-align: 1px; }
.hall.base header h3::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--base); margin-right: 8px; vertical-align: 1px; }
.hall canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.meter { margin-top: 12px; }
.meter .bar { height: 10px; background: var(--floor-2); border-radius: 5px; overflow: hidden; position: relative; }
.meter .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--base); border-radius: 5px; transition: width .3s; }
.hall.opt .meter .bar i { background: var(--decode); }
.meter .bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--alarm); }
.meter .lab { display: flex; justify-content: space-between; font-size: 13px; color: #9AA7B6; margin-top: 6px; }
.meter .lab b { color: #fff; font-weight: 600; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--floor-2); border-radius: 8px; padding: 9px 11px; }
.stat .k { font-size: 12px; color: #9AA7B6; }
.stat .v { font-size: 19px; font-weight: 600; color: #fff; margin-top: 2px; }
.stat .v small { font-size: 12px; color: #9AA7B6; font-weight: 500; margin-left: 3px; }
.stat.warn .v { color: var(--prefill); }
.stat.bad .v { color: var(--alarm); }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend .l-idle::before { background: var(--idle); }
.legend .l-pre::before { background: var(--prefill); }
.legend .l-dec::before { background: var(--decode); }
.legend .l-dim::before { background: linear-gradient(90deg, #1f5e63, var(--decode)); }

/* trace chart */
.trace { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 10px; }
.trace .hd { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.trace .hd h3 { font-size: 16px; }
.trace .hd .key { font-size: 13px; color: var(--ink-2); display: flex; gap: 16px; }
.trace .hd .key i { display: inline-block; width: 18px; height: 3px; vertical-align: 3px; margin-right: 6px; border-radius: 2px; }
.trace canvas { width: 100%; height: 200px; display: block; margin-top: 8px; }

/* two-column explain blocks */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: start; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split h2 { margin-bottom: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel.dark { background: var(--floor); border-color: var(--floor); color: #E6ECF2; }

/* one gpu scene */
.scene { display: grid; gap: 14px; }
.scene .row { background: var(--floor); border-radius: 10px; padding: 12px 14px 8px; color: #E6ECF2; }
.scene .row .t { display: flex; justify-content: space-between; font-size: 13px; color: #9AA7B6; margin-bottom: 6px; }
.scene .row .t b { color: #fff; font-weight: 600; font-size: 14px; }
.scene canvas { width: 100%; height: 150px; display: block; }
.scene-key { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; margin-top: 4px; }
.scene-key i { display: inline-block; width: 18px; height: 3px; vertical-align: 3px; margin-right: 6px; border-radius: 2px; }
.scene-key .band { width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.readout div { background: var(--paper-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.readout b { display: block; font-size: 20px; color: var(--ink); font-weight: 600; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 20px 18px; min-width: 0; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 14px; margin-bottom: 14px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 15px; color: var(--ink-2); margin: 0; }
.step .tele { margin-top: 12px; background: var(--floor); color: #cfe9ec; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12px; border-radius: 8px; padding: 10px 12px; white-space: pre; overflow-x: auto; line-height: 1.5; }
.step .tele em { color: var(--decode); font-style: normal; }

/* physics explorer */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.explorer canvas, .panel canvas { width: 100%; height: 320px; display: block; }
.slider { margin-top: 12px; }
.slider label { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.slider label b { color: var(--ink); }
.slider input { width: 100%; accent-color: var(--opt); margin-top: 8px; }
.ex-read { display: grid; gap: 10px; margin-top: 8px; }
.ex-read div { background: var(--paper-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.ex-read b { display: block; font-size: 22px; color: var(--ink); font-weight: 600; }
.ex-read .d b { color: var(--opt-ink); }
.ex-read .p b { color: #b9761f; }

/* density */
.rackviz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.rack { background: var(--floor); border-radius: 12px; padding: 16px; color: #E6ECF2; }
.rack h3 { font-size: 16px; color: #fff; margin-bottom: 10px; display: flex; justify-content: space-between; }
.rack h3 span { color: #9AA7B6; font-weight: 400; font-size: 13px; }
.rack canvas { width: 100%; height: 300px; display: block; }
.rack .sum { font-size: 14px; color: #9AA7B6; margin-top: 10px; }
.rack .sum b { color: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin-top: 18px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.hi td { background: #E8F6F7; }
.tablewrap { overflow-x: auto; }

/* receipt */
.receipts { display: grid; gap: 10px; }
.receipt { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 1.9fr 1fr 0.8fr 1.1fr 0.8fr; gap: 10px; font-size: 14px; align-items: baseline; }
.receipt .who { color: var(--ink-2); }
.receipt .who b { color: var(--ink); display: block; font-weight: 600; }
.receipt div span { display: block; font-size: 12px; color: var(--ink-3); }
.receipt div b { font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt.head { background: transparent; border: 0; padding-block: 0; color: var(--ink-3); font-size: 12px; }
.receipt.new { animation: pop .4s ease-out; }
@keyframes pop { from { background: #E8F6F7; } to { background: #fff; } }

/* results */
.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; margin-top: 24px; }
.limits h3 { margin-bottom: 8px; }
.limits ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.limits li { margin-bottom: 6px; }

footer { padding-block: 40px 60px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .receipt.new { animation: none; } }
@media (max-width: 960px) {
  .hero-grid, .split, .split.flip, .explorer, .rackviz, .limits { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twin { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; } section { padding-block: 48px; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .receipt { grid-template-columns: 1fr 1fr; }
  .readout { grid-template-columns: 1fr; }
}
