/* Fløa — Music page, on top of site.css (fonts, top bar, footer, tokens).
   The releases stand on a shelf: the chosen cover faces the room, its neighbours turn away into
   the perspective, and the room takes the chosen cover's colour (--m-deep for the glow behind the
   shelf, --m-floor for the rest of the page, --m-light for accents). Below, a timeline marks every
   release at its date, and the full list, which music.js reads to build all of this, opens on
   request. Without script the list is the page. */

.music {
  --m-floor: #101211;
  --m-deep: #1d2321;
  --m-light: #a9b1ac;
  --cv: clamp(220px, 28vw, 380px);
  position: relative; isolation: isolate; overflow: hidden;
  background-color: var(--m-floor);
  transition: background-color 1.2s var(--ease);
}
.m-glow {
  position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: min(1100px, 140vh); pointer-events: none;
  background-color: var(--m-deep); transition: background-color 1.2s var(--ease);
  -webkit-mask-image: radial-gradient(60% 55% at 50% 34%, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  mask-image: radial-gradient(60% 55% at 50% 34%, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
}

.m-intro { padding-top: clamp(28px, 5vw, 52px); text-align: center; }
.m-intro h1 { font: 400 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0; max-width: none; }
.m-count { color: var(--ink-low); margin-left: 10px; }

/* ---------- shelf ---------- */
.m-stage {
  position: relative; height: calc(var(--cv) * 1.26); margin-top: clamp(20px, 3vw, 36px);
  perspective: 1400px; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.m-stage:focus-visible { outline: 0; }
.m-stage:focus-visible .m-cover.is-on img { outline: 2px solid var(--ink); outline-offset: 6px; }
.m-cover {
  all: unset; position: absolute; left: 50%; top: 0; width: var(--cv); height: var(--cv); margin-left: calc(var(--cv) / -2);
  cursor: pointer; transition: transform .7s var(--ease), opacity .7s var(--ease), filter .7s var(--ease);
}
.m-cover img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: rgba(255, 255, 255, .05);
  box-shadow: 0 30px 60px -24px #000, 0 0 0 1px rgba(255, 255, 255, .07);
  -webkit-box-reflect: below 8px linear-gradient(transparent 72%, rgba(255, 255, 255, .16));
  -webkit-user-drag: none;
}

.m-shelf { scroll-margin-top: 72px; }
/* The arrows stay level with the title when the player opens below it. */
.m-now { display: flex; align-items: flex-start; justify-content: center; gap: 20px; max-width: 820px; }
.m-now .m-step { margin-top: calc(17px + 10px + clamp(28px, 4vw, 48px) * .52 - 24px); }
.m-info { flex: 1 1 auto; min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.m-eyebrow { margin: 0; font: 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--m-light); transition: color .6s; }
.m-title { margin: 0; font: 400 clamp(28px, 4vw, 48px)/1.04 var(--mono); letter-spacing: -.035em; color: #f3f2ec; text-wrap: balance; overflow-wrap: anywhere; }
.m-meta { margin: 0; font: 13px/1.5 var(--mono); letter-spacing: .05em; color: var(--ink-muted); }
.m-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.m-links { display: contents; }

.m-listen, .m-links a, .m-toggle {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: transparent;
  display: inline-flex; align-items: center; gap: 10px; font: 13px/1 var(--mono); letter-spacing: .06em; color: var(--ink);
  text-decoration: none; cursor: pointer; transition: border-color .2s, background-color .6s;
}
.m-links a:hover, .m-toggle:hover, .m-step:hover:not(:disabled) { border-color: rgba(255, 255, 255, .5); }
.m-listen { border: 0; background: var(--m-light); color: #121313; text-transform: uppercase; letter-spacing: .08em; padding-inline: 20px; }
.m-listen[hidden] { display: none; }
.m-player { width: min(100%, 560px); margin-top: 8px; }
.m-player iframe { display: block; width: 100%; height: 152px; border: 0; border-radius: 12px; }

.m-step {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2);
  background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, opacity .2s;
}
.m-step:disabled { opacity: .3; cursor: default; }

/* ---------- timeline ---------- */
.m-timeline { margin-top: clamp(44px, 6vw, 64px); }
.m-tl-head { display: flex; justify-content: space-between; margin-bottom: 14px; font: 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-low); }
.m-ticks { position: relative; height: 64px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.m-tick { all: unset; position: absolute; bottom: 0; width: 10px; margin-left: -5px; height: 56px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.m-tick span { display: block; width: 2px; height: 16px; border-radius: 2px; opacity: .55; transition: height .4s var(--ease), opacity .4s; }
.m-tick:hover span { height: 28px; opacity: 1; }
.m-tick.is-on span { width: 3px; height: 44px; opacity: 1; }
.m-years { position: relative; height: 32px; font: 12px/1 var(--mono); letter-spacing: .06em; color: var(--ink-muted); }
.m-years span { position: absolute; top: 10px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, .18); }

/* ---------- the list ---------- */
.m-all { padding-block: clamp(36px, 5vw, 48px) clamp(56px, 8vw, 96px); }
.m-all-head { font: 400 clamp(24px, 3.2vw, 32px)/1.2 var(--mono); letter-spacing: -.02em; margin: 0 0 20px; }
.js .m-all-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.m-toggle { text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.m-toggle[hidden] { display: none; }
.m-list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.m-list[hidden] { display: none; }
.rel {
  display: grid; grid-template-columns: 44px 48px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 64px auto;
  gap: 16px; align-items: center; padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, .07);
  font: 13px/1.4 var(--mono); color: var(--ink-muted);
}
.js .rel { cursor: pointer; }
.js .rel:hover { background: rgba(255, 255, 255, .04); }
.rel-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 2px; }
.rel-title { all: unset; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.rel.is-on .rel-title { color: var(--m-light); }
.rel-with, .rel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-type { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.rel-links { display: flex; gap: 14px; justify-content: flex-end; }
.rel-links a { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-low); text-decoration: none; padding-block: 6px; }
.rel-links a:hover { color: var(--ink); }
.m-source { margin: 20px 0 0; font: 12px/1.6 var(--mono); color: var(--ink-low); letter-spacing: .03em; }

/* Tablets: the label and type columns give way. */
@media (max-width: 900px) {
  .rel { grid-template-columns: 44px 48px minmax(0, 1.6fr) minmax(0, 1fr) auto; }
  .rel-label, .rel-type { display: none; }
}
/* Phones: the shelf narrows, the arrows sit beside the title, and each list row is the cover with
   title and year, the other artists and the links beneath. */
@media (max-width: 640px) {
  .music { --cv: min(62vw, 300px); }
  /* The arrows sit on the shelf at the cover's sides, so the title and links get the full width. */
  .m-shelf { position: relative; }
  .m-now .m-step {
    position: absolute; z-index: 200; top: calc(clamp(20px, 3vw, 36px) + var(--cv) / 2 - 22px); margin: 0;
    width: 44px; height: 44px; background: rgba(10, 11, 11, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .m-now .m-step[data-step="-1"] { left: 10px; }
  .m-now .m-step[data-step="1"] { right: 10px; }
  .m-now .m-step:disabled { opacity: 0; pointer-events: none; }
  .m-links a, .m-listen { min-height: 40px; padding-inline: 14px; font-size: 12px; }
  .m-tick { width: 8px; margin-left: -4px; }
  .m-years span { font-size: 11px; padding-left: 4px; }
  .rel { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "thumb title year" "thumb with with" "thumb links links"; row-gap: 2px; column-gap: 12px; }
  .rel-thumb { grid-area: thumb; align-self: start; }
  .rel-title { grid-area: title; }
  .rel-year { grid-area: year; font-size: 12px; }
  .rel-with { grid-area: with; font-size: 12px; }
  .rel-with:empty { display: none; }
  .rel-links { grid-area: links; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .music, .m-glow, .m-cover { transition: none; }
}
