/* ==========================================================================
   HUK FUSION — Record Player page
   A shelf of vinyl sleeves (one per track, from assets/js/tracks-data.js)
   that load onto a single turntable with the same preview/playback rules
   as edm.html/jazz.html (see assets/js/record-player.js). Reuses style.css's
   .song-card__controls/.song-card__progress (and sub-classes)/.play-btn/
   .tag/.stream-btn/.info-* classes for the turntable's control row, so
   this file only adds the shelf- and turntable-specific visuals.
   ========================================================================== */

.rp-hero {
  padding: clamp(8.5rem, 14vw, 10.5rem) 0 clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.rp-hero__inner { max-width: 680px; margin-inline: auto; }
.rp-hero .section__kicker { color: var(--bg); } /* same as the page background — kept in the markup, not shown */
.rp-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin: 0.6rem 0 1rem; }
.rp-hero p { color: var(--text-dim); font-size: 1.03rem; line-height: 1.7; }

/* style.css's generic `section { padding: clamp(4.5rem,9vw,7.5rem) 0; }`
   would otherwise stack #shelf's bottom padding with #turntable-section's
   top padding into a very wide gap — tightened so the turntable sits
   right under the shelves instead. */
#shelf { padding-bottom: clamp(1rem, 2vw, 1.5rem); }
#turntable-section { padding-top: clamp(1rem, 2vw, 1.5rem); }

/* ==========================================================================
   Shelf — one per genre (EDM Fusion, Jazz Fusion), each its own
   horizontally scrollable row.
   ========================================================================== */

.record-shelf__label-heading {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.2rem;
}
.record-shelf__label-heading:not(:first-of-type) { margin-top: 1.6rem; }

.record-shelf {
  display: flex;
  gap: 1.3rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1.5rem;
  scroll-snap-type: x proximity;
}
.record-shelf::-webkit-scrollbar { height: 8px; }
.record-shelf::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 999px; }

.record-shelf__item {
  flex: none;
  width: 108px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.record-shelf__disc {
  --art-a: var(--pink);
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-color: var(--art-a);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.record-shelf__disc::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* "New Release" sticker — pinned to the sleeve's corner like a real
   price/promo sticker, rather than the inline pill .tag--new is
   elsewhere (e.g. the Jazz Fusion cards). Shared by record-player.html
   and turntable-mixer.html, both of which render it via
   window.HUK53_newBadgeHtml() into this same .record-shelf__disc. */
.record-shelf__disc .tag--new {
  position: absolute;
  top: -6px;
  left: -8px;
  font-size: 0.56rem;
  padding: 0.18rem 0.42rem;
  transform: rotate(-10deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.record-shelf__item:hover .record-shelf__disc,
.record-shelf__item:focus-visible .record-shelf__disc { transform: translateY(-4px); }

.record-shelf__item.is-selected .record-shelf__disc {
  box-shadow: 0 0 0 3px var(--pink), 0 0 24px rgba(255, 46, 146, 0.35);
}

.record-shelf__item.is-used .record-shelf__disc { opacity: 0.4; }
.record-shelf__item.is-used .record-shelf__status { opacity: 1; }

.record-shelf__status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--cyan);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.record-shelf__label { text-align: center; }

.record-shelf__title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.record-shelf__genre {
  display: block;
  font-size: 0.66rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* ==========================================================================
   Turntable
   ========================================================================== */

.turntable {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.turntable__deck {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Timeline sits at the turntable illustration's own width, directly
   below it — reuses style.css's .song-card__progress*/.song-card__times
   classes, just placed full-width here instead of beside a play button. */
.turntable__timeline {
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}

/* Illustrated turntable (owner-supplied line-art, recolored to fit the
   site's dark theme — see assets/img/record-player/turntable-illustration.webp).
   Drawn at 1060×726; the plinth keeps that exact aspect ratio so the
   percentage-positioned layers below line up at any size. The
   illustration's own Start/Stop buttons were erased from the artwork —
   assets/js/record-player.js's turntable__transport buttons stand in
   for them, deliberately bigger and in the site's own button style per
   the owner's request. The record itself (owner-supplied artwork, full
   360° groove pattern) was also erased from this base illustration and
   now lives as its own rotatable layer, .turntable__record below, so
   the whole disc — grooves, label and cover art together — can spin as
   one piece while playing instead of just the label area. */
.turntable__plinth {
  position: relative;
  aspect-ratio: 1060 / 726;
  max-width: 460px;
  margin-inline: auto;
  width: 100%;
}

.turntable__illustration {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* Sized/positioned to exactly fill the outer platter circle the base
   illustration still implies (same center/radius used when that circle
   was erased from it) — see the image-processing notes in the session
   history if this ever needs re-deriving for a new asset. */
/* Rotation is fully JS-driven (assets/js/record-player.js), not a CSS
   keyframe animation — a scratch drag needs to take over the exact same
   transform the animation would otherwise still be asserting mid-gesture. */
.turntable__record {
  position: absolute;
  left: 10.3774%;
  top: -0.5510%;
  width: 60.7547%;
  height: 88.7052%;
  cursor: grab;
  touch-action: none;
}
.turntable__record.is-scratching,
.turntable__record:active { cursor: grabbing; }

.turntable__record-art {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.turntable__disc {
  --art-a: var(--pink);
  position: absolute;
  left: 30.6314%;
  top: 30.6314%;
  width: 38.7372%;
  height: 38.7372%;
  border-radius: 50%;
  background-color: var(--art-a);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.turntable__spindle {
  width: 16%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

/* Tonearm — the owner's own detailed artwork (cropped to just the arm,
   background removed, recolored to match), not a redrawn stand-in. Sized
   and positioned so its pivot lands exactly on the illustration's own
   pivot post; assets/js/record-player.js rotates it around that same
   point (transform-origin, set below) in step with playback — 0° at the
   outer edge of the record (rest), sweeping to ~40.3° at the record's
   center once the preview finishes. All figures here come from matching
   the artwork's own pivot/needle pixel coordinates to the illustration's
   1060×726 coordinate space — see the image-processing notes in the
   session history if this ever needs re-deriving for a new asset. */
.turntable__tonearm {
  position: absolute;
  left: 59.2617%;
  top: -2.0385%;
  width: 31.3208%;
  height: 78.2369%;
  transform-origin: 69.8269% 25.4928%;
  transform: rotate(-18deg); /* parked at rest — matches ARM_PARK_DEG, no record loaded yet */
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.turntable__tonearm.is-dragging { cursor: grabbing; }
.turntable__tonearm:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Only while the arm is swinging programmatically — parking (by hand
   via the button, or automatically at track end/preview cap) and
   swinging onto the record on Play. Manual dragging stays instant;
   this just eases the hands-free moves, like a real turntable's cue
   lever. */
.turntable__tonearm.is-swinging { transition: transform 1s ease; }

.turntable__panel { min-width: 0; }
.turntable__panel .tag { margin-bottom: 0.7rem; }
.turntable__panel h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin-bottom: 1.2rem;
  word-break: break-word;
}

/* Start/Stop — bigger than the icon-only .play-btn used on edm.html/
   jazz.html, per the owner's request; same gradient/ghost button
   language as the rest of the site (.btn--primary/.btn--ghost). */
.turntable__transport {
  display: flex;
  gap: 0.9rem;
  flex: none;
}

.transport-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.transport-btn:hover:not(:disabled) { transform: translateY(-2px); }
.transport-btn:active:not(:disabled) { transform: scale(0.96); }
.transport-btn:disabled { cursor: not-allowed; transform: none !important; }

.transport-btn--start { background: var(--gradient-main); color: #0b0b14; }
/* A dimmed gradient still reads as "on" at a glance — swap to a flat
   muted fill instead so "disabled" is unambiguous. */
.transport-btn--start:disabled { background: rgba(255, 255, 255, 0.08); color: var(--text-faint); }
/* Pause state (the same button toggles Play/Pause) — a ghost fill reads
   as "currently on, tap to stop" instead of looking identical to Play. */
.transport-btn--start.is-playing { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.transport-btn--stop {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--card-border);
}
.transport-btn--stop:hover:not(:disabled) { border-color: var(--text-dim); }
.transport-btn--stop:disabled { color: var(--text-faint); border-color: var(--card-border); opacity: 0.5; }

/* Hidden link to the Turntable Mixer page — deliberately inconspicuous
   (no nav entry, no hub tile anywhere): sits right after "back to top"
   in the footer row, a plain glyph rather than a nav-styled link so a
   casual visitor reads it as a stray character, not something to click. */
.footer__hidden-link {
  color: var(--text-faint);
  opacity: 0.4;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.footer__hidden-link:hover,
.footer__hidden-link:focus-visible { opacity: 1; color: var(--pink); }

@media (max-width: 860px) {
  .turntable { grid-template-columns: 1fr; text-align: center; }
  .turntable__panel .song-card__controls { justify-content: center; flex-wrap: wrap; row-gap: 0.9rem; }
  .turntable__panel .song-card__note-row { justify-content: center; }
  .turntable__panel .song-card__links-label { display: block; }
}
