:root {
  --bg: #090b12;
  --bg-deep: #05060a;
  --panel: rgba(14, 18, 30, 0.78);
  --panel-strong: rgba(19, 24, 40, 0.92);
  --line: rgba(155, 122, 255, 0.16);
  --text: #f2f4fb;
  --muted: #98a0b7;
  --green: #39d98a;
  --green-soft: rgba(57, 217, 138, 0.14);
  --violet: #9b7aff;
  --violet-soft: rgba(155, 122, 255, 0.16);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(57, 217, 138, 0.18), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(155, 122, 255, 0.24), transparent 30%),
    linear-gradient(180deg, #0c1019 0%, var(--bg) 45%, var(--bg-deep) 100%);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  position: relative;
  z-index: 1;
}

.bg-orb {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
}

.orb-left {
  top: -8vw;
  left: -10vw;
  background: rgba(57, 217, 138, 0.18);
}

.orb-right {
  top: 4vw;
  right: -8vw;
  background: rgba(155, 122, 255, 0.22);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(9, 12, 20, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand > span {
  min-width: 0;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: block;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.nav {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: 160ms ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

h1, h2, h3 {
  margin: 0;
}

h1, .detail-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.94;
  max-width: 680px;
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 700px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hero-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), var(--violet));
  color: #07110d;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  border: 0;
}

.dashboard-grid,
.detail-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.detail-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card.pad {
  padding: 18px;
}

.stats-row {
  grid-column: span 12;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 22px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.stat-value {
  margin-top: 12px;
  font-size: 42px;
  font-weight: 700;
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.now-playing {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(57, 217, 138, 0.14), rgba(155, 122, 255, 0.14)),
    rgba(13, 17, 29, 0.92);
}

.cover,
.cover-placeholder {
  width: 132px;
  height: 132px;
  border-radius: 20px;
}

.cover {
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green-soft), var(--violet-soft));
  color: var(--green);
  font-size: 64px;
}

.section-title {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.1;
}

.recent-card {
  grid-column: span 7;
}

.top-card {
  grid-column: span 5;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item,
.track-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.list-item:first-child,
.track-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-item a,
.track-link {
  color: inherit;
  text-decoration: none;
}

.history-item {
  padding: 12px 0;
}

.history-item .track-link {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 2px 0;
  border-radius: 16px;
  transition: background 180ms ease, transform 180ms ease;
}

.history-item .track-link:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}

.history-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-cover,
.history-cover-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.history-cover {
  object-fit: cover;
}

.history-cover-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green-soft), var(--violet-soft));
  color: var(--green);
  font-size: 20px;
}

.item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-meta {
  color: var(--muted);
  font-size: 14px;
}

.detail-hero {
  display: grid;
  gap: 24px;
  grid-template-columns: 180px 1fr;
  padding: 24px;
}

.detail-title {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.95;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-soft), var(--violet-soft));
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  color: var(--muted);
}

.page-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.spotlight-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(57, 217, 138, 0.15), rgba(155, 122, 255, 0.15)),
    rgba(14, 18, 31, 0.92);
  overflow: hidden;
  position: relative;
}

.home-hero-grid .spotlight-card {
  grid-template-columns: 360px 1fr;
}

.home-hero-grid .cover,
.home-hero-grid .cover-placeholder {
  width: 360px;
  height: 360px;
  border-radius: 28px;
}

.spotlight-card::after {
  content: "";
  position: absolute;
  inset: auto -8% -35% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(155, 122, 255, 0.22), transparent 65%);
  pointer-events: none;
}

.spotlight-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.spotlight-main-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.spotlight-copy-link {
  margin-top: 2px;
}

.spotlight-copy-link:hover .detail-title,
.spotlight-main-link:hover .cover {
  opacity: 0.92;
}

.spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.mini-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}

.home-hero-grid-single {
  grid-template-columns: 1fr;
}

.moment-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(155, 122, 255, 0.12), rgba(57, 217, 138, 0.08)),
    rgba(14, 18, 31, 0.92);
}

.moment-cover,
.moment-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  margin-bottom: 16px;
}

.moment-cover {
  object-fit: cover;
}

.moment-cover-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green-soft), var(--violet-soft));
  color: var(--green);
  font-size: 42px;
}

.moment-title {
  font-size: 24px;
  line-height: 0.95;
  margin-bottom: 8px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
}

.moment-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.history-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 0.52fr;
}

.history-panel {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1;
  justify-self: stretch;
}

.history-loader {
  min-height: 28px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.history-sentinel {
  height: 1px;
}

.home-track-list {
  gap: 0;
}

.home-track-item .track-link {
  grid-template-columns: auto 56px 1fr;
  gap: 14px;
}

.home-track-rank {
  align-self: center;
  min-width: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.sticky-card {
  position: sticky;
  top: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.section-link {
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
}

.section-link:hover {
  color: white;
}

@media (max-width: 900px) {
  .now-playing,
  .detail-hero,
  .detail-grid,
  .home-hero-grid,
  .mini-grid,
  .history-grid,
  .spotlight-card {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }

  .stats-row,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .recent-card,
  .top-card,
  .stats-row,
  .now-playing {
    grid-column: span 1;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 1180px);
    padding: 20px 0 32px;
  }

  .topbar {
    gap: 14px;
    padding: 12px;
    border-radius: 20px;
  }

  .brand {
    align-items: flex-start;
  }

  .nav {
    gap: 6px;
  }

  .nav a {
    padding: 9px 12px;
  }

  .spotlight-card,
  .detail-hero {
    gap: 16px;
    padding: 18px;
  }

  .home-hero-grid .cover,
  .home-hero-grid .cover-placeholder,
  .cover,
  .cover-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .detail-title {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.02;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .moment-title,
  .section-title {
    overflow-wrap: anywhere;
  }

  .hero-copy {
    font-size: 15px;
    line-height: 1.45;
  }
}
