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

:root {
  --indigo:     #6366f1;
  --purple:     #8b5cf6;
  --green:      #3D6B52;
  --green2:     #4ade80;
  --text:       #1a1918;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --bg:         #fafaf9;
  --white:      #ffffff;
  --radius:     14px;
  --shadow:     0 8px 48px rgba(80,60,140,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  text-decoration: none;
}

.logo-icon { font-size: 1.2rem; }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { font-size: .85rem; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--text); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 0 20px 34px;
  text-align: center;
}

.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 45%, #ecfdf5 100%);
  z-index: 0;
}

/* Decorative blobs */
.hero-bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.13) 0%, transparent 70%);
  top: -200px; left: -100px;
}

.hero-bg::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,.10) 0%, transparent 70%);
  bottom: -150px; right: -100px;
}

.hero-inner {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding-top: 0;
}

/* The hero should start with the title. Hide any injected node placed before it. */
.hero-inner > :first-child:not(.hero-title) {
  display: none !important;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 18px;
  animation: fadeUp .5s .08s ease both;
}

.gradient-text {
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem; color: var(--muted);
  max-width: 540px; margin: 0 auto 28px;
  line-height: 1.7;
  animation: fadeUp .5s .16s ease both;
}

/* Trust row */
.trust-row {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  animation: fadeUp .5s .24s ease both;
}

.trust-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
}

.trust-icon { font-size: 1.3rem; }

.trust-item div { text-align: left; }
.trust-item strong { display: block; font-size: .82rem; font-weight: 600; line-height: 1.2; }
.trust-item span   { display: block; font-size: .74rem; color: var(--muted); }

/* ── Converter Section ─────────────────────────────────────────────── */
.converter-section {
  padding: 0 20px 56px;
  position: relative; z-index: 1;
}

.converter-wrap {
  max-width: 720px;
  margin: -12px auto 0;
  background: var(--white);
  border-radius: 22px;
  border: 1px solid var(--border);
  padding: 36px 48px;
  box-shadow: var(--shadow);
  animation: fadeUp .5s .32s ease both;
}

/* Upload */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 52px 28px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--indigo);
  background: rgba(99,102,241,.04);
}

.upload-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.upload-icon { width: 52px; height: 52px; margin: 0 auto 18px; }
.upload-icon svg { width: 100%; height: 100%; }

.upload-zone h2 {
  font-size: 1.4rem; font-weight: 600; margin-bottom: 8px;
}

.upload-zone p { font-size: .88rem; color: var(--muted); }

.browse-pill {
  display: inline-block; margin-top: 16px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  color: #fff; font-size: .82rem; font-weight: 500;
  padding: 7px 20px; border-radius: 99px;
  pointer-events: none;
}

/* Progress */
.prog-top {
  display: flex; justify-content: space-between;
  font-size: .85rem; color: var(--muted); margin-bottom: 10px;
}

.prog-pct { color: var(--indigo); font-weight: 600; }

.prog-track {
  width: 100%; height: 3px;
  background: #f3f4f6; border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--purple));
  border-radius: 99px; width: 0%; transition: width .3s ease;
}

.prog-sub { font-size: .76rem; color: var(--muted); }

/* File info */
.file-info {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.mp3-badge {
  background: rgba(99,102,241,.12); color: var(--indigo);
  font-size: .7rem; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; letter-spacing: .6px; text-transform: uppercase; flex-shrink: 0;
}

.file-name { font-size: .92rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size  { font-size: .82rem; color: var(--muted); flex-shrink: 0; }

/* Waveform */
.wave-wrap {
  background: #f9fafb; border-radius: var(--radius);
  padding: 10px 4px; margin-bottom: 12px; cursor: col-resize; user-select: none;
}

#waveCanvas { display: block; width: 100%; border-radius: var(--radius); }

.wave-controls {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}

.trim-times { font-size: .85rem; color: var(--muted); }
.trim-times strong { color: var(--indigo); font-weight: 600; }

.play-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--border); border-radius: 99px;
  padding: 7px 18px; font-family: 'Outfit', sans-serif; font-size: .82rem;
  color: var(--text); cursor: pointer; transition: all .15s;
}

.play-btn:hover { border-color: var(--indigo); color: var(--indigo); }

.trim-hint {
  font-size: .78rem; color: var(--muted); text-align: center;
  margin-bottom: 22px; font-style: italic;
}

/* Buttons */
.btn-download {
  display: block; width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  color: #fff; border: none; border-radius: var(--radius);
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s; letter-spacing: .2px;
}

.btn-download:hover { opacity: .9; }
.btn-download:disabled { opacity: .5; cursor: not-allowed; }

.btn-reset {
  display: block; width: 100%; padding: 13px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Outfit', sans-serif; font-size: .93rem; color: var(--muted);
  cursor: pointer; margin-top: 10px; transition: all .15s;
}

.btn-reset:hover { border-color: var(--muted); color: var(--text); }

.status-msg { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 12px; min-height: 18px; }

/* Error */
.error-section { text-align: center; padding: 40px 0; }
.error-icon    { font-size: 2.5rem; margin-bottom: 12px; }
.error-msg     { color: var(--muted); font-size: 1rem; }

/* ── Features ─────────────────────────────────────────────────────── */
.features-section {
  padding: 80px 20px;
  background: linear-gradient(180deg, #f8f8ff 0%, #fafaf9 100%);
}

.features-inner { max-width: 1000px; margin: 0 auto; }

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700; margin-bottom: 48px;
}

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

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
  transition: transform .2s, box-shadow .2s;
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p  { font-size: .84rem; color: var(--muted); line-height: 1.6; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--white);
  padding: 36px 20px;
}

.footer-inner { max-width: 1100px; margin: 0 auto; }

.footer-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 16px;
}

.footer-brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 1rem; font-weight: 700;
}

.footer-links { display: flex; gap: 24px; list-style: none; flex-wrap: wrap; }
.footer-links a { font-size: .83rem; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: .8rem; color: var(--muted);
}

.footer-sep { opacity: .4; }

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .hero { padding: 0 16px 26px; }
  .hero-sub { margin-bottom: 22px; }
  .converter-wrap { padding: 28px 20px; }
  .trust-row { gap: 8px; }
  .trust-item { padding: 8px 12px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

