/* =============================================================================
   animations.css — Ayaan & Ayesha Nikah Invitation
   Ambient motion, entrance choreography, decorative floats and the
   prefers-reduced-motion contract. No animation libraries.
   ============================================================================= */

/* ---------- 1. ENTRANCE CHOREOGRAPHY -------------------------------------- *
   Total sequence ≈ 2.0s: card lift (0.9s) + curtain slide (1.5s) + fade (0.6s).
   -------------------------------------------------------------------------- */
.entrance__card {
  animation: card-arrive 900ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.entrance__arch { animation: soft-breathe 5.5s ease-in-out infinite; }
.entrance__star { animation: float-y 4.5s ease-in-out infinite; }

.entrance__open-ring {
  animation: ring-pulse 2.6s ease-out infinite;
}

.entrance__hint {
  animation: fade-up 900ms 350ms ease both;
}

.entrance.is-open .entrance__stage {
  transition: opacity 500ms 450ms ease, transform 700ms 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
  opacity: 0;
  transform: scale(1.04);
}

@keyframes card-arrive {
  from { opacity: 0; transform: translateY(34px) scale(0.965); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes soft-breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.035); }
}

@keyframes ring-pulse {
  0%   { transform: scale(1); opacity: 0.9; }
  70%  { transform: scale(1.14); opacity: 0; }
  100% { transform: scale(1.14); opacity: 0; }
}

/* ---------- 2. HERO -------------------------------------------------------- */
.hero__eyebrow { animation: fade-up 800ms 120ms ease both; }
.hero__names   { animation: fade-up 900ms 240ms ease both; }
.hero__line    { animation: fade-up 900ms 420ms ease both; }
.hero__meta    { animation: fade-up 900ms 540ms ease both; }
.hero__actions { animation: fade-up 900ms 660ms ease both; }
.hero__media   { animation: arch-reveal 1100ms 160ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.scroll-indicator { animation: fade-up 900ms 900ms ease both; }

@keyframes arch-reveal {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wheel {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(9px); opacity: 0.15; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- 3. DECORATIVE FLOATS ------------------------------------------ */
.panel__ornament { animation: float-y 7s ease-in-out infinite; }
.panel__ornament--tr { animation-delay: 0.8s; }
.panel__ornament--bl { animation-delay: 1.6s; }
.panel__ornament--br { animation-delay: 2.4s; }

.scratch__corner { animation: soft-breathe 6s ease-in-out infinite; }

/* ---------- 4. COUNTDOWN TICK --------------------------------------------- */
.countdown__cell.is-ticking { animation: tick 380ms ease; }

@keyframes tick {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* ---------- 5. TIMELINE / SECTION ENTRANCES -------------------------------- */
.timeline__item { opacity: 0; transform: translateY(24px); }
.no-js .timeline__item { opacity: 1; transform: none; }

.timeline__item.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 620ms ease, transform 620ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.timeline__item.is-visible:nth-child(2) { transition-delay: 90ms; }
.timeline__item.is-visible:nth-child(3) { transition-delay: 180ms; }
.timeline__item.is-visible:nth-child(4) { transition-delay: 270ms; }

.event-card,
.dress-card,
.venue-card { transition: transform var(--transition-med), box-shadow var(--transition-med); }

/* ---------- 6. MUSIC ICON -------------------------------------------------- */
.music-icon__wave { transform-origin: center; opacity: 0.45; }

.float-btn--music[data-state="playing"] .music-icon__wave { opacity: 1; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.55); }
  50%      { transform: scaleY(1); }
}

/* ---------- 7. BUTTON MICRO-INTERACTIONS ----------------------------------- */
.btn { will-change: transform; }

.btn--solid::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* ---------- 8. OPTIONAL GENTLE PARALLAX (applied by sections.js) ----------- */
.has-parallax {
  will-change: transform;
  transition: transform 220ms linear;
}

/* ---------- 9. REDUCED MOTION --------------------------------------------- *
   Everything decorative stops. Content is never gated behind an animation:
   .reveal elements are immediately visible, the entrance can be dismissed
   without a transition, and the countdown keeps updating numerically
   (a per-second text change is informational, not decorative motion).
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .reveal,
  .timeline__item {
    opacity: 1 !important;
    transform: none !important;
  }

  .entrance__curtain { transition: none !important; }
  .entrance.is-open .entrance__curtain--left { transform: translateX(-102%); }
  .entrance.is-open .entrance__curtain--right { transform: translateX(102%); }

  .has-parallax { transform: none !important; transition: none !important; }
}
