:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #161f33;
  --border: #24304a;
  --border-bright: #33456b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.14);
  --indigo: #6366f1;
  --indigo-dim: rgba(99, 102, 241, 0.16);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.14);
  --rose: #f43f5e;
  --rose-dim: rgba(244, 63, 94, 0.14);
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: #7dd3fc; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--indigo));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 800;
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
nav.site-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
nav.site-nav a:hover, nav.site-nav a.active {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 36px 0 22px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3.2vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}
.hero p.lead {
  margin: 0;
  max-width: 780px;
  color: var(--text-muted);
  font-size: 1.02rem;
}
.meta-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.pill-green { background: var(--accent-dim); border-color: rgba(16,185,129,0.35); color: #6ee7b7; }
.pill-indigo { background: var(--indigo-dim); border-color: rgba(99,102,241,0.35); color: #a5b4fc; }
.pill-amber { background: var(--amber-dim); border-color: rgba(245,158,11,0.35); color: #fcd34d; }

/* Cards & Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section {
  margin: 26px 0;
}
.section-heading {
  margin: 0 0 12px;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
}
.section-sub {
  margin: -6px 0 16px;
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* Form Controls */
.field {
  margin-bottom: 14px;
}
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.field label strong {
  color: var(--text);
  font-family: var(--mono);
}

select, input[type="number"], input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--sans);
}
select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.seg-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.seg-btn {
  flex: 1;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-btn:hover { border-color: var(--border-bright); color: var(--text); }
.seg-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #6ee7b7;
}

/* KPI Stat Boxes */
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-val {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stacked VRAM bar */
.vram-bar {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin: 14px 0 8px;
}
.vram-seg-weights { background: var(--indigo); }
.vram-seg-kv { background: var(--accent); }
.vram-seg-overhead { background: var(--amber); }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

/* Verdict Banner */
.verdict {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid;
}
.verdict-self {
  background: var(--accent-dim);
  border-color: rgba(16, 185, 129, 0.45);
}
.verdict-api {
  background: var(--indigo-dim);
  border-color: rgba(99, 102, 241, 0.45);
}
.verdict h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.verdict p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* CTA Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #041b12;
}
.btn-primary:hover {
  background: #34d399;
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  border-color: var(--border-bright);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: #6ee7b7;
  text-decoration: none;
}

/* Break-even Chart */
.chart-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.chart-box svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Link cards */
.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.link-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.link-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FAQ & Prose */
.prose { max-width: 820px; }
.prose h2 { margin-top: 26px; font-size: 1.25rem; }
.prose p, .prose li { color: #cbd5e1; }
.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.86em;
}

details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
details.faq-item p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Footer */
footer.site-footer {
  margin-top: 52px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.disclosure-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
