/* Home's Music section (src/components/MusicPlayer.astro): a record player in paper. The deck holds one record, its
   sleeve with the vinyl sliding out of it, and the shelf below holds every record in one row that scrolls sideways,
   standing behind a pale-wood lip like the House's crate. GSAP moves the vinyl and flies a chosen sleeve onto the
   deck; the shelf's hover and its lift are CSS. Nothing here plays: the links open the music page and the House. */
.music-lede { max-width: 38em; color: var(--ink-2); }

/* ---------- the deck ---------- */
.deck { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 96px); align-items: center; padding: clamp(24px, 3vw, 44px) 0 clamp(36px, 4vw, 56px); }
/* the sleeve sits left in its half, so the vinyl has room to come out to the right. Its size also follows the
   window's height, so on a laptop the deck and the whole shelf fit on one screen and you see a sleeve fly up */
.spin { position: relative; width: clamp(240px, calc(100svh - 470px), min(420px, 64%)); aspect-ratio: 1; margin-left: clamp(0px, 3vw, 56px); isolation: isolate; -webkit-tap-highlight-color: transparent; }
.sleeve { position: absolute; inset: 0; border-radius: 3px; overflow: hidden; background: #E9EAE6; box-shadow: 0 1px 0 rgba(18, 20, 24, .08), 0 30px 46px -30px rgba(18, 20, 24, .55); }
.sleeve img { width: 100%; height: 100%; object-fit: cover; }
/* the vinyl: a smooth rim, fine grooves, the smooth run-out, the record's own cover as its label and the spindle hole.
   It is the site's night ink (#121418, #1C1F25); the gradients draw the material (DESIGN.md: only real material). */
.disc { position: absolute; z-index: -1; inset: 2.5%; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 23.5%, #1C1F25 23.5% 25.5%, transparent 25.5% 47%, #121418 47.2%),
    repeating-radial-gradient(circle, #121418 0 1px, #1C1F25 1px 2.5px);
  box-shadow: 0 18px 34px -22px rgba(18, 20, 24, .6), inset 0 0 0 1px #121418; }
.disc .label { position: absolute; left: 33%; top: 33%; width: 34%; height: 34%; border-radius: 50%; object-fit: cover; }
.disc::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 2.6%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(18, 20, 24, .35); }

.now { min-width: 0; }
/* the title keeps room for two lines and sits at the bottom of it, the note for two, so a record with a longer name
   or note never moves the shelf below */
.now .title { display: flex; align-items: flex-end; min-height: 1.96em; font: italic 500 clamp(40px, 5.2vw, 76px)/.98 var(--serif); font-variation-settings: "opsz" 72; letter-spacing: -.03em; text-wrap: balance; }
.now .meta { margin-top: 16px; }
.now .note { min-height: calc(2 * 1.55em); margin-top: 18px; max-width: 26em; color: var(--ink-2); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 28px; }
.player .read { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 15px/1.2 var(--sans); text-decoration: none; transition: background .2s, transform .2s var(--spring); }
.player .read:hover { background: var(--red-ink); }
.player .read:active { transform: scale(.97); }
.house { display: inline-block; padding-block: 12px; font: 500 15px/1.2 var(--sans); text-underline-offset: 4px; }
.house:hover { color: var(--red-ink); }

/* the sleeve that flies from the shelf to the deck (made by the script, removed when it lands) */
.ghost { position: absolute; z-index: 39; margin: 0; border-radius: 3px; object-fit: cover; pointer-events: none; transform-origin: 0 0; box-shadow: 0 26px 44px -24px rgba(18, 20, 24, .55); }

/* ---------- the shelf ---------- */
.shelf { border-top: 1px solid var(--hair); padding-top: 20px; }
.shelf-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; }
.shelf-head h3 { font: 400 clamp(24px, 2.4vw, 32px)/1.1 var(--serif); letter-spacing: -.01em; }
.arrows { display: flex; gap: 8px; }
.arrow { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(18, 20, 24, .22); border-radius: 50%; background: transparent; cursor: pointer; font: 400 18px/1 var(--sans); transition: background .2s, border-color .2s, opacity .2s, transform .2s var(--spring); }
.arrow:hover:not(:disabled) { background: var(--sheet); border-color: var(--ink); }
.arrow:active:not(:disabled) { transform: scale(.94); }
.arrow:disabled { opacity: .3; cursor: default; }

/* the row runs to the screen's edges and scrolls inside itself; a mouse drags it, a finger swipes it */
.rail { margin: 0 calc(-1 * var(--g)); padding: 34px var(--g) 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: var(--g); cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; }
.sleeves { --size: clamp(112px, 10.5vw, 160px); position: relative; display: flex; width: max-content; margin: 0; padding: 0; list-style: none; }
.sleeves li { position: relative; z-index: 1; margin-right: calc(var(--size) * -.16); }
.sleeves li:last-child { margin-right: 0; }
.sleeves li:has(.tile:hover, .tile:focus-visible) { z-index: 5; }
/* the lip in front of the sleeves' feet, the House's pale wood: a sleeve you point at rises out of it */
.sleeves::after { content: ""; position: absolute; z-index: 10; left: calc(-1 * var(--g)); right: calc(-1 * var(--g)); bottom: 24px; height: 12px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(#E9DDC7, #DCCBAE); box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .7), 0 10px 18px -14px rgba(18, 20, 24, .5); }

.tile { display: block; width: var(--size); padding: 0; border: 0; border-radius: 3px; background: none; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rail.dragging .tile { cursor: grabbing; }
.art { display: block; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: #E9EAE6; transform-origin: 50% 100%;
  box-shadow: 0 1px 0 rgba(18, 20, 24, .08), 0 10px 18px -12px rgba(18, 20, 24, .5); }
.art img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.num { display: block; height: 17px; margin-top: 18px; font: 400 12px/17px var(--mono); color: var(--ink-2); }
/* the record on the deck stands a little higher than the rest, and its number turns red */
.tile[aria-pressed="true"] .art { translate: 0 -10px; }
.tile[aria-pressed="true"] .num { color: var(--red-ink); }
.tile[aria-pressed="true"] .num::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: 1px; }
.tile:focus-visible { outline: none; }
.tile:focus-visible .art { outline: 2.5px solid var(--red); outline-offset: 3px; }
.motion .art { transition: transform .45s var(--ease), translate .45s var(--ease), box-shadow .45s var(--ease); }
/* pointing at a sleeve lifts it out of the lip and moves its neighbours aside, so its whole cover shows */
@media (hover: hover) and (pointer: fine) {
  .tile:hover .art, .tile:focus-visible .art { transform: translateY(-18px) rotate(-1.5deg) scale(1.04); box-shadow: 0 1px 0 rgba(18, 20, 24, .08), 0 26px 30px -18px rgba(18, 20, 24, .5); }
  .sleeves li:has(.tile:hover) + li .art { transform: translateX(18px) rotate(1.2deg); }
  .sleeves li:has(+ li .tile:hover) .art { transform: translateX(-8px) rotate(-.8deg); }
  .rail.dragging .tile .art { transform: none; }
}
.tile:focus-visible .art { transform: translateY(-18px) scale(1.04); }
/* touch: no arrows, the row snaps gently to a sleeve when a swipe ends */
@media (hover: none) {
  .arrows { display: none; }
  .rail { cursor: auto; scroll-snap-type: x proximity; }
  .sleeves li { scroll-snap-align: start; }
}

.shelf-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; padding-top: 18px; }
.readout { min-width: 0; }
.readout b { margin-right: 12px; font: italic 500 clamp(22px, 2vw, 28px)/1.15 var(--serif); letter-spacing: -.01em; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .spin { width: clamp(220px, calc(100svh - 470px), min(380px, 68%)); margin-left: 0; } }
/* phones: the deck stacks */
@media (max-width: 760px) {
  .deck { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 24px; }
  .spin { width: min(300px, 60%); }
  .acts { margin-top: 20px; }
  .rail { padding-top: 28px; }
}
/* the smallest phones: a smaller title still fits two lines, and the note gets a third */
@media (max-width: 340px) { .now .title { font-size: 34px; } .now .note { min-height: calc(3 * 1.55em); } }
