:root {
  --bg: #0b0b0f;
  --card: rgba(18, 18, 24, 0.72);
  --row: rgba(255, 255, 255, 0.06);
  --row-hover: rgba(255, 255, 255, 0.12);
  --text: #f4f4f6;
  --muted: #a3a3ad;
  --accent: #f4f4f6;
  --accent-text: #0b0b0f;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

/* Blurred cover art behind the card. */
.backdrop {
  position: fixed;
  inset: -40px;
  background: var(--cover) center / cover no-repeat;
  filter: blur(40px) brightness(0.45) saturate(1.3);
  z-index: -1;
}

/* Page column. On phones it has no box of its own, the album panel is the
   only frame; wide screens frame the whole page (see the media query). */
.card {
  width: 100%;
  max-width: 420px;
}

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #222;
}

.meta { text-align: center; padding: 18px 8px 14px; }
.type { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.title { font-size: 26px; line-height: 1.15; margin: 4px 0 2px; overflow-wrap: anywhere; }
.artist { color: var(--muted); font-size: 17px; }
.countdown {
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
}

.player { margin-bottom: 12px; }
.links .player { margin-bottom: 0; }
.player iframe { display: block; width: 100%; border: 0; border-radius: 12px; }
.player iframe.yt { aspect-ratio: 16 / 9; height: auto; }

.links { list-style: none; display: grid; gap: 8px; }
.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 10px 0 14px;
  border-radius: 12px;
  background: var(--row);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.links a:hover, .links a:focus-visible { background: var(--row-hover); }
.links a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.logo {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--brand);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.platform { flex: 1; }
.action {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
}
.empty { text-align: center; color: var(--muted); padding: 16px 0; }

.tracks h2, .platforms h2, .socials h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 4px 8px;
}
/* Scrollable box about five tracks tall, so the tracklist doesn't push the
   rest of the page down; the bottom fades to hint there's more. */
.tracks ol {
  list-style: none;
  counter-reset: track;
  max-height: 222px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--row);
  border-radius: 12px;
  padding: 0 8px;
  -webkit-mask: linear-gradient(#000 calc(100% - 28px), transparent);
  mask: linear-gradient(#000 calc(100% - 28px), transparent);
  scrollbar-width: thin;
}
.tracks li:first-child { border-top: 0; }
.tracks li:last-child { padding-bottom: 24px; }
.tracks li {
  counter-increment: track;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 15px;
}
.tracks li::before {
  content: counter(track);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 1.5em;
  text-align: right;
}
.track-title { flex: 1; overflow-wrap: anywhere; }

/* Play button replaces the track number when a preview clip is available. */
.tracks li.playable { align-items: center; padding-block: 6px; }
.tracks li.playable::before { align-self: center; }

/* "Listen in full on" row shown after a clip ends. */
.tracks li.more {
  counter-increment: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  border-top: 0;
  padding: 2px 4px 12px calc(1.5em + 54px);
  color: var(--muted);
  font-size: 13px;
}
.tracks li.more::before { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips a {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--row-hover);
  transition: background 0.15s;
}
.chips a:hover, .chips a:focus-visible { background: rgba(255, 255, 255, 0.2); }
.chips .logo { width: 17px; height: 17px; }
.play-slot { flex-shrink: 0; width: 30px; height: 30px; }
.play {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--row-hover);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.play::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(15% 0, 100% 50%, 15% 100%); /* play */
}
.playing .play { background: var(--accent); color: var(--accent-text); }
.playing .play::before {
  clip-path: polygon(10% 0, 40% 0, 40% 100%, 10% 100%, 10% 0, 60% 0, 90% 0, 90% 100%, 60% 100%, 60% 0); /* pause */
}
.playing .track-title { font-weight: 600; }
.play:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.track-length { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }

.credits { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* Album panel: cover, title and tracklist, set apart from the links below. */
.album {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 12px 12px 4px;
  margin-bottom: 24px;
}
.album .tracks ol { background: none; padding: 0; }

/* Phones: Listen and Follow share a frame matching the album panel. */
.links-panel {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 14px 12px 12px;
}
.tracks { margin-bottom: 8px; }
.socials { margin-top: 24px; }

/* Wide screens: links on the left, tracklist on the right. */
@media (min-width: 880px) {
  body { align-items: center; }
  .card {
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "album album" "platforms socials" "foot foot";
    column-gap: 28px;
    padding: 20px;
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  /* The page frame holds everything; Listen and Follow sit in its grid. */
  .links-panel { display: contents; }
  /* Inside the page frame, the album panel is a lighter inset. */
  .album {
    grid-area: album;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    padding: 16px;
  }
  .platforms { grid-area: platforms; }
  .socials { grid-area: socials; align-self: start; margin-top: 0; }
  /* Tracklist as tall as the cover and title beside it, scrolling inside:
     height 0 + min-height 100% keeps it from setting the row height. */
  .tracks { height: 0; min-height: 100%; display: flex; flex-direction: column; margin-bottom: 0; }
  .tracks ol { flex: 1; min-height: 0; max-height: none; }
  .foot { grid-area: foot; }
}
