:root {
  color-scheme: light;
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --panel: #ffffff;
  --panel-soft: #eef6f5;
  --teal: #0f766e;
  --blue: #1d4ed8;
  --amber: #b45309;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.12), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

img,
video {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(16px);
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar strong {
  font-size: 15px;
}

.topbar span {
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a,
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.72);
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

main {
  max-width: 1440px;
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 68px);
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  max-width: 12ch;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
}

h3 {
  margin-bottom: 8px;
}

.lede,
.section-head p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.product-console {
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.console-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.console-head span {
  color: var(--teal);
  font-weight: 800;
}

.console-head small {
  color: var(--muted);
}

.product-console img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.console-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.console-metrics div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.console-metrics div:last-child {
  border-right: 0;
}

.console-metrics strong,
.metric-grid span {
  display: block;
  color: var(--teal);
  font-size: 30px;
  line-height: 1;
}

.console-metrics span,
.metric-grid small,
.stage-card p {
  color: var(--muted);
}

.section {
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-head {
  max-width: 840px;
  margin-bottom: 26px;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

figure {
  margin: 0;
}

.result-hero figure,
.gallery figure,
.screenshot-grid figure,
.stage-card,
.scenario-list article,
.deliverable-grid article,
.architecture-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

figcaption {
  padding: 11px 13px;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  gap: 12px;
}

.metric-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric-grid strong {
  display: block;
  margin: 10px 0 6px;
}

.gallery,
.screenshot-grid,
.stage-grid,
.scenario-list,
.deliverable-grid,
.architecture-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screenshot-grid,
.scenario-list,
.architecture-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stage-card {
  min-height: 218px;
  padding: 18px;
}

.stage-order {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.stage-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 0;
}

.stage-card dt,
.stage-card dd {
  margin: 0;
}

.stage-card dt {
  color: var(--muted);
  font-size: 12px;
}

.stage-card dd {
  font-weight: 800;
}

.scenario-list article,
.architecture-grid article {
  padding: 20px;
}

.deliverable-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.deliverable-grid article {
  padding: 18px;
}

.deliverable-grid span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
}

.video-panel {
  display: grid;
  gap: 14px;
  max-width: 960px;
}

.video-panel video {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.code-list {
  display: grid;
  gap: 12px;
}

pre {
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #0f172a;
  color: #e2e8f0;
}

.manifest-error::before {
  content: "Demo manifest failed to load. Run python scripts/demo/run_demo_pipeline.py --skip-pipeline.";
  display: block;
  padding: 14px 18px;
  background: #991b1b;
  color: #fff;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .hero,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .gallery,
  .stage-grid,
  .deliverable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1 1 auto;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: none;
    font-size: 42px;
  }

  .console-metrics,
  .gallery,
  .screenshot-grid,
  .stage-grid,
  .scenario-list,
  .deliverable-grid,
  .architecture-grid {
    grid-template-columns: 1fr;
  }
}
