/* ---------- viewer (3D models + photos) ---------- */
.viewer { container-type: inline-size; width: 100%; position: relative; z-index: 0; overflow: hidden; isolation: isolate; }
.vtabs { position: relative; z-index: 20; display: flex; gap: 14px; margin: 0 0 14px; font-size: .9rem; }
.vtabs button { padding: 4px 2px; }
.vtabs button { background: none; border: 0; padding: 0; font: inherit; color: #777; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.vtabs button[aria-pressed="true"] { color: #000; text-decoration-thickness: 2px; }
.cap { position: relative; z-index: 20; margin-top: 6px; font-size: .85rem; color: #777; min-height: 1.2em; }
.cap b { color: #000; font-weight: 500; }

.v3d {
  --p: 47cqw; --open: 0; --spread: 0; --flip: 0; --r: 0;
  position: relative; width: 100%; padding-bottom: 90%;
  perspective: 1800px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.v3d:focus-visible { outline: 2px solid #000; outline-offset: -2px; }
.v3d .zoom { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s ease; }
.v3d.snap, .v3d.snap * { transition: none !important; }
.v3d .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-color: #eee; background-repeat: no-repeat; background-size: 100% 100%; box-shadow: 0 3px 12px rgba(0, 0, 0, .22); }
.v3d .face.rev { transform: rotateY(180deg); }
.v3d .half-l { background-size: 200% 100%; background-position: 0 0; }
.v3d .half-r { background-size: 200% 100%; background-position: 100% 0; }

/* cd (cardboard wallet): the front cover swings open on its left edge, the whole thing slides so the spread stays centred */
.cd .zoom { transform: scale(calc(1.66 - .66 * var(--spread))); }
.cd .slide { position: absolute; left: calc(50% - var(--p) / 2); top: calc(50% - var(--p) / 2); width: var(--p); height: var(--p); transform-style: preserve-3d; transform: translateX(calc(var(--spread) * var(--p) / 2)); transition: transform .9s ease; }
.cd .flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--flip) * 180deg)); transition: transform .9s ease; }
.cd .base { position: absolute; inset: 0; transform-style: preserve-3d; }
.cd .lid { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: left center; transform: translateZ(1px) rotateY(calc(var(--open) * -180deg)); transition: transform .9s ease; }

/* jewel case: a real box, rotated front -> spine -> back, then the cover opens */
.jewel { --w: 46cqw; --h: calc(var(--w) * .8565); --dp: calc(var(--h) * .0836); padding-bottom: 84%; }
.jewel .zoom, .cassette .zoom, .vhs .zoom, .doubletape .zoom { transform: scale(calc(1.7 - .7 * var(--spread))); }
.jewel .slide, .cassette .slide, .vhs .slide, .doubletape .slide { position: absolute; left: calc(50% - var(--w) / 2); top: calc(50% - var(--h) / 2); width: var(--w); height: var(--h); transform-style: preserve-3d; transform: translateX(calc(var(--spread) * var(--w) / 2)); transition: transform .9s ease; }
.jewel .rot, .cassette .rot, .vhs .rot, .doubletape .rot { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--r) * 90deg)); transition: transform .9s ease; }
.jewel .jf, .cassette .jf, .vhs .jf, .doubletape .jf { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: 100% 100%; background-repeat: no-repeat; background-color: #cfd2d6; }
.jewel .tray { inset: 0; transform: translateZ(calc(var(--dp) / 2 - 1px)); }
.jewel .back, .cassette .back, .vhs .back, .doubletape .back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--dp) / 2)); box-shadow: 0 3px 12px rgba(0, 0, 0, .22); }
.jewel .spine, .cassette .spine, .vhs .spine, .doubletape .spine { top: 0; height: 100%; width: var(--dp); left: calc(var(--dp) / -2); transform: rotateY(-90deg); }
.jewel .side, .cassette .side, .vhs .side, .doubletape .side { top: 0; height: 100%; width: var(--dp); left: calc(var(--w) - var(--dp) / 2); transform: rotateY(90deg); background: linear-gradient(90deg, #dfe2e6, #bfc3c8); }
.jewel .top, .cassette .top, .vhs .top, .doubletape .top { left: 0; width: 100%; height: var(--dp); top: calc(var(--dp) / -2); transform: rotateX(90deg); background: #d6d9dd; }
.jewel .bottom, .cassette .bottom, .vhs .bottom, .doubletape .bottom { left: 0; width: 100%; height: var(--dp); top: calc(var(--h) - var(--dp) / 2); transform: rotateX(-90deg); background: #c3c7cc; }
.jewel .lid { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: left center; transform: translateZ(calc(var(--dp) / 2)) rotateY(calc(var(--open) * -180deg)); transition: transform .9s ease; }

/* cassette: a tall box (front / spine / back) built from the same faces as the jewel case */
.cassette { --w: 34cqw; --h: calc(var(--w) * 1.511); --dp: calc(var(--h) * .1435); padding-bottom: 94%; }
.cassette .zoom, .vhs .zoom, .doubletape .zoom { transform: scale(1.5); }
.cassette .front, .vhs .front, .doubletape .front { inset: 0; transform: translateZ(calc(var(--dp) / 2)); box-shadow: 0 3px 12px rgba(0, 0, 0, .22); }

/* double-wide cassette: the cassette box with a spine twice as deep (the spine photo is 342 x 1136) */
.doubletape { --w: 32cqw; --h: calc(var(--w) * 1.511); --dp: calc(var(--h) * .3011); padding-bottom: 96%; }
.doubletape .zoom { transform: scale(1.45); }

/* vhs: the same box, taller (512 x 888 covers) */
.vhs { --w: 30cqw; --h: calc(var(--w) * 1.734); --dp: calc(var(--h) * .1435); padding-bottom: 98%; }
.vhs .zoom { transform: scale(1.45); }

/* no spine photo: a flat card, no depth and none of the edge faces */
/* 2px of depth, not 0: the back cover must sit behind the front panel (whose reverse side is the inside page), or the two share a plane and the inside page shows through when it is turned over */
.v3d.flat { --dp: 2px; }
.v3d.flat .spine, .v3d.flat .side, .v3d.flat .top, .v3d.flat .bottom { display: none; }

/* vinyl: a square sleeve that flips; the record sits inside (behind it), slides out of the side, lifts on top, flips, and returns.
   The disc photos have white corners, so they are cut to a circle just inside the edge of the disc. */
.vinyl { --p: 44cqw; --dx: 0; --dz: -1; --df: 0; padding-bottom: 90%; }
.vinyl .zoom { transform: scale(calc(1.5 - .5 * var(--spread))); }
.vinyl .slide { position: absolute; left: calc(50% - var(--p) / 2); top: calc(50% - var(--p) / 2); width: var(--p); height: var(--p); transform-style: preserve-3d; }
.vinyl .flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--flip) * 180deg)); transition: transform .8s ease; }
.vinyl .disc { visibility: hidden; position: absolute; inset: 1.5%; transform-style: preserve-3d; transform: translate3d(calc(var(--dx) * var(--p)), 0, calc(var(--dz) * 8px)); transition: transform .75s ease; }
.vinyl .dflip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--df) * 180deg)); transition: transform .8s ease; }
.vinyl.out .disc { visibility: visible; }
/* round mask: a fully rounded box clips the photo, and the photo is drawn ~4.4% larger than the box so the box edge lands ~9px inside
   the real edge of the disc (the photo's disc edge is at 48.7% of its width; the white background starts right outside it) */
.vinyl .dflip .face { border-radius: 50%; background-size: 104.4% 104.4%; background-position: center; background-color: transparent; box-shadow: none; }

/* booklet / zine: pages are leaves hinged on the spine; the cover and each right page swing over to the left */
.book { --pw: 44cqw; --ph: calc(var(--pw) * .9883); --open: 0; padding-bottom: 84%; }
.book.zine { --ph: calc(var(--pw) * 1.2278); padding-bottom: 98%; }
.book .zoom { transform: scale(calc(1.55 - .55 * var(--spread))); }
.book .slide { position: absolute; left: calc(50% - var(--pw) / 2); top: calc(50% - var(--ph) / 2); width: var(--pw); height: var(--ph); transform-style: preserve-3d; transform: translateX(calc(var(--spread) * var(--pw) / 2)); transition: transform .9s ease; }
.book .flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--flip) * 180deg)); transition: transform .9s ease; }
.book .base { position: absolute; inset: 0; transform-style: preserve-3d; }
.book .leaf { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: left center; transform: translateZ(calc(var(--z) * 1px)) rotateY(calc(var(--tn) * -180deg)); transition: transform .9s ease calc(var(--dl, 0) * 1ms); }
.book .face { box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }

/* sleeve: a card that flips */
.sleeve { padding-bottom: 92%; }
.sleeve .slide { position: absolute; left: calc(50% - 40cqw); top: calc(50% - 40cqw); width: 80cqw; height: 80cqw; transform-style: preserve-3d; }
.sleeve .flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--flip) * 180deg)); transition: transform .8s ease; }

/* photos */
.photos .big { display: block; width: 100%; padding: 0; border: 0; background: #eee; cursor: pointer; }
.photos .big img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: #eee; }
.photos .strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photos .strip button { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; background: #eee; cursor: pointer; }
.photos .strip button[aria-current="true"] { border-color: #000; }
.photos .strip img { display: block; width: 100%; height: 100%; object-fit: cover; }

.sub-line { color: #444; font-size: .95rem; margin: 0 0 10px; }
.sub-line .sold { color: #000; }
.detail .from { margin: 16px 0 0; font-size: .95rem; }
.detail .from b { font-weight: 500; color: #777; margin-right: 8px; }
.item .tagline { display: block; margin-top: 2px; font-size: .78rem; font-weight: 400; color: #777; text-decoration: none; }

@media (prefers-reduced-motion: reduce) { .v3d * { transition-duration: .01s !important; } }

.detail .pkg { color: #777; font-size: .85rem; margin: -4px 0 8px; }
