/* The last node: the greeting, then a vertical reel of congratulations. */

.finale {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: center;
  align-items: center;
}

.finale__title {
  font-size: var(--text-xl);
  line-height: 1.15;
}

.finale__text {
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 34ch;
}

.finale__caption {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- the reel ------------------------------------------------------------
   One clip fills the window; a vertical snap scroll flips to the next, the way
   Reels does. `overscroll-behavior` keeps a hard swipe at either end from
   dragging the sheet underneath. */

.finale__reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.reel {
  position: relative;
  width: 100%;
  height: min(52vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch;
}

.reel__slide {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.reel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: var(--space-4) var(--space-3) var(--space-3);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(to top, rgb(0 0 0 / 60%), transparent);
}

.reel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.reel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 25%, transparent);
  cursor: pointer;
}

.reel__dot--on {
  background: var(--violet);
}

/* A slow drift between paper and rose, only when motion is welcome. */
.finale--animated {
  animation: finale-glow 9s ease-in-out infinite alternate;
}

@keyframes finale-glow {
  from {
    background: var(--surface);
  }
  to {
    background: var(--rose-soft);
  }
}

/* The finale is a full-screen page, not a sheet you drag: no grip, no corners. */
.sheet--finale {
  max-height: 100dvh;
  height: 100dvh;
  justify-content: center;
  border-radius: 0;
  box-shadow: none;
}

.sheet--finale .sheet__grip {
  display: none;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
