/* n1m21n / music. Brand: paper + ink + pink, Bricolage Grotesque headings, DM Mono body, 2px ink borders,
   hard pink shadow. Album and track pages override the colour variables with their cover's theme
   (site/catalog/themes.json, every text pair checked for contrast); layout never changes between albums. */
:root {
  --paper: #F1E9D2; --ink0: #0A0618; --blue: #2E3BDB; --pink: #E0368F; --spiral: #F6E27A;
  --g: var(--paper); --s: #e8dec2; --i: var(--ink0); --m: #4a4258; --a: var(--pink); --at: #a3135f; --oa: var(--ink0);
  --l: var(--pink); --lr: var(--blue);
  --vinyl: #111; --vinyl2: #1b1b1f; --sheen: rgba(255,255,255,.05);
  --r: 12px;
  --head: 'Bricolage Grotesque', system-ui, sans-serif; --mono: 'DM Mono', ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 40px); --playerh: 0px;
  color-scheme: light;
}
body[data-scheme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* a spinning record's box grows as it turns; never let it (or anything) widen the page on a phone */
html, body { overflow-x: clip; }
body { --line: color-mix(in oklab, var(--i) 85%, transparent); --sh: 5px 5px 0 var(--a); margin: 0; background: var(--g); color: var(--i); font: 400 15px/1.55 var(--mono); padding-bottom: var(--playerh);
  transition: background-color .5s ease, color .5s ease; }
a { color: inherit; text-decoration-color: color-mix(in oklab, var(--a) 70%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--at); }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; border-radius: 4px; }
/* the page title takes focus after an in-site page change (for screen readers); it is not a control, so no ring */
[tabindex="-1"]:focus { outline: none; }
h1, h2 { font-family: var(--head); font-weight: 800; font-variation-settings: 'wdth' 75; letter-spacing: -.01em; line-height: .95; margin: 0; }
h1 { font-size: clamp(44px, 8vw, 96px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 40px 0 14px; }
small { font-size: .8em; opacity: .85; }
[id] { scroll-margin-top: 80px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

/* header / footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--pad);
  border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; background: var(--g); }
.mark { font: 800 22px/1 var(--head); font-variation-settings: 'wdth' 75; text-decoration: none; }
.mark span { color: var(--at); }
.top nav { display: flex; gap: 18px; font-size: 13px; white-space: nowrap; }
.mark { white-space: nowrap; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
main { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad) 48px; }
.foot { border-top: 2px solid var(--line); padding: 20px var(--pad); font-size: 12px; color: var(--m); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--i);
  border-radius: 10px; background: var(--s); color: var(--i); font: 500 14px var(--mono); text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--i); transition: transform .08s, box-shadow .08s; }
.btn:hover { color: var(--i); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--i); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--i); }
.btn.primary { background: var(--a); color: var(--oa); border-color: var(--i); }
.btn.primary:hover { color: var(--oa); }

/* hero: sleeve with the record half out */
.hero { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: end; padding-top: clamp(24px, 5vw, 56px); }
.sleeve { position: relative; aspect-ratio: 1; margin-right: 30%; }
.head { position: relative; z-index: 3; }
.sleeve.small { max-width: 300px; }
.sleeve .cover { position: relative; z-index: 2; width: 100%; height: 100%; display: block; border: 2px solid var(--i); border-radius: 6px;
  box-shadow: var(--sh); object-fit: cover; background: var(--s); }
.record { position: absolute; inset: 3%; z-index: 1; transform: translateX(22%); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.disc { width: 100%; height: 100%; border-radius: 50%; background:
  radial-gradient(circle, transparent 0 32%, var(--sheen) 32.5%, transparent 33%),
  repeating-radial-gradient(circle, var(--vinyl) 0 1.2px, var(--vinyl2) 1.6px 2.6px); box-shadow: 0 0 0 2px var(--i); display: grid; place-items: center; }
.disc .lbl { width: 34%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--lr); position: relative; }
.disc .lbl::after { content: ''; position: absolute; inset: 44%; border-radius: 50%; background: var(--g); }
.disc .lbl img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.playing-this .record { transform: translateX(36%); }
body.playing-this .disc { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.head .kicker { margin: 0 0 12px; color: var(--m); font-size: 13px; }
.head .kicker a { color: var(--at); }
.head .by { margin: 10px 0 20px; font-size: 16px; color: var(--m); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 0; }
.native { width: 100%; max-width: 520px; margin: 0 0 16px; display: block; }
html.js .native { display: none; }

/* track lists */
.list { list-style: none; margin: 32px 0 0; padding: 0; border-top: 2px solid var(--line); }
.trk { cursor: pointer; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; gap: 4px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--i) 22%, transparent); min-height: 52px; }
.index .trk { grid-template-columns: 44px minmax(0, 1.3fr) minmax(0, 1fr) auto 44px; }
.trk .pl { width: 44px; height: 44px; border: 0; background: none; color: var(--m); cursor: pointer; display: grid; place-items: center; font: 500 13px var(--mono); }
.trk .pl svg { display: none; }
.trk:hover .pl svg, .trk.now .pl svg, .trk .pl:focus-visible svg { display: block; color: var(--at); }
.trk:hover .pl .num, .trk.now .pl .num, .trk .pl:focus-visible .num { display: none; }
.trk .tt { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 14px 0; }
.trk .tt:hover { text-decoration: underline; }
.trk .ta { color: var(--m); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.trk .ft { color: var(--m); font-size: 13px; }
.trk .ex { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; background: var(--m); color: var(--g); font-size: 10px; text-decoration: none; vertical-align: 2px; }
.trk .dur { color: var(--m); font-size: 13px; font-variant-numeric: tabular-nums; }
.trk .dl { width: 44px; height: 44px; display: grid; place-items: center; color: var(--m); }
.trk .dl:hover { color: var(--at); }
.trk.now { background: color-mix(in oklab, var(--a) 14%, transparent); }
.trk.now .tt { color: var(--at); font-weight: 500; }
.divider { margin: 28px 0 0; font-size: 12px; color: var(--m); text-transform: lowercase; }
.divider + .list { margin-top: 8px; }

/* facts */
.facts { max-width: 760px; }
.facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { color: var(--m); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .about, .facts p { max-width: 64ch; }
.credit, .note { color: var(--m); font-size: 13px; margin-top: 24px; }
.lyrics { font: inherit; white-space: pre-wrap; }
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 16px; border-top: 2px solid var(--line); font-size: 14px; }

/* track page: details beside the album's track list */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.more h2 a { text-decoration: none; }
.more .list { margin-top: 0; }
.more .trk { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
.trk.here { background: color-mix(in oklab, var(--i) 8%, transparent); }
.trk.here .tt { font-weight: 500; }

/* library */
.lib h1 { margin-top: clamp(24px, 5vw, 56px); }
.lede { max-width: 62ch; color: var(--m); margin: 16px 0 0; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 20px; }
.grid a { display: block; text-decoration: none; }
.grid img { width: 100%; height: auto; aspect-ratio: 1; display: block; border: 2px solid var(--i); border-radius: 6px; transition: transform .15s, box-shadow .15s; }
.grid a:hover img { transform: translate(-2px, -2px); box-shadow: var(--sh); }
.grid b { display: block; font: 800 20px/1 var(--head); font-variation-settings: 'wdth' 75; margin-top: 10px; }
.grid span { font-size: 12px; color: var(--m); }

/* crate (built by app.js): a wooden record crate standing sideways at an angle, front wall on the left */
.crate { display: none; }
.crate { --rs: clamp(190px, 30vw, 300px); }
html.js .crate { display: block; position: relative; isolation: isolate; /* its arrows and sleeves stay under the header and player */ height: calc(var(--rs) * 2 + 84px); margin: 28px 0 8px; overflow: hidden; outline: none; scroll-margin-top: 140px; touch-action: pan-y; }
.crate .stage { position: absolute; inset: 72px 0 0; perspective: calc(var(--rs) * 5); perspective-origin: 50% -40%; }
.crate .box { --W: calc(var(--rs) * 1.14); --D: calc(var(--rs) * 1.4); --H: calc(var(--rs) * .42);
  position: absolute; left: 50%; bottom: calc(var(--rs) * .75); width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(-8deg) rotateY(-34deg); }
.crate .w { position: absolute; bottom: 0; left: calc(var(--W) / -2); width: var(--W); height: var(--H); transform-origin: 50% 100%; box-sizing: border-box;
  border: 2px solid var(--i); background: var(--s) repeating-linear-gradient(180deg, transparent 0 calc(var(--H) / 3 - 2px), color-mix(in oklab, var(--i) 45%, transparent) calc(var(--H) / 3 - 2px) calc(var(--H) / 3)); }
.crate .front { transform: translateZ(calc(var(--D) / 2)); border-radius: 3px; }
.crate .back { transform: translateZ(calc(var(--D) / -2)); background-color: color-mix(in oklab, var(--i) 14%, var(--s)); }
.crate .side { left: calc(var(--D) / -2); width: var(--D); background-color: color-mix(in oklab, var(--i) 22%, var(--s)); }
.crate .side.l { transform: translateX(calc(var(--W) / -2)) rotateY(90deg); }
.crate .side.r { transform: translateX(calc(var(--W) / 2)) rotateY(-90deg); }
.crate .floor { height: var(--D); transform: translateZ(calc(var(--D) / 2)) rotateX(90deg); background: color-mix(in oklab, var(--i) 30%, var(--s)); }
.crate .grip { position: absolute; left: 50%; top: 22%; width: 26%; height: 22%; transform: translateX(-50%); border: 2px solid var(--i); border-radius: 999px; background: var(--i); }
.crate .rec { --T: calc(var(--rs) * .026); position: absolute; bottom: 2px; left: calc(var(--rs) / -2); width: var(--rs); height: var(--rs); padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .8, .2, 1), filter .3s; }
/* the front sleeve: a hand on it shows (hover peek on mouse), it can be pulled up (no page scroll from it), and it
   follows the hand without lag while held */
.crate .rec { touch-action: pan-y; }
.crate .rec.on { touch-action: none; }
.crate .rec.on { cursor: grab; }
.crate .rec.tipping { transition: transform .05s linear !important; }
@media (hover: hover) { .crate:not(.held) .rec.on:hover { translate: 0 calc(var(--rs) * -.05); } }
.crate .rec { translate: 0 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), translate .25s ease-out, opacity .3s; }
.crate.lifting .rec.on { transition: transform .06s linear; cursor: grabbing; }
.crate .rec.out { transition: transform .4s cubic-bezier(.3, 0, .2, 1), opacity .35s .1s; opacity: 0; }
.crate .rec img { -webkit-user-drag: none; user-select: none; }
.crate .rec img, .crate .rec .bk { position: absolute; inset: 0; width: 100%; height: 100%; border: 2px solid var(--i); border-radius: 3px; backface-visibility: hidden; }
.crate .rec img { display: block; object-fit: cover; background: var(--s); filter: brightness(var(--dim, 1)); transition: filter .3s; transform: translateZ(calc(var(--T) / 2)); }
.crate .rec .bk { transform: rotateX(180deg) translateZ(calc(var(--T) / 2)); background: linear-gradient(170deg, color-mix(in oklab, white 70%, var(--g)), color-mix(in oklab, white 35%, var(--g)) 70%, color-mix(in oklab, var(--i) 10%, var(--g)));
  box-shadow: inset 0 0 calc(var(--rs) * .08) color-mix(in oklab, var(--i) 14%, transparent); display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 8% 10%; box-sizing: border-box; text-align: left; color: var(--i); }
.crate .rec .bk b { font: 800 calc(var(--rs) * .09)/1 var(--head); font-variation-settings: 'wdth' 75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crate .rec .bk span { font: max(12px, calc(var(--rs) * .045))/1.2 var(--mono); color: var(--m); }
.crate .rec:focus-visible { outline: none; }
/* depth: each sleeve is a thin slab (front cover, back, a cardboard top edge and the side edge that faces the camera);
   kept to four planes per sleeve because iPhone Safari stops drawing when a page holds too many 3D layers. The crate's
   boards show their thickness as a heavy top border, not as separate planes: Safari mis-sorts nested 3D planes and drew
   them through the sleeves. */
.crate .rec .ed { position: absolute; box-sizing: border-box; border: 1px solid var(--i); pointer-events: none; background: color-mix(in oklab, var(--i) 18%, var(--s)); }
.crate .rec .ed.t { left: 0; top: 0; width: 100%; height: var(--T); transform-origin: 50% 0; transform: translateZ(calc(var(--T) / 2)) rotateX(-90deg); }
.crate .rec .ed.r { right: 0; top: 0; width: var(--T); height: 100%; background: color-mix(in oklab, var(--i) 30%, var(--s)); transform-origin: 100% 50%; transform: translateZ(calc(var(--T) / 2)) rotateY(-90deg); }
.crate .w:not(.floor) { border-top: calc(var(--rs) * .035) solid color-mix(in oklab, white 25%, var(--s)); box-shadow: inset 0 2px 0 var(--i), 0 -2px 0 var(--i); }
.crate:focus-visible .rec.on img { outline: 3px solid var(--a); outline-offset: 3px; }
.crate .cap { position: absolute; left: 0; right: 0; top: 0; text-align: center; padding: 0 56px; }
.crate .cap b { font: 800 clamp(26px, 4vw, 40px)/1 var(--head); font-variation-settings: 'wdth' 75; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crate .cap span { font-size: 12px; color: var(--m); }
.crate .nav { position: absolute; top: 52%; width: 44px; height: 44px; border: 2px solid var(--i); border-radius: 50%; background: var(--s); color: var(--i); cursor: pointer; z-index: 60; font: 18px var(--mono); }
.crate .nav:disabled { opacity: .35; cursor: default; }
.crate .nav.p { left: 0; } .crate .nav.n { right: 0; }

/* catalogue doc */
.doc { max-width: 820px; }
.doc h1 { margin-top: clamp(24px, 5vw, 56px); }
.doc code { background: var(--s); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.doc dd { margin: 0; }

/* player (built by app.js; themed by the album playing) */
#player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--pg, var(--paper)); color: var(--pi, var(--ink0));
  border-top: 2px solid var(--pi, var(--ink0)); padding: 8px var(--pad) calc(8px + env(safe-area-inset-bottom)); transition: background-color .5s, color .5s; }
#player .row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; max-width: 1180px; margin: 0 auto; }
#player .now { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
#player .now img { width: 52px; height: 52px; border: 2px solid currentColor; border-radius: 4px; flex: none; }
#player .now .disc { width: 52px; height: 52px; flex: none; }
#player .meta { min-width: 0; }
#player .meta b, #player .meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player .meta b { font: 800 18px/1.1 var(--head); font-variation-settings: 'wdth' 75; }
#player .meta span { font-size: 12px; color: var(--pm, var(--m)); }
#player .ctl { display: flex; align-items: center; gap: 4px; }
#player button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; position: relative; }
#player button svg { width: 22px; height: 22px; }
#player button.big { width: 52px; height: 52px; background: var(--pa, var(--pink)); color: var(--poa, var(--oa)); border: 2px solid currentColor; }
#player button.big { color: var(--poa, var(--oa)); }
#player button[aria-pressed="true"] { color: var(--pat, var(--pink)); }
#player button[aria-pressed="true"]::after { content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
#player button .badge { position: absolute; top: 6px; right: 4px; font: 500 10px var(--mono); }
#player .side { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
#player input[type=range] { width: 90px; accent-color: var(--pa, var(--pink)); }
#player .wave { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; max-width: 1180px; margin: 6px auto 0; font-size: 11px; color: var(--pm, var(--m)); font-variant-numeric: tabular-nums; }
#player canvas { width: 100%; height: 36px; display: block; cursor: pointer; touch-action: none; }
#player .q { position: absolute; right: var(--pad); bottom: calc(100% + 8px); width: min(420px, calc(100vw - 2 * var(--pad))); max-height: min(60vh, 520px); overflow: auto;
  background: var(--pg, var(--paper)); border: 2px solid currentColor; border-radius: var(--r); box-shadow: 5px 5px 0 var(--pa, var(--pink)); padding: 12px; }
#player .q h3 { font: 800 22px/1 var(--head); font-variation-settings: 'wdth' 75; margin: 4px 4px 10px; }
#player .q ol { list-style: none; margin: 0; padding: 0; }
#player .q li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
#player .q li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player .q li small { color: var(--pm); }
#player .q li.cur { background: color-mix(in oklab, var(--pa, var(--pink)) 22%, transparent); font-weight: 500; }
#player .q li:hover { outline: 1px solid currentColor; }

/* listen elsewhere: platform short links (/music/<album>/on/<service>) */
.listen .svcs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.svc { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 2px solid var(--i); border-radius: 999px;
  background: var(--s); text-decoration: none; font-size: 14px; box-shadow: 3px 3px 0 var(--i); transition: transform .08s, box-shadow .08s; }
.svc::after { content: '↗'; margin-left: 8px; color: var(--at); }
.svc:hover { color: var(--i); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--i); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .sleeve { max-width: 340px; width: 78%; }
  .sleeve.small { width: 62%; }
  .index .trk { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
  .index .trk .ta { display: none; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .facts p, .doc p, .doc li { overflow-wrap: anywhere; }
  .doc dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc dd { margin-bottom: 12px; overflow-wrap: anywhere; }
  /* phone: the album's track list first, then the details as a compact two-column list */
  .cols .more { order: -1; }
  .facts dl { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 13px; line-height: 1.35; }
  .facts dd { margin-bottom: 0; }
  .top nav { gap: 12px; font-size: 12px; }
  .mark span { display: none; }
  #player .row { grid-template-columns: minmax(0, 1fr) auto; }
  #player .side { display: none; }
  #player .ctl .opt { display: none; }
  #player .now img, #player .now .disc { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.crate .cap { transition: opacity .2s; }
.crate.lifting .cap { opacity: .15; }
@media (max-width: 600px) { .crate .nav { top: auto; bottom: 6px; } }
/* phones: two releases side by side */
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } .grid b { font-size: 17px; overflow-wrap: anywhere; } }

/* artworks */
/* edge to edge, every row full: tiles grow to close their row and crop a little rather than leave a hole */
.art { margin: 0 calc(50% - 50vw); }
.art .wall { --row: clamp(120px, 20vw, 260px); display: flex; flex-wrap: wrap; gap: 3px; }
.art .wall a { flex: var(--r) 1 calc(var(--r) * var(--row)); height: var(--row); min-width: 0; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
body:has(.art) main { padding-bottom: 0; }
body:has(.art) { overflow-x: clip; }
