:root {
  --bg: #0b1120;
  --bg-elev: #111a2e;
  --bg-card: #172238;
  --bg-card-hi: #1d2a44;
  --fg: #e6edf7;
  --fg-dim: #8c9bb5;
  --accent: #5aa3ff;
  --accent-2: #7b8cff;
  --good: #35d399;
  --warn: #ffb74d;
  --danger: #ff5d5d;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --tab-h: 68px;
  --player-h: 108px;
  --max-w: 720px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(1200px 600px at 50% -20%, #1a2548, transparent 60%), var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  min-height: 100vh;
}
button { font-family: inherit; color: inherit; }

.app {
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* ---------- Player Bar ---------- */
.player-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 17, 32, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 10px;
}
.track-info {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}
.track-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3e5bff, #7a2bff);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.track-icon svg { width: 22px; height: 22px; }
.track-meta { min-width: 0; }
.track-title {
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.track-sub {
  color: var(--fg-dim);
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.dot { opacity: .6; }
.boost-pill {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent);
  background: rgba(90, 163, 255, 0.12);
  border: 1px solid rgba(90, 163, 255, 0.3);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.track-progress { margin-top: 6px; }
.track-progress input[type="range"] {
  width: 100%;
  height: 3px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn, .play-btn {
  border: none;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover, .play-btn:hover { background: rgba(255,255,255,0.06); }
.icon-btn svg, .play-btn svg { width: 24px; height: 24px; }
.play-btn {
  background: var(--accent);
  color: #061126;
  width: 42px; height: 42px;
}
.play-btn:hover { background: #6fb2ff; }

.peak-meter {
  max-width: var(--max-w);
  margin: 8px auto 0;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.peak-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--good), var(--warn) 70%, var(--danger));
  transition: width .1s ease-out;
}
.peak-label {
  position: absolute;
  right: 6px; top: -18px;
  font-size: 10px;
  color: var(--fg-dim);
}

/* ---------- Tab Bar ---------- */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--border);
}
.tab {
  border: none;
  background: transparent;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--tab-h);
  cursor: pointer;
  font-size: 11px;
  transition: color .15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); }
.tab:hover { color: var(--fg); }

/* ---------- Content ---------- */
.content { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.tab-panel { display: none; flex-direction: column; gap: 14px; }
.tab-panel.active { display: flex; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.hero-card { background: linear-gradient(160deg, #1d2a4c, #172238); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-title { font-weight: 700; font-size: 15px; }
.row-title { font-weight: 600; }
.row-sub { color: var(--fg-dim); font-size: 12.5px; }

/* ---------- Boost Hero ---------- */
.boost-display { text-align: center; margin: 4px 0 18px; }
.boost-percent {
  font-size: 68px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  letter-spacing: -2px;
}
.boost-label { color: var(--fg-dim); font-size: 13px; margin-top: 6px; }
.boost-slider-wrap {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
}
.step-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card-hi);
  font-size: 18px;
  cursor: pointer;
}
.step-btn:hover { background: #253356; }
.boost-legend {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  font-size: 10px;
  margin-top: 6px;
}

.safety-note {
  margin-top: 14px;
  background: rgba(255, 183, 77, 0.08);
  border: 1px solid rgba(255, 183, 77, 0.3);
  color: var(--warn);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ---------- Sliders ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(90, 163, 255, 0.15);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 50px; height: 30px; }
.switch.small { width: 42px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  transition: .2s;
  cursor: pointer;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 22px; width: 22px;
  left: 4px; bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}
.switch.small .slider::before { height: 18px; width: 18px; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch.small input:checked + .slider::before { transform: translateX(16px); }

.toggle-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

/* ---------- Dropzone & Playlist ---------- */
.dropzone {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  transition: all .15s;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dropzone.drag { border-color: var(--accent); background: rgba(90,163,255,0.08); }
.dropzone svg { color: var(--accent); margin-bottom: 6px; }

.primary-btn, .secondary-btn, .link-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.primary-btn {
  background: var(--accent);
  color: #0b1120;
  margin-top: 8px;
}
.primary-btn:hover { background: #6fb2ff; }
.primary-btn.small { padding: 6px 12px; font-size: 12px; }
.primary-btn.full-width { width: 100%; }
.secondary-btn {
  background: var(--bg-card-hi);
  color: var(--fg);
  border: 1px solid var(--border);
}
.secondary-btn:hover { background: #253356; }
.secondary-btn.full-width { width: 100%; margin-top: 10px; }
.link-btn {
  background: transparent;
  color: var(--accent);
  padding: 4px 6px;
  font-weight: 600;
}
.link-btn.small { font-size: 12px; display: block; margin: 8px auto 0; }

.playlist { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.playlist li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.playlist li:hover { background: rgba(255,255,255,0.04); }
.playlist li.playing { background: rgba(90,163,255,0.10); color: var(--accent); }
.playlist .track-idx { color: var(--fg-dim); font-size: 12px; text-align: center; }
.playlist .track-name { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.playlist .remove-btn {
  background: transparent; border: none;
  color: var(--fg-dim);
  cursor: pointer;
  opacity: .6;
  font-size: 18px;
}
.playlist .remove-btn:hover { color: var(--danger); opacity: 1; }

/* ---------- EQ ---------- */
.eq-container {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  align-items: end;
  padding: 10px 4px 0;
}
.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.eq-band.locked { opacity: .35; }
.eq-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 150px;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  background: transparent;
}
.eq-gain { font-size: 10px; color: var(--accent); min-height: 14px; }
.eq-freq { font-size: 10px; color: var(--fg-dim); }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.preset {
  background: var(--bg-card-hi);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  transition: all .15s;
}
.preset:hover { background: #253356; }
.preset.active { background: rgba(90,163,255,0.15); border-color: var(--accent); color: var(--accent); }
.preset.locked { opacity: .5; position: relative; }
.preset.locked::after { content: "🔒"; position: absolute; top: 4px; right: 6px; font-size: 10px; }
.preset-emoji { display: block; font-size: 18px; margin-bottom: 4px; }

/* ---------- Enhance ---------- */
.enhance-row { margin: 16px 0; }
.enhance-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.enhance-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--bg-card-hi);
}
.enhance-icon.bass { background: rgba(255, 90, 90, 0.12); }
.enhance-icon.wide { background: rgba(90, 163, 255, 0.12); }
.enhance-icon.voice { background: rgba(53, 211, 153, 0.12); }
.enhance-val { font-weight: 600; color: var(--accent); }

/* ---------- Settings ---------- */
.setting-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.setting-row input[type="range"] { width: 120px; }
.device-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.device-icon { font-size: 22px; }
/* ---------- Profiles ---------- */
.profile-list { list-style: none; padding: 0; margin: 0; }
.profile-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.profile-list li:last-child { border-bottom: none; }
.profile-list .pbadge {
  background: rgba(90,163,255,0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.profile-list .active { color: var(--accent); font-weight: 600; }

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.modal-title { font-weight: 700; font-size: 17px; margin-bottom: 14px; }
.modal-card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 15px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* =======================================================================
   LANDING PAGE
   ======================================================================= */

/* ---------- Top Nav ---------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
}
.brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.site-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-links a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.site-links a:hover { color: var(--fg); }
.nav-cta {
  background: var(--accent);
  color: #0b1120 !important;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: #6fb2ff; color: #0b1120 !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 28px 48px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 80%;
  background: radial-gradient(1000px 500px at 30% 0%, rgba(122, 43, 255, 0.25), transparent 60%),
              radial-gradient(900px 450px at 80% 10%, rgba(62, 91, 255, 0.25), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-icon {
  width: 88px; height: 88px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(62, 91, 255, 0.3), 0 4px 14px rgba(0,0,0,.4);
  margin-bottom: 18px;
}
.hero-eyebrow {
  display: inline-block;
  color: var(--accent);
  background: rgba(90,163,255,0.12);
  border: 1px solid rgba(90,163,255,0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: .02em;
}
.hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 0 0 16px;
}
.gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, #d97aff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-dim);
  margin: 0 0 28px;
  max-width: 540px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.app-store-badge {
  display: inline-flex;
  transition: transform .15s, filter .15s;
  line-height: 0;
}
.app-store-badge:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary-cta {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  opacity: .8;
  transition: opacity .15s;
}
.secondary-cta:hover { opacity: 1; }
.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-dim);
  font-size: 13px;
  flex-wrap: wrap;
}
.meta-label { color: var(--fg); font-weight: 600; }
.meta-sep { opacity: .4; }
.meta-stars { color: var(--warn); letter-spacing: 2px; }

/* Phone screenshot stack */
.hero-phones {
  position: relative;
  height: 520px;
  display: flex;
  justify-content: center;
}
.phone {
  position: absolute;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 8px #1a1a1a, 0 0 0 10px #333;
  transition: transform .3s ease;
}
.phone img {
  display: block;
  width: 260px;
  height: auto;
}
.phone-back {
  right: 8%;
  top: 30px;
  transform: rotate(6deg);
  opacity: .85;
}
.phone-front {
  left: 8%;
  top: 0;
  transform: rotate(-4deg);
  z-index: 2;
}
.hero-phones:hover .phone-back  { transform: rotate(8deg)  translateY(-4px); }
.hero-phones:hover .phone-front { transform: rotate(-2deg) translateY(-6px); }

/* ---------- Section Titles ---------- */
.section-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  text-align: center;
  margin: 0 0 12px;
}
.section-sub {
  text-align: center;
  color: var(--fg-dim);
  max-width: 640px;
  margin: 0 auto 36px;
  font-size: 16px;
  line-height: 1.55;
}
.inline-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

/* ---------- Features ---------- */
.features {
  padding: 72px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.features .section-title { margin-bottom: 40px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform .2s, border-color .2s;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: rgba(90,163,255,0.3);
}
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(62,91,255,0.15), rgba(122,43,255,0.15));
  border: 1px solid rgba(90,163,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.feature h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.feature p  { margin: 0; color: var(--fg-dim); line-height: 1.55; font-size: 14px; }

/* ---------- Demo wrapper ---------- */
.demo-wrap {
  padding: 40px 20px 72px;
  max-width: 820px;
  margin: 0 auto;
}
.demo-header { margin-bottom: 28px; }

/* ---------- CTA Strip ---------- */
.cta-strip {
  padding: 60px 28px;
  background: linear-gradient(135deg, rgba(62,91,255,0.12), rgba(122,43,255,0.12));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-inner h2 { margin: 0 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.cta-inner p  { margin: 0; color: var(--fg-dim); font-size: 16px; max-width: 520px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 28px 28px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  color: var(--fg-dim);
  font-size: 13px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 15px;
}
.footer-brand img { width: 28px; height: 28px; border-radius: 6px; }
.footer-sub { margin-top: 4px; font-size: 12px; }
.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}
.footer-links a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: color .15s;
}
.footer-links a:hover { color: var(--fg); }
.footer-copy { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 20px 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 16px; }
  .hero-phones { height: 420px; }
  .phone img { width: 220px; }
  .section-title { font-size: 28px; }
  .cta-inner { justify-content: center; text-align: center; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-copy { text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .site-nav { padding: 12px 16px; }
  .site-links { gap: 10px; }
  .site-links a:not(.nav-cta) { display: none; }
  .hero-title { font-size: 32px; }
  .hero-phones { height: 360px; }
  .phone img { width: 180px; }
  .boost-percent { font-size: 56px; }
  .eq-slider { height: 120px; }
  .track-info { grid-template-columns: 40px 1fr auto; }
  .track-icon { width: 40px; height: 40px; }
  .features, .cta-strip, .demo-wrap { padding-left: 16px; padding-right: 16px; }
}
