/*
  Mellow Groove: record shop website (Screenery template)
  A 1960s psychedelic gig poster: vibrating complementary grounds (magenta against lime, orange against violet),
  op-art rings, paisley and swirls. Anything you read sits on a calm cream panel in deep plum ink.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Grounds, panels, display type
   4. Components: buttons, chips, fields, stepper, alert, tags
   5. Header
   6. Hero: melted lettering, rings, disc
   7. The crate: filters, stage and flip, spines, detail, booth, grading
   8. New arrivals shelf
   9. Trade-in
  10. Listening nights
  11. Questions
  12. Footer, bag dialog
  13. Motion (only with prefers-reduced-motion: no-preference)
  14. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette */
  --plum: #330a1f;      /* ink and night ground */
  --cream: #fff2d6;     /* calm reading panels */
  --magenta: #e8177d;
  --orange: #ff5b14;
  --lime: #b5f23d;
  --violet: #6a2ee8;
  --gold: #ffc21a;

  /* Derived */
  --plum-soft: #5a2a3e;                                        /* secondary text on cream (8:1) */
  --plum-deep: #1f0512;
  --plum-lift: #4a1830;
  --cream-shade: #f3dfb6;                                      /* wells and rules on cream */
  --cream-dim: #f0d6df;                                        /* secondary text on plum */
  --magenta-ink: #a80d58;                                      /* magenta for text on cream (6:1) */
  --error: #b0122a;

  /* Type */
  --f-display: 'Kablammo', 'Sarabun', sans-serif;
  --f-body: 'Sarabun', system-ui, sans-serif;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --t-display: clamp(2.6rem, 1.6rem + 4.4vw, 5.25rem);

  /* Space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  /* Shape and depth */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;
  --shadow: 0 10px 28px -10px rgb(20 3 10 / 0.55), 0 2px 6px rgb(20 3 10 / 0.25);
  --shadow-lift: 0 22px 44px -14px rgb(20 3 10 / 0.6), 0 4px 10px rgb(20 3 10 / 0.3);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* exponential ease-out */
  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; scrollbar-color: var(--magenta) var(--plum-deep); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--plum);
  background: var(--plum);
  caret-color: var(--magenta);
  accent-color: var(--magenta);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--lime); color: var(--plum); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--plum-deep); }
::-webkit-scrollbar-thumb { background: var(--magenta); border-radius: 12px; border: 3px solid var(--plum-deep); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; box-shadow: 0 0 0 6px var(--plum); border-radius: 6px; }
.panel :focus-visible, .faq :focus-visible { outline-color: var(--magenta-ink); box-shadow: 0 0 0 6px var(--cream); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--magenta); }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input, select { font: inherit; color: inherit; }
.num, .price, output, [data-total], [data-bag-total] { font-variant-numeric: tabular-nums; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: var(--s-4); top: -4rem; z-index: 50; padding: var(--s-3) var(--s-4); background: var(--lime); color: var(--plum); font-weight: 700; border-radius: var(--r-sm); }
.skip:focus { top: var(--s-4); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
[hidden] { display: none !important; }

/* ---------- 3. Grounds, panels, display type ---------- */
.panel {
  background: var(--cream);
  color: var(--plum);
  border: 3px solid var(--plum);
  border-radius: var(--r-lg);
  padding: clamp(var(--s-5), 3vw, var(--s-6));
  box-shadow: var(--shadow);
}
.panel--tight { padding: var(--s-5) clamp(var(--s-5), 3vw, var(--s-6)); }
.display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 0.95;
  letter-spacing: 0;
}
.sec-head { display: grid; gap: var(--s-4); max-width: 46rem; margin-bottom: var(--s-6); }
.sec-head p { max-width: 62ch; font-size: var(--t-lg); line-height: 1.5; }
.sec-head--dark { color: var(--cream); }
.sec-head--dark .display { color: var(--lime); }
.sec-head--dark p { color: var(--cream-dim); }
.hint { font-size: var(--t-sm); color: var(--plum-soft); }

/* ---------- 4. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border: 3px solid var(--plum); border-radius: var(--r-pill);
  font-weight: 800; font-size: var(--t-md); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgb(20 3 10 / 0.6); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { cursor: not-allowed; opacity: 0.55; transform: none; box-shadow: none; }
.btn--lime { background: var(--lime); color: var(--plum); }
.btn--lime:hover { background: #c6f75f; }
.btn--plum { background: var(--plum); color: var(--cream); }
.btn--plum:hover { background: var(--plum-lift); }
.btn--ghost { background: transparent; color: var(--plum); }
.btn--ghost:hover { background: var(--cream-shade); }
.btn--wide { width: 100%; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.round-btn {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border-radius: 50%; border: 3px solid var(--plum);
  background: var(--lime); color: var(--plum); cursor: pointer;
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
}
.round-btn:hover { transform: scale(1.06); }
.round-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.round-btn--small { width: 44px; height: 44px; background: var(--cream); }
.round-btn--small[aria-pressed="true"] { background: var(--magenta); color: var(--cream); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4);
  border: 2px solid var(--plum); border-radius: var(--r-pill);
  background: var(--cream); font-weight: 700;
  transition: background-color 0.2s, color 0.2s;
}
.chip b { font-weight: 500; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.chip input:checked + span { background: var(--plum); color: var(--cream); }
.chip input:focus-visible + span { outline: 3px solid var(--magenta-ink); outline-offset: 3px; }
.chip:hover input:not(:checked) + span { background: var(--cream-shade); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .field > label, .filters__price label { font-weight: 800; padding: 0; margin-bottom: var(--s-2); }
.field { display: grid; gap: var(--s-1); }
.field input[type="text"], .field input[type="email"], .select-wrap select {
  width: 100%; min-height: 50px; padding: 0 var(--s-4);
  border: 2px solid var(--plum); border-radius: var(--r-sm);
  background: #fffaf0; color: var(--plum);
}
.field input::placeholder { color: var(--plum-soft); }
.field input:hover, .select-wrap select:hover { border-color: var(--violet); }
[aria-invalid="true"] { border-color: var(--error) !important; background: #fff0ef !important; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 3rem; cursor: pointer; }
.select-wrap .icon { position: absolute; right: var(--s-4); top: 50%; translate: 0 -50%; pointer-events: none; }
.field-error { color: var(--error); font-size: var(--t-sm); font-weight: 700; }
.check { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; font-weight: 500; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--plum); border-radius: var(--r-pill); background: #fffaf0; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.stepper button:hover { background: var(--cream-shade); }
.stepper input {
  width: 3.5rem; height: 44px; border: 0; background: none; text-align: center;
  font-weight: 800; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.alert {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4); border: 2px solid var(--error); border-radius: var(--r-md);
  background: #fff0ef; color: #6d0a1a;
}
.alert .icon { color: var(--error); margin-top: 2px; }

.tag {
  display: inline-block; padding: 0 var(--s-3); border-radius: var(--r-pill);
  background: var(--plum); color: var(--lime); font-weight: 800; font-size: var(--t-xs);
  text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.9;
}
.grade {
  display: inline-grid; place-items: center; min-width: 3em; padding: 0 0.4em;
  border-radius: var(--r-sm); background: var(--plum); color: var(--cream);
  font-weight: 800; font-size: 0.85em; line-height: 1.8; margin-right: 0.35em;
}

/* ---------- 5. Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-3) var(--gutter);
  background: var(--plum); color: var(--cream);
  border-bottom: 3px solid var(--magenta);
}
.logo { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; font-weight: 800; font-size: var(--t-lg); letter-spacing: 0.01em; }
.logo__disc { width: 36px; height: 36px; }
.nav { display: flex; gap: var(--s-1); margin-left: auto; }
.nav a { padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); text-decoration: none; font-weight: 600; color: var(--cream-dim); }
.nav a:hover { color: var(--plum); background: var(--lime); }
.bag-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-2) 0 var(--s-4);
  background: var(--cream); color: var(--plum); border: 0; border-radius: var(--r-pill);
  font-weight: 800; cursor: pointer;
}
.bag-btn__count {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 var(--s-2);
  border-radius: var(--r-pill); background: var(--magenta-ink); color: #fff;
  font-variant-numeric: tabular-nums;
}
.bag-btn__count.bump { animation: bump 0.5s var(--ease-out); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: var(--s-7) 0 calc(var(--s-9) + 2rem);
  background: var(--magenta);
}
/* Op-art: two sets of concentric rings whose centres disagree, so they moire where they cross */
.hero__rings {
  position: absolute; inset: 0; z-index: -1;
  background:
    repeating-radial-gradient(circle at 78% 46%, var(--orange) 0 22px, transparent 22px 44px),
    repeating-radial-gradient(circle at 18% 120%, var(--magenta) 0 18px, var(--violet) 18px 36px);
  background-blend-mode: normal;
}
.hero__rings::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-radial-gradient(circle at 78% 46%, transparent 0 60px, rgb(181 242 61 / 0.85) 60px 66px, transparent 66px 132px);
  mix-blend-mode: normal;
}
.hero__inner {
  width: min(100% - 2 * var(--gutter), 1320px); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: var(--s-5) var(--s-6);
  align-items: center;
}
.hero__title { grid-column: 1 / -1; grid-row: 1; margin: 0 auto; width: min(100%, 1060px); }
.melt { width: 100%; height: auto; overflow: visible; }
.melt__word {
  font-family: var(--f-display); font-size: 228px;
  fill: var(--cream); stroke: var(--plum); stroke-width: 14px; stroke-linejoin: round;
  paint-order: stroke fill;
}
.melt__word--bottom { fill: var(--lime); font-size: 210px; }
.hero__panel { grid-column: 1; grid-row: 2; display: grid; gap: var(--s-4); max-width: 38rem; justify-self: end; }
.hero__lede { font-size: var(--t-xl); font-weight: 800; line-height: 1.3; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.hero__open { font-size: var(--t-sm); color: var(--plum-soft); font-weight: 600; }
.hero__disc { grid-column: 2; grid-row: 2; width: min(100%, 340px); filter: drop-shadow(0 22px 24px rgb(20 3 10 / 0.55)); }
.hero__disc svg { width: 100%; height: auto; }
.drips { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(70px, 9vw, 120px); }

/* ---------- 7. The crate ---------- */
.crate-sec {
  position: relative; padding: var(--s-7) 0 var(--s-8);
  background:
    radial-gradient(circle at 10% 20%, rgb(106 46 232 / 0.35), transparent 40%),
    radial-gradient(circle at 90% 70%, rgb(232 23 125 / 0.25), transparent 45%),
    var(--plum);
}
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-5) var(--s-7); margin-bottom: var(--s-6); padding-block: var(--s-5); }
.filters__price { display: grid; gap: var(--s-1); flex: 1 1 260px; max-width: 420px; }
.filters__price label { margin: 0; }
.filters__price output { color: var(--magenta-ink); }
input[type="range"] { width: 100%; height: 44px; accent-color: var(--magenta-ink); cursor: pointer; }

.crate-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }

.stage {
  position: relative; aspect-ratio: 1 / 1.16; max-width: 520px; margin-inline: auto;
  perspective: 1400px; border-radius: var(--r-lg); touch-action: pan-y; user-select: none; cursor: grab;
}
.stage:active { cursor: grabbing; }
.stage__sleeves { position: absolute; left: 7%; right: 7%; bottom: 14.5%; aspect-ratio: 1; }
/* Each sleeve's place in the stack: 0 is the front one */
.sleeve {
  position: absolute; inset: 0; transform-origin: 50% 100%;
  border-radius: 6px; box-shadow: var(--shadow-lift);
  transition: transform 0.55s var(--ease-out), opacity 0.4s var(--ease-out), filter 0.4s;
  backface-visibility: hidden;
}
.sleeve svg { width: 100%; height: 100%; border-radius: 6px; }
.sleeve[data-pos="0"] { transform: translateZ(0); z-index: 4; }
.sleeve[data-pos="1"] { transform: translateY(-7%) translateZ(-60px) rotateX(4deg); z-index: 3; filter: brightness(0.72); }
.sleeve[data-pos="2"] { transform: translateY(-13%) translateZ(-120px) rotateX(6deg); z-index: 2; filter: brightness(0.55); }
.sleeve[data-pos="3"] { transform: translateY(-18%) translateZ(-180px) rotateX(8deg); z-index: 1; filter: brightness(0.4); }
/* The flip: the front sleeve tips toward you and drops out; flipping back brings it up from below */
.sleeve.is-out { transform: translateY(22%) rotateX(-96deg); opacity: 0; z-index: 5; }
.sleeve.is-in { transform: translateY(22%) rotateX(-96deg); opacity: 0; z-index: 5; transition: none; }
.stage__front {
  background-color: var(--orange);
  position: absolute; left: 0; right: 0; bottom: 0; height: 16%; z-index: 6;
  display: flex; align-items: center; justify-content: space-around; gap: var(--s-2);
  padding: 0 var(--s-4);
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.06) 0 2px, transparent 2px 22px),
    linear-gradient(var(--orange), #e0480b);
  border: 3px solid var(--plum); border-radius: 10px 10px var(--r-lg) var(--r-lg);
  color: var(--plum); font-weight: 800; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.1em;
  box-shadow: 0 -10px 24px -10px rgb(20 3 10 / 0.7);
}
.stage__front span:first-child { font-family: var(--f-display); font-size: var(--t-lg); text-transform: none; letter-spacing: 0; }
.stage__empty {
  position: absolute; inset: 12% 8% 26%; z-index: 7;
  display: grid; place-content: center; gap: var(--s-4); text-align: center; padding: var(--s-5);
  background: var(--cream); border: 3px dashed var(--plum); border-radius: var(--r-md);
}
.stage:focus-visible { outline-offset: 8px; }

.flip-bar { display: flex; align-items: center; justify-content: center; gap: var(--s-5); margin-top: var(--s-5); color: var(--cream); }
.flip-bar__pos { min-width: 10ch; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.spines { max-width: 400px; margin-inline: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--s-5); }
.spine {
  width: 44px; height: 44px; padding: 0; border: 2px solid var(--plum-lift); border-radius: 6px;
  overflow: hidden; cursor: pointer; background: none; opacity: 0.75;
  transition: transform 0.3s var(--ease-out), opacity 0.2s, border-color 0.2s;
}
.spine svg { width: 100%; height: 100%; }
.spine:hover { opacity: 1; transform: translateY(-3px); }
.spine[aria-current="true"] { opacity: 1; border-color: var(--lime); transform: translateY(-4px); box-shadow: 0 0 0 2px var(--plum), 0 0 0 5px var(--lime); }

.detail { display: grid; gap: var(--s-3); }
.detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-sm); color: var(--plum-soft); font-weight: 600; }
.detail__title { font-size: var(--t-xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.detail__artist { font-size: var(--t-lg); font-weight: 500; color: var(--magenta-ink); }
.detail__note { max-width: 60ch; }
.grades { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin: var(--s-2) 0 0; }
.grades div { padding: var(--s-3); border: 2px solid var(--cream-shade); border-radius: var(--r-md); background: #fffaf0; }
.grades dt { font-size: var(--t-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--plum-soft); }
.grades dd { margin: 0; font-size: var(--t-sm); line-height: 1.4; }
.grades a { display: inline-block; font-weight: 800; font-size: var(--t-lg); color: var(--magenta-ink); margin-right: var(--s-1); }
.detail__buy { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) 0; border-block: 2px dashed var(--cream-shade); }
.price { font-size: 2.25rem; font-weight: 800; line-height: 1; }
[data-add][aria-pressed="true"] { background: var(--plum); color: var(--lime); }

.booth {
  display: grid; grid-template-columns: 140px 1fr; gap: var(--s-4); align-items: center;
  margin-top: var(--s-2); padding: var(--s-4); border-radius: var(--r-md);
  background:
    repeating-linear-gradient(-45deg, rgb(106 46 232 / 0.1) 0 10px, transparent 10px 20px),
    var(--cream-shade);
}
.booth__deck { width: 100%; height: auto; }
.booth__platter { transform-origin: 66px 60px; transform-box: view-box; }
.booth__arm { transform-origin: 136px 22px; transform-box: view-box; transform: rotate(18deg); transition: transform 0.7s var(--ease-out); }
.booth.is-playing .booth__arm { transform: rotate(0deg); }
.booth__body { display: grid; gap: var(--s-2); min-width: 0; }
.booth h4 { font-size: var(--t-md); font-weight: 800; }
.booth__status { font-size: var(--t-sm); line-height: 1.45; min-height: 2.9em; }
.booth__controls { display: flex; align-items: center; gap: var(--s-3); }
[data-play][aria-pressed="true"] { background: var(--magenta-ink); border-color: var(--plum); }

.grading { margin-top: var(--s-7); display: grid; gap: var(--s-4); }
.grading h3 { font-size: var(--t-xl); font-weight: 800; }
.grading > p { max-width: 70ch; }
.grade-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.grade-table th, .grade-table td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-3); border-bottom: 2px solid var(--cream-shade); }
.grade-table thead th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--plum-soft); }
.grade-table tbody th { white-space: nowrap; font-weight: 800; }
.grade-table .num { text-align: right; font-weight: 800; white-space: nowrap; }

/* The plain record list: shown without JavaScript, hidden once the crate is built */
.records { display: grid; gap: var(--s-3); margin: var(--s-6) 0 0; padding: 0; list-style: none; counter-reset: rec; }
.records li { padding: var(--s-4); background: var(--cream); border: 2px solid var(--plum); border-radius: var(--r-md); }
.records li b { display: block; font-size: var(--t-lg); }
.records li i { display: block; color: var(--magenta-ink); font-style: normal; font-weight: 700; }
.records li::after { content: attr(data-genre) " · " attr(data-media) " · £" attr(data-price); display: block; margin-top: var(--s-2); font-weight: 800; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.06em; }
.js .records { display: none; }
.no-js-hide { display: none; }

/* ---------- 8. New arrivals shelf ---------- */
.arrivals {
  position: relative; padding: var(--s-8) 0 var(--s-8);
  /* vibrating stripes: lime against magenta */
  background: repeating-linear-gradient(100deg, var(--lime) 0 26px, var(--magenta) 26px 52px);
}
.arrivals .sec-head { margin-bottom: var(--s-7); }
.arrivals .display { color: var(--plum); }
.shelf {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5);
  margin: 0; padding: 0 var(--s-4); list-style: none; align-items: end;
}
.shelf li { display: grid; gap: var(--s-3); }
.shelf li:nth-child(1) .shelf__sleeve { rotate: -4deg; }
.shelf li:nth-child(2) .shelf__sleeve { rotate: 2deg; translate: 0 -6px; }
.shelf li:nth-child(3) .shelf__sleeve { rotate: -1deg; }
.shelf li:nth-child(4) .shelf__sleeve { rotate: 5deg; translate: 0 -4px; }
.shelf__sleeve { border-radius: 6px; box-shadow: var(--shadow-lift); transition: rotate 0.5s var(--ease-out), translate 0.5s var(--ease-out); }
.shelf__sleeve svg { width: 100%; height: auto; border-radius: 6px; }
.shelf li:hover .shelf__sleeve { rotate: 0deg; translate: 0 -14px; }
.shelf__card { padding: var(--s-3) var(--s-4) var(--s-4); background: var(--cream); border: 3px solid var(--plum); border-radius: var(--r-md); display: grid; gap: var(--s-1); }
.shelf__card h3 { font-size: var(--t-md); font-weight: 800; line-height: 1.25; }
.shelf__card p { font-size: var(--t-sm); color: var(--plum-soft); }
.shelf__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-2); }
.shelf__row strong { font-size: var(--t-lg); font-variant-numeric: tabular-nums; }
.shelf__row .btn { min-height: 44px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.shelf__plank { height: 22px; margin: var(--s-3) var(--s-2) 0; border-radius: 6px; background: var(--plum); box-shadow: 0 14px 24px -10px rgb(20 3 10 / 0.8); }

/* ---------- 9. Trade-in ---------- */
.trade {
  padding: var(--s-8) 0;
  /* sunburst: orange against violet */
  background: repeating-conic-gradient(from 0deg at 20% 30%, var(--orange) 0 7.5deg, var(--violet) 7.5deg 15deg);
}
.trade__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--s-6); align-items: start; }
.trade__intro { display: grid; gap: var(--s-4); position: sticky; top: 6rem; }
.trade__intro .display { color: var(--plum); }
.trade__phone { font-weight: 800; font-size: var(--t-lg); }
.trade__phone a { color: var(--magenta-ink); }
.trade__form, .trade__done { display: grid; gap: var(--s-5); }
.trade__form h3, .trade__done h3 { font-size: var(--t-xl); font-weight: 800; }
.counts { display: grid; gap: var(--s-2); }
.count-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-2) 0; border-bottom: 2px dashed var(--cream-shade);
}
.count-row label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1) var(--s-2); font-weight: 700; }
.count-row small { font-size: var(--t-sm); color: var(--plum-soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.estimate {
  display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md); background: var(--plum); color: var(--cream);
}
.estimate__formula { font-size: var(--t-sm); color: var(--cream-dim); font-variant-numeric: tabular-nums; line-height: 1.7; }
.estimate__total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); font-weight: 700; }
.estimate__total strong { font-size: 2.25rem; color: var(--lime); font-variant-numeric: tabular-nums; line-height: 1; }
.trade__ref strong { font-size: var(--t-xl); color: var(--magenta-ink); font-variant-numeric: tabular-nums; }
.trade__done { outline: none; }

/* ---------- 10. Listening nights ---------- */
.nights {
  position: relative; padding: var(--s-8) 0;
  background-color: var(--violet);
  /* a paisley tile, drawn once and repeated */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%235a22cf'%3E%3Cpath d='M30 74c-22 0-28-24-16-39 8-11 23-15 21-35 19 13 25 39 19 54-5 13-13 20-24 20z'/%3E%3Cpath transform='translate(90 100) rotate(180)' d='M0 34c-22 0-28-24-16-39 8-11 23-15 21-35 19 13 25 39 19 54-5 13-13 20-24 20z'/%3E%3C/g%3E%3Cg fill='%237d45f0'%3E%3Ccircle cx='30' cy='54' r='5'/%3E%3Ccircle cx='90' cy='60' r='5'/%3E%3C/g%3E%3C/svg%3E");
}
.gigs { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.gig {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) auto; gap: var(--s-5); align-items: center;
  padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4);
  background: var(--cream); border: 3px solid var(--plum); border-radius: var(--r-pill);
  box-shadow: var(--shadow);
}
.gig:nth-child(even) { margin-left: clamp(0rem, 5vw, 4rem); }
.gig:nth-child(odd) { margin-right: clamp(0rem, 5vw, 4rem); }
.gig__date {
  display: grid; place-items: center; align-content: center; width: 8rem; aspect-ratio: 1;
  border-radius: 50%; color: var(--plum);
  background: repeating-radial-gradient(circle, var(--gold) 0 7px, var(--orange) 7px 14px);
  border: 3px solid var(--plum);
}
.gig__day { font-family: var(--f-display); font-size: 3rem; line-height: 0.9; color: var(--plum); -webkit-text-stroke: 6px var(--cream); paint-order: stroke fill; }
.gig__month { font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; background: var(--cream); padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: var(--t-sm); }
.gig__body { display: grid; gap: var(--s-1); }
.gig__body h3 { font-size: var(--t-lg); font-weight: 800; }
.gig__body p { max-width: 62ch; }
.gig__time { font-size: var(--t-sm); font-weight: 700; color: var(--plum-soft); }
.gig__rsvp { display: grid; gap: var(--s-2); justify-items: end; text-align: right; }
.gig__seats { font-size: var(--t-sm); font-weight: 700; font-variant-numeric: tabular-nums; max-width: 18ch; }
[data-rsvp][aria-pressed="true"] { background: var(--lime); color: var(--plum); }

/* ---------- 11. Questions ---------- */
.faq {
  padding: var(--s-8) 0;
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 30px, rgb(232 23 125 / 0.14) 30px 40px),
    var(--cream);
}
.faq__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-6); align-items: start; }
.faq__aside { display: grid; gap: var(--s-4); position: sticky; top: 7rem; }
.faq__aside p { max-width: 36ch; font-size: var(--t-lg); line-height: 1.5; }
.faq__aside a { color: var(--magenta-ink); font-weight: 800; }
.faq .display { color: var(--plum); font-size: clamp(2.4rem, 1.6rem + 3vw, 4.25rem); }
.faq__list { display: grid; gap: var(--s-3); }
.faq details { border: 3px solid var(--plum); border-radius: var(--r-md); background: #fffaf0; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; padding: var(--s-3) var(--s-5); cursor: pointer; list-style: none;
  font-weight: 800; font-size: var(--t-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: rotate 0.3s var(--ease-out); }
.faq details[open] summary .icon { rotate: 180deg; }
.faq details[open] summary { color: var(--magenta-ink); }
.faq details p { padding: 0 var(--s-5) var(--s-5); max-width: 65ch; }

/* ---------- 12. Footer, bag dialog ---------- */
.foot { background: var(--plum); color: var(--cream-dim); padding-bottom: var(--s-6); }
.foot__band {
  height: 28px;
  background: repeating-linear-gradient(90deg, var(--magenta) 0 40px, var(--orange) 40px 80px, var(--gold) 80px 120px, var(--lime) 120px 160px, var(--violet) 160px 200px);
}
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr; gap: var(--s-6); padding: var(--s-7) 0 var(--s-6); }
.foot__name { font-family: var(--f-display); font-size: 2.5rem; line-height: 1; color: var(--lime); margin-bottom: var(--s-3); }
.foot__h { font-size: var(--t-md); text-transform: uppercase; letter-spacing: 0.1em; color: var(--cream); margin-bottom: var(--s-3); }
.foot__addr { display: flex; gap: var(--s-2); }
.foot__addr .icon { margin-top: 3px; color: var(--lime); }
.foot a { color: var(--cream); }
.hours { border-collapse: collapse; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.hours th, .hours td { text-align: left; padding: 3px var(--s-4) 3px 0; font-weight: 500; vertical-align: top; }
.hours tr.is-today { color: var(--lime); font-weight: 800; }
.hours tr.is-today th, .hours tr.is-today td { font-weight: 800; }
.foot__nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); font-size: var(--t-sm); }
.foot__small { font-size: var(--t-xs); border-top: 1px solid var(--plum-lift); padding-top: var(--s-4); }

.bag {
  width: min(100% - 2rem, 30rem); max-height: min(90vh, 44rem); margin: auto 1rem auto auto;
  padding: var(--s-5); border: 3px solid var(--plum); border-radius: var(--r-lg);
  background: var(--cream); color: var(--plum); box-shadow: var(--shadow-lift);
}
.bag::backdrop { background: rgb(20 3 10 / 0.7); }
.bag__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.bag__head h2 { font-family: var(--f-display); font-weight: 400; font-size: 2.5rem; }
.bag__list { display: grid; gap: var(--s-3); margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.bag__item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s-3); align-items: center; padding-bottom: var(--s-3); border-bottom: 2px dashed var(--cream-shade); }
.bag__item svg.art { width: 56px; height: 56px; border-radius: 4px; }
.bag__item b { display: block; line-height: 1.25; }
.bag__item span { font-size: var(--t-sm); color: var(--plum-soft); }
.bag__item .price-sm { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.bag__item button { margin-top: var(--s-1); padding: 0; min-height: 32px; background: none; border: 0; color: var(--magenta-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; font-size: var(--t-sm); }
.bag__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-4); font-weight: 700; }
.bag__total strong { font-size: 1.75rem; }
.bag__held { margin-top: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--lime); border: 2px solid var(--plum); border-radius: var(--r-md); font-weight: 700; }

/* ---------- 13. Motion ---------- */
@keyframes spin { to { rotate: 360deg; } }
@keyframes bump { 40% { transform: scale(1.35); } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: 132px 0, 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .hero__disc svg { animation: turn 5.4s linear infinite; }
  .booth.is-playing .booth__platter { animation: turn 1.8s linear infinite; }
  /* Content rises into place as it scrolls in, from an already visible start */
  @supports (animation-timeline: view()) {
    .shelf li, .gig {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes rise { from { translate: 0 28px; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .btn.is-loading::before { animation: none; border-right-color: currentColor; opacity: 0.5; }
  .shelf__sleeve, .shelf li:hover .shelf__sleeve { rotate: 0deg; translate: 0; }
}

/* ---------- 14. Narrow screens ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .bag-btn { margin-left: auto; }
  .crate-grid { grid-template-columns: minmax(0, 1fr); }
  .detail { max-width: 40rem; margin-inline: auto; width: 100%; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
  .shelf__plank { display: none; }
  .trade__grid, .faq__grid { grid-template-columns: 1fr; }
  .trade__intro { position: static; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero { padding-top: var(--s-5); }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__title { grid-row: 1; }
  .hero__disc { grid-column: 1; grid-row: 2; width: 46%; justify-self: end; margin-top: -18%; margin-right: 4%; position: relative; z-index: -1; }
  .hero__panel { grid-column: 1; grid-row: 3; justify-self: stretch; margin-top: -14%; }
  .gig { grid-template-columns: 5.5rem minmax(0, 1fr); border-radius: var(--r-lg); margin: 0 !important; padding: var(--s-4); gap: var(--s-4); }
  .gig__date { width: 5.5rem; align-self: start; }
  .gig__day { font-size: 2.1rem; -webkit-text-stroke-width: 5px; }
  .gig__rsvp { grid-column: 1 / -1; justify-items: stretch; text-align: left; grid-template-columns: 1fr auto; align-items: center; }
  .grade-table thead { display: none; }
  .grade-table tr { display: grid; grid-template-columns: 1fr auto; padding: var(--s-3) 0; border-bottom: 2px solid var(--cream-shade); }
  .grade-table th, .grade-table td { border: 0; padding: var(--s-1) 0; }
  .grade-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .grade-table .num { grid-column: 2; grid-row: 1; }
  .booth { grid-template-columns: 96px 1fr; }
  .stage__front { font-size: var(--t-xs); letter-spacing: 0.06em; }
  .stage__front span:last-child { display: none; }
  .bag { margin: auto auto 0; width: 100%; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 86vh; }
}
@media (max-width: 520px) {
  .shelf { grid-template-columns: 1fr 1fr; gap: var(--s-5) var(--s-3); padding: 0; }
  .shelf__row { flex-direction: column; align-items: stretch; }
  .shelf__card { padding: var(--s-3); }
  .foot__grid { grid-template-columns: 1fr; }
  .grades { grid-template-columns: 1fr; }
  .logo span { font-size: var(--t-md); }
  .bag-btn > span:not(.bag-btn__count) { display: none; }
  .bag-btn { padding-left: var(--s-3); }
  .count-row { gap: var(--s-2); }
  .estimate__total strong { font-size: 1.75rem; }
  .flip-bar { gap: var(--s-3); }
}

/* Late adjustments: keep buttons on one line, let grade rows keep their stepper beside the label, scroll the sleeve strip on phones */
.btn { white-space: nowrap; }
.count-row { flex-wrap: nowrap; }
.count-row label { flex: 1 1 0; min-width: 0; }
.stepper { flex: none; }
@media (max-width: 520px) {
  .spines { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; max-width: 100%; padding: 8px 4px 10px; scrollbar-width: thin; }
  .spine { flex: none; }
  .stepper button { width: 40px; }
  .stepper input { width: 2.75rem; }
}

/* Without JavaScript the crate is the plain record list; hide the controls that need a script */
html:not(.js) .filters, html:not(.js) .crate-grid, html:not(.js) .shelf, html:not(.js) .shelf__plank, html:not(.js) .bag-btn { display: none; }
@media (max-width: 520px) {
  .booth { grid-template-columns: minmax(0, 1fr); }
  .booth__deck { width: 120px; }
  .booth__controls .btn { flex: 1; }
}
