/* Music: a wall of sleeves under a link-blue front, and the cursed records in a navy back room. */
@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(league-spartan-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(league-spartan-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body.music {
  --m: max(16px, 3vw);
  --display: "League Spartan", "Arial Narrow", Arial, sans-serif;
  --front: #0000ee;
  --back: #050a5c;
  --hot: #ff3b1f;
  --sel: #0000ee;
  --red: #ee0000;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--front);
}
/* League Spartan for everything on the page itself; the nav and the player keep the site's Times. */
body.music main, body.music footer { font-family: var(--display); }
body.music main { padding: 0; }
/* The page never shifts itself to keep something in place while it is being scrolled. */
body.music { overflow-anchor: none; }
body.music main > * { max-width: none; }

/* ---- The front: nav and the name of the page on link blue ---- */
body.music nav { color: #fff; position: relative; z-index: 1; }
body.music nav a, body.music nav a:visited { color: #fff; }
body.music nav a:active { color: var(--hot); }
body.music nav :focus-visible, body.music .front :focus-visible { outline-color: #fff; }

.front {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 26vw); align-items: end; column-gap: var(--m);
  padding: 13vh var(--m) 44px; color: #fff;
}
.front h1 {
  font: 700 clamp(104px, 17vw, 260px) / 0.8 var(--display); letter-spacing: -0.045em;
  margin: 0 0 -0.06em -0.04em; color: #fff;
}
.front .lead { font-size: clamp(22px, 1.2vw + 10px, 30px); line-height: 1.25; margin: 0; max-width: 22ch; justify-self: end; }

/* The player sits on the blue front while it is closed. Open, it keeps the site's own light panel. */
body.music #player:not(.open) { --ink: #fff; --soft: #dcdcff; --pl-ground: var(--front); --pl-track: #4d4dff; }
body.music #player:not(.open) :focus-visible { outline-color: #fff; }
body.music #player:not(.open) .play:hover:not(:disabled),
body.music #player:not(.open) .skip:hover:not(:disabled),
body.music #player:not(.open) .mute:hover { background: #2a2aff; }

/* ---- The wall: one sleeve per song, a tag in the sleeve's colour hung under it. The sleeve plays the song; the tag
   is the way to the song's own page. ---- */
ol.wall {
  list-style: none; margin: 0; padding: 40px var(--m) 120px; background: #fff;
  --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 44px 18px;
}
/* The sleeve itself is not a size container: Safari can leave a container stuck at its old width after it changes
   columns in the grid. The face and the tag, which never do, carry the container units instead. */
ol.wall > li { margin: 0; display: flex; flex-direction: column; min-width: 0; }
ol.wall a { color: var(--k); text-decoration: none; -webkit-tap-highlight-color: transparent; }
ol.wall a[data-song] { display: flex; flex-direction: column; }
ol.wall a:focus-visible { outline: 4px solid var(--sel); outline-offset: 4px; }
.face { display: block; position: relative; aspect-ratio: 1; background: var(--c); overflow: hidden; container-type: inline-size; }
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.face svg { display: block; width: 100%; height: 100%; }
.face .ink { stroke: var(--k); stroke-width: 6; fill: none; }
.face .heard { stroke: #fff; stroke-width: 6; fill: none; }
.face .at { stroke: var(--red); stroke-width: 6; fill: none; }
.face .band { fill: var(--sel); }
.face video.loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 300ms ease; }
.face video.loop.on { opacity: 1; }

/* The song that is on: two columns wide (placed by music.js), the picture and its loop whole on the sleeve's colour.
   A wide picture keeps its shape; a tall or square one gets two rows and sits in the middle of them. */
ol.wall > li.big .face { aspect-ratio: var(--ar, 1); }
ol.wall > li.big.tall > a[data-song] { flex: 1 0 auto; }
ol.wall > li.big.tall .face { aspect-ratio: 1; max-height: 72svh; flex: 1 0 auto; }
ol.wall > li.big.tall .tag { flex: none; }
ol.wall > li.big .face img, ol.wall > li.big .face video.loop { position: absolute; inset: 0; object-fit: contain; }

/* The part heard, on a strip of clear glass over the picture: the picture shows through it blurred, the part heard is
   frosted white, and a bead of glass marks where the song is now. Press or drag on it to move the song. */
.face .glass {
  position: absolute; left: clamp(12px, 3cqi, 24px); right: clamp(12px, 3cqi, 24px); bottom: clamp(12px, 3cqi, 24px); height: 14px;
  border-radius: 999px; cursor: pointer; touch-action: none;
  background: rgb(255 255 255 / .14);
  -webkit-backdrop-filter: blur(14px) saturate(1.8) brightness(1.06); backdrop-filter: blur(14px) saturate(1.8) brightness(1.06);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), inset 0 -1px 0 rgb(0 0 0 / .14), 0 0 0 1px rgb(255 255 255 / .2);
  opacity: 0; visibility: hidden; translate: 0 10px;
  transition: opacity 300ms ease, translate 420ms var(--ease-out), visibility 0s linear 420ms;
}
.face .glass::before { content: ""; position: absolute; inset: -14px 0; }
li.is-on .face .glass { opacity: 1; visibility: visible; translate: none; transition: opacity 300ms ease 120ms, translate 420ms var(--ease-out) 120ms; }
.face .glass .fill {
  position: absolute; inset: 3px; border-radius: inherit; background: rgb(255 255 255 / .82);
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0 round 999px); transition: clip-path 260ms linear;
}
/* The bead rides on a rail as wide as its travel and is moved by a transform, so the song going on never lays the page out
   again (on an iPhone that made the page jump while it was being scrolled). */
.face .glass .knob {
  position: absolute; top: 50%; left: 13px; width: calc(100% - 26px); height: 20px; margin-top: -10px; pointer-events: none;
  transform: translateX(calc(var(--p, 0) * 100%)); transition: transform 260ms linear;
}
.face .glass .knob::before {
  content: ""; position: absolute; left: -13px; top: 0; width: 26px; height: 20px;
  border-radius: 999px; background: linear-gradient(rgb(255 255 255 / .75), rgb(255 255 255 / .35));
  -webkit-backdrop-filter: blur(6px) saturate(1.8); backdrop-filter: blur(6px) saturate(1.8);
  box-shadow: 0 0 0 .5px rgb(255 255 255 / .5), 0 2px 8px rgb(0 0 0 / .25), inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -1px 1px rgb(0 0 0 / .1);
}
@media (prefers-reduced-motion: reduce) { .face .glass, li.is-on .face .glass { translate: none; } }

.tag { display: flex; flex-direction: column; gap: 8px; flex: 1; background: var(--c); color: var(--k); padding: 14px 14px 12px; margin-top: 6px; container-type: inline-size; }
.tag .title {
  font: 700 min(var(--tmax, 34px), calc((100cqi - 2px) / var(--w))) / 0.95 var(--display); letter-spacing: -0.02em;
}
.tag .after { font-size: 16px; line-height: 1.25; }
.meta { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; font-size: 16px; line-height: 1.2; font-variant-numeric: tabular-nums; }
li.is-on .state { font-weight: bold; }

/* ---- The back room ---- */
h2.backroom {
  margin: 0; padding: 120px var(--m) 28px; background: var(--back); color: var(--hot);
  font: 700 clamp(56px, 9.4vw, 150px) / 0.86 var(--display); letter-spacing: -0.045em;
}
ol.records {
  list-style: none; margin: 0; padding: 12px var(--m) 140px; background: var(--back); color: #fff;
  container-type: inline-size; --disc: clamp(84px, 11vw, 176px); --gap: clamp(16px, 2.4vw, 40px);
}
/* The record plays the song; its name and facts are the way to the song's own page. */
ol.records > li { margin: 0; display: grid; grid-template-columns: var(--disc) minmax(0, 1fr); align-items: center; column-gap: var(--gap); padding: 10px 0; }
ol.records a { color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ol.records a[data-song] { display: block; }
ol.records a.page { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--gap); }
ol.records a:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.records .name {
  font: 700 min(7vw, calc((100cqi - var(--disc) - 2 * var(--gap) - 190px) / var(--w))) / 0.9 var(--display);
  letter-spacing: -0.04em; padding-top: 0.08em;
}
/* A record with a loop: while it plays, the clip shows through its name and the letters themselves go clear. */
.records .name { position: relative; z-index: 0; }
.records .name video.loop {
  position: absolute; z-index: -1; left: 0; top: 0; width: 0; height: 0; object-fit: cover; opacity: 0; pointer-events: none;
  filter: brightness(1.35) saturate(1.2);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  transition: opacity 400ms ease;
}
.records .name video.loop.on.cut { opacity: 1; }
/* A rim in the record's colour keeps the word readable where the clip is dark. */
.records .name:has(> video.loop.on.cut) { color: transparent; -webkit-text-stroke: 0.025em var(--c); transition: color 400ms ease; }
.records .meta { gap: 28px; font-size: 20px; margin: 0; justify-content: flex-end; color: #fff; }
.records .time { min-width: 4.5ch; text-align: right; }
.disc { display: block; width: var(--disc); height: var(--disc); }
.disc .vinyl { fill: var(--c); }
.disc .ink { stroke: var(--k); fill: none; }
.disc .heard { stroke: #fff; fill: none; }
.disc .at { stroke: var(--red); fill: none; }
.disc .band path { stroke: var(--sel); fill: none; stroke-width: 16; }
.disc .label { fill: #fff; }
.disc .hole { fill: var(--back); }

body.music footer { margin: 0; padding: 0 var(--m) 64px; background: var(--back); color: #fff; }
/* The room left under the page for the docked player is the back room's, not a strip of the front's blue. */
body.music:has(#player.docked) { padding-bottom: 0; }
body.music:has(#player.docked) footer { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }

/* ---- Feedback under the hand ---- */
@media (hover: hover) and (pointer: fine) {
  ol.wall .face { transition: transform 200ms var(--ease-out); }
  ol.wall a[data-song]:hover .face { transform: translateY(-6px); }
  ol.wall a.tag:hover .title { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }
  .records .name { transition: color 160ms ease; }
  .records a.page:hover .name { color: var(--hot); }
  .records .disc { transition: transform 260ms var(--ease-out); }
  .records a[data-song]:hover .disc { transform: rotate(-24deg); }
}
ol.wall a[data-song]:active .face { transform: translateY(-2px); transition-duration: 100ms; }

/* A record that is on turns at 33 1/3, and stops where it is when paused. */
@keyframes music-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  li.record.is-on .disc { animation: music-spin 1.8s linear infinite; animation-play-state: paused; }
  li.record.is-playing .disc { animation-play-state: running; }
  .js ol.wall > li.rise { transform: translateY(28px); }
  .js ol.wall > li.rise.in { transform: none; transition: opacity 600ms ease, transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
  .js ol.records > li.rise { transform: translateX(-32px); }
  .js ol.records > li.rise.in { transform: none; transition: opacity 600ms ease, transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
}

/* ---- Narrower ---- */
@media (max-width: 1100px) {
  ol.wall { --cols: 3; }
}
@media (max-width: 700px) {
  .front { grid-template-columns: 1fr; padding: 9vh var(--m) 28px; row-gap: 28px; }
  .front h1 { font-size: 27vw; }
  .front .lead { justify-self: start; font-size: 22px; max-width: 18ch; }
  ol.wall { --cols: 2; gap: 28px 10px; padding: 24px var(--m) 80px; }
  .tag { padding: 10px 10px 9px; gap: 6px; }
  .tag { --tmax: 22px; }
  .tag .title { font-size: min(var(--tmax), calc(100cqi / var(--w))); }
  .meta { font-size: 15px; gap: 6px; }
  .tag .after { font-size: 14px; }
  h2.backroom { padding-top: 88px; font-size: 13.5vw; }
  ol.records { --disc: 76px; --gap: 14px; padding-bottom: 96px; }
  ol.records > li { padding: 8px 0; }
  ol.records a.page { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .records .name { font-size: min(12vw, calc((100cqi - var(--disc) - var(--gap)) / var(--w))); }
  .records .meta { justify-content: flex-start; font-size: 16px; gap: 16px; }
  .records .time { text-align: left; min-width: 0; }
}

/* WebGL samples the cover once for the strip and thumb. CSS remains the fallback
   until its first frame succeeds; progress and highlights stay native elements. */
html[data-glass] .face .glass .knob::before {
  left: -22px; top: -6px; width: 44px; height: 32px;
  background: linear-gradient(rgb(255 255 255 / .16), rgb(255 255 255 / 0));
  box-shadow: 0 0 0 .5px rgb(255 255 255 / .6), 0 4px 12px rgb(0 0 0 / .3), inset 0 1.5px 0 rgb(255 255 255 / .85), inset 0 -1px 1px rgb(255 255 255 / .3), inset 2px 0 3px -1px rgb(255 80 80 / .35), inset -2px 0 3px -1px rgb(80 140 255 / .35);
}
.face .seek-glass-film { position: absolute; left: -24px; top: -12px; width: calc(100% + 48px); height: 38px; pointer-events: none; z-index: 0; }
html[data-glass] .face.seek-glass-ready .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(255 255 255 / .035); }
html[data-glass] .face.seek-glass-ready .glass :is(.fill, .knob) { z-index: 1; }
html[data-glass] .face.seek-glass-ready .glass .knob::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
