/* production page: cover flow. Shared chrome (font, colours, back link, title, footer) comes from site.css. */
/* --line comes from site.css; it's themed there along with every other colour on this page */
:root{--size:min(42vh, 58vw, 400px)}
/* touch-action:manipulation kills double-tap-to-zoom across the page, including taps that fall through a
   disabled arrow to its container. Panning and pinch zoom are untouched. */
body{overflow-x:hidden;touch-action:manipulation}
.production{gap:18px;padding:24px 0;min-width:0}

/* the shelf */
.flow{
  position:relative;
  height:calc(var(--size) * 1.12);   /* just enough room for the reflection; the caption sits above it (z-index) */
  margin-inline:-30px;              /* bleed to the screen edge; covers are clipped, not the page */
  overflow:hidden;                  /* older browsers */
  overflow-x:clip;overflow-y:visible; /* clip only at the sides, so a cover turning over is never cut at the top */
  perspective:1100px;
  perspective-origin:50% 38%;
  touch-action:pan-y;
  cursor:grab;
  user-select:none;-webkit-user-select:none;
  outline-offset:-4px;
}
.flow:focus-visible{outline:1px solid var(--muted)}
.flow.dragging{cursor:grabbing}
.cover{
  position:absolute;left:50%;top:0;
  width:var(--size);height:var(--size);
  margin-left:calc(var(--size) / -2);
  transform-style:preserve-3d;
  will-change:transform;
}
.cover .art{
  position:absolute;left:0;top:0;width:100%;height:100%;
  background-size:cover;background-position:center;
  box-shadow:0 0 0 1px var(--hairline);
}
/* reflection: an opaque strip, so a nearer cover's reflection hides the ones behind it instead of stacking with them */
.cover .mirror{
  position:absolute;left:0;top:100%;width:100%;height:30%;
  overflow:hidden;background:var(--paper);
}
.cover .mirror i{
  position:absolute;inset:0;
  background-size:100% auto;background-position:center bottom;background-repeat:no-repeat;
  transform:scaleY(-1);filter:blur(2px);
}
.cover .mirror::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(to bottom, color-mix(in srgb, var(--paper) 87%, transparent) 0%, var(--paper) 85%);
}
.cover .art,.cover .mirror,.cover .shade{-webkit-backface-visibility:hidden;backface-visibility:hidden}
/* the back of a cover: shown when the centre cover is flipped */
.cover .rear{
  position:absolute;inset:0;display:flex;flex-direction:column;
  transform:rotateY(180deg);-webkit-backface-visibility:hidden;backface-visibility:hidden;
  background:var(--paper);box-shadow:0 0 0 1px var(--line);
  pointer-events:none;cursor:default;
}
.cover.is-flipped .rear{pointer-events:auto}
.rear-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line);font-size:10px;color:var(--muted)}
.rear-bar span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rear-close{flex:none;border:0;background:none;padding:0;font-family:var(--mono);font-size:10px;color:var(--ink);cursor:pointer;touch-action:manipulation}
.rear-close:hover{color:var(--accent-hover)}
.rear-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;font-size:11px;line-height:1.7;color:var(--muted)}
.rear-body p{margin:0;padding-inline:18px;max-width:30ch}
.plat{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:170px;padding:9px 0 9px 18px;border:1px solid var(--line);border-radius:3px;font-size:11px;letter-spacing:.04em;color:var(--ink);transition:background .15s ease,color .15s ease,border-color .15s ease}
.plat{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.plat:hover{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.plat svg{width:14px;height:14px;flex:none;fill:currentColor}
.cover .shade{position:absolute;inset:0;background:var(--paper);opacity:0;pointer-events:none}

/* caption + controls */
.caption{position:relative;z-index:1;text-align:center;min-height:126px;padding-inline:4px}  /* room for the optional note line, so the arrows never shift */
.c-title{font-size:15px;margin:0;font-weight:400;text-wrap:balance}
.c-artist{font-size:11px;color:var(--muted);margin:4px 0 0}
.c-album{font-size:11px;color:var(--muted);margin:2px 0 0;min-height:17px}
.c-role{display:inline-block;margin-top:10px;padding:5px 12px;background:var(--accent);color:var(--on-accent);border-radius:3px;font-size:10px;letter-spacing:.06em}
.c-note{font-size:10px;color:var(--muted);margin:8px 0 0}
.controls{display:flex;align-items:center;justify-content:center;gap:22px}
/* touch-action:manipulation stops a quick second tap being read as double-tap-to-zoom; pinch zoom still works */
.step{width:32px;height:32px;border:0;border-radius:3px;background:var(--accent);color:var(--on-accent);font-family:var(--mono);font-size:12px;cursor:pointer;transition:background .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.step:hover{background:var(--accent-hover)}
.step:disabled{background:var(--line);color:var(--muted);cursor:default}
.count{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;min-width:48px;text-align:center}
.hint{text-align:center;font-size:10px;color:var(--muted);margin:0}

@media (max-width:809px){
  :root{--size:min(40vh, 60vw, 300px)}
  .flow{perspective:800px;margin-inline:-20px}
  .caption{min-height:137px}
  .step{width:44px;height:44px}   /* full-size touch target on a phone */
}

/* a rotated phone: short viewport, but often wide enough to miss the max-width rule above
   (e.g. 844x390). max-width:809px alone would then read it as "desktop" and size the shelf
   off vh against a squashed 390px-tall screen, shrinking it to a third of its portrait size.
   This is keyed on height instead, so it catches any phone in landscape regardless of width. */
@media (orientation:landscape) and (max-height:500px){
  :root{--size:min(68vh, 42vw, 320px)}
  .flow{perspective:900px}
  .caption{min-height:112px}
}
@media (prefers-reduced-motion:reduce){ .step{transition:none} }
