:root {
  --bg: #0f0f12;
  --panel: #18181d;
  --line: #2a2a31;
  --text: #f2f2f2;
  --muted: #9a9aa5;
  --accent: #ff5a36;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3, .logo { font-family: "Archivo Black", "Arial Black", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 600;
  transition: transform .15s, opacity .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.full { width: 100%; }
.icon-btn { background: none; border: none; color: var(--text); font-size: 20px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 5%;
  background: rgba(15, 15, 18, .97);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 22px; }
.logo { white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 20px; margin-left: auto; color: var(--muted); }
.nav a:hover { color: var(--text); }
.cart-btn {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px;
}
.cart-btn span {
  background: var(--accent); border-radius: 999px;
  padding: 1px 8px; margin-left: 4px; font-size: 13px;
}

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding: 70px 5%;
  flex-wrap: wrap;
}
.hero-text { max-width: 560px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 600; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin: 10px 0 18px; }
.hero p { color: var(--muted); font-size: 18px; }
.hero-art { position: relative; width: min(440px, 100%); aspect-ratio: 380 / 300; }
.hero-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vinyl-slide { position: absolute; inset: 0; transition: transform .8s var(--ease); will-change: transform; }
.hero-art:hover .vinyl-slide { transform: translateX(16%); }
/* the record gets its own layer so turning it never redraws anything */
.vinyl {
  position: absolute; left: 33.38%; top: 12.97%; width: 56.37%; height: 71.4%;
  animation: spin 6s linear infinite;
  will-change: transform;
}
.vinyl-shine { animation: none; }

/* ---------- CD + cassette drawings ---------- */
.disc {
  width: 120px; height: 120px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg) 0 9%, #ddd 10% 12%, transparent 13%),
    conic-gradient(from 30deg, #c9c9d1, #fff, var(--c), #c9c9d1, #fff, var(--c), #c9c9d1);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.tape {
  width: 130px; height: 82px; border-radius: 8px;
  background: var(--c);
  border: 4px solid #222;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  position: relative;
}
.tape::before {
  content: ""; position: absolute; inset: 22% 14%;
  background: #111; border-radius: 20px;
}
.reel {
  position: relative; z-index: 1;
  width: 22%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #111 0 30%, #eee 32% 100%);
  border: 3px dashed #444;
}
.card:hover .reel { animation: spin 1.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Shop ---------- */
.shop, .artists, .about { padding: 40px 5%; }
.shop-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
h2 { font-size: 32px; margin: 0 0 16px; }
input, select, textarea {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font: inherit;
}
#search { width: min(320px, 100%); }
.filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.chips, .selects { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px;
}
.chip.active { background: var(--text); color: var(--bg); }
.result-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.result-count { color: var(--muted); font-size: 14px; margin: 0; }
.clear-btn {
  background: rgba(255, 90, 54, .12); color: var(--accent);
  border: 1px solid rgba(255, 90, 54, .4); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.clear-btn:hover { background: rgba(255, 90, 54, .22); }
.clear-btn:active { transform: scale(.95); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  contain: layout paint; /* keeps each card's drawing work inside the card */
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: #444; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
/* ---------- Product cover tile ---------- */
.cover {
  --art-bg: var(--art) center / cover no-repeat, linear-gradient(135deg, var(--c), #111 120%);
  position: relative;
  aspect-ratio: 1;
  display: grid; place-items: center;
  overflow: hidden;
  background: #0b0b0e;
  isolation: isolate;
}
/* Blurred album cover filling the background */
/* Speed trick: blur a small copy (1/4 size) and scale it up. It looks the same
   as a big blur but costs ~16x less work, and hover only animates transform. */
.cover-bg {
  position: absolute; left: 50%; top: 50%;
  width: 31%; height: 31%;
  z-index: -2;
  background: var(--art-bg);
  filter: blur(5.5px) brightness(.55) saturate(1.3);
  transform: translate(-50%, -50%) scale(4);
  transition: transform .8s var(--ease);
}
.card:hover .cover-bg { transform: translate(-50%, -50%) scale(4.3); }
/* Soft vignette + floor shadow */
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 14% at 50% 84%, rgba(0,0,0,.45), transparent 70%),
    radial-gradient(circle at 50% 45%, transparent 45%, rgba(0,0,0,.45));
  pointer-events: none;
}

/* ----- CD: sleeve with the disc sliding out ----- */
.cd-stage {
  position: relative;
  width: 84%; aspect-ratio: 1.4;
  transform: translateX(-4%);
}
.cd-sleeve {
  position: absolute; left: 0; top: 0;
  height: 100%; aspect-ratio: 1;
  border-radius: 3px;
  background: var(--art-bg);
  box-shadow:
    0 22px 40px -8px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,255,255,.08);
  transition: transform .6s var(--ease);
  z-index: 1;
}
.cd-sleeve::after { /* glossy plastic */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255,255,255,.22), rgba(255,255,255,0) 38%),
    linear-gradient(90deg, rgba(255,255,255,.18) 0 2%, rgba(0,0,0,.25) 2% 3.2%, transparent 3.2%);
}
.cd-disc {
  position: absolute; top: 4%; left: 30%;
  height: 92%; aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.55));
  transition: transform .6s var(--ease);
}
.cd-face, .cd-shine {
  position: absolute; inset: 0; border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 0 7%, #000 7.4%);
          mask: radial-gradient(circle, transparent 0 7%, #000 7.4%);
}
.cd-face { /* the album art printed on the disc */
  background:
    radial-gradient(circle, rgba(235,235,240,.95) 0 9%, rgba(170,170,180,.9) 9.5% 15%, rgba(0,0,0,.35) 15.5% 16.5%, transparent 17%),
    var(--art-bg);
}
.cd-shine { /* light reflection that stays still while the disc spins */
  background:
    radial-gradient(circle, transparent 0 96.5%, rgba(255,255,255,.55) 97.5% 100%),
    conic-gradient(from 210deg, transparent 0 6%, rgba(255,255,255,.38) 11%, transparent 17% 52%, rgba(255,255,255,.28) 60%, transparent 67%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.card:hover .cd-disc   { transform: translateX(16%); }
.card:hover .cd-sleeve { transform: translateX(-3%); }
.card:hover .cd-face   { animation: spin 3.5s linear infinite; }

/* ----- Cassette with the cover as its label ----- */
.cassette {
  position: relative;
  width: 82%; aspect-ratio: 1.58;
  border-radius: 6% / 9.5%;
  padding: 5.5% 5.5% 0;
  background: linear-gradient(165deg, #34343b, #17171b 60%, #101013);
  box-shadow:
    0 22px 40px -8px rgba(0,0,0,.75),
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .6s var(--ease);
}
.cassette::before { /* screws */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle at 3.2% 5%,  #6a6a72 0 2px, #2a2a2f 2.5px, transparent 3.5px),
    radial-gradient(circle at 96.8% 5%, #6a6a72 0 2px, #2a2a2f 2.5px, transparent 3.5px),
    radial-gradient(circle at 3.2% 95%, #6a6a72 0 2px, #2a2a2f 2.5px, transparent 3.5px),
    radial-gradient(circle at 96.8% 95%,#6a6a72 0 2px, #2a2a2f 2.5px, transparent 3.5px);
}
.cassette-label {
  position: relative;
  height: 70%;
  border-radius: 4px;
  overflow: hidden;
  background: var(--art-bg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 1px 2px rgba(0,0,0,.6);
}
.cassette-label::after { /* glossy plastic */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.2), transparent 40%);
  pointer-events: none;
}
.cassette-window {
  position: absolute; left: 50%; top: 52%;
  width: 64%; height: 40%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(8, 8, 10, .82);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 0 2px rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 7%;
  z-index: 1;
}
.cassette-window::before { /* tape visible between the spools */
  content: ""; position: absolute; left: 30%; right: 30%; top: 30%; bottom: 30%;
  background: linear-gradient(#5a3d2b, #3a281d);
  border-radius: 2px;
}
.spool {
  position: relative; z-index: 1;
  height: 74%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, #0b0b0d 0 26%, transparent 27%),
    repeating-conic-gradient(#ececf0 0 30deg, #9b9ba3 30deg 60deg);
  box-shadow: 0 0 0 2px #e4e4e8;
}
.cassette-bottom {
  position: absolute; left: 22%; right: 22%; bottom: 0;
  height: 17%;
  background: linear-gradient(#26262c, #1a1a1f);
  clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 14%;
}
.cassette-bottom i { width: 7%; aspect-ratio: 1; border-radius: 50%; background: #050506; }
.card:hover .cassette { transform: translateY(-3%) rotate(-2deg); }
.card:hover .spool    { animation: spin 1.6s linear infinite; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 8px 0 4px; font-size: 17px; }
.card-artist { margin: 0; color: var(--text); font-size: 14px; }
.genre { margin: 2px 0 6px; color: var(--muted); font-size: 13px; }

/* ---------- Stock ---------- */
.stock {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 12px; font-size: 12px; font-weight: 600;
}
.stock i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.stock.in  { color: #4ade80; }
.stock.low { color: #fbbf24; }
.stock.out { color: #f87171; }
.stock.low i { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.card.sold-out .cover > :not(.cover-bg) { filter: grayscale(1) brightness(.7); }
.card.sold-out .cover::before {
  content: "Sold out";
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(15,15,18,.85); color: #f87171;
  border: 1px solid rgba(248,113,113,.4);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
}
.card.sold-out:hover .cd-disc, .card.sold-out:hover .cd-sleeve, .card.sold-out:hover .cassette { transform: none; }
.card.sold-out:hover .cd-face, .card.sold-out:hover .spool { animation: none; }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty .max { color: #fbbf24; font-size: 11px; font-weight: 600; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge.cd { background: #26324a; color: #9cc0ff; }
.badge.tape-badge { background: #4a2a26; color: #ffb39c; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.empty { color: var(--muted); padding: 20px 0; }

/* ---------- Artists ---------- */
.artist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.artist {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.artist:hover, .artist.active { border-color: var(--accent); }
.artist.active { background: rgba(255, 90, 54, .1); }
.artist small { display: block; color: var(--muted); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}

.about p { color: var(--muted); max-width: 640px; line-height: 1.6; }
.footer { padding: 30px 5%; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20;
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.overlay.open { opacity: 1; visibility: visible; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
  width: min(400px, 100%);
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s var(--ease);
  box-shadow: -20px 0 60px rgba(0,0,0,.4);
}
.cart.open { transform: none; }
.cart-head, .cart-foot { padding: 18px 20px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.cart-head h3 { margin: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 10px 20px; }
.cart-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.info { flex: 1; }
.info small { display: block; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.qty button {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.cart-foot { border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 18px; }

/* ---------- Checkout modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.7);
  display: grid; place-items: center; padding: 16px;
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-box {
  position: relative;
  transform: translateY(16px) scale(.97);
  transition: transform .3s var(--ease);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; width: min(440px, 100%);
}
.modal.open .modal-box { transform: none; }
.modal-box .close { position: absolute; top: 14px; right: 14px; }
.modal-box h3 { margin-top: 0; }
.modal-box p { color: var(--muted); }
form label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
form input, form textarea { display: block; width: 100%; margin-top: 6px; }
.note { font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 100px);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; font-weight: 600;
  transition: transform .4s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Smooth extras ---------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.card { animation: cardIn .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }

@keyframes bump {
  0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); }
}
.cart-btn span { display: inline-block; }
.cart-btn span.bump { animation: bump .4s var(--ease); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

body.locked { overflow: hidden; }
#shop, #artists, #about { scroll-margin-top: 72px; }

.btn:active, .chip:active, .qty button:active, .cart-btn:active { transform: scale(.95); }
.chip, .cart-btn, .artist, .nav a, .qty button, input, select, textarea {
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.chip:hover:not(.active) { color: var(--text); border-color: #444; }

/* Respect people who turn off animations on their device */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero { padding: 40px 5%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 8px; }
}

/* ---------- Checkout error ---------- */
.form-error {
  background: rgba(248, 113, 113, .1); color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, .35); border-radius: 10px;
  padding: 10px 12px; font-size: 14px;
}
