:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #172034;
  --border: #24324d;
  --border-hi: #3b517c;
  --ink: #ecf2fc;
  --muted: #93a5c4;
  --accent: #60a5fa;
  --accent-dim: rgba(96, 165, 250, 0.14);
  --rose: #fb7185;
  --rose-dim: rgba(251, 113, 133, 0.13);
  --ok: #34d399;
  --ok-dim: rgba(52, 211, 153, 0.13);
  --amber: #fbbf24;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 82% -10%, rgba(251, 113, 133, 0.08), transparent 60%),
              radial-gradient(950px 520px at 12% 0%, rgba(96, 165, 250, 0.10), transparent 55%),
              var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  color: #f3f7ff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.12rem; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: 0.9rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); text-decoration: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.hero { padding: 1.5rem 0 2.75rem; border-bottom: 1px solid var(--border); }

.kicker, .eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin: 0 0 0.65rem;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
}
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); letter-spacing: -0.02em; margin: 0 0 0.6rem; }
h3 { font-size: 1.04rem; margin: 0 0 0.55rem; }

.lede { max-width: 72ch; color: #c7d5ec; font-size: 1.05rem; margin: 0 0 1.75rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.75rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; }
.stat-val { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-lbl { font-size: 0.88rem; color: var(--accent); font-weight: 600; margin-top: 0.2rem; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 1.1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--ink);
}
.btn:hover { border-color: var(--rose); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #07101f; }
.btn.primary:hover { background: #7ab8ff; border-color: #7ab8ff; }

.section { padding: 2.75rem 0 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-note { max-width: 52ch; color: var(--muted); font-size: 0.92rem; margin: 0; }

.panel-grid { display: grid; gap: 1rem; margin-top: 2rem; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.3rem 1.4rem; }
.card p { margin: 0; color: #c7d5ec; font-size: 0.94rem; }

.stager-shell { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.stager-compare { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.compare-card { padding: 0.95rem 1rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.compare-card.bad { border-color: rgba(251, 113, 133, 0.45); }
.compare-card.ok { border-color: rgba(96, 165, 250, 0.45); }
.c-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.65rem; font-size: 0.86rem; }
.compare-card.bad .c-head strong { font-family: var(--mono); color: var(--rose); }
.compare-card.ok .c-head strong { font-family: var(--mono); color: var(--ok); }

.cap-bar { background: rgba(251, 113, 133, 0.16); border: 1px solid rgba(251, 113, 133, 0.4); border-radius: 7px; padding: 0.5rem 0.75rem; font-family: var(--mono); font-size: 0.78rem; color: #fecdd3; }

.tx-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.55rem; }
.tx-btn {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.tx-btn span { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.tx-btn strong { font-family: var(--mono); font-size: 0.92rem; }
.tx-btn small { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.tx-btn.active { border-color: var(--ok); background: var(--ok-dim); box-shadow: 0 0 0 1px var(--ok); }

.tx-detail {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.tx-detail h3 { color: var(--accent); font-family: var(--mono); font-size: 0.96rem; margin-bottom: 0.45rem; }
.tx-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.7rem; }
.tx-kv div { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 0.5rem 0.65rem; }
.tx-kv span { display: block; font-size: 0.72rem; font-family: var(--mono); color: var(--muted); }
.tx-kv strong { display: block; font-family: var(--mono); font-size: 0.88rem; margin-top: 0.15rem; }

.callout { padding: 0.9rem 1rem; border-radius: 8px; font-size: 0.88rem; color: #dce7fa; }
.callout.warn { background: rgba(251, 113, 133, 0.09); border: 1px solid rgba(251, 113, 133, 0.35); }

.tab-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.82rem;
  border-radius: 7px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}
tr:last-child td { border-bottom: none; }

.code-stack { display: flex; flex-direction: column; gap: 0.85rem; }
.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.95rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--muted);
}
.copy-btn {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
pre { margin: 0; padding: 0.9rem 1rem; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem; }
pre code { background: none; padding: 0; }

.plain-list { margin: 0; padding-left: 1.15rem; color: #c7d5ec; font-size: 0.92rem; }
.plain-list li { margin-bottom: 0.55rem; }

.constellation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.c-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.05rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}
.c-card strong { font-family: var(--mono); color: var(--rose); font-size: 0.92rem; }
.c-card span { font-size: 0.82rem; color: var(--muted); }
.c-card:hover { border-color: var(--rose); text-decoration: none; }
.c-card.current { border-color: var(--accent); background: var(--surface-2); }
.c-card.current strong { color: var(--accent); }

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .three-col { grid-template-columns: minmax(0, 1fr); }
  .tx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tx-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .topbar { padding: 0.75rem 1rem; }
  .nav { gap: 0.7rem; font-size: 0.82rem; }
  .stat-grid, .tx-grid, .tx-kv { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 1.5rem 0.95rem 3rem; }
}
