.showcase {
  --stage-white: var(--snow, #f2f7fe);
  --stage-rail: 66px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-self: stretch;
  min-width: 0;
  min-height: 455px;
  background: var(--midnight, #0a1526);
  color: var(--stage-white);
  border-radius: 0;
}

.rotation-clock { position: absolute; z-index: 5; inset: auto 0 0; height: 2px; background: rgb(191 211 237 / 18%); }
.rotation-clock span { display: block; height: 100%; background: var(--sky, #4cc2ff); transform-origin: left; transform: scaleX(0); }
@media (scripting: none) { .showcase .stage-controls, .rotation-clock { display: none; } }

.setting-frame {
  position: absolute; inset: 0 0 var(--stage-rail); width: 100%; padding: 0;
  border: 0; overflow: hidden; background: var(--midnight, #0a1526); cursor: zoom-in;
}
button.setting-frame:focus-visible { outline: 3px solid var(--sky, #4cc2ff); outline-offset: -5px; }
.setting-frame:focus-visible::after,
.showcase .actor button:focus-visible::after { opacity: 1; translate: 0; }
.setting-frame::after, .showcase .actor button::after {
  position: absolute;
  padding: 6px 9px;
  background: var(--midnight, #0a1526);
  color: var(--snow, #f2f7fe);
  font: 600 .73rem/1.2 var(--mono, monospace);
  white-space: nowrap;
  opacity: 0;
  translate: 0 3px;
  pointer-events: none;
  transition: opacity 260ms var(--ease), translate 360ms var(--ease);
}
.setting-frame::after { content: "Inspect scene"; top: 16px; right: 16px; }
.showcase .actor button::after {
  content: "Inspect skin";
  left: 50%;
  bottom: calc(100% + 7px);
  margin-left: -3.9em;
}
.showcase .showcase-setting {
  display: block;
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  transform-origin: 51% 69%;
  transform: scale(1.025);
  transition: transform 1400ms var(--ease-expo, cubic-bezier(.16,1,.3,1));
  pointer-events: none;
}

.showcase[data-collection="1"] .showcase-setting { transform: translate(.8%, -.7%) scale(1.055); }
.showcase[data-collection="2"] .showcase-setting { transform: translate(-1%, .5%) scale(1.04); }

.showcase .stage-scene {
  position: absolute;
  inset: 0 0 var(--stage-rail);
  overflow: hidden;
  pointer-events: none;
  transform-origin: 51% 74%;
}

.showcase .actor {
  position: absolute;
  width: 29%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  container-type: size;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.showcase .actor::before {
  content: "";
  position: absolute;
  left: 27%;
  bottom: -.8%;
  width: 46%;
  height: 4%;
  border-radius: 50%;
  background: rgb(15 16 17 / 38%);
  filter: blur(2px);
}

.showcase .actor button {
  display: block;
  position: relative;
  aspect-ratio: var(--skin-ratio, .5);
  width: min(100%, calc(100cqh * var(--skin-ratio, .5)));
  max-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: zoom-in;
  pointer-events: auto;
}
.showcase .actor button:focus-visible { outline: 3px solid var(--sky, #4cc2ff); outline-offset: 3px; box-shadow: 0 0 0 3px var(--midnight, #0a1526); }
.showcase .actor:focus-within { z-index: 5; }
.showcase .actor[inert] button { pointer-events: none; }

.showcase .actor img {
  position: relative;
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  margin: 0 auto;
  transition: filter 280ms var(--ease), translate 420ms var(--ease);
}
.showcase .actor button img { width: 100%; height: auto; }

.showcase .actor-left { left: 1.5%; bottom: 14%; height: 52%; z-index: 1; }
.showcase .actor-center { left: 18.2%; bottom: 4%; height: 66%; z-index: 3; }
.showcase .actor-right { left: 68%; bottom: 7%; height: 55%; z-index: 2; }

.showcase .stage-caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  min-height: var(--stage-rail);
  padding: 9px 4.2%;
  background: var(--midnight, #0a1526);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.showcase .caption-label, .showcase .caption-label p { min-width: 0; margin: 0; }
.showcase .caption-label small, .showcase .caption-label b { display: block; }

.showcase .caption-label small {
  color: var(--snow-soft, #bfd3ed);
  font: 600 .69rem/1.3 var(--mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.showcase .caption-label b {
  margin-top: 3px;
  color: var(--stage-white);
  font-size: clamp(.84rem, 1.12vw, 1rem);
  line-height: 1.2;
  font-weight: 650;
}

.showcase .stage-controls { display: flex; align-items: center; gap: 4px; }
.showcase .stage-controls button {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--stage-white);
  cursor: pointer;
  transition: background-color 260ms var(--ease), color 260ms var(--ease), border-color 260ms var(--ease);
}

.showcase .stage-controls button:focus-visible { outline: 2px solid white; outline-offset: 0; }
.showcase .stage-controls button:active { background: var(--cobalt-hover, #213f70); }
@media (hover: hover) { .showcase .stage-controls button:hover { background: var(--cobalt-hover, #213f70); } }
@media (hover: hover) and (pointer: fine) {
  .showcase .actor:hover { z-index: 5; }
  .showcase .actor button:hover img {
    filter: drop-shadow(2px 0 #ffffff) drop-shadow(-2px 0 #ffffff) drop-shadow(0 -2px #ffffff) drop-shadow(0 8px 12px rgb(22 34 56 / 28%));
    translate: 0 -4px;
  }
  .showcase .actor button:hover::after, button.setting-frame:hover::after { opacity: 1; translate: 0; }
}
.showcase .stage-controls svg { transition: translate 260ms var(--ease); }
.showcase #stage-next:active svg { translate: 2px 0; }
.showcase #stage-prev:active svg { translate: -2px 0; }

.showcase .stage-controls svg { display: block; width: 15px; height: 15px; }
#stage-prev svg { transform: rotate(180deg); }
#stage-play::before { content: ""; display: block; width: 9px; height: 12px; border-inline: 3px solid currentColor; }
#stage-play[data-playing="false"]::before {
  width: 0;
  height: 0;
  border: 0;
  border-block: 6px solid transparent;
  border-left: 9px solid currentColor;
}
.showcase #slide-number {
  display: inline-flex;
  gap: 3px;
  color: var(--stage-white);
  font: 500 .75rem/1 var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.showcase #slide-number i { color: var(--snow-muted, #8aa6cc); font-style: normal; }

@media (max-width: 760px) {
  .showcase { --stage-rail: 58px; width: 100%; min-height: 300px; height: clamp(300px, 80vw, 465px); margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase .showcase-setting { transition: none; }
  .showcase[data-collection] .showcase-setting { transform: scale(1.025); }
  .setting-frame::after, .showcase .actor button::after { transition: none; translate: none; }
  .showcase .stage-controls svg { transition: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .opening-reel { view-timeline-name: --winter-reel; }
    .showcase .showcase-setting, .showcase .stage-scene {
      animation: winter-camera linear both;
      animation-timeline: --winter-reel;
      animation-range: exit 0% exit 90%;
    }
    .showcase .showcase-setting { --camera-end: 1.085; }
    .showcase .stage-scene { --camera-end: 1.12; }
    @keyframes winter-camera { from { scale: 1; } to { scale: var(--camera-end); } }
  }
}

@media (max-width: 430px) {
  .showcase .stage-controls { gap: 0; }
  .showcase .stage-controls button { width: 30px; height: 36px; }
  .showcase #slide-number { font-size: .7rem; }
}
