:root {
  --bg-light: #f6f8fc;
  --bg-dark: #070b14;
  --surface-light: #ffffff;
  --surface-dark: #0f1626;
  --surface-alt-light: #edf2f9;
  --surface-alt-dark: #162036;
  --border-light: #cbd5e1;
  --border-dark: #253554;
  --text-light: #0f172a;
  --text-dark: #eef4ff;
  --muted-light: #475569;
  --muted-dark: #94a8c9;
  --accent-light: #1d4ed8;
  --accent-dark: #5ba4ff;
  --emerald-light: #059669;
  --emerald-dark: #34d399;
  --amber-light: #d97706;
  --amber-dark: #fbbf24;
  --crimson-light: #dc2626;
  --crimson-dark: #f87171;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --border: var(--border-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --accent: var(--accent-light);
  --emerald: var(--emerald-light);
  --amber: var(--amber-light);
  --crimson: var(--crimson-light);

  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-alt: var(--surface-alt-dark);
    --border: var(--border-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --accent: var(--accent-dark);
    --emerald: var(--emerald-dark);
    --amber: var(--amber-dark);
    --crimson: var(--crimson-dark);
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-alt: light-dark(var(--surface-alt-light), var(--surface-alt-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --emerald: light-dark(var(--emerald-light), var(--emerald-dark));
    --amber: light-dark(var(--amber-light), var(--amber-dark));
    --crimson: light-dark(var(--crimson-light), var(--crimson-dark));
  }

  color-scheme: light dark;
  accent-color: var(--accent);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(76, 145, 255, 0.16), transparent),
    var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

pre, code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
  accent-color: var(--accent);
}

.container {
  max-inline-size: 78rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Sticky Top Navigation */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4rem;
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-dot {
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  border-block-end: 2px solid var(--accent);
  padding-block-end: 0.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 0.6rem;
  font-weight: 650;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
  color: #ffffff;
}

.btn-emerald {
  border-color: var(--emerald);
  color: var(--emerald);
}

.btn-sm {
  padding: 0.42rem 0.78rem;
  font-size: 0.83rem;
}

/* Hero */
.hero {
  padding-block: 4.5rem 3.25rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--emerald);
  margin-block-end: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-inline-size: 18ch;
  margin-inline: auto;
  margin-block: 0 1.2rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 1.8vw, 1.24rem);
  color: var(--muted);
  max-inline-size: 66ch;
  margin-inline: auto;
  margin-block: 0 2rem;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-block-end: 2.75rem;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.9rem;
  text-align: start;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1rem 1.15rem;
}

.kpi-val {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--accent);
}

.kpi-lbl {
  font-size: 0.83rem;
  color: var(--muted);
}

/* Sections */
.section {
  padding-block: 3.5rem;
  border-block-start: 1px solid var(--border);
}

.section-hdr {
  margin-block-end: 2rem;
}

.section-hdr h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.025em;
  margin-block: 0 0.5rem;
}

.section-hdr p {
  color: var(--muted);
  max-inline-size: 70ch;
  margin: 0;
  font-size: 1.03rem;
}

/* 3-Column Feature & Layer Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18.5rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.card h3 {
  margin: 0;
  font-size: 1.18rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pill {
  font-size: 0.74rem;
  font-weight: 700;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--emerald);
}

/* Code & Compiler Proof Split */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 1.25rem;
  margin-block-start: 1.5rem;
}

.code-panel {
  background: #0a0f1c;
  color: #e2e8f0;
  border: 1px solid #243452;
  border-radius: 0.9rem;
  overflow: hidden;
}

.code-hdr {
  padding: 0.65rem 1rem;
  background: #111a2e;
  border-block-end: 1px solid #243452;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a8c9;
  display: flex;
  justify-content: space-between;
}

.code-panel pre {
  margin: 0;
  padding: 1rem 1.15rem;
  font-size: 0.83rem;
  line-height: 1.55;
  overflow-x: auto;
}

/* Showcase Cards (Stage 2 Apps & Stage 1 3D Games) */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.5rem;
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.demo-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #080c16;
  border-block-end: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.demo-thumb-wrap img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

.demo-thumb-wrap:hover img {
  transform: scale(1.025);
}

.demo-badges {
  position: absolute;
  inset-block-start: 0.7rem;
  inset-inline-start: 0.7rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-dark {
  background: rgba(8, 12, 22, 0.86);
  color: #eef4ff;
  border: 1px solid rgba(120, 160, 220, 0.35);
  backdrop-filter: blur(6px);
  padding: 0.2rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.demo-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.demo-body h3 {
  margin: 0;
  font-size: 1.18rem;
}

.demo-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.demo-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-block-start: 0.45rem;
}

/* Responsive Benchmark Table (@container + sticky headers) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

table.bench-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  --label-2: "Legacy Electron / DOM";
  --label-3: "Axiom v0.2 + Axiom-UI";
  --label-4: "Engineering Advantage";
}

.bench-table caption {
  text-align: start;
  padding: 0.9rem 1.15rem;
  font-weight: 700;
  color: var(--muted);
  border-block-end: 1px solid var(--border);
  background: var(--surface-alt);
}

.bench-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.bench-table th,
.bench-table td {
  padding: 0.85rem 1.1rem;
  text-align: start;
  border-block-end: 1px solid var(--border);
}

.bench-table thead th {
  background: var(--surface-alt);
  font-weight: 700;
}

.bench-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  font-weight: 700;
}

.bench-win {
  color: var(--emerald);
  font-weight: 700;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@container (width < 680px) {
  .bench-table,
  .bench-table thead,
  .bench-table tbody,
  .bench-table tr,
  .bench-table th,
  .bench-table td {
    display: block;
  }

  .bench-table thead {
    display: none;
  }

  .bench-table tr {
    margin: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    overflow: hidden;
  }

  .bench-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--surface-alt);
  }

  .bench-table td:nth-child(2)::before {
    content: var(--label-2) ": ";
    font-weight: 700;
    color: var(--muted);
  }

  .bench-table td:nth-child(3)::before {
    content: var(--label-3) ": ";
    font-weight: 700;
    color: var(--muted);
  }

  .bench-table td:nth-child(4)::before {
    content: var(--label-4) ": ";
    font-weight: 700;
    color: var(--muted);
  }
}

/* Roadmap List */
.roadmap-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
}

.stage-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1.15rem 1.25rem;
}

.stage-item[data-state="done"] {
  border-color: color-mix(in srgb, var(--emerald) 55%, var(--border));
}

.stage-item[data-state="next"] {
  border-color: var(--accent);
}

.stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.4rem;
  font-weight: 750;
}

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Interactive Live Demo Modal (<dialog closedby="any">) */
dialog#demo-modal {
  inline-size: min(94dvw, 90rem);
  block-size: min(90dvh, 58rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #080c16;
  color: #eef4ff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

dialog#demo-modal[open] {
  display: flex;
  flex-direction: column;
}

dialog#demo-modal::backdrop {
  background-color: rgba(3, 6, 14, 0.76);
  backdrop-filter: blur(4px);
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #10182b;
  border-block-end: 1px solid #263859;
  flex-wrap: wrap;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.modal-frame {
  flex: 1;
  inline-size: 100%;
  border: 0;
  background: #080c16;
}
