:root {
  --bg: #070a11;
  --bg-elev: #0c111d;
  --surface: #101726;
  --surface-2: #151f33;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #eef2f9;
  --muted: #94a3b8;
  --dim: #64748b;

  --cyan: #22d3ee;
  --sky: #38bdf8;
  --emerald: #34d399;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --rose: #fb7185;

  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 75% 45% at 50% -10%, rgba(56, 189, 248, 0.12), transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 15%, rgba(167, 139, 250, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 1px 5px;
  border-radius: 5px;
  color: #e2e8f0;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 10, 17, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #22d3ee 0%, #6366f1 55%, #34d399 100%);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  color: #050811;
  letter-spacing: -0.04em;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.28);
}

.brand-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: #f8fafc;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

.nav-pill:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
}

/* Main Layout Container */
.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 22px 64px;
}

/* Compact Hero */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 8px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.hero h1 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #f8fafc;
  margin-bottom: 8px;
}

.hero h1 span {
  background: linear-gradient(90deg, #38bdf8, #34d399, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 14px;
  color: var(--muted);
  max-width: 720px;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat {
  background: rgba(16, 23, 38, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 13px;
  min-width: 118px;
}

.hero-stat-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.hero-stat-lbl {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
}

/* Interactive 20-Engine Stage */
.stage-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  margin-bottom: 42px;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #090d16;
  border-bottom: 1px solid var(--border);
  padding: 6px;
  gap: 5px;
}

.tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  background: rgba(148, 163, 184, 0.07);
  color: #f1f5f9;
}

.tab-btn[aria-selected="true"] {
  background: var(--surface-2);
  border-color: var(--tab-accent, rgba(56, 189, 248, 0.45));
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tab-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tab-dot, var(--cyan));
  flex-shrink: 0;
}

.tab-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.25);
  white-space: nowrap;
}

.tab-domain {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-btn[aria-selected="true"] .tab-domain {
  color: var(--muted);
}

/* Engine Info Strip above Iframe */
.engine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.engine-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.engine-tagline {
  color: #e2e8f0;
  font-weight: 500;
}

.engine-api {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sky);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 2px 8px;
  border-radius: 6px;
}

.engine-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 4px 9px;
  border-radius: 7px;
}

.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 5px 11px;
  border-radius: 7px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.open-btn:hover {
  border-color: var(--sky);
  background: rgba(56, 189, 248, 0.14);
}

/* Full-Bleed Demo Viewport */
.viewport-wrap {
  position: relative;
  width: 100%;
  height: min(76vh, 780px);
  min-height: 600px;
  background: #07090e;
}

.demo-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #07090e;
}

/* Sections Below the Fold */
.section {
  margin-bottom: 44px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.section-head p {
  font-size: 13px;
  color: var(--muted);
}

/* Verified Benchmark Matrix */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

.eng-cell {
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.eng-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--dim);
  margin-top: 2px;
}

.mono-strong {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mono-muted {
  font-family: var(--mono);
  font-size: 12px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.demo-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sky);
  white-space: nowrap;
}

.demo-link:hover {
  text-decoration: underline;
}

/* Architecture Cards */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.arch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.arch-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.arch-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 6px;
  border-radius: 5px;
}

.arch-phase {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.arch-phase strong {
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}

.arch-phase.hot strong {
  color: var(--emerald);
}

.arch-phase.cold strong {
  color: var(--sky);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--dim);
}

footer a {
  color: var(--sky);
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1120px) {
  .tab-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .arch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .nav-links {
    display: none;
  }
  .shell {
    padding: 16px 14px 48px;
  }
  .tab-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .arch-grid {
    grid-template-columns: 1fr;
  }
  .viewport-wrap {
    height: 620px;
    min-height: 520px;
  }
}
