* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #080b0d; }
body { color: #f8f7f5; font-family: Inter, Arial, sans-serif; }
main { position: relative; touch-action: pan-x; isolation: isolate; }
.media, .shade { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.motion, .fallback { object-fit: cover; object-position: 50% 50%; }
#transitionVideo, .fallback, #photoDepth { opacity: 0; pointer-events: none; }
.shade {
  pointer-events: none;
  background: linear-gradient(90deg, #0000001f, transparent 45%, #00000040),
    linear-gradient(0deg, #0000006b, transparent 22%);
}
.photo-frame {
  --corner-color: #f0d7af;
  position: absolute;
  inset: clamp(10px, 2vw, 28px);
  opacity: 0;
  pointer-events: none;
}
main[data-stop="2"] .photo-frame { --corner-color: #f9d5ce; }
.photo-frame i { position: absolute; width: 34px; height: 34px; border: 0 solid var(--corner-color); opacity: .65; }
.photo-frame i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.photo-frame i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.photo-frame i:nth-child(3) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.photo-frame i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
main[data-stop="1"] .photo-frame, main[data-stop="2"] .photo-frame {
  opacity: 1;
  animation: frame-arrives .9s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes frame-arrives {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

.card {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 5vw, 80px);
  top: 50%;
  width: clamp(200px, 17vw, 250px);
  transform: translateY(-48%) perspective(820px) rotateY(-13deg) rotateX(2deg) scale(var(--print-scale, 1));
  transform-origin: right center;
  background: linear-gradient(135deg, #39332eaf, #101419c2);
  border: 1px solid #dddedb80;
  box-shadow: inset 0 1px 0 #ffffff26, 6px 18px 45px #0009;
  padding: 10px;
}
.card img { width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; }
.details { padding: 10px 8px 6px; text-shadow: 0 1px 4px #0008; }
.details p { font-size: 10px; letter-spacing: .2em; color: #c9cac8; margin: 0; }
.details h1 { font-size: 14px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; margin: 9px 0 14px; }
.details p, .prompt { text-transform: uppercase; }
.rule { height: 1px; background: #ffffff40; margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; gap: 8px; color: #dedfdd; font-size: 11px; margin: 10px 0; }
.row span:last-child { text-align: right; }
#printDetails {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #ffffff90;
  background: transparent;
  border-radius: 30px;
  padding: 10px;
  color: white;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  cursor: pointer;
}
#printDetails:focus-visible { outline: 1px solid white; outline-offset: 4px; }
#printMessage { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: #ddd; }
.prompt {
  position: absolute;
  bottom: 78px;
  left: 7%;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: .2em;
  line-height: 1.7;
  text-shadow: 0 1px 10px #000;
  transition: opacity .4s;
  pointer-events: none;
}
.prompt[hidden] { display: none; }
.prompt-icon { width: 38px; height: 46px; display: grid; place-items: center; border: 1px solid #ffffffb0; border-radius: 30px; font-size: 19px; letter-spacing: 0; }
.journey { position: absolute; bottom: 24px; left: 7%; width: 86%; height: 35px; pointer-events: none; }
.journey path { fill: none; stroke: #ffffff8a; stroke-width: 1; }
.journey circle { fill: white; filter: drop-shadow(0 0 4px #fff); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
@media (max-width: 600px) {
  .motion, .fallback { object-position: 42% 50%; }
  .card {
    width: 165px; top: auto; right: 16px; bottom: 70px;
    transform: perspective(820px) rotateY(-9deg) rotateX(2deg) scale(var(--print-scale, 1));
    transform-origin: right bottom;
  }
  .details { padding: 8px 4px; }
  .details h1 { font-size: 12px; margin: 8px 0; }
  .row { font-size: 10px; margin: 7px 0; }
  #printDetails { margin-top: 5px; padding: 8px; }
  .journey { bottom: 20px; height: 25px; }
  .prompt { bottom: 75px; left: 6%; font-size: 9px; max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-frame, .card, .prompt { animation-duration: .01s !important; transition: none !important; }
}
