/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a0a0b;
  --color-bg-subtle: #111113;
  --color-bg-card: #16161a;
  --color-bg-card-hover: #1c1c21;
  --color-surface: #1e1e23;
  --color-border: #2a2a30;
  --color-border-strong: #3a3a42;
  --color-text: #e8e8ed;
  --color-text-secondary: #9898a4;
  --color-text-dim: #6b6b78;
  --color-accent: #6c8aff;
  --color-accent-dim: #4a64d4;
  --color-accent-glow: rgba(108, 138, 255, 0.15);
  --color-green: #4ade80;
  --color-yellow: #facc15;
  --color-red: #f87171;
  --color-cyan: #67e8f9;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --radius: 10px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav-logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 6px 14px;
}

.btn-lg {
  font-size: 1rem;
  padding: 12px 28px;
}

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

.btn-primary:hover {
  background: var(--color-accent-dim);
  box-shadow: 0 0 24px var(--color-accent-glow);
}

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

.btn-outline:hover {
  border-color: var(--color-text-dim);
  color: var(--color-text);
}

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

.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

/* ── Hero ── */
.hero {
  padding: 160px 0 100px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-highlight {
  background: linear-gradient(135deg, var(--color-accent), var(--color-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
}

.hero-urgency {
  font-size: 0.95rem;
  color: var(--color-text-dim);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
  font-style: italic;
}

.hero-install {
  display: inline-block;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.hero-install code {
  display: inline-block;
  font-size: 0.9rem;
  padding: 10px 12px 10px 24px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--color-text-secondary);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 4px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.copy-btn .copy-icon,
.copy-btn .check-icon {
  width: 15px;
  height: 15px;
}

.copy-btn .check-icon {
  display: none;
  color: var(--color-green);
}

.copy-btn.copied .copy-icon {
  display: none;
}

.copy-btn.copied .check-icon {
  display: block;
}

.code-block {
  position: relative;
}

.code-block pre {
  padding-right: 48px;
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.code-block:hover .code-copy-btn,
.code-copy-btn.copied {
  opacity: 1;
}

/* ── Sections ── */
.section {
  padding: 100px 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ── Problem Section ── */
.section-problem {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.problem-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.problem-icon {
  width: 40px;
  height: 40px;
  color: var(--color-red);
  margin-bottom: 16px;
}

.problem-icon svg {
  width: 100%;
  height: 100%;
}

.problem-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.problem-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ── Features ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.2s, background 0.2s;
}

.feature-card:hover {
  border-color: var(--color-border-strong);
  background: var(--color-bg-card-hover);
}

.feature-card-large {
  grid-column: span 1;
}

.feature-icon-wrap {
  width: 40px;
  height: 40px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.feature-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ── Layers (How It Works) ── */
.layers {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 48px;
}

.layer {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.layer-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-glow);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 12px;
}

.layer-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.layer-content p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ── Architecture Diagram ── */
.section-arch {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.arch-diagram {
  margin-top: 48px;
}

.arch-svg {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* ── HITL Demos ── */
.section-hitl {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.hitl-demos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.hitl-demo-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hitl-demo-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

.hitl-demo-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hitl-demo-body {
  padding: 20px;
}

.hitl-demo-terminal {
  background: #0d0d0f;
  font-size: 0.82rem;
}

.hitl-demo-terminal pre {
  line-height: 1.8;
}

.hitl-msg {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.hitl-msg:last-child {
  margin-bottom: 0;
}

.hitl-msg-bot {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.hitl-msg-user {
  background: var(--color-accent-glow);
  border: 1px solid rgba(108, 138, 255, 0.25);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
}

.hitl-msg-lock {
  font-weight: 700;
  color: var(--color-yellow);
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.hitl-msg-detail {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.hitl-msg-params {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin: 10px 0;
  padding: 8px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  line-height: 1.6;
}

.hitl-msg-batch {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin: 10px 0;
  line-height: 1.8;
}

.hitl-msg-actions {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  font-family: var(--font-mono);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* Terminal colors */
.t-yellow { color: var(--color-yellow); }
.t-green { color: var(--color-green); }
.t-cyan { color: var(--color-cyan); }
.t-dim { color: var(--color-text-dim); }

/* ── Config Showcase ── */
.config-showcase {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.config-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.config-tab {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.config-tab:hover {
  color: var(--color-text-secondary);
  background: var(--color-surface);
}

.config-tab.active {
  color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.config-panel {
  display: none;
  padding: 28px 32px;
}

.config-panel.active {
  display: block;
}

.config-panel pre {
  font-size: 0.84rem;
  line-height: 1.75;
}

/* YAML syntax colors */
.y-key { color: var(--color-accent); }
.y-comment { color: var(--color-text-dim); }

/* ── Quickstart ── */
.section-quickstart {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 40px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-glow);
  color: var(--color-accent);
  font-weight: 700;
  border-radius: 10px;
  font-size: 1rem;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.step-content pre {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.84rem;
  line-height: 1.7;
  overflow-x: auto;
}

/* ── Use Cases ── */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.usecase-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s;
}

.usecase-card:hover {
  border-color: var(--color-border-strong);
}

.usecase-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.usecase-card p {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ── Security ── */
.section-security {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.security-item {
  padding: 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.security-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.security-item p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ── CTA ── */
.section-cta {
  text-align: center;
  padding: 120px 0;
}

.section-cta .section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.section-cta .section-desc {
  margin: 0 auto 36px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-dim);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--color-text-secondary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .problem-grid,
  .features-grid,
  .usecases-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .hitl-demos {
    grid-template-columns: 1fr;
  }

  .feature-card-large {
    grid-column: span 1;
  }

  .layer {
    flex-direction: column;
    gap: 16px;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .section {
    padding: 64px 0;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .arch-svg {
    max-width: 100%;
    overflow-x: auto;
  }

  .hero-actions {
    flex-direction: column;
  }

  .config-tab {
    padding: 12px 14px;
    font-size: 0.8rem;
  }

  .config-panel {
    padding: 20px 16px;
  }
}
