:root {
  --bg: #0b0712;
  --panel: #140d1f;
  --panel-2: #1b1229;
  --line: #2e2145;
  --ink: #f1ecfa;
  --mute: #9d91b5;
  --purple: #8b5cf6;
  --violet: #c4a6ff;
  --error: #ff7a8a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.hidden { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 28%, rgba(139, 92, 246, 0.22), transparent 40%),
    radial-gradient(circle at 78% 72%, rgba(196, 166, 255, 0.12), transparent 42%);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) rotate(0deg); }
  to   { transform: translate3d(3%, 2%, 0) rotate(4deg); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.02em; }
.muted { color: var(--mute); }

.reveal { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(11, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
}
.notice { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* Hero */
.hero {
  padding: 56px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 1080px;
  margin: 0 auto;
}
.logo { width: 260px; max-width: 80%; height: auto; margin-bottom: 28px; animation: float 6s ease-in-out infinite; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--violet); }
.metric { margin: 0 0 28px; color: var(--mute); font-size: 15px; }

.search {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 720px;
}
.hint { color: var(--mute); margin: 10px 0 0; line-height: 1.5; }
.status { color: var(--mute); min-height: 1.2em; margin: 10px 0 0; }

/* Blocks */
.block { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.block-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

/* Search results */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.artist-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.artist-card:hover { transform: translateY(-3px); border-color: var(--purple); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.15); }
.artist-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--panel-2), #2a1c40);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 40px;
  color: var(--violet);
}
.artist-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.artist-card .muted { font-size: 13px; }
.artist-card .row { display: flex; gap: 8px; }
.artist-card .row .btn { flex: 1; padding: 8px; }

.song-list { display: grid; gap: 10px; }
.song-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.song-item:hover { border-color: var(--purple); transform: translateX(3px); }
.song-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.song-item strong { display: block; font-size: 15px; }
.song-item span { color: var(--mute); font-size: 13px; }
.song-actions { display: flex; gap: 8px; align-items: center; }

/* Feed */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rise 0.6s ease both;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--purple); }
.cover { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--panel-2); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.artists { margin: 0; font-weight: 500; color: var(--violet); }
.info { margin: 0; color: var(--mute); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.small { margin: 0; color: var(--mute); font-size: 12px; }

/* Player */
.player {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: var(--panel-2);
}
.player-row { display: flex; align-items: center; gap: 10px; }
.time { font-family: "JetBrains Mono", monospace; font-size: 12px; min-width: 52px; color: var(--mute); }
.bar, .vol { flex: 1; accent-color: var(--purple); }
.vol { flex: 0 0 90px; }
.eq { display: inline-flex; gap: 2px; height: 14px; align-items: flex-end; }
.eq span { width: 3px; height: 100%; background: var(--purple); transform-origin: bottom; transform: scaleY(0.3); }
.playing .eq span { animation: eq 0.9s ease-in-out infinite; }
.playing .eq span:nth-child(2) { animation-delay: 0.15s; }
.playing .eq span:nth-child(3) { animation-delay: 0.3s; }
.yt { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }

/* Buttons & inputs */
.btn {
  border: 1px solid var(--purple);
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: rgba(139, 92, 246, 0.18); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn.primary:hover { background: #7a48ea; }
.btn.block { width: 100%; padding: 14px; }
.btn.play { min-width: 76px; }
.link-btn { background: none; border: none; color: var(--violet); cursor: pointer; font-family: "JetBrains Mono", monospace; font-size: 12px; text-transform: uppercase; }

input, select, textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder, textarea::placeholder { color: #6f6388; }
input[type="file"] { padding: 8px; font-size: 13px; color: var(--mute); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.btn:focus-visible, .tab:focus-visible, .side-btn:focus-visible, .close:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 14px; flex: 1; color: var(--mute); }

/* Side buttons */
.side-buttons {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 15;
}
.side-btn {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  border: 1px solid var(--line);
  border-left: none;
  background: var(--panel);
  color: var(--ink);
  padding: 18px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease;
}
.side-btn + .side-btn { border-top: none; }
.side-btn:hover { background: var(--panel-2); }
.side-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.side-btn.primary:hover { background: #7a48ea; }

/* Drawers */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}
.drawer.wide { width: min(540px, 100%); }
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.close {
  background: var(--panel-2);
  border: 1px solid var(--line);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s ease;
}
.close:hover { background: var(--purple); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.prose p { font-size: 16px; line-height: 1.7; margin: 0 0 16px; color: #d8cfea; }

.overlay { position: fixed; inset: 0; background: rgba(5, 3, 10, 0.6); z-index: 20; backdrop-filter: blur(2px); }

/* Form */
.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.tab {
  background: transparent;
  border: none;
  padding: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--mute);
  transition: background 0.2s ease, color 0.2s ease;
}
.tab + .tab { border-left: 1px solid var(--line); }
.tab.active { background: var(--purple); color: #fff; }

.mode { margin-bottom: 18px; }
.row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .btn { flex: 0 0 auto; }
.row > select { flex: 0 0 110px; }

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 18px; }
legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--purple);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  animation: rise 0.3s ease both;
}
.chip-x {
  border: none;
  background: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: var(--violet);
  padding: 0 4px;
}
.cover-preview { width: 140px; height: 140px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; margin-bottom: 14px; }

.results { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.results li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.results img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.results strong { display: block; font-size: 14px; }
.results span { font-size: 13px; color: var(--mute); }
.msg { min-height: 1.2em; margin: 4px 0 14px; line-height: 1.5; color: var(--violet); }
.msg.error { color: var(--error); }

/* Mobile */
@media (max-width: 640px) {
  .side-buttons { top: auto; bottom: 0; left: 0; right: 0; transform: none; flex-direction: row; }
  .side-btn { writing-mode: horizontal-tb; transform: none; flex: 1; border-left: 1px solid var(--line); border-top: none; }
  .side-btn + .side-btn { border-top: none; }
  .search { flex-direction: column; }
  .song-item { grid-template-columns: 48px 1fr; }
  .song-item img { width: 48px; height: 48px; }
  .song-actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Extra motion */
@keyframes shine { from { background-position: 0% center; } to { background-position: 200% center; } }
@keyframes grow { from { width: 0; } to { width: 100%; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 rgba(139,92,246,0); } 50% { box-shadow: 0 0 28px rgba(139,92,246,0.25); } }

.hero h1 em {
  background: linear-gradient(90deg, #c4a6ff, #8b5cf6, #e7dcff, #c4a6ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s linear infinite;
}
.block-head { position: relative; }
.block-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--purple);
  animation: grow 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.card:hover { animation: glow 2.4s ease-in-out infinite; }
.side-btn.primary { animation: glow 3s ease-in-out infinite; }
.song-item { animation: rise 0.5s ease both; }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn.primary:hover::after { left: 120%; }
