:root {
  --bg: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --text: #e4e4ed;
  --text-dim: #8888a0;
  --accent: #7c5cfc;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --accent-soft: rgba(124, 92, 252, 0.12);
  --green: #34d399;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html { scroll-behavior: smooth; }

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

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

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 120px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.code-block {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: left;
  max-width: 560px;
  margin: 0 auto 32px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.8;
  overflow-x: auto;
  backdrop-filter: blur(12px);
}

.code-block code { color: var(--text); }
.kw { color: #c792ea; }
.fn { color: #82aaff; }
.str { color: #c3e88d; }
.num { color: #f78c6c; }
.prop { color: #89ddff; }

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: var(--font);
}

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

.btn-primary:hover {
  background: #6b4fe6;
  transform: translateY(-1px);
  box-shadow: 0 6px 32px var(--accent-glow);
}

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

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

.btn-ghost:hover { background: var(--bg-card-hover); }

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  width: 100%;
  justify-content: center;
}

.install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 16px;
}

.install-cmd code {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
}

.copy-btn {
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.copy-btn:hover { background: rgba(124, 92, 252, 0.2); }

/* ── Features ───────────────────────────────────────────────────── */

.features {
  padding: 60px 0;
}

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

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

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124, 92, 252, 0.2);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}

.feature-card code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(124, 92, 252, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.code-sm {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

.code-sm code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* ── Demo ───────────────────────────────────────────────────────── */

.demo {
  padding: 80px 0;
}

.demo h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.demo-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 32px;
}

.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(8px);
}

.step {
  margin-bottom: 24px;
}

.step:last-child { margin-bottom: 0; }

.step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.step-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-btn {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.voice-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.voice-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.voice-btn.recording {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  animation: rec-pulse 1s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

#text-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}

#text-input:focus { border-color: var(--accent); }

.player {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.waveform {
  height: 60px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}

.waveform .bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.1s ease;
}

audio {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
}

audio::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.3);
}

.status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  min-height: 20px;
}

.status.error { color: #ef4444; }
.status.success { color: var(--green); }

.btn-loader { display: inline-flex; align-items: center; gap: 8px; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ─────────────────────────────────────────────────────── */

footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 14px;
  color: var(--text-dim);
}

footer a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .hero { padding: 80px 0 60px; }
  .code-block { padding: 16px 20px; font-size: 13px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .demo-card { padding: 20px; }
  .step-options { flex-direction: column; }
  .voice-btn { text-align: center; }
}
