/* ==========================================================================
   IMABEATDUHPARTY — MUSIC PAGE
   Two separate visual environments on one page:
     1. the studio hero at the top   (MUSIC SCREEN.png,      data-art="music")
     2. the listening room lower down (APPLE MUSIC IMAGE.png, data-art="apple")
   Both are live <picture> elements with real HTML layered over them.
   ========================================================================== */

.music-page {
  /* Warm accents pulled from the listening room, sitting alongside the brand
     pink and light blue. Scoped to this page only. */
  --ember: #ff5b2e;
  --ember-soft: #ff9a4d;
  --glass: rgb(14 6 8 / 0.52);
  --glass-line: rgb(255 255 255 / 0.14);
  --glow-ember: 0 0 0 1px rgb(255 91 46 / 0.34), 0 10px 46px -10px rgb(255 91 46 / 0.5);
}

/* ==========================================================================
   1. STUDIO HERO — the main Music visual
   ========================================================================== */
.music-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
}
.music-hero__inner {
  max-width: var(--shell-max);
  margin-inline: auto;
  width: 100%;
  padding-inline: var(--gutter);
  padding-block: calc(var(--header-h) + var(--sp-6)) clamp(3rem, 9vh, 6rem);
  display: grid;
  gap: var(--sp-4);
  justify-items: start;
}
.music-hero__title { line-height: 0.9; }
.music-hero__lede { max-width: 34ch; }

/* ==========================================================================
   2. MUSIC CONTENT
   Releases sit on the page's own dark ground rather than over artwork, so
   nothing competes with either photograph.
   ========================================================================== */
.music-body {
  position: relative;
  background:
    radial-gradient(70% 40% at 10% 4%, rgb(255 47 146 / 0.11), transparent 62%),
    radial-gradient(60% 40% at 92% 42%, rgb(255 91 46 / 0.09), transparent 64%),
    radial-gradient(50% 35% at 40% 96%, rgb(138 216 255 / 0.05), transparent 66%),
    var(--ink);
}

/* The listening-room artwork and both streaming promo cards now live on the
   Connect page. Their styles are in assets/css/streaming.css. */

/* ==========================================================================
   4. GLASS PANEL — shared surface for the modules on this page
   ========================================================================== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   5. FEATURED PLAYER
   ========================================================================== */
.player {
  display: grid;
  gap: clamp(1.25rem, 1rem + 2vw, 2.5rem);
  padding: clamp(1.1rem, 0.8rem + 1.6vw, 2rem);
  overflow: hidden;
}
@media (min-width: 56rem) {
  .player {
    grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
    align-items: center;
  }
}

.player__art {
  /* An <a> now, so it needs to be blockified for the aspect ratio to apply */
  display: block;
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  isolation: isolate;
}
.player__art img { width: 100%; height: 100%; object-fit: cover; }
.player__art .cover { border-radius: 0; height: 100%; }

/* Changing release: the new artwork eases in rather than snapping */
.is-swapping { animation: swap-in var(--dur-slow) var(--ease-out) both; }
@keyframes swap-in {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .is-swapping { animation: none; }
}

.player__body { display: grid; gap: var(--sp-4); min-width: 0; }

.player__title {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: clamp(1.6rem, 1.1rem + 2.4vw, 3rem);
  line-height: 1;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
}
.player__artist {
  font-size: var(--t-small);
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--pink-light);
}
.player__blurb { color: var(--fg-muted); max-width: 46ch; }

/* --- Transport ---------------------------------------------------------- */
.transport {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--fg);
  border: 1px solid var(--glass-line);
  background: rgb(255 255 255 / 0.05);
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur) var(--ease-out);
}
.tbtn:hover:not(:disabled),
.tbtn:focus-visible { background: rgb(255 255 255 / 0.14); transform: translateY(-2px); }
.tbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.tbtn svg { width: 18px; height: 18px; }

.tbtn--main {
  width: 64px;
  height: 64px;
  background: var(--pink);
  border-color: transparent;
  color: var(--ink);
}
.tbtn--main svg { width: 24px; height: 24px; }
.tbtn--main:hover:not(:disabled),
.tbtn--main:focus-visible {
  background: var(--pink-bright);
  box-shadow: var(--glow-pink);
}

/* Swap the icon by state rather than rewriting the button */
.tbtn [data-icon-pause] { display: none; }
.is-playing .tbtn [data-icon-pause] { display: block; }
.is-playing .tbtn [data-icon-play] { display: none; }

/* --- Progress ----------------------------------------------------------- */
.progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
}
.progress__time {
  font-family: var(--font-display);
  font-weight: var(--w-medium);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  min-width: 4ch;
}

/* Real range inputs, so seeking and volume work with keyboard, mouse and
   touch for free. --fill is set by JS to colour the played portion. */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--pink) 0 var(--fill, 0%),
    rgb(255 255 255 / 0.18) var(--fill, 0%) 100%
  );
}
.range::-moz-range-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--pink) 0 var(--fill, 0%),
    rgb(255 255 255 / 0.18) var(--fill, 0%) 100%
  );
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgb(255 47 146 / 0.28);
  transition: transform var(--dur-fast) var(--ease-out);
}
.range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgb(255 47 146 / 0.28);
}
.range:hover::-webkit-slider-thumb { transform: scale(1.18); }
.range:disabled { opacity: 0.45; cursor: not-allowed; }

.volume {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.volume .range { width: clamp(5rem, 12vw, 9rem); }

/* --- Streaming buttons --------------------------------------------------- */
.streams {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding-block-start: var(--sp-2);
  border-block-start: 1px solid var(--glass-line);
}
.stream {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0.5em 1em;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--t-micro);
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--fg-muted);
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    transform var(--dur) var(--ease-out);
}
.stream:hover,
.stream:focus-visible {
  color: var(--ink);
  background: var(--ember-soft);
  border-color: var(--ember-soft);
  transform: translateY(-2px);
}
.stream svg { width: 15px; height: 15px; }

/* ==========================================================================
   6. RELEASE ARTWORK + CARDS
   ========================================================================== */
/* Placeholder cover: a branded gradient with the catalogue number. Rotated
   per index so the grids do not look repetitive. Deliberately abstract —
   these are not pretending to be real album art.
   Every term in the hue calc has to carry an angle unit; mixing a bare
   number with deg makes the whole declaration invalid. */
.cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 22% 18%, rgb(255 255 255 / 0.22), transparent 60%),
    linear-gradient(150deg,
      hsl(calc(330deg + var(--cover-shift, 0) * 1deg) 100% 62%) 0%,
      hsl(calc(350deg + var(--cover-shift, 0) * 1deg) 92% 52%) 48%,
      hsl(calc(368deg + var(--cover-shift, 0) * 1deg) 96% 50%) 100%);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover__mark {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: clamp(2rem, 1rem + 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgb(8 3 6 / 0.42);
  text-transform: uppercase;
  user-select: none;
}

.release {
  position: relative;
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  color: inherit;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease-out);
}
.release:hover,
.release:focus-within {
  background: rgb(255 255 255 / 0.05);
  border-color: var(--glass-line);
  transform: translateY(-4px);
}

.release__art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.release:hover .release__art,
.release:focus-within .release__art {
  box-shadow: var(--glow-ember);
  transform: scale(1.02);
}

.release__play {
  position: absolute;
  inset-block-end: var(--sp-3);
  inset-inline-end: var(--sp-3);
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out),
    background-color var(--dur-fast) var(--ease);
}
.release:hover .release__play,
.release__play:focus-visible,
.release.is-current .release__play { opacity: 1; transform: none; }
.release__play:hover { background: var(--pink-bright); }
.release__play svg { width: 18px; height: 18px; }

/* Touch devices have no hover, so the button is always visible there */
@media (hover: none) {
  .release__play { opacity: 1; transform: none; }
}

.release__title {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--t-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.release__meta {
  font-size: var(--t-micro);
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--fg-faint);
}
.release.is-current .release__title { color: var(--pink); }

/* Little animated bars on whatever is playing */
.eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
  margin-inline-start: var(--sp-2);
  vertical-align: -2px;
}
.release.is-current .eq { display: inline-flex; }
.eq span {
  width: 3px;
  background: var(--pink);
  height: 45%;
  border-radius: 1px;
}
.is-playing .eq span { animation: eq-bounce 900ms var(--ease-in-out) infinite alternate; }
.eq span:nth-child(2) { animation-delay: 150ms; }
.eq span:nth-child(3) { animation-delay: 300ms; }
@keyframes eq-bounce {
  from { height: 25%; }
  to   { height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .is-playing .eq span { animation: none; height: 60%; }
}

/* ==========================================================================
   7. LAYOUTS — rail and grids
   ========================================================================== */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(11rem, 15rem);
  gap: var(--sp-4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-block-end: var(--sp-4);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }

/* Two up on phones — a single column of full-width covers makes the page
   enormous. Above that the grid fills naturally. */
.release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
@media (min-width: 40rem) {
  .release-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
}

/* The playlist that used to sit here has been removed along with its
   section; only the dock still needs the small-thumbnail rule. */
.dock__art .cover__mark { font-size: 0.75rem; letter-spacing: 0; }

/* ==========================================================================
   9. DOCKED MINI PLAYER
   ========================================================================== */
.dock {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: calc(var(--z-header) - 1);
  padding: var(--sp-3) var(--gutter);
  background: rgb(10 4 6 / 0.86);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-block-start: 1px solid var(--glass-line);
  transform: translateY(110%);
  visibility: hidden;
  transition:
    transform var(--dur) var(--ease-out),
    visibility 0s linear var(--dur);
}
.dock.is-visible {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

.dock__inner {
  max-width: var(--shell-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
}
.dock__art { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; }
.dock__meta { min-width: 0; display: grid; gap: 2px; }
.dock__title {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dock__progress { display: flex; align-items: center; gap: var(--sp-2); }
.dock__progress .progress__time { display: none; }
.dock__controls { display: flex; align-items: center; gap: var(--sp-2); }

@media (max-width: 40rem) {
  .dock__controls .tbtn:not(.tbtn--main) { display: none; }
  .dock__inner { gap: var(--sp-3); }
  .dock__art { width: 38px; height: 38px; }
}
@media (min-width: 40rem) {
  .dock__progress .progress__time { display: block; }
}
.dock .tbtn--main { width: 46px; height: 46px; }
.dock .tbtn--main svg { width: 18px; height: 18px; }

/* ==========================================================================
   10. SECTION RHYTHM ON THIS PAGE
   ========================================================================== */
.music-page .section { padding-block: clamp(3rem, 1.5rem + 6vw, 7rem); }

/* Leaves room for the dock so it never covers the last row */
.music-page .site-footer { padding-block-end: 5rem; }
