:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #101113;
  --surface-2: #17181b;
  --line: #27292d;
  --line-soft: #1b1d20;
  --text: #f0f1f2;
  --text-2: #b9bcc1;
  --muted: #7f858d;
  --green: #76b900;
  --green-soft: rgba(118, 185, 0, 0.1);
  --green-line: rgba(118, 185, 0, 0.34);
  --max: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}
button, video { font: inherit; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 9, 10, 0.9);
  backdrop-filter: blur(14px);
}
.topbar-inner, main, footer {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}
.topbar-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 750; }
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--green);
  color: #050700;
  font-size: 14px;
  font-weight: 900;
}
nav { display: flex; gap: 26px; color: var(--muted); font-size: 13px; font-weight: 650; }
nav a:hover, nav a:focus-visible, footer a:hover, footer a:focus-visible { color: var(--green); }

.intro {
  min-height: 288px;
  padding: 58px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 64px;
  border-bottom: 1px solid var(--line-soft);
}
.kicker, .section-index {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.kicker { display: flex; align-items: center; gap: 8px; }
.kicker span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 17px; font-size: clamp(40px, 6vw, 72px); line-height: 0.98; }
h1 em { color: var(--green); font-style: normal; }
.intro-copy > p:last-child { max-width: 780px; margin-bottom: 0; color: var(--text-2); font-size: 18px; }
.run-spec {
  min-width: 390px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.run-spec div { padding: 13px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.run-spec dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.run-spec dd { margin: 2px 0 0; color: #fff; font-size: 14px; font-weight: 700; }

.viewer-section, .results-section, .method-section { padding: 60px 0 72px; }
.results-section, .method-section { border-top: 1px solid var(--line-soft); }
.section-heading { margin-bottom: 26px; display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.section-heading h2, .method-section h2 { margin: 0; font-size: 30px; line-height: 1.15; }
.section-index { margin-bottom: 8px; }
.viewer-heading-copy { min-width: 0; }
.viewer-prompt { max-width: 112ch; margin: 0; display: flex; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.viewer-prompt strong { flex: 0 0 auto; color: var(--green); font-size: 10px; text-transform: uppercase; }
.section-note, .media-legend { margin: 0; color: var(--muted); font-size: 13px; }
.media-legend { display: flex; align-items: center; gap: 9px; }
.media-legend i { width: 9px; height: 9px; border-radius: 2px; background: #60646a; }
.media-legend span { width: 1px; height: 12px; background: var(--line); }

.control-row { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.control-group { display: flex; align-items: center; gap: 10px; }
.control-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.segmented button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.segmented button[aria-selected="true"] { background: var(--green); color: #070900; }
.segmented button:disabled { cursor: not-allowed; opacity: 0.45; }
.segmented button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.video-pair { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pair-play {
  position: absolute; z-index: 6; top: 50%; left: 50%; width: 58px; height: 58px;
  padding: 0 0 0 4px; transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.38); border-radius: 50%;
  color: #070907; background: var(--green); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.58);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.pair-play:hover, .pair-play:focus-visible { background: #8ce000; outline: 2px solid #fff; outline-offset: 3px; }
.pair-play[hidden] { display: none; }
.video-card { overflow: hidden; margin: 0; border: 1px solid #303238; border-radius: 8px; background: var(--surface); }
.video-card.sol-card { border-color: var(--green-line); }
.video-card video { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: contain; background: #000; }
.video-meta { min-height: 54px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.video-meta span { color: var(--text-2); font-size: 13px; font-weight: 700; }
.video-meta strong { color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.sol-card .video-meta span, .sol-card .video-meta strong { color: var(--green); }
.method-metrics { margin-top: 20px; overflow: hidden; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.method-metrics-head, .method-metrics-row { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); align-items: center; }
.method-metrics-head { min-height: 40px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.method-metrics-row { min-height: 62px; border-top: 1px solid var(--line); background: var(--green-soft); }
.method-metrics-head span, .method-metrics-row > * { padding: 10px 18px; text-align: right; }
.method-metrics-head span:first-child, .method-metrics-row > *:first-child { padding-left: 2px; text-align: left; }
.method-metrics-row strong { color: var(--text-2); font-size: 13px; }
.method-metrics-row span { color: var(--green); font-size: 21px; font-weight: 800; }

.chart-panel { margin-bottom: 28px; padding: 26px 26px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.chart-head { margin-bottom: 25px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.chart-head h3 { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-2); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 2px; }
.stage1-swatch, .chart-segment.stage1 { background: #4d760b; }
.stage2-swatch, .chart-segment.stage2 { background: var(--green); }
.other-swatch, .chart-segment.other { background: #555b63; }
.chart-scroll { overflow-x: auto; }
.latency-chart { min-width: 880px; }
.chart-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 190px minmax(440px, 1fr) 100px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.chart-row:last-child { border-bottom: 0; }
.chart-label strong, .chart-label small { display: block; }
.chart-label strong { color: var(--text-2); font-size: 13px; font-weight: 700; }
.chart-label small { color: var(--muted); font-size: 11px; }
.chart-track { position: relative; height: 18px; background: #15171a; }
.chart-bar { height: 100%; display: flex; overflow: hidden; border-radius: 4px; }
.chart-segment { height: 100%; min-width: 1px; border-right: 2px solid var(--surface); }
.chart-segment:last-child { border-right: 0; }
.chart-value { text-align: right; font-variant-numeric: tabular-nums; }
.chart-value strong, .chart-value small { display: block; }
.chart-value strong { color: #fff; font-size: 17px; }
.chart-row.sol .chart-value strong { color: var(--green); }
.chart-value small { color: var(--muted); font-size: 11px; }
.chart-pending { color: var(--muted); font-size: 12px; }
.chart-pair-axis {
  min-height: 28px;
  display: grid;
  grid-template-columns: 190px minmax(440px, 1fr) 100px;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
}
.chart-ticks { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.chart-pair-axis:not(:last-child) { margin-bottom: 15px; border-bottom: 1px dashed #34373c; }
.chart-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 1060px; border-collapse: collapse; background: var(--surface); font-size: 13px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.sol td { background: var(--green-soft); }
td.accent { color: var(--green); font-weight: 800; }
td.muted { color: var(--muted); }

.method-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.method-grid div { min-height: 130px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-grid span { color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.method-grid p { margin: 9px 0 0; color: var(--text-2); font-size: 14px; }

footer { padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
code { color: var(--text-2); }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; align-items: start; gap: 34px; }
  .run-spec { min-width: 0; max-width: 560px; }
  .method-section { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 760px) {
  .video-pair { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-inner, main, footer { width: min(calc(100% - 28px), var(--max)); }
  nav a:not(:last-child) { display: none; }
  .intro { min-height: 0; padding: 38px 0 32px; }
  h1 { font-size: 42px; }
  .intro-copy > p:last-child { font-size: 15px; }
  .viewer-section, .results-section, .method-section { padding: 44px 0 52px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .control-row, .control-group { align-items: stretch; flex-direction: column; gap: 7px; }
  .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; overflow-x: auto; }
  .segmented button { padding-inline: 9px; }
  .viewer-prompt { display: block; }
  .viewer-prompt strong { margin-right: 8px; }
  .method-metrics { overflow-x: auto; }
  .method-metrics-head, .method-metrics-row { min-width: 620px; }
  .chart-panel { padding: 20px 14px 14px; }
  .chart-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .latency-chart { min-width: 0; }
  .chart-row { grid-template-columns: 110px minmax(110px, 1fr) 58px; gap: 8px; }
  .chart-pair-axis { grid-template-columns: 110px minmax(110px, 1fr) 58px; gap: 8px; }
  .chart-value strong { font-size: 13px; }
  .chart-label strong { font-size: 11px; }
  .chart-label small, .chart-value small { font-size: 9px; }
  .chart-track { height: 15px; }
  .method-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}
