/* cover.css — one full-bleed photographic stage (the page column, one screen tall).
 *
 * Layers, bottom -> top: cover img (the still: reduced motion + every fallback) < sway loop
 * (.is-on once a frame is presented) < [veil clip < veil poster img < lace hem img] < scrims
 * < text. Every picture is exactly 9:16 and shares object-fit / object-position, so the
 * layers register to the pixel. The veil layers leave the DOM once the veil has lifted.
 */
.cover {
  position: relative;
  height: max(var(--stage-h), var(--stage-min));
  overflow: clip;
  text-align: center;
  color: var(--ink);
}
@supports not (overflow: clip) { .cover { overflow: hidden; } }

.cover__media { position: absolute; inset: 0; }
.cover__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 60%;
}
.cover__img { background: var(--lilac-50); }
.cover__sway { opacity: 0; transition: opacity 300ms linear; }
.cover__sway.is-on { opacity: 1; }
.cover__veil { position: absolute; inset: 0; }

/* the lace hem breathes while the veil waits for the guest: it scales a few px from the
 * stage's bottom edge (its opaque part always covers the poster's own lace) */
.cover__hem { transform-origin: 50% 100%; }
.is-ready:not(.is-opening) .cover__hem { animation: hem-breathe 4.2s var(--ease-soft) infinite; }
@keyframes hem-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.035); }
}

/* the clip is on screen: the poster + hem go (its first frame IS the poster) */
.is-playing .cover__veil-img, .is-playing .cover__hem { opacity: 0; }
/* the clip has ended on the cover picture: it fades over the sway loop */
.is-veil-gone .cover__veil { opacity: 0; transition: opacity 200ms linear; }
/* fallback (no clip): the poster rises and fades over the cover */
.is-veil-fallback .cover__veil-video { display: none; }
.is-veil-fallback .cover__veil {
  opacity: 0;
  transform: translate3d(0, -100%, 0);
  transition: transform 900ms cubic-bezier(0.55, 0, 0.3, 1), opacity 900ms var(--ease-standard);
}
.is-open .cover__veil { display: none; }

/* scrims: gradients only. Pale paper at the top for the names; a faint shade at the foot */
.cover__scrim { position: absolute; left: 0; right: 0; pointer-events: none; }
.cover__scrim--top {
  top: 0;
  height: 52%;
  background: linear-gradient(180deg,
    rgba(251, 250, 253, 0.78) 0%, rgba(251, 250, 253, 0.66) 34%,
    rgba(251, 250, 253, 0.3) 62%, rgba(251, 250, 253, 0) 100%);
}
.cover__scrim--bottom {
  bottom: 0;
  height: 26%;
  background: linear-gradient(0deg, rgba(42, 32, 64, 0.34) 0%, rgba(42, 32, 64, 0.12) 45%, rgba(42, 32, 64, 0) 100%);
  opacity: 0; /* only once the veil is up: it would grey the lace hem */
  transition: opacity 1200ms var(--ease-standard) 600ms;
}
.is-entered .cover__scrim--bottom { opacity: 1; }

/* ---- text: in the sky band ------------------------------------------------------------------ */
.cover__text {
  position: absolute;
  left: 0; right: 0;
  top: max(7.5%, 44px);
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cover__kicker { max-width: 240px; text-wrap: balance; }

/* the names on one line (long names shrink; css var --chars from js/render.js) */
.names {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: min(15.4vw, 64px, calc((min(100vw, var(--column)) - 2 * var(--gutter)) / (var(--chars, 13) * 0.43)));
  line-height: 1;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
}
.names__line, .names__amp { display: inline-block; }
.names__amp {
  margin: 0 0.16em;
  font-style: italic;
  font-size: 0.66em;
  color: var(--lilac-800);
}
.names:focus { outline: none; }

.cover__meta { margin-top: 16px; display: grid; justify-items: center; gap: 6px; }
.cover__meta .rule { margin-bottom: 10px; background: rgba(90, 70, 135, 0.4); }
.cover__meta .kicker--soft { color: var(--ink); }

/* the scroll cue, white on the faint bottom shade */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  transition: opacity var(--motion-medium) var(--ease-standard);
}
/* on the photograph: a compact paper pill (the walk cue's language), ink on paper */
.scroll-cue__pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 15px 8px 17px;
  border: 1px solid rgba(50, 39, 76, 0.14);
  border-radius: 999px;
  background: rgba(251, 250, 253, 0.86);
}
.scroll-cue__label {
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--lilac-800);
}
.scroll-cue__chev {
  width: 6px; height: 6px;
  margin-top: -3px;
  border-right: 1.2px solid var(--lilac-800);
  border-bottom: 1.2px solid var(--lilac-800);
  transform: rotate(45deg);
}
.is-entered .scroll-cue__chev { animation: cue-nod 2.4s var(--ease-soft) 1.2s infinite; }
@keyframes cue-nod { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(3px) rotate(45deg); } }
.scroll-cue.is-retired { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .is-ready:not(.is-opening) .cover__hem { animation: none; }
  .is-opening .cover__veil { opacity: 0; transition: opacity 400ms linear; }
}

@media (max-height: 700px) {
  .cover__meta { margin-top: 12px; }
}
