/* Animation is progressive: the invitation stays readable without JavaScript. */
.music-autoscrolling {
  scroll-behavior: auto !important;
}

.scroll-loop-curtain {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: var(--cream);
  pointer-events: none;
  transform-origin: center top;
  backface-visibility: hidden;
  will-change: opacity, transform;
}

.motion-enabled .reveal-pending {
  opacity: 0;
  translate: 0 24px;
}

.motion-enabled .reveal-visible {
  opacity: 1;
  translate: 0 0;
  transition: opacity 850ms ease, translate 850ms cubic-bezier(.2,.65,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Reveal the calligraphy as a whole so Vietnamese accents stay with each word. */
.motion-enabled .venue-card > .script.reveal-pending {
  clip-path: inset(-25% 100% -25% -12%);
  translate: 0 10px;
}

.motion-enabled .venue-card > .script.reveal-visible {
  clip-path: inset(-25% -12% -25% -12%);
  transition: opacity 900ms ease, translate 1100ms cubic-bezier(.2,.65,.3,1),
    clip-path 1300ms cubic-bezier(.2,.65,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-enabled .venue-location > .reveal-pending {
  translate: 0 14px;
}

.motion-enabled .venue-location > .reveal-visible {
  transition-duration: 1000ms;
}

@media (prefers-reduced-motion: no-preference) {
  .venue-location[data-side="groom"] {
    --venue-enter-x: 36px;
  }

  .venue-location[data-side="bride"] {
    --venue-enter-x: -36px;
  }

  .motion-enabled .venue-location.reveal-pending {
    translate: var(--venue-enter-x, 0px) 0;
  }

  .motion-enabled .venue-location.reveal-visible {
    transition-duration: 1150ms;
  }

  .motion-enabled .venue-location > .venue-name.reveal-pending {
    translate: 0 0;
  }

  .motion-enabled .venue-location > .venue-address.reveal-pending {
    translate: 0 6px;
  }

  .motion-enabled .venue-location > .venue-details.reveal-pending {
    translate: 0 16px;
    scale: .97;
  }

  .motion-enabled .venue-location > .venue-map.reveal-pending {
    translate: 0 8px;
    scale: .9;
  }

  .motion-enabled .venue-location > .venue-details.reveal-visible,
  .motion-enabled .venue-location > .venue-map.reveal-visible {
    scale: 1;
    transition: opacity 800ms ease, translate 1000ms cubic-bezier(.2,.65,.3,1),
      scale 1000ms cubic-bezier(.2,.65,.3,1);
    transition-delay: var(--reveal-delay, 0ms);
  }
}

.hero-photo,
.thank-you {
  overflow: hidden;
}

.motion-enabled .hero-photo > img,
.motion-enabled .venue-photo > img,
.motion-enabled .thank-you > img {
  animation: wedding-photo-drift 16s ease-in-out infinite alternate;
  animation-play-state: paused;
  transform-origin: 50% 55%;
}

.motion-enabled .venue-photo > img {
  animation-duration: 20s;
}

.motion-enabled .photo-in-view > img {
  animation-play-state: running;
}

.motion-paused .photo-in-view > img {
  animation-play-state: paused;
}

.album-slideshow {
  margin-bottom: 18px;
}

.album-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #d8d0c6;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
}

.album-slide {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: #d8d0c6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1100ms ease;
}

.album-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.album-slide:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: -8px;
}

.album-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  transform: scale(1.035);
  transition: transform 6500ms linear;
  user-select: none;
}

.album-slide.is-active > img {
  transform: scale(1);
}

.album-slide[data-photo="ending.webp"] > img {
  object-position: center 60%;
}

.album-slide-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 46px 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
  background: linear-gradient(transparent, #2d191975);
  color: white;
  z-index: 2;
  pointer-events: none;
}

.album-slide-caption > span:first-child {
  font: 2rem var(--script);
}

#album-slide-count {
  font: .75rem var(--sans);
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}

.album-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 0;
  gap: 3px;
}

.album-control,
.album-playback,
.album-dots > button {
  border: 0;
  background: transparent;
  color: var(--wine);
  min-height: 44px;
}

.album-control {
  width: 40px;
  display: grid;
  place-items: center;
}

.album-control svg {
  width: 18px;
  height: 18px;
}

.album-dots {
  display: flex;
  align-items: center;
}

.album-dots > button {
  width: 26px;
  display: grid;
  place-items: center;
  padding: 0;
}

.album-dots > button::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b5a18b;
  transition: background 250ms, transform 250ms;
}

.album-dots > button[aria-current="true"]::before {
  background: var(--wine);
  transform: scale(1.5);
}

.album-playback {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-left: auto;
  padding: 0 4px;
  font-size: .75rem;
}

.album-playback svg {
  width: 15px;
  height: 15px;
}

.album-playback:disabled {
  color: var(--muted);
  cursor: default;
}

@keyframes wedding-photo-drift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.055) translateY(-.5%); }
}

@media (max-width: 360px) {
  .album-slide-caption > span:first-child { font-size: 1.65rem; }
  .album-playback { font-size: .7rem; }
  .album-controls { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-enabled .venue-card > .script.reveal-pending,
  .motion-enabled .venue-card > .script.reveal-visible,
  .motion-enabled .venue-location > .reveal-pending,
  .motion-enabled .venue-location > .reveal-visible {
    clip-path: none;
    opacity: 1;
    translate: none;
    transition: none;
  }

  .motion-enabled .reveal-pending,
  .motion-enabled .reveal-visible {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .motion-enabled .hero-photo > img,
  .motion-enabled .venue-photo > img,
  .motion-enabled .thank-you > img {
    animation: none;
    transform: none;
  }

  .album-slide,
  .album-slide > img,
  .album-dots > button::before {
    transition: none;
    transform: none;
  }
}
