/* Sound Shelf: a record shop. Crates of sleeves; play pulls the record out. */

@font-face {
  font-family: "Bungee";
  src: url("fonts/bungee-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: oklch(95.5% 0.022 82);
  --paper-2: oklch(91.5% 0.03 78);
  --board: oklch(82% 0.055 70);       /* cardboard */
  --board-edge: oklch(70% 0.06 62);
  --ink: oklch(25% 0.025 55);
  --ink-soft: oklch(43% 0.03 60);
  --line: oklch(84% 0.03 75);
  --accent: oklch(55% 0.17 40);       /* shop-sign orange: white on it is >= 4.5:1 */
  --accent-ink: oklch(98% 0.012 80);
  --accent-ring: oklch(58% 0.17 40 / 0.28);
  --sleeve-l: 77%;
  --sleeve-c: 0.105;
  --vinyl: oklch(20% 0.01 60);
  --vinyl-2: oklch(28% 0.01 60);
  --focus: oklch(50% 0.2 40);
  --now-tint: oklch(100% 0 0 / 0.12);  /* tints on the dark now-playing bar */
  --now-track: oklch(100% 0 0 / 0.18);
  --shadow: oklch(25% 0.04 60 / 0.25);
  --shadow-deep: oklch(20% 0.04 60 / 0.55);
  --h: 40;                            /* crate hue fallback; [data-h] rules set the real one */
  --band: 32px;                       /* height of a sleeve's Download band */
  --band-drop: 14%;                   /* how much darker the band is than its sleeve */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);          /* ease-out-quint */
  --display: "Bungee", "Arial Black", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(18.5% 0.014 60);
    --paper-2: oklch(22.5% 0.018 62);
    --board: oklch(33% 0.035 62);
    --board-edge: oklch(26% 0.03 60);
    --ink: oklch(94% 0.02 80);
    --ink-soft: oklch(77% 0.03 75);
    --line: oklch(32% 0.02 60);
    --accent: oklch(72% 0.15 50);
    --accent-ink: oklch(20% 0.02 50);
    --accent-ring: oklch(72% 0.15 50 / 0.3);
    --sleeve-l: 70%;
    --sleeve-c: 0.1;
    --band-drop: 7%;                  /* darker sleeves: a smaller drop keeps the text >= 5:1 */
    --vinyl: oklch(24% 0.01 60);
    --vinyl-2: oklch(34% 0.012 60);
    --focus: oklch(78% 0.15 60);
    --now-tint: oklch(0% 0 0 / 0.1);   /* the bar is light ink in dark mode */
    --now-track: oklch(0% 0 0 / 0.16);
    --shadow: oklch(0% 0 0 / 0.45);
    --shadow-deep: oklch(0% 0 0 / 0.7);
    color-scheme: dark;
  }
}
@media (pointer: coarse) { :root { --band: 42px; } }

/* Crate hues, set by data-h on sleeves, dividers and crate buttons (no inline styles). */
[data-h="42"] { --h: 42; }
[data-h="85"] { --h: 85; }
[data-h="300"] { --h: 300; }
[data-h="140"] { --h: 140; }
[data-h="20"] { --h: 20; }
[data-h="330"] { --h: 330; }
[data-h="250"] { --h: 250; }
[data-h="60"] { --h: 60; }
[data-h="200"] { --h: 200; }
[data-h="275"] { --h: 275; }
[data-h="110"] { --h: 110; }
[data-h="170"] { --h: 170; }
[data-h="355"] { --h: 355; }
[data-h="95"] { --h: 95; }
[data-h="225"] { --h: 225; }
[data-h="30"] { --h: 30; }
[data-h="155"] { --h: 155; }
[data-h="315"] { --h: 315; }
[data-h="70"] { --h: 70; }
[data-h="190"] { --h: 190; }
[data-h="5"] { --h: 5; }
[data-h="125"] { --h: 125; }
[data-h="262"] { --h: 262; }
[data-h="50"] { --h: 50; }
[data-h="212"] { --h: 212; }
[data-h="342"] { --h: 342; }
[data-h="180"] { --h: 180; }
[data-h="288"] { --h: 288; }
[data-h="238"] { --h: 238; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 110px; }  /* keep focus clear of the now-playing bar */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--body);
  padding-inline: clamp(16px, 3.5vw, 44px);
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header: the shop sign + search ---------- */

.top {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px clamp(24px, 4vw, 56px);
  align-items: end;
}
@media (max-width: 760px) { .top { grid-template-columns: 1fr; } }

.sign { position: relative; padding-bottom: 18px; }
.sign::after {                               /* the shelf plank */
  content: "";
  position: absolute; left: -8px; right: 18%; bottom: 0;
  height: 10px; border-radius: 3px;
  background: linear-gradient(var(--board), var(--board-edge));
  box-shadow: 0 5px 0 -2px var(--shadow);
}
.wordmark {
  margin: 0;
  font: 400 clamp(2.5rem, 5.6vw, 4.2rem)/0.92 var(--display);
  letter-spacing: -0.01em;
}
.wordmark .w2 {
  display: inline-block;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.04em 0.16em 0.02em;
  border-radius: 6px;
  transform: rotate(-2.5deg) translateY(-0.04em);
  box-shadow: 4px 4px 0 var(--ink);           /* the one hard shadow: it's the shop sign */
}
.tagline {
  margin: 14px 0 10px;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  color: var(--ink-soft);
}

.search { margin: 0 0 18px; }
.search-label {
  display: block;
  font: 700 0.95rem/1 var(--body);
  margin-bottom: 8px;
}
.search-box { position: relative; }
.search-icon {
  position: absolute; left: 16px; top: 50%; translate: 0 -50%;
  width: 22px; height: 22px; fill: none; stroke: var(--ink-soft); stroke-width: 2.4;
  stroke-linecap: round; pointer-events: none;
}
#q {
  width: 100%;
  font: 700 1.25rem/1.2 var(--body);
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px 50px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
#q::placeholder { color: var(--ink-soft); font-weight: 400; opacity: 0.85; }
#q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
#q::-webkit-search-cancel-button { cursor: pointer; }
.slash {
  position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  font: 700 0.85rem/1 var(--body); color: var(--ink-soft);
  border: 1.5px solid var(--line); border-radius: 6px; padding: 4px 8px;
}
#q:focus ~ .slash, #q:not(:placeholder-shown) ~ .slash { display: none; }
@media (hover: none) { .slash { display: none; } }
.search-hint { margin: 8px 2px 0; font-size: 0.92rem; color: var(--ink-soft); }
.search.typing .search-hint { visibility: hidden; }

/* ---------- layout: crates sidebar + results ---------- */

.layout {
  max-width: 1280px;
  margin: clamp(14px, 2.4vw, 24px) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 960px) {
  .layout { grid-template-columns: 228px minmax(0, 1fr); gap: 34px; align-items: start; }
}
/* The crate list stays in view while you browse, when all 30 rows (29 crates + All sounds) fit on screen. */
@media (min-width: 960px) and (min-height: 740px) and (pointer: fine) {
  .side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; overscroll-behavior: contain; }
}
.side-links { display: flex; gap: 6px; margin-bottom: 12px; }
.side-link {
  flex: 1;
  display: block;
  padding: 8px 10px;
  font: 700 0.85rem/1.15 var(--body);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-2);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.side-link span { display: block; font-weight: 400; font-size: 0.75rem; color: var(--ink-soft); }
.side-zip { background: transparent; box-shadow: inset 0 0 0 1.5px var(--board); }
@media (hover: hover) {
  .side-link:hover { background: var(--board); color: var(--ink); }
}
@media (max-width: 959px) { .side-links { display: none; } }
.picks-link {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  padding: 8px 10px;
  font: 700 0.95rem/1.2 var(--body);
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.picks-star { color: var(--accent); font-size: 1.15rem; line-height: 1; }
.picks-text { flex: 1; text-align: left; }
.picks-count { font-weight: 400; color: var(--ink-soft); }
.picks-link[aria-pressed="true"] { border-color: var(--accent); }
@media (hover: hover) { .picks-link:not([aria-pressed="true"]):hover { border-color: var(--ink); } }
@media (max-width: 959px) { .picks-link { margin: 0 0 8px; } }
.picks-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -14px 0 22px;
}
.picks-zip, .picks-clear {
  min-height: 40px;
  padding: 8px 16px;
  font: 700 0.95rem/1 var(--body);
  border-radius: 999px;
  cursor: pointer;
}
.picks-zip { color: var(--accent-ink); background: var(--accent); border: 0; }
.picks-zip span { font-weight: 400; }
.picks-zip[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.picks-clear { color: var(--ink); background: var(--paper); border: 2px solid var(--line); }
@media (hover: hover) { .picks-clear:hover { border-color: var(--ink); } }
.results-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  font: 700 0.9rem/1 var(--body);
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.tool-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tool-btn svg circle { fill: currentColor; stroke: none; }
@media (hover: hover) { .tool-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } }
@media (max-width: 520px) { .results-tools { margin-left: 0; width: 100%; } }
/* 404 page */
.lost { max-width: 560px; margin: clamp(40px, 10vh, 120px) auto 0; }
.lost h1 { font: 400 clamp(1.8rem, 5vw, 2.6rem)/1.1 var(--display); margin: 0 0 12px; }
.lost p { font-size: 1.1rem; margin: 0 0 22px; }
.lost a.home { display: inline-block; font-weight: 700; text-decoration: none; color: var(--accent-ink); background: var(--accent); padding: 12px 18px; border-radius: 12px; }

/* ---------- crates ---------- */

.side-title {
  margin: 0 0 6px;
  font: 400 0.95rem/1 var(--display);
  letter-spacing: 0.03em;
}
.crate-list { list-style: none; margin: 0; padding: 0; }
.crate {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  font: 700 0.9rem/1.2 var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 3px 10px;
  min-height: 24px;
  cursor: pointer;
  transition: background 160ms var(--ease);
}
.crate::before {                                 /* a divider tab in the crate's colour */
  content: "";
  flex: none;
  width: 11px; height: 14px;
  border-radius: 3px 3px 1px 1px;
  background: oklch(var(--sleeve-l) calc(var(--sleeve-c) + 0.03) var(--h));
}
.crate-name { flex: 1; }
.crate-count { font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }
.crate[aria-pressed="true"] {
  background: oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
  color: oklch(23% 0.045 var(--h));
}
.crate[aria-pressed="true"] .crate-count { color: inherit; opacity: 0.8; }
.crate[aria-pressed="true"]::before { background: oklch(23% 0.045 var(--h)); }
.crate.all::before { background: var(--accent); }
.crate.all[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .crate:not([aria-pressed="true"]):hover { background: var(--paper-2); } }
@media (pointer: coarse) { .crate { min-height: 44px; } }

.crate-toggle { display: none; }

@media (max-width: 959px) {
  .side-title { display: none; }
  .crate-toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 52px;
    padding: 10px 16px;
    font: inherit; text-align: left; color: var(--ink);
    background: var(--paper-2);
    border: 2px solid var(--ink);
    border-radius: 12px;
    cursor: pointer;
  }
  .crate-toggle-label { font-weight: 400; font-size: 0.9rem; color: var(--ink-soft); }
  .crate-toggle-current { flex: 1; font-weight: 700; font-size: 1.1rem; }
  .chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: rotate 200ms var(--ease); }
  .crates.open .chev { rotate: 180deg; }
  .crate-list {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
    margin-top: 8px;
    padding: 8px;
    background: var(--paper-2);
    border-radius: 12px;
    border-bottom: 8px solid var(--board);
  }
  .crates.open .crate-list { display: grid; }
  .crate { font-size: 0.92rem; padding: 7px 10px; min-height: 36px; }
}
@media (max-width: 959px) and (pointer: coarse) { .crate { min-height: 44px; } }

/* ---------- help: a panel above the results; wide screens open it from the sidebar ---------- */

.help {
  margin: 0 0 22px;
  padding: 14px 16px;
  background: var(--paper-2);
  border-radius: 12px;
  font-size: 0.95rem;
}
.help summary { cursor: pointer; font-weight: 700; }
.help ol { margin: 10px 0 12px; padding-left: 1.25em; }
.help li { margin-bottom: 5px; }
.help li::marker { font-weight: 700; color: var(--accent); }
.help-free { margin: 0 0 12px; }
.help-small { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.zip {
  display: block;
  align-self: start;
  font-weight: 700;
  text-decoration: none;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: 10px;
  transition: background 160ms var(--ease);
}
.zip span { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.8; }
@media (hover: hover) { .zip:hover { color: var(--accent-ink); background: var(--accent); } }
.help[open] { padding-bottom: 16px; }
/* Wide screens open help from the sidebar's "How to use" button; the folded bar would just repeat it. */
@media (min-width: 960px) { .help:not([open]) { display: none; } }
@media (min-width: 700px) {
  .help[open] { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 28px; align-items: start; }
  .help[open] summary { grid-column: 1 / -1; }
  .help[open] ol { grid-row: span 2; }
}
@media (max-width: 959px) { .help { padding: 12px 16px; } }
@media (max-width: 560px) {                       /* phones: get to the sounds sooner */
  .top { gap: 10px; padding-top: 14px; }
  .sign { padding-bottom: 0; }
  .sign::after { display: none; }
  .wordmark { font-size: 2.15rem; }
  .tagline { margin: 10px 0 4px; }
  .search { margin-bottom: 10px; }
  .search-hint { display: none; }
}

/* ---------- results: the bin of sleeves ---------- */

main { min-width: 0; padding-bottom: 96px; }
main:focus { outline: none; }
.results-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 2px 0 26px;
}
.results-title { margin: 0; font: 400 clamp(1.2rem, 2.2vw, 1.5rem)/1.1 var(--display); }
.results-title.quiet { font: 700 clamp(1.15rem, 1.8vw, 1.3rem)/1.1 var(--body); }
.results-count { margin: 0; color: var(--ink-soft); font-weight: 700; }
.results-note { margin: -16px 0 24px; color: var(--ink-soft); font-size: 0.95rem; }
/* A playing record rises out of the first row: keep the title and buttons drawn above it. */
.results-head, .results-note, .picks-bar { position: relative; z-index: 3; }

.sort {
  display: inline-flex;
  padding: 3px; gap: 2px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.sort button {
  min-height: 34px;
  padding: 5px 13px;
  font: 700 0.9rem/1 var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.sort button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (pointer: coarse) { .sort button { min-height: 42px; } }


.bin {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(118px, 9.4vw, 140px), 1fr));
  gap: clamp(24px, 2.6vw, 30px) clamp(10px, 1.2vw, 14px);
}
@media (max-width: 560px) {
  .bin { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 10px; }
}

.sleeve {
  position: relative;
  aspect-ratio: 1;
  isolation: isolate;
  animation: arrive 260ms var(--ease) both;
  /* No content-visibility here: its paint containment would clip the record peeking out. */
}
@media (max-width: 560px) { .sleeve { aspect-ratio: 6 / 5; } }
@keyframes arrive { from { opacity: 0; translate: 0 8px; } }
.bin.calm .sleeve { animation: none; }          /* no re-entrance on every keystroke */
.bin > :nth-child(2) { animation-delay: 10ms; }
.bin > :nth-child(3) { animation-delay: 20ms; }
.bin > :nth-child(4) { animation-delay: 30ms; }
.bin > :nth-child(5) { animation-delay: 40ms; }
.bin > :nth-child(6) { animation-delay: 50ms; }
.bin > :nth-child(7) { animation-delay: 60ms; }
.bin > :nth-child(8) { animation-delay: 70ms; }
.bin > :nth-child(9) { animation-delay: 80ms; }
.bin > :nth-child(10) { animation-delay: 90ms; }
.bin > :nth-child(11) { animation-delay: 100ms; }
.bin > :nth-child(12) { animation-delay: 110ms; }
.bin > :nth-child(13) { animation-delay: 120ms; }
.bin > :nth-child(14) { animation-delay: 130ms; }
.sleeve::before {                                /* soft shadow under the whole sleeve */
  content: ""; position: absolute; inset: 0; z-index: -2;
  border-radius: 6px;
  box-shadow: 0 10px 16px -12px var(--shadow-deep);
}

/* the record: peeks out of the sleeve; slides up and spins while playing */
.record {
  position: absolute; z-index: -1;
  left: 9%; top: 4%; width: 82%; aspect-ratio: 1;
  translate: 0 -11%;
  transition: translate 520ms var(--ease);
  pointer-events: none;
}
.record i {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, var(--vinyl) 0 2.5%, oklch(var(--sleeve-l) calc(var(--sleeve-c) + 0.06) var(--h)) 3% 22%,
                    var(--vinyl) 22.5% 24%, transparent 24.5%),
    repeating-radial-gradient(circle, var(--vinyl) 0 2px, var(--vinyl-2) 2.5px 3px),
    var(--vinyl);
  box-shadow: inset 0 0 0 2px var(--vinyl-2), 0 0 0 2.5px oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
}
.record i::after {                          /* sheen, so the spin reads */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 18%, oklch(100% 0 0 / 0.16) 24%, transparent 32% 68%, oklch(100% 0 0 / 0.1) 74%, transparent 82%);
}
.sleeve.playing { z-index: 2; }
.sleeve.playing .record { translate: 0 -52%; }
.sleeve.playing .record i { animation: spin 1.8s linear infinite; }
.sleeve.loading .record i { animation-duration: 5s; }   /* still fetching: a slow turn */
.sleeve.loading .hole { animation: wait 1s ease-in-out infinite alternate; }
@keyframes wait { to { opacity: 0.55; } }
@keyframes spin { to { rotate: 1turn; } }

.play {
  position: absolute; inset: 0 0 var(--band) 0;
  display: flex; flex-direction: column; justify-content: space-between;
  width: 100%;
  padding: 9px 10px 8px;
  text-align: left;
  font: inherit;
  color: oklch(23% 0.045 var(--h));
  border: 0;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  background:
    linear-gradient(135deg, oklch(100% 0 0 / 0.22), transparent 42%),
    repeating-linear-gradient(-45deg, transparent 0 9px, oklch(0% 0 0 / 0.025) 9px 10px),
    oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
  box-shadow: inset 0 0 0 1px oklch(0% 0 0 / 0.07);
  transition: translate 220ms var(--ease);
}
.sleeve-crate {
  font: 700 0.72rem/1.2 var(--body);
  opacity: 0.8;
  max-width: calc(100% - 38px);
}
.bin.grouped .sleeve-crate { visibility: hidden; }
.wave {
  display: block;
  height: 20px;
  margin: 2px 0;
  fill: none;
  stroke: oklch(23% 0.045 var(--h) / 0.42);
  stroke-width: 0.62;
  stroke-linecap: round;
}
.sleeve.playing .wave { stroke: oklch(23% 0.045 var(--h) / 0.75); }
.player-hint {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  color: oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
  background: oklch(23% 0.045 var(--h) / 0.85);
  vertical-align: 1px;
  cursor: help;
}
.sleeve-name {
  font-weight: 700;
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.sleeve-name.long { font-size: clamp(0.88rem, 1vw, 0.95rem); }   /* "Confirmation 2" fits on one line */
.sleeve-dur { display: block; font-weight: 400; font-size: 0.8rem; opacity: 0.8; margin-top: 2px; }

/* die-cut hole with the play / stop glyph */
.hole {
  position: absolute; right: 9px; top: 9px;
  width: 30px; height: 30px; border-radius: 50%;
  background: oklch(23% 0.045 var(--h) / 0.9);
  display: grid; place-items: center;
  transition: scale 200ms var(--ease);
}
.hole::before {                                  /* play triangle */
  content: "";
  width: 0; height: 0; margin-left: 3px;
  border-left: 10px solid oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
  border-block: 6px solid transparent;
}
.sleeve.playing .hole::before {                  /* stop square */
  width: 9px; height: 9px; margin: 0; border: 0; border-radius: 2px;
  background: oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
}

/* the band along the bottom of the sleeve: Download, and a Pick star */
.band {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: var(--band);
  display: flex;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  background: oklch(calc(var(--sleeve-l) - var(--band-drop)) calc(var(--sleeve-c) + 0.02) var(--h));
  transition: translate 220ms var(--ease);
}
.pick {
  flex: none;
  width: calc(var(--band) + 6px);
  font: 700 1.05rem/1 var(--body);
  color: oklch(20% 0.045 var(--h) / 0.75);
  background: none;
  border: 0;
  border-left: 1px solid oklch(20% 0.045 var(--h) / 0.15);
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.pick[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }
.pick:focus-visible { outline-offset: -3px; outline-color: oklch(20% 0.045 var(--h)); }
.dl {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 0.85rem/1 var(--body);
  text-decoration: none;
  color: oklch(17% 0.045 var(--h));
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.dl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dl:focus-visible { outline-offset: -3px; outline-color: oklch(var(--sleeve-l) var(--sleeve-c) var(--h)); color: oklch(var(--sleeve-l) var(--sleeve-c) var(--h)); background: oklch(23% 0.045 var(--h)); }

@media (hover: hover) {
  .sleeve:not(.playing):hover .record { translate: 0 -19%; }
  .sleeve:hover .play, .sleeve:hover .band { translate: 0 -3px; }
  .pick:hover { color: var(--accent-ink); background: var(--accent); }
  .sleeve:hover .hole { scale: 1.08; }
  .dl:hover { color: oklch(var(--sleeve-l) var(--sleeve-c) var(--h)); background: oklch(23% 0.045 var(--h)); }
}
.sleeve.playing .play, .sleeve.playing .band { translate: 0 2px; }

/* placeholder sleeves while the catalogue loads */
.sleeve.skeleton {
  background: var(--paper-2);
  border-radius: 6px;
  animation: none;
}
.sleeve.skeleton::before { box-shadow: none; }
.sleeve.skeleton::after {
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  background-image: linear-gradient(100deg, transparent 30%, oklch(100% 0 0 / 0.35) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: shimmer 1.4s linear infinite;
}
@media (prefers-color-scheme: dark) {
  :root .sleeve-dur, :root .sleeve-crate, :root .divider-count { opacity: 0.9; }
  .sleeve.skeleton::after { background-image: linear-gradient(100deg, transparent 30%, oklch(100% 0 0 / 0.06) 50%, transparent 70%); }
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* crate divider cards between groups in the All sounds view */
.divider {
  grid-column: 1 / -1;
  display: flex; align-items: flex-end;
  margin: 6px 0 -12px;
  border-bottom: 5px solid oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
}
.divider:first-child { margin-top: 0; }
.divider-title { margin: 0; font: inherit; }
.divider-tab {
  display: inline-flex; align-items: baseline; gap: 10px;
  min-height: 40px;
  padding: 10px 16px 7px;
  font: inherit;
  color: oklch(23% 0.045 var(--h));
  background: oklch(var(--sleeve-l) var(--sleeve-c) var(--h));
  border: 0;
  border-radius: 10px 10px 0 0;
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  cursor: pointer;
}
.divider-name { font: 400 clamp(0.9rem, 1.5vw, 1rem)/1.1 var(--display); letter-spacing: 0.02em; }
.divider-count { font-weight: 700; font-size: 0.9rem; opacity: 0.75; }
@media (hover: hover) {
  .divider-tab:hover .divider-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
}

/* ---------- empty, loading, more ---------- */

.empty { max-width: 48ch; padding: 10px 0; font-size: 1.1rem; }
.empty h3 { font: 400 1.3rem/1.2 var(--display); margin: 0 0 10px; }
.empty p { margin: 0 0 12px; }
.empty .tries { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.empty button {
  font: 700 1rem/1 var(--body); color: var(--ink); cursor: pointer;
  background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px;
  padding: 9px 15px; min-height: 40px;
}
@media (hover: hover) { .empty button:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } }
.more { height: 1px; }
.noscript { font-size: 1.1rem; }

/* ---------- now playing ---------- */

.now {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 20;
  width: min(460px, calc(100% - 32px));
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 10px 14px 16px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 16px;
  box-shadow: 0 12px 28px -10px var(--shadow-deep);
  animation: rise 260ms var(--ease) both;
}
@keyframes rise { from { opacity: 0; translate: -50% 12px; } }
.now-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.98rem; }
.now-stop {
  min-height: 40px; padding: 8px 16px;
  font: 700 0.95rem/1 var(--body);
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 999px; cursor: pointer;
}
.now-loop {
  min-height: 40px; padding: 8px 12px;
  font: 700 0.9rem/1 var(--body);
  color: var(--paper); background: var(--now-tint);
  border: 0; border-radius: 999px; cursor: pointer;
}
.now-loop[aria-pressed="true"] { color: var(--ink); background: var(--paper); }
.now-bar { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--now-track); overflow: hidden; }
.now-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.now-eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.now-eq i { width: 4px; height: 100%; border-radius: 2px; background: var(--accent); animation: eq 0.9s ease-in-out infinite; transform-origin: bottom; }
.now-eq i:nth-child(2) { animation-delay: 0.15s; }
.now-eq i:nth-child(3) { animation-delay: 0.3s; }
.now :focus-visible { outline-color: var(--paper); }
@keyframes eq { 50% { transform: scaleY(0.35); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sleeve.playing .record { translate: 0 -52%; }
}
