:root {
  --bg: #07090c;
  --bg-2: #0d1117;
  --card: #121820;
  --card-2: #182029;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f6f8;
  --muted: #8b97a5;
  --accent: #2ee6a6;
  --accent-2: #3db8ff;
  --hot: #ff5a6a;
  --amber: #ffb020;
  --green: #2ee6a6;
  --grad: linear-gradient(135deg, #2ee6a6 0%, #3db8ff 100%);
  --grad-hot: linear-gradient(135deg, #ff5a6a 0%, #ffb020 48%, #2ee6a6 100%);
  --grad-soft: linear-gradient(160deg, rgba(46, 230, 166, 0.18), rgba(61, 184, 255, 0.08));
  --radius: 18px;
  --font: "Outfit", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --glow: 0 12px 40px rgba(46, 230, 166, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
h1, h2, h3, .brand, .top-title, .hero-landing h1, .hero-brand h1 { font-family: var(--display); letter-spacing: -0.02em; }

#app.landing-mode .sidebar,
#app.landing-mode .topbar,
#app.landing-mode .tabbar { display: none !important; }
#app.landing-mode { grid-template-columns: 1fr; }
#app.landing-mode .shell {
  background:
    radial-gradient(900px 480px at 70% -5%, rgba(46, 230, 166, 0.18), transparent 55%),
    radial-gradient(700px 360px at 10% 30%, rgba(255, 90, 106, 0.12), transparent 50%),
    var(--bg);
}
.topbar .icon-btn.is-hidden { visibility: hidden; pointer-events: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.shell {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(800px 400px at 85% -8%, rgba(46, 230, 166, 0.12), transparent 55%),
    radial-gradient(600px 320px at 8% 18%, rgba(61, 184, 255, 0.1), transparent 50%),
    var(--bg);
}

.sidebar { display: none; }

.hero-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: end;
  justify-items: center;
  overflow: hidden;
  padding: 2rem 1.25rem 4.5rem;
  gap: 0;
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 9, 12, 0.15) 0%, rgba(7, 9, 12, 0.55) 45%, rgba(7, 9, 12, 0.96) 100%),
    radial-gradient(ellipse 80% 50% at 50% 35%, rgba(46, 230, 166, 0.22), transparent 60%),
    radial-gradient(circle at 20% 60%, rgba(255, 90, 106, 0.18), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(61, 184, 255, 0.16), transparent 42%),
    #0a0d12;
  z-index: 0;
}
/* Brand sits clearly above the EQ bars */
.hero-brand {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-align: center;
  margin-bottom: 2.5rem;
  animation: rise 0.7s ease both;
}
.hero-bars {
  position: relative;
  z-index: 1;
  width: min(28rem, 92vw);
  height: 96px;
  margin: 0 auto 1.35rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  opacity: 0.55;
  pointer-events: none;
}
.hero-bars i {
  display: block;
  width: 8px;
  border-radius: 999px;
  background: var(--grad);
  animation: eq 1.2s ease-in-out infinite;
  transform-origin: bottom;
}
.hero-bars i:nth-child(odd) { animation-duration: 0.9s; }
.hero-bars i:nth-child(3n) { animation-duration: 1.4s; background: linear-gradient(180deg, #ff5a6a, #ffb020); }
@keyframes eq {
  0%, 100% { transform: scaleY(0.35); opacity: 0.45; }
  50% { transform: scaleY(1); opacity: 1; }
}

.hero-landing {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1rem;
  text-align: center;
  justify-items: center;
  max-width: 40rem;
  margin: 0 auto;
  width: 100%;
  animation: rise 0.75s ease both;
  animation-delay: 0.06s;
}
.hero-brand .mark,
.hero-brand .mark,
.hero-landing .mark,
.hero-landing .mark-img {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 22px;
  display: grid;
  place-items: center;
  box-shadow: var(--glow);
  animation: pulse-mark 2.8s ease-in-out infinite;
}
.hero-brand .mark-img {
  width: min(196px, 42vw);
  height: min(196px, 42vw);
  margin: 0 auto;
  border-radius: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: pulse-mark 2.8s ease-in-out infinite;
}
.hero-landing .mark-img {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
}
.hero-brand .mark-img img,
.hero-landing .mark-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-mark-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
  object-fit: contain;
  background: transparent;
}
.btn.top-connect {
  white-space: nowrap;
  min-width: 8.5rem;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.hero-brand .mark,
.hero-landing .mark {
  background: var(--grad); font-size: 1.8rem;
}
@keyframes pulse-mark {
  0%, 100% { transform: scale(1); box-shadow: var(--glow); }
  50% { transform: scale(1.04); box-shadow: 0 16px 48px rgba(46, 230, 166, 0.35); }
}
.hero-brand h1,
.hero-landing h1 {
  margin: 0; font-size: clamp(2.4rem, 9vw, 3.8rem); line-height: 1.02;
  background: linear-gradient(180deg, #fff 20%, #9fe8d0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-landing .hook {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  color: var(--text);
  line-height: 1.3;
}
.hero-landing p { margin: 0 auto; max-width: 28rem; color: var(--muted); line-height: 1.55; }
.hero-cta-group { display: grid; gap: 0.65rem; margin-top: 0.35rem; }

.hook-strip {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.hook-line {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.hook-line b {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 4.5rem;
  padding-top: 0.15rem;
}
.hook-line span { color: var(--text); font-size: 0.95rem; line-height: 1.4; }

.tabbar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.45rem 0.6rem calc(0.55rem + var(--safe-bottom));
  background: rgba(7, 9, 12, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35rem;
}
.tabbar button span { font-size: 1.1rem; }
.tabbar button.active { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(7, 9, 12, 0.82);
  backdrop-filter: blur(10px);
  z-index: 15;
}
.top-title { font-weight: 700; flex: 1; }
.top-actions { display: flex; gap: 0.5rem; align-items: center; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--grad); color: #04120c; font-weight: 800;
  padding: 0; overflow: hidden; display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-img {
  width: 48px; height: 48px; border-radius: 14px; object-fit: cover;
  background: #f3f6f8;
  display: block; margin: 0 auto;
}
.avatar-img.lg { width: 72px; height: 72px; border-radius: 20px; }
.creator-song {
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
  display: grid; gap: 0.5rem;
}
.icon-btn {
  border: 0; background: var(--card); width: 36px; height: 36px;
  border-radius: 12px; color: var(--text);
}

main#screens { flex: 1; padding: 1rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.screen { display: none; animation: fade 0.35s ease; }
.screen.active { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 0; border-radius: 14px; padding: 0.95rem 1.2rem; font-weight: 700;
}
.btn.primary {
  background: var(--grad-hot);
  color: #0a0c10;
  box-shadow: 0 10px 30px rgba(255, 90, 106, 0.22);
}
.btn.ghost { background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--text); }
.btn.block { width: 100%; }
.btn.small { padding: 0.55rem 0.85rem; font-size: 0.88rem; border-radius: 12px; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.linkish { background: none; border: 0; color: var(--accent-2); font-weight: 600; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.card.accent {
  background: var(--grad-soft);
  border: 1px solid rgba(46, 230, 166, 0.22);
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.grid-2 { display: grid; gap: 0.85rem; }
.section-title { margin: 1.25rem 0 0.75rem; font-size: 1.05rem; font-weight: 700; }
.tiny { font-size: 0.75rem; color: var(--muted); margin: 0.35rem 0 0; }

.field { display: grid; gap: 0.4rem; margin-bottom: 0.85rem; }
.field[hidden],
.field.is-hidden { display: none !important; }
.field > span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.mode-tabs { margin-bottom: 0.75rem; }
.mode-tabs button { position: relative; z-index: 1; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: #0a0e14; padding: 0.85rem 0.95rem;
}
textarea { min-height: 110px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  border: 1px solid var(--line); background: #121820; color: var(--muted);
  border-radius: 999px; padding: 0.45rem 0.8rem; font-size: 0.85rem; font-weight: 600;
}
.chip.active { background: rgba(46, 230, 166, 0.18); color: #d7ffef; border-color: transparent; }

.tabs {
  display: flex; gap: 0.35rem; overflow: auto; padding-bottom: 0.25rem; margin-bottom: 0.85rem;
}
.tabs button {
  border: 0; background: transparent; color: var(--muted); font-weight: 700;
  padding: 0.55rem 0.8rem; border-radius: 999px; white-space: nowrap;
}
.tabs button.active { background: rgba(46, 230, 166, 0.16); color: #e8fff5; }

.track-row, .asset-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 0.75rem; align-items: center;
  padding: 0.75rem; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.cover {
  width: 56px; height: 56px; border-radius: 14px; overflow: hidden;
  background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #04120c;
}
.cover.lg { width: 160px; height: 160px; border-radius: 24px; margin: 0 auto 1rem; font-size: 2rem; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.meta strong { display: block; font-size: 0.95rem; }
.meta span { color: var(--muted); font-size: 0.8rem; }

.progress-ring {
  width: 160px; height: 160px; margin: 1.5rem auto; border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--bg) 58%, transparent 59%),
    conic-gradient(#2ee6a6 var(--p, 35%), rgba(255,255,255,0.08) 0);
  display: grid; place-items: center; font-size: 2rem;
}
.checklist { display: grid; gap: 0.55rem; margin: 1rem 0; padding: 0; }
.checklist li {
  list-style: none; display: flex; gap: 0.55rem; align-items: center;
  color: var(--muted); font-size: 0.92rem;
}
.checklist li.done { color: #bbf7d0; }
.checklist li::before { content: "○"; color: var(--muted); }
.checklist li.done::before { content: "✓"; color: var(--green); }

.player {
  display: grid; gap: 0.75rem; justify-items: center; text-align: center; margin: 0.5rem 0 1rem;
}
.player audio { width: 100%; }
.row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }

.kv { display: grid; gap: 0.55rem; }
.kv div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.kv span { color: var(--muted); }
.kv strong { text-align: right; word-break: break-all; }

.success-hero { text-align: center; padding: 1.5rem 0; }
.success-hero .check {
  width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%;
  background: rgba(46, 230, 166, 0.15); color: var(--green);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 800;
}

.chart {
  height: 160px; border-radius: 16px; border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(46, 230, 166, 0.12), transparent),
    repeating-linear-gradient(90deg, transparent, transparent 28px, rgba(255,255,255,0.03) 28px, rgba(255,255,255,0.03) 29px);
  position: relative; overflow: hidden;
}
.chart svg { width: 100%; height: 100%; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.75rem;
}
.stat b { display: block; font-size: 1rem; }
.stat span { color: var(--muted); font-size: 0.72rem; }
.stat em { color: var(--green); font-style: normal; font-size: 0.75rem; }

.bar-list { display: grid; gap: 0.55rem; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 40px; gap: 0.5rem; align-items: center; font-size: 0.82rem; }
.bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }

.toast {
  position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%);
  background: #152029; border: 1px solid var(--line); color: white;
  padding: 0.7rem 1rem; border-radius: 12px; z-index: 50; font-size: 0.88rem;
  max-width: min(90vw, 420px);
}

.code {
  background: #090d12; border: 1px solid var(--line); border-radius: 14px;
  padding: 0.85rem; overflow: auto; font-size: 0.75rem; color: #9fe8d0;
  white-space: pre-wrap; word-break: break-word;
}

.stack { display: grid; gap: 0.85rem; }
.muted { color: var(--muted); }

.wallet-hero {
  background:
    radial-gradient(420px 160px at 90% 0%, rgba(46, 230, 166, 0.16), transparent 60%),
    var(--card);
}
.wallet-hero h2 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0.15rem 0;
  letter-spacing: -0.03em;
}
.wallet-hero .eth-sub {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center;
  margin-top: 0.35rem;
}
.wallet-hero .eth-sub span {
  font-size: 0.85rem; color: var(--muted);
  padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--line);
}

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.55);
  animation: pulse-dot 1.8s ease-out infinite;
  display: inline-block;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(46, 230, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0); }
}

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 960px) {
  #app { grid-template-columns: 240px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 1rem;
    padding: 1.25rem 1rem; border-right: 1px solid var(--line);
    background: #080b10; position: sticky; top: 0; height: 100vh;
  }
  .brand {
    display: flex; align-items: center; gap: 0.65rem; font-weight: 800; padding: 0.35rem;
  }
  .logo-mark {
    width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
    background: var(--grad); color: #04120c;
  }
  .side-nav { display: grid; gap: 0.25rem; }
  .side-nav button {
    border: 0; background: transparent; color: var(--muted); text-align: left;
    padding: 0.75rem 0.85rem; border-radius: 12px; display: flex; gap: 0.65rem; font-weight: 600;
  }
  .side-nav button.active, .side-nav button:hover {
    background: rgba(46, 230, 166, 0.1); color: #e8fff5;
  }
  .side-foot { margin-top: auto; }
  .tabbar { display: none; }
  main#screens { padding: 1.5rem 2rem 3rem; }
  .hero-stage {
    padding: 4rem 2rem 5rem;
  }
  .hero-brand {
    margin-bottom: 2.75rem;
  }
  .hero-landing {
    text-align: center;
    justify-items: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
  }
  .hero-landing p { margin: 0 auto; }
  .hero-cta-group { max-width: 24rem; width: 100%; }
  .desktop-2 {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; align-items: start;
  }
  .desktop-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .track-row { grid-template-columns: 72px 1fr auto; }
  .cover { width: 72px; height: 72px; }
}

@media (min-width: 1200px) {
  #app { grid-template-columns: 260px 1fr; }
}
