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

:root {
  --bg: #09090b;
  --bg-subtle: #111113;
  --fg: #fafafa;
  --fg-muted: #a1a1aa;
  --border: #27272a;
  --border-subtle: #1e1e21;
  --accent: #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.15);
  --radius: 0.75rem;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

code {
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "Geist Mono", ui-monospace, monospace;
}

/* Grid background */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 20%, transparent 100%);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-icon {
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--fg);
}

/* Hero */
.hero {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  margin-bottom: 1.75rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 520px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

.install-snippet {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: -0.01em;
  user-select: all;
}

/* Buttons */
.cta-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--fg);
  background: transparent;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--fg-muted);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Sections */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* Steps */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  text-align: center;
}

.step-number {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.step-arrow {
  color: var(--fg-muted);
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 640px) {
  .step-arrow {
    display: none;
  }
  .steps {
    flex-direction: column;
    align-items: center;
  }
  .step {
    max-width: 100%;
  }
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* ── Animated board demo ────────────────────────── */
.demo-section {
  padding-top: 0;
  padding-bottom: 2rem;
}

.demo-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(8px);
  overflow: hidden;
  min-height: 220px;
}

.demo-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 160px;
}

.demo-col-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.25rem;
}

.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.demo-dot-gray { background: #71717a; }
.demo-dot-blue { background: #3b82f6; }
.demo-dot-yellow { background: #f59e0b; }
.demo-dot-pink { background: #ec4899; }
.demo-dot-green { background: #22c55e; }

.demo-card {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--fg);
  line-height: 1.3;
}

.demo-card-dim {
  opacity: 0.45;
}

.demo-card-done {
  opacity: 0.35;
  text-decoration: line-through;
  color: var(--fg-muted);
}

.demo-card-static {
  animation: demo-pulse 4s ease-in-out infinite;
}

@keyframes demo-pulse {
  0%, 100% { opacity: var(--card-opacity, 1); }
  50% { opacity: calc(var(--card-opacity, 1) - 0.08); }
}

.demo-card-dim { --card-opacity: 0.45; }
.demo-card-done { --card-opacity: 0.35; }

/* The animated card that moves through the pipeline */
.demo-animated-card {
  position: absolute;
  width: calc(20% - 0.5rem);
  z-index: 10;
  animation: demo-move 12s ease-in-out infinite;
}

.demo-animated-inner {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--fg);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.demo-card-title {
  display: block;
  line-height: 1.3;
}

.demo-card-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.demo-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}

.demo-agent-icon {
  width: 9px;
  height: 9px;
}

/* Phase labels */
.demo-phase {
  position: absolute;
  bottom: -1.4rem;
  left: 0.6rem;
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.demo-check {
  width: 10px;
  height: 10px;
  color: #22c55e;
}

/* Phase visibility keyframes */
.demo-phase-plan   { animation: demo-show-plan 12s ease-in-out infinite; }
.demo-phase-code   { animation: demo-show-code 12s ease-in-out infinite; }
.demo-phase-review { animation: demo-show-review 12s ease-in-out infinite; }
.demo-phase-done   { animation: demo-show-done 12s ease-in-out infinite; }

/* Card movement: Todo → Planning → In Progress → Review → Done */
@keyframes demo-move {
  /* Sit in Todo column */
  0%, 5%     { top: 3.2rem; left: calc(0 * 20% + 1rem);   opacity: 1; }
  /* Move to Planning */
  10%, 28%   { top: 3.2rem; left: calc(1 * 20% + 1rem);   opacity: 1; }
  /* Move to In Progress */
  33%, 53%   { top: 3.2rem; left: calc(2 * 20% + 1rem);   opacity: 1; }
  /* Move to Review */
  58%, 78%   { top: 3.2rem; left: calc(3 * 20% + 1rem);   opacity: 1; }
  /* Move to Done */
  83%, 92%   { top: 3.2rem; left: calc(4 * 20% + 1rem);   opacity: 1; }
  /* Fade out, reset */
  97%        { top: 3.2rem; left: calc(4 * 20% + 1rem);   opacity: 0; }
  100%       { top: 3.2rem; left: calc(0 * 20% + 1rem);   opacity: 0; }
}

@keyframes demo-show-plan {
  0%, 9%   { opacity: 0; }
  12%, 26% { opacity: 1; }
  30%, 100%{ opacity: 0; }
}
@keyframes demo-show-code {
  0%, 32%  { opacity: 0; }
  36%, 51% { opacity: 1; }
  55%, 100%{ opacity: 0; }
}
@keyframes demo-show-review {
  0%, 57%  { opacity: 0; }
  60%, 76% { opacity: 1; }
  80%, 100%{ opacity: 0; }
}
@keyframes demo-show-done {
  0%, 82%  { opacity: 0; }
  85%, 93% { opacity: 1; }
  97%, 100%{ opacity: 0; }
}

/* Glow trail effect */
.demo-animated-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.08), transparent 70%);
  z-index: -1;
  animation: demo-glow 12s ease-in-out infinite;
}

@keyframes demo-glow {
  0%, 5%, 92%, 100% { opacity: 0; }
  8%, 10%, 31%, 33%, 56%, 58%, 81%, 83% { opacity: 1; }
  12%, 28%, 36%, 53%, 60%, 78%, 85%, 90% { opacity: 0.3; }
}

@media (max-width: 640px) {
  .demo-board {
    grid-template-columns: repeat(3, 1fr);
    min-height: 180px;
  }
  .demo-board .demo-col:nth-child(4),
  .demo-board .demo-col:nth-child(5) {
    display: none;
  }
  .demo-animated-card {
    width: calc(33.33% - 0.5rem);
  }
  @keyframes demo-move {
    0%, 5%     { top: 3.2rem; left: calc(0 * 33.33% + 1rem); opacity: 1; }
    15%, 40%   { top: 3.2rem; left: calc(1 * 33.33% + 1rem); opacity: 1; }
    50%, 85%   { top: 3.2rem; left: calc(2 * 33.33% + 1rem); opacity: 1; }
    95%        { top: 3.2rem; left: calc(2 * 33.33% + 1rem); opacity: 0; }
    100%       { top: 3.2rem; left: calc(0 * 33.33% + 1rem); opacity: 0; }
  }
}

/* Install options */
.install-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.install-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
}

.install-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.install-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}

.install-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.install-card p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.install-snippet-block {
  margin: 1rem 0 0.75rem;
  display: block;
  text-align: left;
  width: 100%;
  overflow-x: auto;
}

.install-note {
  font-size: 0.78rem !important;
  color: var(--fg-muted);
  opacity: 0.7;
}

.install-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.install-step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.install-step-item code {
  font-size: 0.8rem;
  user-select: all;
}

.install-step-num {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--fg-muted);
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* CTA section */
.cta-section {
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.cta-desc {
  color: var(--fg-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 600;
  color: var(--fg);
}

.footer-sep {
  opacity: 0.3;
}

.footer a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover {
  color: var(--fg);
}
