/* A song of its own (tools/song-pages.mjs): its name across the first screen on the song's colour, with its picture,
   or its waveform's bars, inside the letters (song.js cuts them out), then the picture whole with the glass strip, then the songs after it as strips of their colours. */
@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.song {
  --m: max(16px, 3vw);
  --display: "League Spartan", "Arial Narrow", Arial, sans-serif;
  --front: #0000ee;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--c);
  color: var(--k);
}
/* League Spartan for everything on the page itself; the nav and the player keep the site's Times. */
body.song main, body.song footer { font-family: var(--display); }
body.song main { padding: 0; }
/* The page never shifts itself to keep something in place while it is being scrolled. */
body.song { overflow-anchor: none; }
body.song main > * { max-width: none; }
body.song ::selection { background: var(--k); color: var(--c); }
body.song :focus-visible { outline: 3px solid var(--k); outline-offset: 3px; }
/* After a page swap site.js focuses the title for screen readers; like everywhere else on the site, it shows no ring. */
body.song h1[tabindex="-1"]:focus { outline: none; }

body.song nav { color: var(--k); position: relative; z-index: 1; }
body.song nav a, body.song nav a:visited { color: var(--k); }
body.song nav a:active { color: var(--k); text-decoration-thickness: 3px; }

/* The player keeps to the song's colour while it is closed; open, it is the site's light panel as everywhere. */
body.song #player:not(.open) {
  --ink: var(--k); --soft: var(--k); --pl-ground: var(--c);
  --pl-track: color-mix(in srgb, var(--k) 30%, var(--c));
}
body.song #player:not(.open) :focus-visible { outline-color: var(--k); }
body.song #player:not(.open) .play:hover:not(:disabled),
body.song #player:not(.open) .skip:hover:not(:disabled),
body.song #player:not(.open) .mute:hover { background: color-mix(in srgb, var(--k) 12%, var(--c)); }

/* ---- The name, with the picture inside it ---- */
.front { padding: 13vh var(--m) 44px; container-type: inline-size; overflow-x: clip; }
.front .songname {
  position: relative; isolation: isolate; margin: 0; max-width: none;
  font: 700 min(62svh, calc(100cqi / var(--w) * 0.97)) / 0.8 var(--display); letter-spacing: -0.045em;
  color: var(--k); overflow-wrap: anywhere;
}
.front .songname.one { margin-bottom: -0.07em; }
.songname .t, .word .t { transition: color 450ms ease; }
.one > .t { white-space: nowrap; }
.cut > .t { color: transparent; }
.inside {
  position: absolute; z-index: -1; left: 0; top: 0; width: 0; height: 0; overflow: hidden; display: none; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.cut > .inside { display: block; animation: show-in 450ms ease both; }
@keyframes show-in { from { opacity: 0; } }
.inside .media { position: absolute; left: 0; top: 0; will-change: transform; }
.inside img, .inside video, .inside canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.inside video, .face video { opacity: 0; transition: opacity 400ms ease; }
.inside video.on, .face video.on { opacity: 1; }

.songfacts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; margin: 20px 0 0; max-width: none; position: relative; z-index: 1;
  font-size: clamp(20px, 0.8vw + 12px, 26px); line-height: 1.2; font-variant-numeric: tabular-nums;
}
.songfacts .time { min-width: 5ch; }

/* Play is a link to the song, so it is in the link blue of the music page's front. */
a.play {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 28px 0 22px;
  background: var(--front); color: #fff; text-decoration: none; font-weight: bold;
  -webkit-tap-highlight-color: transparent;
}
a.play:visited { color: #fff; }
a.play svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
a.play .i-pause, .is-playing a.play .i-play { display: none; }
.is-playing a.play .i-pause { display: inline; }

/* ---- The picture whole, beside its tag ---- */
.whole {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 18px; align-items: stretch;
  padding: 40px var(--m) 160px;
}
.tag {
  grid-column: 1 / span 3; container-type: inline-size;
  display: flex; flex-direction: column; gap: 12px; min-height: 360px;
  background: var(--k); color: var(--c); padding: 24px 22px 22px;
}
.tag h2 {
  margin: 0 0 8px; max-width: none; font: 700 min(36px, calc(100cqi / var(--w))) / 0.95 var(--display); letter-spacing: -0.02em;
}
.tag p { margin: 0; max-width: none; font-size: 20px; line-height: 1.3; }
.tag .meta { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.is-on .tag .state { font-weight: bold; }
.tag .acts { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.tag .share {
  min-height: 52px; width: 100%; border: 0; border-radius: 0; background: var(--c); color: var(--k);
  font: 700 20px/1 var(--display); cursor: pointer;
}
.tag .share[hidden] { display: none; }
.tag .tomusic { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; color: var(--c); }
.tag .tomusic:visited { color: var(--c); }
.tag :focus-visible { outline-color: var(--c); }

.face {
  grid-column: 4 / -1; justify-self: start; align-self: start; position: relative; display: block; overflow: hidden;
  width: min(100%, calc(84svh * var(--ar))); aspect-ratio: var(--ar); background: var(--k);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.face img, .face video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* A song without a picture: its sleeve drawn from its bars, in its colour on its ink, the part heard lit as it plays. */
.face.drawn svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.face.drawn path { fill: none; stroke-width: 6; }
.face.drawn .ink { stroke: var(--c); }
.is-on .face.drawn .ink { stroke: color-mix(in srgb, var(--c) 45%, var(--k)); }
.face.drawn .heard { stroke: var(--c); }
.face.drawn .at { stroke: #ee0000; }
.whole.bare .face { display: none; }
.whole.bare .tag { grid-column: 1 / span 4; }

/* The part heard, on a strip of clear glass over the picture, as on the music page's wall. Press or drag to move the song. */
.face .glass {
  position: absolute; left: clamp(12px, 2.4%, 24px); right: clamp(12px, 2.4%, 24px); bottom: clamp(12px, 3%, 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); /* taste-skill-ignore: the music page's glass strip, a brand asset Filip asked for */
  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); /* taste-skill-ignore: the music page's glass strip, a brand asset Filip asked for */
  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: -16px 0; }
.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)); /* taste-skill-ignore: the music page's glass strip, a brand asset Filip asked for */
  -webkit-backdrop-filter: blur(6px) saturate(1.8); backdrop-filter: blur(6px) saturate(1.8); /* taste-skill-ignore: the music page's glass strip, a brand asset Filip asked for */
  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); /* taste-skill-ignore: the music page's glass strip, a brand asset Filip asked for */
}

/* ---- The way on: every other song in the running order, each a strip of its own sleeve colour and ink. The next one
   is tall, its name with its picture inside; the last strip is the music page's link-blue front. ---- */
ol.rooms { list-style: none; margin: 0; padding: 0; max-width: none; }
ol.rooms > li { margin: 0; background: var(--c); color: var(--k); }
ol.rooms a {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; column-gap: 20px; align-items: center;
  min-height: 76px; padding: 10px var(--m); color: var(--k); text-decoration: none;
  font-size: clamp(20px, 0.8vw + 12px, 26px); line-height: 1.2; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
ol.rooms a:visited { color: var(--k); }
ol.rooms a:focus-visible { outline: 3px solid var(--k); outline-offset: -6px; }
ol.rooms a > img, ol.rooms a > i { display: block; width: 56px; height: 56px; object-fit: cover; }
ol.rooms .st { font: 700 clamp(24px, 2.2vw, 34px) / 1 var(--display); letter-spacing: -0.02em; padding-top: 0.1em; overflow-wrap: anywhere; }
ol.rooms .l { min-width: 4ch; text-align: right; }
ol.rooms li.music { --c: var(--front); --k: #fff; }
ol.rooms li.music a { min-height: 124px; }

ol.rooms li.first a {
  grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto 1fr; align-items: start; row-gap: 24px;
  min-height: 40svh; padding: 22px var(--m) 30px; container-type: inline-size;
}
ol.rooms li.first .x { grid-column: 1; }
ol.rooms li.first .word {
  grid-column: 1 / -1; align-self: end; display: block; position: relative; isolation: isolate; overflow-wrap: anywhere;
  font: 700 min(28svh, calc(100cqi / var(--w) * 0.97)) / 0.86 var(--display); letter-spacing: -0.045em;
}

body.song footer { margin: 0; padding: 36px var(--m) 64px; color: var(--k); }
body.song:has(#player.docked) { padding-bottom: 0; }
body.song:has(#player.docked) footer { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }

/* ---- Under the hand ---- */
@media (hover: hover) and (pointer: fine) {
  a.play { transition: background-color 160ms ease; }
  a.play:hover { background: #0000b8; }
  .tag .share { transition: transform 160ms var(--ease-out); }
  .tag .share:hover { transform: translateY(-2px); }
  .tag .tomusic:hover { text-decoration-thickness: 3px; }
  ol.rooms a > * { transition: transform 260ms var(--ease-out); }
  ol.rooms a:hover > * { transform: translateX(10px); }
  ol.rooms a:hover .st { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }
}
a.play:active, .tag .share:active { transform: translateY(1px); }
ol.rooms a:active > * { transform: translateX(4px); }

/* ---- Motion: the parts of each section come up in turn; a still picture drifts in the letters while its song plays ---- */
@media (prefers-reduced-motion: no-preference) {
  .up-ready [data-up] { opacity: 0; transform: translateY(24px); }
  .up-ready [data-up].on { opacity: 1; transform: none; transition: opacity 600ms ease, transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
  .js ol.rooms > li.rise { opacity: 1; transform: none; }
  .js ol.rooms > li.rise > a { opacity: 0; transform: translateY(18px); }
  .js ol.rooms > li.rise.in > a { opacity: 1; transform: none; transition: opacity 500ms ease, transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
  @keyframes drift { from { scale: 1; } to { scale: 1.07; } }
  .is-playing .songname .inside img { animation: drift 16s ease-in-out infinite alternate; }
}

/* ---- Narrower ---- */
@media (max-width: 900px) {
  .whole { grid-template-columns: 1fr; row-gap: 0; padding: 32px 0 96px; }
  .face { grid-row: 1; grid-column: 1; width: 100%; max-height: none; }
  .tag { grid-row: 2; grid-column: 1; position: static; min-height: 0; padding-left: var(--m); padding-right: var(--m); }
  .whole.bare .tag { grid-column: 1; }
}
@media (max-width: 700px) {
  .front { padding: 8vh var(--m) 28px; }
  .front .songname { font-size: min(62svh, calc(100cqi / var(--w2) * 0.97)); line-height: 0.86; text-wrap: balance; }
  ol.rooms li.first .word { font-size: min(28svh, calc(100cqi / var(--w2) * 0.97)); text-wrap: balance; }
  .songfacts { gap: 12px 22px; margin-top: 24px; }
  a.play { flex-basis: 100%; justify-content: center; }
  .tag { padding-top: 20px; padding-bottom: 18px; }
  .tag h2 { font-size: min(32px, calc(100cqi / var(--w))); }
  ol.rooms a { grid-template-columns: 44px minmax(0, 1fr) auto auto; column-gap: 12px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; font-size: 17px; }
  ol.rooms a > img, ol.rooms a > i { width: 44px; height: 44px; }
  ol.rooms .st { font-size: 22px; }
  ol.rooms li.first a { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 32svh; padding-top: 18px; padding-bottom: 22px; font-size: 20px; }
  ol.rooms li.music a { min-height: 96px; }
}

/* 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; }
