/* The canvas and its photographic surface share a fixed camera in the room. */
/* Reveal the assembled character in one pass after the first complete frame. */
.stage {
  opacity: 0;
  transition: opacity .42s ease-out;
}

.stage[data-portrait-ready] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .stage { transition: none; }
}

.stage #portrait-surface {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 85.98%;
  width: auto;
  max-width: none;
  display: block;
  transform: translate(-50%, -50%);
  opacity: .26;
  /* Keep the face dim when the cutout is used as a fallback. */
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / .10) 0 12%, #000 19%);
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / .10) 0 12%, #000 19%);
  pointer-events: none;
  user-select: none;
}

.stage[data-photo-projection] #portrait-surface {
  /* The cutout is 1.024 times the projected body height. Match its chest blend
     to the projected photograph and suppress the second head and neck. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 18.75%, #000 26.1%);
  mask-image: linear-gradient(to bottom, transparent 18.75%, #000 26.1%);
}

.stage #portrait {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
}
