:root {
  color-scheme: dark;
  --bg: #070612;
  --card: #12142c;
  --card-2: #191734;
  --line: rgba(164, 156, 255, 0.18);
  --text: #f4f2ff;
  --muted: #a39dc4;
  --purple: #7c6bff;
  --purple-2: #b7a6ff;
  --danger: #ffb4c0;
  font-family: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 80% 8%, rgba(92, 70, 220, 0.35), transparent 60%),
    radial-gradient(700px 320px at 10% 0%, rgba(40, 80, 180, 0.25), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 140px;
  pointer-events: none;
  background:
    radial-gradient(120px 40px at 10% 80%, rgba(120, 90, 255, 0.35), transparent 70%),
    radial-gradient(160px 50px at 40% 100%, rgba(70, 140, 255, 0.28), transparent 70%),
    radial-gradient(180px 46px at 75% 90%, rgba(160, 80, 255, 0.3), transparent 70%);
  mask-image: linear-gradient(to top, #000, transparent);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 120px;
}

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.logo {
  width: 22px;
  height: 16px;
  background:
    linear-gradient(var(--purple-2), var(--purple-2)) 0 4px / 3px 12px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) 6px 0 / 3px 16px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) 12px 5px / 3px 10px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) 18px 2px / 3px 13px no-repeat;
}
.how-link { color: var(--muted); font-size: 0.95rem; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid;
  gap: 4px;
  place-content: center;
}
.icon-btn span { display: block; width: 16px; height: 2px; background: #fff; border-radius: 2px; }
.menu {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 5;
  min-width: 180px;
  padding: 8px;
  border-radius: 14px;
  background: #1a1836;
  border: 1px solid var(--line);
}
.menu:not([hidden]) { display: grid; gap: 4px; }
.menu a, .menu button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
}
.menu a:hover, .menu button:hover { background: rgba(255,255,255,0.05); }

.pill {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
}
.pill.solid, .pill.on {
  background: linear-gradient(180deg, #8d7dff, #6a58f6);
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 24px rgba(108, 90, 255, 0.35);
}
.pill.ghost { background: rgba(255,255,255,0.03); }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  margin-top: 28px;
}
.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #9aa4d6;
}
h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
h1 span {
  background: linear-gradient(90deg, #fff, #b7a6ff 55%, #7aa2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.upload { width: min(420px, 100%); margin-top: 14px; }
.upload-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #241f45;
}
.upload-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d5efc, #efeaff, #7aa2ff, #6d5efc);
  background-size: 220% 100%;
  animation: upload-shimmer 1s linear infinite;
  transition: width 0.12s linear;
}
.upload.is-working .upload-fill {
  width: 38%;
  transition: none;
  animation: upload-shimmer 1s linear infinite, upload-sweep 1.15s ease-in-out infinite;
}
.upload.is-error .upload-fill { animation: none; background: #ff8fa3; }
.upload p { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; }
@keyframes upload-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@keyframes upload-sweep {
  from { left: -40%; }
  to { left: 100%; }
}
.hero-art {
  width: 100%;
  height: min(360px, 46vw);
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.mixer {
  margin-top: 28px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(24, 22, 52, 0.96), rgba(12, 12, 28, 0.96));
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.now {
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) 1fr auto;
  gap: 14px;
  align-items: center;
}
.cover { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.now-copy p { margin: 0; }
#track-title { font-size: 1.25rem; font-weight: 750; }
.muted, .mix-note, small { color: var(--muted); }
.wave-wrap { min-width: 0; }
#wave { width: 100%; height: 54px; display: block; cursor: pointer; }
.time { margin: 2px 0 0; text-align: right; font-variant-numeric: tabular-nums; color: #c9c4e8; font-size: 0.85rem; }
.transport { display: flex; align-items: center; gap: 8px; }
.transport button {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1c1a36;
}
#play {
  width: 54px; height: 54px;
  background: linear-gradient(180deg, #8d7dff, #6a58f6);
  border: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 18px 0 12px;
}
.focus-row h2 { margin: 0 0 4px; font-size: 1.15rem; }
.focus-row p { margin: 0; }
.focus-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.channels {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}
.channel {
  min-width: 0;
  padding: 10px 6px 8px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #141328;
  text-align: center;
}
.channel.on {
  border-color: #8d7dff;
  box-shadow: 0 0 0 1px #8d7dff, 0 0 28px rgba(124, 107, 255, 0.35);
  background: linear-gradient(180deg, #2a2158, #16132e);
}
.channel header, .channel .name {
  background: transparent;
  border: 0;
  width: 100%;
  padding: 0;
}
.mark-icon {
  width: 36px; height: 36px;
  margin: 0 auto 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 22%, #121022);
  color: var(--c);
}
.mark-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.channel .name { font-size: 0.72rem; letter-spacing: 0.08em; font-weight: 750; text-transform: uppercase; }
.pct { margin: 4px 0 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.fader {
  position: relative;
  height: 132px;
  margin: 8px auto 6px;
  touch-action: none;
  cursor: pointer;
}
.fader-track {
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 8px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #242846;
  overflow: hidden;
}
.fader-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, var(--c), #fff);
}
.fader-thumb {
  position: absolute;
  left: 50%;
  width: 16px; height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent);
}
.toggles { display: flex; justify-content: center; gap: 6px; }
.toggles button {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1b1933;
  font-size: 0.72rem;
  font-weight: 750;
}
.toggles button.on { background: var(--c); color: #140f22; border-color: transparent; }
.channel.missing { opacity: 0.45; }

.other {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 280px) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.other strong, .other small { display: block; }
.other small { font-weight: 400; margin-top: 2px; }
.other input { width: 100%; accent-color: #8d7dff; }
.other b { font-variant-numeric: tabular-nums; }

.status, .error { margin: 12px 0 0; }
.status { color: var(--purple-2); }
.error { color: var(--danger); }

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
}
.features h3 { margin: 0 0 6px; font-size: 1rem; }
.features p { margin: 0; color: var(--muted); line-height: 1.4; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  width: min(360px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 36px 14px 14px;
  border-radius: 18px;
  background: #1a1640;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.toast p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.toast-actions { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }
#install-later { background: transparent; border: 0; color: var(--muted); }
.toast-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border: 0; background: transparent;
  font-size: 1.2rem;
}

@media (max-width: 900px) {
  .hero, .features, .now, .focus-row, .other { grid-template-columns: 1fr; display: grid; }
  .now { grid-template-columns: auto minmax(0, 1fr); }
  .now-copy, .wave-wrap, .mixer { min-width: 0; max-width: 100%; }
  .wave-wrap, .transport { grid-column: 1 / -1; }
  .focus-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.15fr) minmax(0, 0.75fr);
  }
  .focus-actions .pill { min-width: 0; padding: 0 8px; font-size: 0.82rem; }
  .transport { justify-content: space-between; width: 100%; }
  .toast { position: relative; width: min(1120px, calc(100% - 32px)); margin: 20px auto 28px; right: auto; bottom: auto; }
  .hero-art { height: 220px; order: -1; }
  .channels {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }
  .channel { flex: 0 0 104px; scroll-snap-align: start; }
  .how-link { display: none; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .page { width: min(100% - 20px, 1120px); }
  #install-top { display: none; }
  .features { grid-template-columns: 1fr; }
}
