/* trackstack: the burned-CD binder, the visor sleeves and the zip-up cases.
 *
 * Before streaming, friends passed music around as CD-Rs with the title in
 * Sharpie: a few loose in the car's visor organizer, whole mixes zipped into a
 * case. trackstack is that habit, so this page is those objects. Single songs
 * live in each person's VISOR SLEEVE; a shared playlist is a ZIP-UP CASE that
 * opens onto pocket pages. Search and sort sit above all of it and reach every
 * disc at once: the objects are how the stack is kept, the finder is how it is
 * used.
 *
 * Two faces: Permanent Marker for what is handwritten (disc titles, case
 * labels, names on sleeves), Atkinson Hyperlegible for everything you read and
 * click. Motion only answers a hand: a disc lifts when pointed at, a case
 * unzips when opened. prefers-reduced-motion turns all of it off.
 */

@font-face { font-family: "Marker"; src: url("/trackstack/fonts/PermanentMarker-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/trackstack/fonts/AtkinsonHyperlegible-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/trackstack/fonts/AtkinsonHyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/trackstack/fonts/AtkinsonHyperlegible-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --felt: #c9c4d3;        /* the page: the organizer's lining */
  --felt-deep: #b2abc0;   /* its seams */
  --nylon: #27252b;       /* the cases and sleeves: black nylon */
  --nylon-hi: #35323a;
  --stitch: #a9a4b2;      /* white-ish stitching on the nylon */
  --teeth: #8d8996;       /* zipper teeth */
  --ink: #1d1a24;         /* Sharpie black */
  --ink-soft: #4a4456;    /* secondary text on felt (7.5:1 on --felt) */
  --paper: #fbf8f1;       /* labels and insert cards */
  --red: #c8102e;         /* Sharpie red: votes, and only votes */
  --pen: #2340c4;         /* ballpoint blue: links and focus */
  --film: rgba(255, 255, 255, .22);
  --film-edge: rgba(255, 255, 255, .72);
  --marker: "Marker", "Comic Sans MS", cursive;
  --read: "Atkinson", system-ui, sans-serif;
  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2.4rem, 6vw, 3.8rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.035) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--read);
}
a { color: var(--pen); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--paper); padding: .5rem .8rem; z-index: 10; }
.skip:focus { top: 1rem; }
code { font: 600 .9em/1 ui-monospace, Consolas, monospace; background: rgba(255,255,255,.45); padding: .1em .35em; border-radius: 3px; }
button { font: inherit; color: inherit; }

.top, .finder, main, .foot { width: min(1200px, 100% - 2rem); margin-inline: auto; }

/* ---- header ------------------------------------------------------------- */
.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; padding-block: 2.2rem 1rem; }
.wordmark { margin: 0; font: 400 var(--step-3)/1 var(--marker); transform: rotate(-2deg); transform-origin: left bottom; }
.wordmark a { color: inherit; text-decoration: none; }
.tabs { display: flex; gap: .4rem; }
.tabs a { padding: .45rem .9rem; border-radius: 999px; color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink-soft); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- the finder: search and sort, always first -------------------------- */
.finder {
  position: sticky; top: 0; z-index: 5;
  padding: .8rem 0 .7rem;
  background: color-mix(in srgb, var(--felt) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--felt-deep);
}
.search input {
  width: 100%;
  font: inherit; font-size: var(--step-1); color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: .7rem 1rem;
}
.search.small input { font-size: var(--step-0); padding: .5rem .75rem; border-width: 1.5px; border-radius: 8px; }
.pickers { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem .8rem; margin-top: .65rem; }
.pick { display: grid; gap: .15rem; font-size: var(--step--1); color: var(--ink-soft); flex: 1 1 8rem; }
.pick select {
  width: 100%; font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--ink-soft); border-radius: 6px; padding: .45rem .6rem;
}
.view { display: flex; border: 1.5px solid var(--ink-soft); border-radius: 6px; overflow: hidden; }
.view button { padding: .45rem .85rem; border: 0; background: var(--paper); cursor: pointer; }
.view button + button { border-left: 1.5px solid var(--ink-soft); }
.view button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tally { margin: .5rem 0 0; font-size: var(--step--1); color: var(--ink-soft); min-height: 1.3em; }
.tally button { border: 0; background: none; color: var(--pen); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }

main { padding: 1.4rem 0 3rem; }
main:focus { outline: none; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .8rem; }
.shelf-head:first-child { margin-top: 0; }
.shelf-head h2 { margin: 0; font-size: var(--step-1); }
.shelf-head p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }

/* ---- a disc (unchanged from the binder) --------------------------------- */
.disc {
  --art: none;
  position: relative; aspect-ratio: 1; border-radius: 50%;
  container-type: inline-size;
  background:
    radial-gradient(circle, transparent 0 24.5%, rgba(255,255,255,.75) 24.5% 25.3%, transparent 25.3%),
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.85), rgba(255,255,255,0) 38%),
    conic-gradient(from 200deg, #dfe2e9, #c5d2ec, #e9d1e8, #cfe9da, #eee4c3, #dcdfe7, #c4d0ee, #e6cfe4, #d3ebdb, #dfe2e9);
  box-shadow: inset 0 0 0 1px rgba(29,26,36,.18), inset 0 0 0 4px rgba(255,255,255,.35), 0 2px 3px rgba(29,26,36,.25);
  -webkit-mask: radial-gradient(circle, transparent 0 7%, #000 7.4%);
          mask: radial-gradient(circle, transparent 0 7%, #000 7.4%);
}
.disc::before {
  content: ""; position: absolute; inset: 25.5%; border-radius: 50%;
  background: var(--art) center / cover no-repeat, #d6d3dd;
  box-shadow: 0 0 0 1px rgba(29,26,36,.2);
  -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 31%);
          mask: radial-gradient(circle, transparent 0 30%, #000 31%);
}
.disc.no-art::before { background: none; box-shadow: none; }

/* A Spotify song: a jewel case. The cover whole and square behind the
   plastic (Spotify: never cropped, animated, or written on), the title on the
   spine strip below it, and nothing that moves. */
.disc.jewel {
  border-radius: 4px; aspect-ratio: 1 / 1.12; -webkit-mask: none; mask: none;
  background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.12) 40%, rgba(255,255,255,.3)), #1d1a24;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 2px 3px rgba(29,26,36,.3);
}
.disc.jewel::before {
  inset: 5% 5% auto; aspect-ratio: 1; height: auto; border-radius: 4px; -webkit-mask: none; mask: none;
  background: var(--art) center / contain no-repeat, #2c2833;
}
.disc.jewel .scrawl { top: auto; bottom: 1.5%; left: 6%; right: 6%; transform: none; color: #f2f0f5; -webkit-line-clamp: 1; font-size: clamp(.5rem, 6.5cqi, 1rem); }
.disc.jewel .from { display: none; }
.pocket .disc.jewel, .result > button:hover .disc.jewel, .result > button:focus-visible .disc.jewel { transform: none; transition: none; }
.pocket:has(.jewel)::after { display: none; } /* no sleeve film across Spotify's art */
.deck-disc .disc.jewel, .deck-disc.spinning .disc.jewel { animation: none; }
.credit { margin: -.4rem 0 1rem; font-size: var(--step--1); color: var(--ink-soft); }
.credit:empty { display: none; }
.heat { font-weight: 700; }
.src { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.scrawl, .from { position: absolute; left: 20%; right: 20%; text-align: center; font-family: var(--marker); color: var(--ink); line-height: 1.05; pointer-events: none; }
.scrawl { top: 11%; font-size: clamp(.55rem, 8cqi, 1.35rem); transform: rotate(-5deg); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scrawl.long { font-size: clamp(.5rem, 6.2cqi, 1.05rem); }
.from { bottom: 9%; font-size: clamp(.55rem, 5.4cqi, .95rem); transform: rotate(3deg); color: #3b3542; }
.disc.bare .scrawl, .disc.bare .from { display: none; }

/* ---- zip-up cases ------------------------------------------------------- */
.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.case-card > button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
/* The closed case: black nylon, zipper teeth round three sides, a pull at the
   corner and a paper label written in marker. */
.case-shut {
  position: relative; aspect-ratio: 1 / 1.08;
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--nylon-hi), var(--nylon) 60%);
  box-shadow: 0 10px 18px rgba(29,26,36,.32), inset 0 1px 0 rgba(255,255,255,.12);
  overflow: hidden;
}
.case-shut::before { /* the zipper */
  content: ""; position: absolute; inset: 7px 7px 7px -10px;
  border: 4px dashed var(--teeth); border-left: 0; border-radius: 0 14px 14px 0;
}
.case-shut::after { /* the stitching inside it */
  content: ""; position: absolute; inset: 17px 17px 17px 10px;
  border: 1.5px dashed rgba(169,164,178,.55); border-radius: 10px;
}
.pull {
  position: absolute; right: 2px; top: 30%; width: 14px; height: 34px; z-index: 2;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(90deg, #8e8b95, #e3e1e8 45%, #9a97a2);
  box-shadow: 0 2px 3px rgba(0,0,0,.35);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.case-card > button:hover .pull, .case-card > button:focus-visible .pull { transform: translateY(10px) rotate(-8deg); }
.case-label {
  position: absolute; left: 14%; right: 18%; top: 34%; z-index: 1;
  padding: .55rem .6rem;
  background: var(--paper); color: var(--ink);
  font: 400 clamp(1rem, 4.2vw, 1.5rem)/1.05 var(--marker);
  text-align: center; transform: rotate(-2.5deg);
  box-shadow: 0 2px 4px rgba(0,0,0,.35);
  overflow-wrap: anywhere;
}
.case-peek { /* a few discs showing at the open edge, so a case says what is inside */
  position: absolute; left: 12%; bottom: 7%; z-index: 1; display: flex;
}
.case-peek .disc { width: 3.1rem; margin-right: -1.4rem; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.case-caption { margin: .6rem 0 0; }
.case-caption .n { font-weight: 700; }
.case-caption .by { display: block; color: var(--ink-soft); font-size: var(--step--1); }

/* ---- visor sleeves ------------------------------------------------------ */
.sleeves { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.visor {
  position: relative; padding: .7rem .9rem 1rem;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px),
    linear-gradient(170deg, var(--nylon-hi), var(--nylon));
  box-shadow: 0 8px 16px rgba(29,26,36,.3);
  color: #ece9f2;
}
.visor::after { content: ""; position: absolute; inset: 6px; border: 1.5px dashed rgba(169,164,178,.55); border-radius: 10px; pointer-events: none; }
.visor-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: .2rem; }
.visor-name { font: 400 var(--step-1)/1.1 var(--marker); color: #fff; }
.visor-head button { border: 0; background: none; color: #d8d4e2; text-decoration: underline; cursor: pointer; font-size: var(--step--1); padding: 0; }
/* The slots: narrow pockets side by side, each disc riding up out of its
   pocket, the next one overlapping it -- the organizer clipped to a visor. */
.slots { position: relative; z-index: 1; display: flex; padding: 1.6rem 3.6rem 0 .3rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
/* The pocket front: ONE band across the whole sleeve, stitched into narrow
   pockets every 3.3rem, so the empty pockets read as empty pockets. */
.slots::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3.2rem; z-index: 3; pointer-events: none;
  min-width: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(3.3rem - 1.5px), rgba(169,164,178,.55) calc(3.3rem - 1.5px) 3.3rem),
    linear-gradient(180deg, #3b3840, var(--nylon) 70%);
  background-position: .3rem 0, 0 0;
  border-top: 1.5px dashed rgba(169,164,178,.75);
  box-shadow: 0 -3px 6px rgba(0,0,0,.35);
}
.slot { position: relative; flex: 0 0 auto; width: 3.3rem; height: 7.4rem; }
.slot > button {
  position: absolute; left: 0; top: 0; width: 6.6rem; padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.slot > button:hover, .slot > button:focus-visible { transform: translateY(-1.2rem) rotate(-3deg); z-index: 2; }
.slot.more { width: 6rem; }
.slot.more > button {
  width: 5.4rem; height: 5.4rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff; font: 400 var(--step-0)/1.1 var(--marker); border: 1.5px dashed var(--stitch);
}

/* ---- results: discs in sleeves, or a list ------------------------------- */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.result > button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.pocket { position: relative; padding: 3% 8% 0; border-radius: 8px 8px 0 0; background: rgba(255,255,255,.16); border: 1px solid var(--film-edge); border-bottom: 0; overflow: hidden; }
.pocket::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(180deg, var(--film-edge) 0 2px, var(--film) 2px); pointer-events: none; }
.pocket .disc { transition: transform .35s cubic-bezier(.2,.8,.2,1); transform: translateY(20%); }
.result > button:hover .disc, .result > button:focus-visible .disc { transform: translateY(5%); }
.insert { background: var(--paper); border: 1px solid var(--film-edge); border-top: 0; border-radius: 0 0 8px 8px; padding: .7rem .8rem .75rem; box-shadow: 0 1px 0 var(--felt-deep); }
.insert .t { margin: 0; font-weight: 700; line-height: 1.25; }
.insert .a { margin: 0; color: var(--ink-soft); }
.insert .note { margin: .45rem 0 0; font-style: italic; overflow-wrap: anywhere; }
.insert .by, .insert .where { margin: .45rem 0 0; font-size: var(--step--1); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.vote { color: var(--red); font-family: var(--marker); font-size: 1.05em; letter-spacing: .02em; }
.repeat { display: inline-block; margin-top: .45rem; font-size: var(--step--1); padding: .05rem .45rem; border: 1.5px dashed var(--ink-soft); border-radius: 4px; }
mark { background: #ffe58a; color: inherit; padding: 0 .1em; border-radius: 2px; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--felt-deep); }
.rows li { border-bottom: 1.5px solid var(--felt-deep); }
.rows button { width: 100%; display: grid; align-items: center; gap: .3rem 1rem; grid-template-columns: 3rem minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr) 4rem; padding: .55rem .4rem; border: 0; background: none; text-align: left; cursor: pointer; }
.rows button:hover { background: rgba(255,255,255,.28); }
.rows .disc { width: 3rem; }
.rows .t { font-weight: 700; }
.rows .muted { color: var(--ink-soft); }
.rows .n { text-align: right; }
.rows-head { display: grid; gap: 1rem; grid-template-columns: 3rem minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr) 4rem; padding: 0 .4rem .3rem; font-size: var(--step--1); color: var(--ink-soft); }
.rows-head .n { text-align: right; }

.state { margin: 3rem auto; max-width: 46ch; text-align: center; font-size: var(--step-1); }
.state button { font-size: var(--step-0); margin-top: 1rem; padding: .5rem 1rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper); cursor: pointer; }

/* ---- dialogs ------------------------------------------------------------ */
dialog { width: min(1040px, 100% - 2rem); max-height: min(94vh, 100% - 2rem); padding: 0; border: 0; border-radius: 14px; background: var(--felt); color: var(--ink); box-shadow: 0 30px 80px rgba(29,26,36,.45); }
dialog::backdrop { background: rgba(29,26,36,.55); }
.close { position: absolute; top: .8rem; right: .8rem; font-size: var(--step--1); padding: .35rem .7rem; border: 1.5px solid var(--ink-soft); border-radius: 6px; background: var(--paper); cursor: pointer; z-index: 3; }

/* ---- an open case ------------------------------------------------------- */
.case-dialog { background: var(--nylon); color: #ece9f2; overflow-x: hidden; } /* the lid swings out past the edge */
.case-open { position: relative; padding: 1.3rem 1.4rem 1.2rem; }
.case-head { display: flex; justify-content: space-between; gap: 1rem; padding-right: 7rem; }
.case-head h2 { margin: 0; font: 400 var(--step-2)/1.1 var(--marker); color: #fff; overflow-wrap: anywhere; }
.case-meta { margin: .3rem 0 0; color: #cfcad9; font-size: var(--step--1); }
.case-dialog .close { background: #ece9f2; color: var(--ink); border-color: #ece9f2; }
.case-tools { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem .9rem; margin: .9rem 0 1rem; }
.case-tools .search { flex: 2 1 14rem; }
.case-tools .pick { flex: 1 1 9rem; color: #cfcad9; }
.case-tools .out, .deck-actions .out { color: inherit; }
.case-tools .out { padding: .45rem .9rem; border: 1.5px solid var(--stitch); border-radius: 999px; text-decoration: none; }
.shell { position: relative; perspective: 1800px; }
.spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; padding: 1rem; border-radius: 12px; background: #1d1b21; box-shadow: inset 0 2px 10px rgba(0,0,0,.6); }
.spread::before { /* the spine between the pages */
  content: ""; grid-column: 1 / -1; grid-row: 1; justify-self: center; width: 10px; height: 100%; margin: 0;
  background: linear-gradient(90deg, #121014, #2c2930, #121014); border-radius: 4px; pointer-events: none;
}
.page { grid-row: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: .6rem; border-radius: 8px; background: rgba(255,255,255,.03); }
.page:first-of-type { grid-column: 1; } .page:last-of-type { grid-column: 2; }
.pocket-slot { position: relative; border-radius: 10px; padding: 6%; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.22); }
.pocket-slot > button { display: block; width: 100%; max-width: 10.5rem; margin-inline: auto; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.pocket-slot > button:hover, .pocket-slot > button:focus-visible { transform: scale(1.04) rotate(-4deg); }
.pocket-slot .cap { display: block; margin-top: .35rem; font-size: var(--step--1); color: #d8d4e2; text-align: center; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pocket-slot.empty { background: rgba(255,255,255,.03); border-style: dashed; min-height: 6rem; }
.lid { /* the case's front cover, swung open on its hinge */
  position: absolute; inset: 0; border-radius: 12px; transform-origin: left center; backface-visibility: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--nylon-hi), var(--nylon) 60%);
  border: 4px dashed var(--teeth);
  display: grid; place-items: center;
  transform: rotateY(-178deg); opacity: 0; pointer-events: none;
}
.lid-label { padding: .8rem 1.2rem; background: var(--paper); color: var(--ink); font: 400 var(--step-2)/1.05 var(--marker); transform: rotate(-2.5deg); max-width: 70%; text-align: center; }
/* Opening a case is three beats, about two seconds (Michael, 2026-10-25: the
   first version was "too fast, too little frames"):
     1. unzip   0.00-1.00s  the pull runs the whole way round the edge, and the
                            opened seam draws in behind it
     2. swing   1.05-2.15s  the lid lifts off, swings through 90 degrees and
                            settles open, with waypoints so it reads as a motion
     3. reveal  1.30-2.20s  the pages come up to full light as the lid clears
   Closing plays it backwards: swing shut, then zip up (JS waits 1.7s).
   The lid holds its closed pose during the unzip (fill: both). */
.zip-pull {
  position: absolute; z-index: 2; width: 16px; height: 30px; margin: -15px 0 0 -8px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(90deg, #8e8b95, #eeedf2 45%, #9a97a2);
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
  offset-path: inset(0 round 12px); offset-distance: 0%; offset-rotate: auto 90deg;
}
.zip-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.zip-trail rect { fill: none; stroke: rgba(201,196,211,.9); stroke-width: 6; /* the pale lining showing where it's open */ stroke-dasharray: 100 100; stroke-dashoffset: 100; vector-effect: non-scaling-stroke; }
.shell.opening .zip-pull       { animation: unzip 1s cubic-bezier(.55,.1,.35,1) both; }
.shell.opening .zip-trail rect { animation: seam 1s cubic-bezier(.55,.1,.35,1) both; }
.shell.opening .lid            { animation: lid-swing 1.1s cubic-bezier(.45,.05,.25,1) 1.05s both; }
.shell.opening .spread         { animation: pages-in .9s ease-out 1.3s both; }
.shell.closing .lid            { animation: lid-swing .95s cubic-bezier(.6,0,.6,.95) reverse both; }
.shell.closing .zip-pull       { animation: unzip .7s ease-in-out .95s reverse both; }
.shell.closing .zip-trail rect { animation: seam .7s ease-in-out .95s reverse both; }
@keyframes unzip { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes seam  { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes lid-swing {
  0%   { transform: rotateY(0);                         opacity: 1; box-shadow: 0 0 0 rgba(0,0,0,0); }
  12%  { transform: rotateY(-7deg) translateZ(16px);    opacity: 1; box-shadow: 8px 10px 24px rgba(0,0,0,.45); }
  35%  { transform: rotateY(-48deg) translateZ(34px);   opacity: 1; }
  55%  { transform: rotateY(-95deg) translateZ(38px);   opacity: 1; }
  78%  { transform: rotateY(-150deg) translateZ(18px);  opacity: 1; }
  92%  { transform: rotateY(-172deg) translateZ(4px);   opacity: .85; }
  100% { transform: rotateY(-178deg);                   opacity: 0; box-shadow: 0 0 0 rgba(0,0,0,0); }
}
@keyframes pages-in { from { opacity: .15; transform: scale(.985); } to { opacity: 1; transform: none; } }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .9rem; color: #cfcad9; }
.pager button { padding: .4rem .9rem; border: 1.5px solid var(--stitch); border-radius: 999px; background: none; color: #ece9f2; cursor: pointer; }
.pager button:disabled { opacity: .35; cursor: default; }

/* ---- the deck: one disc, out of its sleeve ------------------------------ */
.deck { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; padding: 2rem; }
.deck-disc { align-self: start; position: sticky; top: 0; }
.deck-disc .disc { animation: slide-out .5s cubic-bezier(.2,.8,.2,1) both; }
.deck-disc.spinning .disc { animation: slide-out .5s cubic-bezier(.2,.8,.2,1) both, spin 1.8s linear .5s infinite; }
@keyframes slide-out { from { transform: translateX(-18%) rotate(-40deg); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.deck-body { min-width: 0; padding-top: .4rem; }
.deck-body h2 { margin: 0 4rem 0 0; font-size: var(--step-2); line-height: 1.15; overflow-wrap: anywhere; }
.deck-artist { margin: .35rem 0 0; font-size: var(--step-1); color: var(--ink-soft); }
.deck-where { margin: .3rem 0 0; font-size: var(--step--1); color: var(--ink-soft); }
.deck-where button { border: 0; background: none; padding: 0; color: var(--pen); text-decoration: underline; cursor: pointer; font-size: inherit; }
.deck-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.deck-actions .play, .deck-actions .out, .deck-actions .copy { font: 700 var(--step-0)/1 var(--read); padding: .7rem 1.1rem; border-radius: 999px; cursor: pointer; text-decoration: none; }
.deck-actions .play { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); }
.deck-actions .play[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.deck-actions .out, .deck-actions .copy { background: transparent; color: var(--ink); border: 2px solid var(--ink-soft); }
.player { margin-bottom: 1.2rem; border-radius: 10px; overflow: hidden; background: var(--ink); }
.player iframe { display: block; width: 100%; border: 0; }
.player.video iframe { aspect-ratio: 16 / 9; height: auto; }
.player.audio iframe { height: 175px; }
.deck .insert { border-radius: 8px; border-top: 1px solid var(--film-edge); }
.talk { margin-top: 1.2rem; }
.votes { margin: 0 0 .6rem; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.comments li { background: rgba(255,255,255,.4); border-radius: 8px; padding: .55rem .75rem; overflow-wrap: anywhere; }
.comments .who { font-weight: 700; }
.comments time { color: var(--ink-soft); font-size: var(--step--1); margin-left: .4rem; }

/* ---- How it works ------------------------------------------------------- */
.about { max-width: 72ch; }
.about h2 { font-size: var(--step-2); margin: 2rem 0 .6rem; }
.about h2:first-child { margin-top: 0; }
.about h3 { margin: 0 0 .4rem; font-size: var(--step-1); }
.about p, .about li { line-height: 1.6; }
.platforms { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); max-width: none; margin: 1rem 0; padding: 0; list-style: none; }
.platforms > li { background: var(--paper); border-radius: 10px; padding: 1rem 1.1rem; box-shadow: 0 1px 0 var(--felt-deep); }
.platforms dl { margin: 0; }
.platforms dt { font-weight: 700; margin-top: .6rem; }
.platforms dd { margin: .1rem 0 0; }

/* ---- footer ------------------------------------------------------------- */
.foot { padding: 1.5rem 0 3rem; border-top: 2px solid var(--felt-deep); color: var(--ink-soft); font-size: var(--step--1); }
.foot p { margin: .3rem 0; }

/* ---- small screens ------------------------------------------------------ */
@media (max-width: 760px) {
  .top { padding-top: 1.4rem; }
  .finder { position: static; }
  .pick { flex: 1 1 7rem; }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .insert .note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .rows button, .rows-head { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
  .rows .disc { width: 2.6rem; }
  .rows .col-who, .rows .col-where, .rows-head .col-who, .rows-head .col-where, .rows-head .col-artist { display: none; }
  .rows .col-artist { grid-column: 2; font-size: var(--step--1); }
  .rows .n { grid-row: 1; grid-column: 3; }
  dialog { width: 100%; max-width: 100%; max-height: 94vh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .deck { grid-template-columns: 1fr; gap: 1rem; padding: 1.2rem; }
  .deck-disc { position: static; width: min(62%, 15rem); margin-inline: auto; }
  .case-open { padding: 1rem; }
  .case-head { padding-right: 6rem; }
  .spread { grid-template-columns: 1fr; padding: .6rem; }
  .spread::before { display: none; }
  .page:first-of-type, .page:last-of-type { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pocket .disc, .slot > button, .pull, .pocket-slot > button { transition: none; }
  .deck-disc .disc, .deck-disc.spinning .disc, .shell.opening .lid, .shell.closing .lid,
  .shell .zip-pull, .shell .zip-trail rect, .shell.opening .spread { animation: none !important; }
}
