:root {
  --on: #00E5FF;
  --field: #FF1B1C;
  --bone: #00E5FF;
  --bone-2: #00C4DC;
  --ink: #161412;
  --rust: #FF1B1C;
  --font-display: 'Cabinet Grotesk', 'Archivo', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --sw: 40px;
  --sh: 300px;
  --S: 340px;
  --d: 45px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--ink);
  color: var(--on);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.dim { opacity: .55; }

.layer, .layer-abs { position: fixed; inset: 0; pointer-events: none; }
.layer-abs { inset: auto; }
.field { background: var(--field); }
#fieldA { z-index: 0; }
#fieldB { z-index: 1; clip-path: circle(0px at 50% 50%); }

/* ---------- Shelf / crate ---------- */
#shelfBg {
  z-index: 2; left: 0; right: 0; bottom: 0; height: 36vh;
  background: var(--bone);
  color: var(--ink);
}
.flank { position: absolute; bottom: 72px; width: 200px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; }
.flank-l { left: 32px; }
.flank-r { right: 32px; text-align: right; align-items: flex-end; }
.flank-n { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: .85; letter-spacing: -.04em; }
.flank .mono { font-size: 11px; }

#lip {
  z-index: 4; left: 0; right: 0; bottom: 0; height: 48px;
  background: #161412; color: #00E5FF;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; font-weight: 500;
  box-shadow: 0 -10px 18px -8px rgba(0,0,0,.45);
}
#lip::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(#3a332c, #1A1714); }
#lip a { pointer-events: auto; text-decoration: none; opacity: .8; }
#lip a:hover { opacity: 1; }

#spines { z-index: 3; }
.sp {
  position: absolute; left: 0; top: 0; width: var(--sw); height: var(--sh);
  pointer-events: auto; padding: 0; will-change: transform;
  outline: none;
}
.spi {
  position: absolute; inset: 0; background: var(--bg); color: var(--fg);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: inset 2px 0 0 rgba(255,255,255,.14), inset -3px 0 0 rgba(0,0,0,.22), inset 0 3px 0 rgba(255,255,255,.08);
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.spi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.18), transparent 30%, transparent 70%, rgba(0,0,0,.12)); pointer-events: none; }
.spf {
  position: absolute; left: 0; top: 0; width: var(--sw); height: var(--sh);
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 9px; padding: 12px 0 14px;
  white-space: nowrap;
}
.spf b { font-weight: 800; font-size: 13.5px; letter-spacing: -.005em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-height: 0; }
.spf em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; opacity: .72; overflow: hidden; text-overflow: ellipsis; flex: 0 100 auto; min-height: 0; }
.spf i { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; opacity: .6; margin-inline-start: auto; }
.spf svg { width: 13px; height: 13px; flex: none; fill: var(--ac); transform: rotate(90deg); }
body.is-shelf .sp:hover .spi, .sp:focus-visible .spi { transform: translateY(-16px); }
.sp:focus-visible .spi { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--bone); }
body.is-stack .sp:hover .spi { transform: translateX(-14px); }
.sp.cur .spi { filter: brightness(1.08); }

/* ---------- Stack panel ---------- */
#panelBg {
  z-index: 2; top: 0; right: 0; bottom: 0; width: 480px;
  background: var(--bone); color: var(--ink);
  visibility: hidden;
}
.panel-head { position: absolute; left: 40px; right: 40px; top: 92px; }
.panel-h { font-weight: 800; font-size: 44px; line-height: .95; letter-spacing: -.035em; }
.panel-now { margin-top: 18px; display: flex; align-items: center; gap: 8px; }

/* ---------- Deck ---------- */
#deck { z-index: 5; }
#disc {
  position: absolute; left: 0; top: 0; width: var(--S); height: var(--S);
  border-radius: 50%; pointer-events: auto; visibility: hidden; will-change: transform, opacity;
  filter: drop-shadow(0 24px 30px rgba(0,0,0,.35));
}
.vinyl { position: absolute; inset: 0; border-radius: 50%; display: block; }
.grooves {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #0b0a09 0 1.2px, #1b1917 1.4px 2.4px, #0e0d0c 2.6px 3.4px),
    #0d0c0b;
  box-shadow: inset 0 0 0 3px #050505, inset 0 0 0 calc(var(--S) * .06) #0d0c0b;
}
.grooves::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; box-shadow: 0 0 0 calc(var(--S) * .012) #070606; }
.label { position: absolute; inset: 32.5%; border-radius: 50%; overflow: hidden; display: block; }
.label svg { width: 100%; height: 100%; display: block; }
.sheen {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none; display: block;
  background: conic-gradient(from 210deg, transparent 0 8%, rgba(255,255,255,.13) 14%, transparent 22% 56%, rgba(255,255,255,.09) 63%, transparent 71% 100%);
  mix-blend-mode: screen;
}

/* ---------- Sleeves (3D) ---------- */
#sleeves { z-index: 6; perspective: 1900px; }
.sleeve {
  position: absolute; left: 0; top: 0; width: var(--S); height: var(--S);
  transform-style: preserve-3d; visibility: hidden; will-change: transform;
}
.sleeve .f { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.sleeve .front { inset: 0; transform: translateZ(calc(var(--d) / 2)); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.sleeve .front svg, .sleeve .front img { width: 100%; height: 100%; display: block; }
.sleeve .front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.12), transparent 35%, transparent 70%, rgba(0,0,0,.12)); pointer-events: none; }
.sleeve .back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: var(--bg); }
.sleeve .side { top: 0; width: var(--d); height: var(--S); left: calc((var(--S) - var(--d)) / 2); background: var(--bg); }
.sleeve .side.l { transform: rotateY(-90deg) translateZ(calc(var(--S) / 2)); }
.sleeve .side.r { transform: rotateY(90deg) translateZ(calc(var(--S) / 2)); }
.sleeve .cap { left: 0; width: var(--S); height: var(--d); top: calc((var(--S) - var(--d)) / 2); background: var(--bg); filter: brightness(.8); }
.sleeve .cap.t { transform: rotateX(90deg) translateZ(calc(var(--S) / 2)); }
.sleeve .cap.b { transform: rotateX(-90deg) translateZ(calc(var(--S) / 2)); }
.sleeve .side .spi { position: absolute; left: 0; top: 0; width: var(--sw); height: var(--sh); transform-origin: 0 0; transform: scale(calc(var(--S) / var(--sh))); transition: none; }
/* side scale set inline in JS for browsers without unitless calc division */

/* ---------- Arm ---------- */
#armLayer { z-index: 7; }
#arm { position: absolute; left: 0; top: 0; overflow: visible; visibility: hidden; filter: drop-shadow(0 8px 10px rgba(0,0,0,.3)); }
#arm line { stroke: var(--on); transition: stroke .6s; }
#arm circle, #arm rect { fill: var(--on); transition: fill .6s; }
#arm .arm-hub { fill: var(--field); transition: fill .6s; }

/* ---------- UI ---------- */
#ui { z-index: 8; }
#top {
  position: absolute; left: 0; right: 0; top: 0; min-height: 88px; padding: 12px 32px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  color: var(--on); transition: color .6s;
}
.logo { font-weight: 800; font-size: 50px; line-height: .95; letter-spacing: -.035em; text-decoration: none; pointer-events: auto; justify-self: start; white-space: nowrap; }
.top-mid { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.views { position: relative; display: flex; border: 1.5px solid currentColor; border-radius: 4px; pointer-events: auto; overflow: hidden; }
.views button { position: relative; z-index: 1; padding: 6px 14px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; transition: color .35s; }
.views button.on { color: var(--field); }
.shuffle-btn { padding: 6px 14px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: 4px; pointer-events: auto; transition: background .25s, color .25s, transform .2s; }
.shuffle-btn:hover, .shuffle-btn:focus-visible { background: var(--on); color: var(--field); outline: none; }
.shuffle-btn:active { transform: scale(.96); }
.nav-dd { position: relative; pointer-events: auto; }
.menu-btn { display: inline-flex; align-items: center; gap: 7px; }
.menu-btn .caret { display: inline-block; transition: transform .22s cubic-bezier(.2,.8,.2,1); font-size: 10px; }
.nav-dd.open .menu-btn { background: var(--on); color: var(--field); }
.nav-dd.open .menu-btn .caret { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px;
  background: var(--ink); color: var(--bone);
  border: 1.5px solid var(--on); border-radius: 6px;
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 18px 34px -10px rgba(0,0,0,.6);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1), visibility .2s;
  z-index: 40;
}
.nav-dd.open .menu-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.menu-item {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 4px; text-decoration: none;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bone); transition: background .18s, color .18s;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--rust); color: #fff; outline: none; }
#vi { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: currentColor; transform-origin: 0 0; }
.status { transition: opacity .4s; justify-self: end; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #FF1B1C; display: inline-block; flex: none; box-shadow: 0 0 0 0 rgba(255,27,28,.6); }
body.playing .dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,27,28,.55); } 70% { box-shadow: 0 0 0 9px rgba(255,27,28,0); } 100% { box-shadow: 0 0 0 0 rgba(232,69,47,0); } }

.intro { position: absolute; left: 32px; top: 102px; width: 250px; line-height: 1.6; font-size: 11px; color: var(--on); opacity: .8; transition: color .6s, opacity .4s; }

#cap { position: absolute; left: 0; top: 0; transform-origin: 0 0; color: var(--on); transition: color .6s; width: 380px; }
.mask { overflow: hidden; padding-bottom: .08em; }
.mask > span { display: inline-block; will-change: transform; }
#c-meta { font-size: 11.5px; opacity: .85; }

#player { position: absolute; left: 0; top: 0; width: 340px; height: 80px; pointer-events: auto; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.18); box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); }
#player iframe { display: block; border: 0; }

/* ---------- Grain + cursor ---------- */
#grain {
  position: fixed; inset: -50%; z-index: 20; pointer-events: none; opacity: .09; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0,0); } 33% { transform: translate(-3%,2%); } 66% { transform: translate(2%,-3%); } 100% { transform: translate(0,0); } }

#cur { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; display: none; mix-blend-mode: difference; color: #fff; }
@media (pointer: fine) {
  html.has-cur, html.has-cur * { cursor: none !important; }
  html.has-cur #player, html.has-cur #player * { cursor: auto !important; }
  html.has-cur #cur { display: block; }
}
#cur .ring { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border: 1.5px solid #fff; border-radius: 50%; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s; transform: scale(.45); }
#cur .dotc { position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; background: #fff; border-radius: 50%; }
#cur .t { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; font-weight: 500; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#cur.big .ring { transform: scale(1.5); }
#cur.big .dotc { opacity: 0; }
#cur.big .t { opacity: 1; }

/* ---------- Mobile ---------- */
body.is-stack .status { opacity: 0; }
@media (max-width: 759px) {
  .status { display: none; }
  .spf em { display: none; }
  .spf b { font-size: 12.5px; }
  #top { height: auto; min-height: 54px; padding: 10px 16px; grid-template-columns: 1fr auto; gap: 10px; }
  .logo { font-size: clamp(28px, 8.5vw, 38px); line-height: .95; }
  .views { display: none; }
  .shuffle-btn { padding: 5px 11px; font-size: 10.5px; }
  .intro, .flank { display: none; }
  #lip { height: 40px; padding: 0 16px; font-size: 9.5px; letter-spacing: .1em; }
  .lip-mid { display: none; }
  #cap { width: calc(100% - 32px); }
  #c-meta { font-size: 10.5px; line-height: 1.3; }
  #player { max-width: calc(100% - 32px); }
  .status { font-size: 10.5px; }
}
@media (max-width: 1100px) { .lip-mid { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #grain { animation: none; }
  .spi { transition: none; }
}
