:root {
  --bg: #0b0d13;
  --bg-subtle: #121620;
  --card: #181d2a;
  --card-hover: #1e2435;
  --border: #262d3e;
  --border-focus: #7c5cff;
  --text: #f0f3f8;
  --text-muted: #949db2;
  --accent: #7c5cff;
  --accent-gradient: linear-gradient(135deg, #7c5cff 0%, #4facfe 100%);
  --accent2: #00f2fe;
  --err: #ff4d6d;
  --err-bg: rgba(255, 77, 109, 0.12);
  --ok: #00e676;
  --ok-bg: rgba(0, 230, 118, 0.12);
  --info: #00b4d8;
  --info-bg: rgba(0, 180, 216, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }

.hidden { display: none !important; }

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 8vw;
  background: rgba(11, 13, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

.nav nav a {
  margin-left: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav nav a:hover { color: var(--text); }

/* Hero */
.hero {
  text-align: center;
  padding: 60px 6vw 40px;
  max-width: 820px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-block;
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.35);
  color: #c4b5fd;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto;
}

/* Card */
.main-card {
  max-width: 780px;
  margin: 20px auto 60px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.step {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.step:last-of-type { border-bottom: none; margin-bottom: 20px; }

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* Presets & Templates */
.preset-row, .templates-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.preset-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-sm {
  background: #202737;
  border: 1px solid var(--border);
  color: #c9d1e2;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm:hover {
  border-color: var(--accent);
  color: #fff;
  background: #283145;
}

/* Upload Grid */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .upload-grid { grid-template-columns: 1fr; }
  .main-card { padding: 22px; }
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dropzone:hover, .dropzone.drag, .dropzone:focus {
  border-color: var(--accent);
  background: #1a2030;
}
.drop-icon { font-size: 1.8rem; margin-bottom: 6px; }

.record-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-record {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #242c3d;
  color: #fff;
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-record:hover { border-color: var(--accent); background: #2f384d; }

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d6d;
}

.btn-record.recording {
  background: rgba(255, 77, 109, 0.2);
  border-color: var(--err);
  color: var(--err);
  animation: pulse 1.5s infinite;
}
.btn-record.recording .rec-dot {
  animation: blink 0.8s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.4); } 70% { box-shadow: 0 0 0 12px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }

.rec-time {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Preview */
.preview {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #11141d;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.preview-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.btn-icon:hover { color: var(--err); }
canvas { width: 100%; height: 60px; background: #080a0e; border-radius: 6px; margin: 8px 0; }
audio { width: 100%; height: 40px; margin-top: 6px; border-radius: 6px; }
.sample-info-tag { font-size: 0.8rem; color: var(--accent2); margin-top: 4px; font-weight: 600; }

/* Input Groups */
.input-group { margin-top: 18px; }
.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.badge-sub {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent2);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}
input[type="text"], textarea {
  width: 100%;
  background: #10141f;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

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

/* Sliders */
.slider-box {
  display: block;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 10px;
}
.slider-box input[type="range"] {
  width: 100%;
  margin: 10px 0 6px;
  accent-color: var(--accent);
}

/* Consent & Generate */
.consent-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}
.consent-box input { margin-top: 4px; accent-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.4);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-generate { width: 100%; padding: 16px; font-size: 1.1rem; }

.btn-secondary {
  background: #242c3d;
  color: #fff;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #2f384d; border-color: var(--accent); color: #fff; }

/* Status Cards */
.status-card {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
}
.status-card.info { background: var(--info-bg); color: #90e0ef; border: 1px solid rgba(0, 180, 216, 0.3); }
.status-card.ok { background: var(--ok-bg); color: #b9f6ca; border: 1px solid rgba(0, 230, 118, 0.3); }
.status-card.error { background: var(--err-bg); color: #ff8fa3; border: 1px solid rgba(255, 77, 109, 0.3); }

/* Result Card */
.result-card {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(180deg, #182030 0%, #121622 100%);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.result-badge {
  display: inline-block;
  background: rgba(0, 230, 118, 0.15);
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.result-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.result-actions { display: flex; gap: 12px; margin-top: 14px; }

/* History Grid */
.section { max-width: 820px; margin: 60px auto; padding: 0 20px; }
.section h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.02em; }
.history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.history-text { font-size: 0.95rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
.empty-history { text-align: center; padding: 24px; }

/* Info Tiles & How it works */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.tile-icon { font-size: 2rem; margin-bottom: 12px; }
.tile h3 { font-size: 1.15rem; margin-bottom: 8px; }
.tile p { color: var(--text-muted); font-size: 0.92rem; }

.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.how-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  position: relative;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.2);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.how-step h4 { font-size: 1.1rem; margin-bottom: 6px; }
.how-step p { color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 8vw;
  margin-top: 80px;
  background: var(--bg-subtle);
}
.footer-content {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo { font-weight: 700; font-size: 1.1rem; }
.footer-content p { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a { margin-left: 16px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
