:root {
  --bg: #0a0a0b;
  --fg: #f5f5f7;
  --muted: #a1a1aa;
  --accent: #5eead4;
  --accent-fg: #04241e;
  --surface: #161618;
  --border: #2a2a2e;
  --max: 1100px;
}

/* Contrast (on --bg #0a0a0b): --fg ≈ 19:1, --muted ≈ 8:1 (AA body);
   --accent-fg on --accent ≈ 11:1 (AA). */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  font-size: 0.9em;
}

/* ---- Hero ---- */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }

.hero-grid { display: grid; gap: 2.5rem; align-items: center; }

.hero-copy h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.subhead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 34ch;
}
.subhead strong { color: var(--fg); }

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  min-height: 44px;
  border-radius: 10px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta:active { transform: translateY(0); }

/* ---- Demo media ---- */
.demo {
  margin: 0;
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.demo-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.demo-fallback { display: none; }
/* Reveal when JS flags a missing video */
.demo.no-video .demo-video { display: none; }
.demo.no-video .demo-fallback {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  padding: 1rem;
  background: var(--surface);
}

.demo-fallback-window { display: flex; gap: 0.4rem; padding: 0.25rem 0.25rem 0.75rem; }
.demo-fallback-window .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }

.demo-fallback-stage {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.6rem;
}
.pipe-step {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  opacity: 0.45;
}

/* ---- How it works ---- */
.how { padding-block: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--border); }
.how h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0 0 1.75rem; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}
.step-badge {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}
.step-label { font-size: 1.1rem; font-weight: 600; }

/* ---- Sign-up stub ---- */
.signup { padding-block: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--border); }
.signup h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0 0 0.5rem; }
.muted { color: var(--muted); margin: 0; }

/* ---- Breakpoints ---- */
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }

  .steps { flex-direction: row; align-items: stretch; }
  .step { flex: 1; flex-direction: column; text-align: center; }
  /* connector arrows between steps */
  .step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -0.4rem;
    top: 1rem;
    color: var(--muted);
  }
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .cta { /* transitions already gentle; keep as-is */ }
  .demo.no-video .pipe-step {
    animation: pipe-cycle 6s ease-in-out infinite;
  }
  .pipe-step[data-step="classify"]  { animation-delay: 0s; }
  .pipe-step[data-step="plan"]      { animation-delay: 1.5s; }
  .pipe-step[data-step="implement"] { animation-delay: 3s; }
  .pipe-step[data-step="pr"]        { animation-delay: 4.5s; }
}

@keyframes pipe-cycle {
  0%, 100% { opacity: 0.45; }
  16%      { opacity: 1; color: var(--accent); border-color: var(--accent); }
  33%      { opacity: 0.45; color: var(--muted); border-color: var(--border); }
}

/* When motion is reduced: hide the video entirely and show the (static) fallback. */
@media (prefers-reduced-motion: reduce) {
  .demo-video { display: none; }
  .demo .demo-fallback {
    display: flex;
    position: absolute;
    inset: 0;
    flex-direction: column;
    padding: 1rem;
    background: var(--surface);
  }
  .cta { transition: none; }
}
