:root {
  color-scheme: dark;
  --burgundy: color(display-p3 0.4078431373 0.031372549 0.0352941176);
  --ivory: #eee5cc;
  --scene-scale: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 280px;
  min-height: 100%;
  background: var(--burgundy);
}

body { color: var(--ivory); }

.hero {
  position: relative;
  height: 100svh;
  min-height: 400px;
  overflow: hidden;
}

.composition {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1080px;
  height: 766px;
  transform: translate(-50%, -50%) scale(var(--scene-scale));
}

.artwork {
  position: absolute;
  margin: 0;
  padding: 0;
  background-image: url('./assets/reference-artwork.jpg');
  background-repeat: no-repeat;
  background-size: 1080px 766px;
}

.heading {
  left: 302px;
  top: 30px;
  width: 472px;
  height: 99px;
  background-position: -302px -30px;
  overflow: hidden;
}

.name-mask {
  position: absolute;
  z-index: 1;
  top: 27px;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--burgundy);
}

.hero-names {
  position: absolute;
  z-index: 2;
  top: var(--name-top);
  left: 0;
  width: 100%;
  margin: 0;
  color: var(--ivory);
  font-family: var(--name-font);
  font-size: var(--name-size);
  font-weight: 400;
  letter-spacing: var(--name-spacing);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-rendering: geometricPrecision;
}

.photobooth {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.tray {
  left: 430px;
  top: 135px;
  width: 214px;
  height: 404px;
  background-position: -430px -135px;
}

.empty-basin {
  position: absolute;
  left: 470px;
  top: 177px;
  width: 134px;
  height: 333px;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent), linear-gradient(transparent, #000 12px, #000 96%, transparent);
  mask-composite: intersect;
  animation: clear-basin 4000ms both;
}

.print-window {
  position: absolute;
  left: 477px;
  top: 175px;
  width: 118px;
  height: 328px;
  overflow: hidden;
}

.photo-strip {
  position: absolute;
  left: 13px;
  top: 17px;
  width: 91px;
  height: 301px;
  background: url('./assets/reference-artwork.jpg') -490px -192px / 1080px 766px no-repeat;
  transform-origin: 50% 0;
  animation: print-photo 4000ms both;
}

.photo-strip img {
  position: absolute;
  left: 4px;
  display: block;
  width: 83px;
  object-fit: cover;
  object-position: 50% 35%;
  filter: grayscale(1) brightness(.86) contrast(.9);
}

.photo-strip img:nth-child(1) { top: 0; height: 69px; }
.photo-strip img:nth-child(2) { top: 75px; height: 63px; }
.photo-strip img:nth-child(3) { top: 144px; height: 64px; }
.photo-strip img:nth-child(4) { top: 210px; height: 66px; }

.slot-shade {
  position: absolute;
  left: 486px;
  top: 173px;
  width: 98px;
  height: 12px;
  background: linear-gradient(#171715b3, transparent);
  animation: clear-basin 4000ms both;
}

.date {
  left: 406px;
  top: 551px;
  width: 268px;
  height: 102px;
  background-position: -406px -551px;
}

.seal {
  left: 483px;
  top: 653px;
  width: 118px;
  height: 109px;
  border: 0;
  appearance: none;
  background-color: transparent;
  background-position: -483px -653px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.seal:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes print-photo {
  0%, 7% { transform: translateY(-319px); animation-timing-function: linear; }
  87% { transform: translateY(-18px); animation-timing-function: ease-in; }
  91% { transform: translateY(-18px); animation-timing-function: cubic-bezier(.5, 0, .9, .7); }
  97% { transform: translateY(1px); animation-timing-function: ease-out; }
  100% { transform: translateY(0); }
}

@keyframes clear-basin {
  0%, 98% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-strip, .empty-basin, .slot-shade { animation-duration: 1ms; }
}
