.video-stage { display: block; width: min(100%, 250px); aspect-ratio: 16 / 9; margin: 0 auto; perspective: 650px; }
.video-stage.is-portrait { width: min(100%, 160px); aspect-ratio: 9 / 16; }
.video-object { --object-rest: -2deg; position: relative; display: block; width: 100%; height: 100%; transform: translateY(calc(var(--record-lift, 0px) + var(--object-hover, 0px))) rotateX(var(--record-pitch, 0deg)) rotateY(calc(var(--object-rest) + var(--record-yaw, 0deg))) rotateZ(var(--record-roll, 0deg)); transform-style: preserve-3d; }
.video-tile:nth-child(even) .video-object, #tv .video-object { --object-rest: 2deg; }
.tile-video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; background: #090909; border-radius: 2px; box-shadow: 2px 3px 0 #25251f, 3px 5px 10px rgb(0 0 0 / 28%); transform: translateZ(3px); }
.video-border { position: absolute; z-index: 2; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); overflow: visible; color: inherit; transform: translateZ(4px); pointer-events: none; }
.video-border path { fill: none; stroke: currentColor; stroke-width: 1.9px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* Playback controls sit below the image, leaving every frame unobscured. */
.video-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; width: min(100%, 250px); min-height: 44px; margin: 8px auto 0; color: inherit; }
.print-progress .video-controls { width: 100%; }
.video-controls.no-fullscreen { grid-template-columns: 44px minmax(0, 1fr); }
.video-controls[hidden], .video-controls [hidden] { display: none; }
.tile-play, .video-fullscreen { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile-play svg, .video-fullscreen svg { display: block; width: 24px; height: 24px; }
.tile-play svg { fill: currentColor; }
.video-fullscreen svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.video-seek { appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; accent-color: currentColor; cursor: pointer; }
.video-seek::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: currentColor; }
.video-seek::-moz-range-track { height: 2px; border-radius: 1px; background: currentColor; }
.video-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0; border-radius: 50%; background: currentColor; }
.video-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: currentColor; }
.video-seek:disabled { opacity: .4; cursor: default; }
.tile-play:focus-visible, .video-fullscreen:focus-visible, .video-seek:focus-visible, .tile-video:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.video-tile.is-playing .video-object { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .video-tile:not(.is-playing):hover .video-object { --object-hover: -2px; }
  .tile-play:hover, .video-fullscreen:hover { opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  .video-object { transform: none !important; }
}

@media (forced-colors: active) {
  .tile-video { box-shadow: none; outline: 1px solid CanvasText; }
  .tile-play, .video-fullscreen { color: ButtonText; border: 1px solid ButtonText; }
}
