/* Pack previews react to browsing only. Links, odds and purchase state are
   unchanged; effects stay on the artwork so surrounding controls do not move. */
html .shell :is(.pv-showcase-art, .pack-showroom .pack-art) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow: none;
}
html .shell :is(.pv-showcase-art, .pack-showroom .pack-art)::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 0;
  border-radius: 0;
  opacity: 0;
  background: linear-gradient(115deg, transparent 32%, #ffffff0a 43%, #ffffff47 50%, #ffffff0a 57%, transparent 68%);
  transform: translateX(-120%);
}
html .shell .pv-showcase-card .pv-showcase-art > img,
html .shell .pack-showroom .pack-card .pack-art > img,
html .shell.shell--landing .pv-entry .pv-entry-pack > img {
  transition: transform 320ms cubic-bezier(.2,.7,.2,1), filter 320ms ease;
  transform-origin: 50% 60%;
}
html .shell.shell--landing .pv-entry .pv-entry-pack > canvas {
  transition: filter 320ms ease;
}

@keyframes pv-pack-foil-pass {
  0% { opacity: 0; transform: translateX(-120%); }
  20%, 65% { opacity: 1; }
  100% { opacity: 0; transform: translateX(120%); }
}

/* Keep one keyboard focus indicator on the actual link. The card border and
   artwork must not create a second, inner frame when focus and hover overlap. */
html .shell .pack-showroom .pack-card:is(:hover, :focus-visible) {
  border-color: var(--pvu-line);
}

/* Keyboard browsing receives the same artwork motion without an inset frame. */
html .shell .pv-showcase-card:has(:focus-visible) .pv-showcase-art > img,
html .shell .pack-showroom .pack-card:focus-visible .pack-art > img {
  transform: perspective(700px) translateY(-3px) rotateY(-10deg);
  filter: drop-shadow(5px 14px 12px #0009) drop-shadow(0 0 9px #dfbd6b2b);
}
html .shell .pv-showcase-card:has(:focus-visible) .pv-showcase-art::after,
html .shell .pack-showroom .pack-card:focus-visible .pack-art::after {
  animation: pv-pack-foil-pass 720ms ease-out both;
}
html .shell.shell--landing .pv-entry:has([data-home-odds]:focus-visible) .pv-entry-pack:not(.is-pack-dragging) > img {
  transform: perspective(900px) translateY(-5px) rotateY(-7deg);
  filter: drop-shadow(0 22px 22px #000b) drop-shadow(0 0 18px #dfbd6b47);
}
html .shell.shell--landing .pv-entry:has([data-home-odds]:focus-visible) .pv-entry-pack > canvas {
  filter: drop-shadow(0 0 18px #dfbd6b47) brightness(1.1);
}

/* Touch taps remain a single navigation gesture, with no sticky hover pose. */
@media (hover: hover) and (pointer: fine) {
  html .shell .pv-showcase-card:hover .pv-showcase-art > img,
  html .shell .pack-showroom .pack-card:hover .pack-art > img {
    transform: perspective(700px) translateY(-3px) rotateY(-10deg);
    filter: drop-shadow(5px 14px 12px #0009) drop-shadow(0 0 9px #dfbd6b2b);
  }
  html .shell .pv-showcase-card:hover .pv-showcase-art::after,
  html .shell .pack-showroom .pack-card:hover .pack-art::after {
    animation: pv-pack-foil-pass 720ms ease-out both;
  }
  html .shell.shell--landing .pv-entry:has([data-home-odds]:hover) .pv-entry-pack:not(.is-pack-dragging) > img {
    transform: perspective(900px) translateY(-5px) rotateY(-7deg);
    filter: drop-shadow(0 22px 22px #000b) drop-shadow(0 0 18px #dfbd6b47);
  }
  /* Keep the WebGL canvas in its original coordinate system for dragging. */
  html .shell.shell--landing .pv-entry:has([data-home-odds]:hover) .pv-entry-pack > canvas {
    filter: drop-shadow(0 0 18px #dfbd6b47) brightness(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html .shell .pv-showcase-card:is(:hover, :has(:focus-visible)) .pv-showcase-art > img,
  html .shell .pack-showroom .pack-card:is(:hover, :focus-visible) .pack-art > img,
  html .shell.shell--landing .pv-entry:has([data-home-odds]) .pv-entry-pack:not(.is-pack-dragging) > img {
    transform: none;
    transition: none;
  }
  html .shell .pv-showcase-card:is(:hover, :has(:focus-visible)) .pv-showcase-art::after,
  html .shell .pack-showroom .pack-card:is(:hover, :focus-visible) .pack-art::after {
    content: none;
    animation: none;
  }
}
