/* Mashups player, shared by Home and Releases (shared/player.js) */
/* Mashups: one player in the language of DJ gear (mono readouts, hairlines, deep black), none of its hardware.
   Nothing moves unless a track is playing: the clock, the progress line and the record are all driven by playback. */
.mx { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.mx-note { color: var(--cue); }

/* Play key: a flat icon; it shows pause while a track loads or plays */
.pb { flex: none; display: grid; place-items: center; padding: 0; cursor: pointer; }
.pb-i { display: block; width: 12px; height: 14px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
[data-on] .pb-i { clip-path: none; background: none; border-inline: 4px solid currentColor; }
.na { color: var(--muted); }

/* Clock */
.tm { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); font-variant-numeric: tabular-nums; }
.tm [data-remain] { color: var(--muted); }

/* Progress: a hairline, lit in the accent up to the playhead; the playhead itself is a 2px tick */
.seek { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0; padding: 0; background:
  linear-gradient(var(--cue), var(--cue)) 0 50% / calc(var(--p, 0) * 100%) 1px no-repeat,
  linear-gradient(var(--line-2), var(--line-2)) 0 50% / 100% 1px no-repeat; cursor: pointer; }
.seek:disabled { cursor: default; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 14px; background: var(--cue); border: 0; border-radius: 0; }
.seek::-moz-range-thumb { width: 2px; height: 14px; background: var(--cue); border: 0; border-radius: 0; }
.seek:disabled::-webkit-slider-thumb { visibility: hidden; }
.seek:disabled::-moz-range-thumb { visibility: hidden; }

/* Artwork: the cover, or type on a dark sleeve */
.art { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-3); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.is-empty { display: grid; place-items: center; background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); }
.art.is-empty::after { content: ''; position: absolute; inset: 7%; border: 1px solid var(--line); }
.art.is-empty svg { width: 58%; height: auto; color: color-mix(in srgb, var(--text) 30%, transparent); }

/* The record: grooves with the cover as its label; it turns only while playing. Sized and placed by the feature */
.sl-disc { position: absolute; top: 3%; aspect-ratio: 1; transition: transform .9s var(--ease); }
.sl-spin { position: absolute; inset: 0; animation: spin 1.8s linear infinite paused; }
.sl-spin svg { display: block; width: 100%; height: 100%; fill: var(--groove-1); }
.sl-spin .g { fill: none; stroke: var(--groove-2); stroke-width: .25; }
.sl-label { position: absolute; inset: 31%; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--cue); color: var(--on-cue); }
.sl-label img { width: 100%; height: 100%; object-fit: cover; }
.sl-label::before { content: ''; position: absolute; z-index: 2; left: 50%; top: 50%; width: 6%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { rotate: 1turn; } }

.ft-test { color: var(--cue); }

/* feature: the cover beside the title; a round play key and the waveform standing on its floor; the rest as rows.
   Matte surfaces only: no glass, no blur behind anything */
.ft { display: grid; gap: var(--s-4); align-items: center; }
.ft-art { border-radius: var(--r-lg); box-shadow: 0 40px 80px -30px var(--shadow); }
.ft-info { display: grid; gap: var(--s-3); min-width: 0; }
.ft-t { font: 800 var(--fs-title)/var(--lh-head) var(--ff); font-stretch: var(--head-stretch); text-transform: uppercase; letter-spacing: -.005em; overflow-wrap: anywhere; text-wrap: balance; }
.ft-by { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem var(--s-2); margin-top: calc(var(--s-2) - var(--s-3)); }
.ft-by b { color: var(--cue-2); font-weight: 700; }
.ft-by span { color: var(--muted); font-size: var(--fs-small); }
.ft-ctl { display: flex; align-items: center; gap: var(--s-2); }
.ft-wave { flex: 1; min-width: 0; }
.ft .tm { font-size: var(--fs-label); color: var(--muted); }
/* From tablet the cover is a smaller sleeve; on play its record slides out to the right and turns, as in sleeves. Phone keeps the full cover */
.ft-rec { position: relative; }
.ft-rec .sl-disc { display: none; }
@media (min-width: 760px) {
  /* --r: box width over sleeve width, just wide enough for the record half out; at rest it peeks a quarter so the box never reads empty */
  .ft { grid-template-columns: clamp(15rem, 37vw, 27.5rem) minmax(0, 1fr); column-gap: var(--s-4); }
  .ft-rec { --r: 1.47; aspect-ratio: var(--r); }
  .ft-rec .ft-art { position: relative; z-index: 1; width: calc(100% / var(--r)); }
  .ft-rec .sl-disc { display: block; left: calc(100% / var(--r) * .03); width: calc(100% / var(--r) * .94); border-radius: 50%; box-shadow: 18px 24px 48px -20px var(--shadow); transform: translateX(25%); }
  .ft-rec .sl-label { inset: 24%; box-shadow: 0 0 0 3px var(--groove-2); }
  .ft:is([data-state="loading"], [data-state="playing"], [data-state="paused"]) .sl-disc { transform: translateX(52%); }
  .ft[data-state="playing"] .sl-spin { animation-play-state: running; }
}

/* Round play key: white, inside a thin ring that turns blue while it plays. No progress on it, the waveform shows that */
.pb.pb-ring { position: relative; width: 60px; height: 60px; margin: 9px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); }
.pb.pb-ring::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1.5px solid var(--line-2); transition: border-color .3s; pointer-events: none; }
.pb.pb-ring[data-on]::before { border-color: var(--cue); }
.pb.pb-ring:active { transform: scale(.94); }
.pb-ring .pb-i { margin-left: 3px; }
.pb-ring[data-on] .pb-i { margin-left: 0; }
.pb.pb-sm { width: 44px; height: 44px; margin: 0; }
.pb.pb-sm::before { display: none; }
.pb-sm .pb-i { width: 10px; height: 12px; }
.pb-sm[data-on] .pb-i { border-inline-width: 3px; }
span.pb-sm { width: 44px; }

/* Links out: icon and label, no box. They light up in the accent on hover, keyboard focus and press */
.lk { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }
.lk a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--text); text-decoration: none; white-space: nowrap; font: 600 var(--fs-small)/1 var(--ff); letter-spacing: var(--track); text-transform: uppercase; transition: color var(--btn-fade); }
.lk svg { width: 18px; height: 18px; flex: none; }
.lk a:is(:focus-visible, :active) { color: var(--cue); }
.lk a:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (hover: hover) { .lk a:hover { color: var(--cue); } }
@media (max-width: 479px) { .ft .lk { justify-content: space-between; gap: 0; } } /* three labels across a phone, edge to edge */
@media (max-width: 379px) { .ft .lk svg { display: none; } } /* smallest phones: labels only, so all three stay on one row */

/* Rows: play key, cover, title and credit, link icons */
.fr { display: grid; gap: 4px; }
.fr-row { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-2) var(--s-1) var(--s-1); border-radius: var(--r-lg); transition: background .25s; }
.fr-row:hover { background: var(--bg-2); }
.fr-art { border-radius: var(--r-sm); }
.fr-txt { display: grid; min-width: 0; }
/* Newest release, labelled the same in the feature and in the rows */
.fr-t { font-weight: 700; line-height: var(--lh-snug); overflow-wrap: anywhere; }
.fr-d { color: var(--muted); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr .lk { flex-wrap: nowrap; gap: 0; }
.fr .lk a { justify-content: center; width: 44px; }
.fr .lk a span { display: none; }
@media (max-width: 639px) { .fr-row { grid-template-columns: auto 48px minmax(0, 1fr) auto; gap: var(--s-1); } .fr .lk li:not(:first-child) { display: none; } }

/* Waveform on its floor: bars light up in the accent to the playhead, the line under them lights up with them,
   a soft light spreads under what has played; the seek range sits invisible on top */
.wf { --h: 64px; position: relative; isolation: isolate; }
.wf-up, .wf-refl { position: relative; display: block; height: var(--h); }
.wf-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.wf-bars i { flex: 1; min-width: 0; background: var(--line-2); border-radius: 2px 2px 0 0; }
.wf-bars.on { clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); }
.wf-bars.on i { background: var(--cue); }
.wf-bars.hv { opacity: 0; clip-path: inset(0 calc((1 - var(--hv, 0)) * 100%) 0 0); transition: opacity .2s; }
.wf-bars.hv i { background: color-mix(in srgb, var(--line-2), var(--text) 20%); }
@media (hover: hover) { .wf:hover .wf-bars.hv { opacity: 1; } }
.wf-line { display: block; height: 1px; background: linear-gradient(90deg, var(--cue) calc(var(--p, 0) * 100%), var(--line-2) 0); }
.wf-refl { height: calc(var(--h) * .45); overflow: hidden; transform: scaleY(-1); -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.5), transparent 80%); mask-image: linear-gradient(to top, rgba(0,0,0,.5), transparent 80%); }
.wf-refl .wf-bars { height: var(--h); top: auto; }
.wf-pool { position: absolute; z-index: -1; left: 0; top: calc(var(--h) - 14px); width: calc(var(--p, 0) * 100%); height: 34px; background: var(--cue); filter: blur(18px); opacity: 0; pointer-events: none; transition: opacity .5s; }
:is([data-state="loading"], [data-state="playing"], [data-state="paused"]) .wf-pool { opacity: .32; }
.wf .seek { position: absolute; inset: 0; width: auto; height: 100%; background: none; opacity: 0; }
.wf:has(.seek:focus-visible) { outline: 2px solid var(--cue); outline-offset: 6px; }
@media (max-width: 599px) { .wf-bars i:nth-child(even) { display: none; } }

.sc-frame { position: fixed; left: -9999px; top: 0; width: 320px; height: 160px; border: 0; opacity: 0; pointer-events: none; }

/* Hover motion */
.pb { transition: background .25s, border-color .2s, color .2s, transform .2s var(--ease); }
