/* ============ RESET + BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0b0d12;
  color: #e8eaf0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: #8b9aff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 32px; margin-bottom: 8px; }
h3 { font-size: 18px; }
.muted { color: #8a92a3; font-size: 14px; }
.center { text-align: center; }
.grad {
  background: linear-gradient(90deg, #7c5cff 0%, #ff5cae 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ BUTTONS ============ */
button, .btn-primary, .btn-ghost, .btn-outline {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #7c5cff 0%, #5a3eff 100%);
  color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,92,255,0.4); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: #e8eaf0;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8eaf0;
}
.btn-outline:hover { border-color: #7c5cff; color: #b9a7ff; }
.btn-primary.big, .btn-outline.big { padding: 14px 26px; font-size: 15px; }
.full { width: 100%; }
.small { padding: 6px 10px; font-size: 12px; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  background: rgba(11,13,18,0.85);
  backdrop-filter: blur(14px);
  z-index: 50;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #7c5cff 0%, #ff5cae 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white;
}
.logo h1 { font-size: 18px; }
.logo small { color: #8a92a3; font-size: 12px; }
.topnav { display: flex; gap: 26px; }
.topnav a { color: #c4c9d6; font-size: 14px; font-weight: 500; }
.topnav a:hover { color: white; text-decoration: none; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.credits-badge {
  background: rgba(124,92,255,0.15);
  color: #b9a7ff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  padding: 80px 40px 60px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: center;
}
.hero-text .tag {
  display: inline-block;
  background: rgba(124,92,255,0.15);
  color: #b9a7ff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h2 { font-size: 52px; line-height: 1.05; margin-bottom: 18px; }
.hero p { color: #b6bdcc; font-size: 17px; margin-bottom: 30px; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 40px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 28px; color: white; }
.hero-stats span { color: #8a92a3; font-size: 13px; }

.hero-visual { display: flex; justify-content: center; }
.wave-card {
  background: linear-gradient(135deg, rgba(124,92,255,0.15) 0%, rgba(255,92,174,0.15) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 30px; border-radius: 20px;
  width: 100%; max-width: 420px;
}
.wave-bars {
  display: flex; gap: 4px; align-items: center; justify-content: center;
  height: 80px; margin-bottom: 20px;
}
.wave-bars span {
  display: block; width: 6px; border-radius: 3px;
  background: linear-gradient(180deg, #7c5cff, #ff5cae);
  animation: wave 1.3s ease-in-out infinite;
}
.wave-bars span:nth-child(1) { height: 30%; animation-delay: 0.0s }
.wave-bars span:nth-child(2) { height: 50%; animation-delay: 0.1s }
.wave-bars span:nth-child(3) { height: 70%; animation-delay: 0.2s }
.wave-bars span:nth-child(4) { height: 90%; animation-delay: 0.3s }
.wave-bars span:nth-child(5) { height: 60%; animation-delay: 0.4s }
.wave-bars span:nth-child(6) { height: 80%; animation-delay: 0.5s }
.wave-bars span:nth-child(7) { height: 40%; animation-delay: 0.6s }
.wave-bars span:nth-child(8) { height: 70%; animation-delay: 0.7s }
.wave-bars span:nth-child(9) { height: 95%; animation-delay: 0.8s }
.wave-bars span:nth-child(10) { height: 50%; animation-delay: 0.9s }
.wave-bars span:nth-child(11) { height: 80%; animation-delay: 0.0s }
.wave-bars span:nth-child(12) { height: 35%; animation-delay: 0.2s }
.wave-bars span:nth-child(13) { height: 65%; animation-delay: 0.4s }
.wave-bars span:nth-child(14) { height: 85%; animation-delay: 0.6s }
.wave-bars span:nth-child(15) { height: 55%; animation-delay: 0.8s }
.wave-bars span:nth-child(16) { height: 75%; animation-delay: 0.1s }
.wave-bars span:nth-child(17) { height: 45%; animation-delay: 0.3s }
.wave-bars span:nth-child(18) { height: 90%; animation-delay: 0.5s }
.wave-bars span:nth-child(19) { height: 60%; animation-delay: 0.7s }
.wave-bars span:nth-child(20) { height: 30%; animation-delay: 0.9s }
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
  50% { transform: scaleY(1.1); opacity: 1; }
}
.wave-card p {
  color: #d4daea; font-style: italic; text-align: center;
  margin: 0; font-size: 15px;
}

/* ============ STUDIO ============ */
.studio { padding: 60px 40px; max-width: 1380px; margin: 0 auto; }
.studio-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}
.studio-side {
  background: #131722;
  border-radius: 16px;
  padding: 22px;
  position: sticky;
  top: 90px;
  align-self: flex-start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.studio-side h3 { margin-bottom: 4px; }
.studio-side .muted { margin-bottom: 16px; }
.preset-list { list-style: none; padding: 0; margin: 0; }
.preset-list li {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; margin-bottom: 4px;
  transition: background 0.15s;
}
.preset-list li:hover { background: rgba(124,92,255,0.10); }
.preset-list li.active { background: rgba(124,92,255,0.18); }
.preset-list span { font-size: 22px; }
.preset-list strong { display: block; font-size: 14px; color: white; }
.preset-list small { color: #8a92a3; font-size: 12px; }

.studio-main { display: flex; flex-direction: column; gap: 20px; }
.card {
  background: #131722;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.05);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.char-count { color: #8a92a3; font-size: 12px; }
textarea {
  width: 100%;
  background: #0b0d12;
  border: 1px solid rgba(255,255,255,0.08);
  color: white;
  border-radius: 10px;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  min-height: 180px;
}
textarea:focus { outline: 2px solid #7c5cff; border-color: transparent; }

.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.row.sliders { grid-template-columns: repeat(4, 1fr); }
.field { display: flex; flex-direction: column; }
.field label {
  font-size: 13px; color: #b6bdcc; margin-bottom: 6px;
  display: flex; justify-content: space-between;
}
.field .val { color: #7c5cff; font-weight: 700; }
.field small { color: #6c7385; font-size: 11px; margin-top: 4px; }
select, input[type="password"], input[type="text"] {
  background: #0b0d12;
  border: 1px solid rgba(255,255,255,0.08);
  color: white;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: #7c5cff;
  border-radius: 50%;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: #7c5cff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.actions {
  display: flex; gap: 10px; margin-top: 24px;
}

/* PLAYER */
.player-card audio { width: 100%; margin: 12px 0; }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* HISTORY */
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  padding: 12px 14px;
  background: #0b0d12;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.history-list li.empty {
  background: transparent;
  color: #6c7385;
  font-style: italic;
  padding: 16px 0;
}
.history-list .hist-text {
  flex: 1;
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.history-list .hist-meta {
  color: #6c7385;
  font-size: 11px;
}

/* ============ VOICES SECTION ============ */
.voices { padding: 80px 40px; max-width: 1280px; margin: 0 auto; text-align: center; }
.voices h2 { margin-bottom: 8px; }
.voices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 40px;
}
.voice-card {
  background: #131722;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s;
}
.voice-card:hover {
  border-color: rgba(124,92,255,0.4);
  transform: translateY(-3px);
}
.avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 28px;
}
.avatar.male { background: linear-gradient(135deg, #5a3eff, #2660ff); }
.avatar.female { background: linear-gradient(135deg, #ff5cae, #ff8a3d); }
.voice-card strong { display: block; color: white; margin-bottom: 4px; }
.voice-card small { color: #8a92a3; font-size: 13px; }

/* ============ PRICING ============ */
.pricing { padding: 80px 40px; max-width: 1180px; margin: 0 auto; text-align: center; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.plan {
  background: #131722;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 32px 26px;
  text-align: left;
  position: relative;
}
.plan.featured {
  background: linear-gradient(180deg, rgba(124,92,255,0.10) 0%, #131722 100%);
  border-color: rgba(124,92,255,0.5);
  transform: scale(1.04);
}
.plan .badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #7c5cff, #ff5cae);
  color: white;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.plan h3 { margin-bottom: 10px; color: #c4c9d6; }
.plan .price {
  font-size: 16px; color: #8a92a3;
  margin-bottom: 20px;
}
.plan .price strong {
  font-size: 42px;
  color: white;
  margin: 0 4px;
}
.plan ul { list-style: none; padding: 0; margin: 0 0 26px; }
.plan li {
  padding: 8px 0;
  color: #b6bdcc;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.plan li::before { content: '✓ '; color: #7c5cff; font-weight: 700; }
.legal { color: #6c7385; font-size: 12px; margin-top: 30px; }

/* ============ FOOTER ============ */
footer {
  background: #0a0c11;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 50px 40px 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  gap: 30px;
}
.foot-grid strong { color: white; display: block; margin-bottom: 10px; }
.foot-grid p { color: #8a92a3; font-size: 14px; }
.copy {
  text-align: center;
  color: #6c7385;
  font-size: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ============ MODAL ============ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,7,12,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-box {
  background: #131722;
  border-radius: 18px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
}
.modal-box h3 { margin-bottom: 10px; }
.modal-box p { color: #b6bdcc; font-size: 14px; margin-bottom: 20px; }
.modal-box label { display: block; color: #c4c9d6; margin-bottom: 6px; font-size: 13px; }
.modal-box input { width: 100%; }
.modal-box .close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  color: #8a92a3;
  font-size: 26px;
  width: 36px; height: 36px;
  padding: 0;
}
.modal-box .close:hover { color: white; }
.warn {
  background: rgba(255,165,0,0.08);
  border: 1px solid rgba(255,165,0,0.25);
  color: #ffc56a;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 16px;
}
.warn code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.hint { color: #8a92a3; font-size: 13px; margin-top: 14px; }

.paygrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.paybtn {
  background: #0b0d12;
  border: 1px solid rgba(255,255,255,0.10);
  color: white;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
}
.paybtn:hover { border-color: #7c5cff; }
.paybtn span { display: block; font-size: 26px; margin-bottom: 6px; }
.paybtn small { color: #8a92a3; }

/* ============ TOAST ============ */
#toast {
  position: fixed;
  bottom: 30px; right: 30px;
  background: #1c2030;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 200;
  max-width: 360px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { border-color: rgba(255,80,80,0.4); }
#toast.success { border-color: rgba(80,200,120,0.4); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding: 50px 24px; }
  .hero h2 { font-size: 36px; }
  .studio { padding: 30px 20px; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-side { position: relative; top: 0; max-height: none; }
  .row, .row.sliders { grid-template-columns: 1fr 1fr; }
  .voices-grid, .pricing-grid, .foot-grid { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .topnav { display: none; }
  .topbar { padding: 14px 20px; }
}
@media (max-width: 560px) {
  .row, .row.sliders { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .topbar-actions .btn-primary { display: none; }
  .modal-box { padding: 24px; }
}
