/* ═══════════════════════════════════════════════════════
   ANIMATIONS.CSS — Chris & Gariné Wedding Site
   All @keyframes and animation utility classes
═══════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────
   SITE BORDER: Scrolling floral background
──────────────────────────────────────────────────────── */

/* Scrolling floral background — preserves native aspect ratio of background.png.
   JavaScript translates the image upward as the user scrolls, creating a
   natural parallax where more of the tall image is revealed. */
.site-border {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.site-border__inner {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    object-fit: cover;
    object-position: center top;
    opacity: 0.95;
    will-change: transform;
    /* JS sets --scroll-y; no transition on transform so scroll is instant */
    transform: translateY(var(--scroll-y, 0)) scale(1);
}

/* Before intro completes: zoomed in, invisible */
body:not(.intro-done) .site-border__inner {
    transform: translateY(var(--scroll-y, 0)) scale(1.8);
    opacity: 0;
}

/* Only during the brief zoom-out moment: apply the scale+opacity transition.
   JS removes .intro-zooming once the transition ends, so scroll is instant after. */
body.intro-zooming .site-border__inner {
    opacity: 0.95;
    transition: opacity 2s var(--ease-out), transform 1.8s var(--ease-out);
}

/* ────────────────────────────────────────────────────
   INTRO OVERLAY: Full-screen background.png + dancer
   
   The overlay covers the entire viewport. background.png
   fills it at scale(1) (full cover), creating the
   "we're inside the floral world" feeling.
   When body.intro-done is set, the overlay fades out
   while the site-border zooms from its scaled-up state
   to the framed border position.
──────────────────────────────────────────────────────── */

#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: all;
    overflow: hidden;
    /* background.png fills the overlay entirely */
    background-image: url('../assets/background.png');
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

#intro-overlay.fade-out {
    opacity: 0;
    transition: opacity 1.5s var(--ease-soft);
    pointer-events: none;
}

/* ── Dancer inside the intro overlay ── */
.intro-dancer {
    position: relative;
    width: clamp(120px, 22vw, 200px);
    height: clamp(120px, 22vw, 200px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(43, 32, 24, 0.35);
    opacity: 0;
    transform: translateY(16px) scale(0.92);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.intro-dancer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.intro-dancer--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ────────────────────────────────────────────────────
   DANCER: Fixed floating accent (bottom-right, after intro)
──────────────────────────────────────────────────────── */

@keyframes dancerSway {
    0% {
        transform: translateY(0px) rotate(-1deg);
    }

    25% {
        transform: translateY(-6px) rotate(0.5deg);
    }

    50% {
        transform: translateY(-2px) rotate(1.5deg);
    }

    75% {
        transform: translateY(-8px) rotate(0deg);
    }

    100% {
        transform: translateY(0px) rotate(-1deg);
    }
}

@keyframes dancerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) rotate(-1deg);
    }

    to {
        opacity: 1;
        transform: translateY(0px) rotate(-1deg);
    }
}

#dancer-float {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 50;
    width: clamp(80px, 12vw, 140px);
    height: clamp(80px, 12vw, 140px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(43, 32, 24, 0.1);
}

#dancer-float video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    animation: dancerSway 4.5s ease-in-out infinite;
}

#dancer-float.visible {
    animation: dancerFadeIn 1s var(--ease-out) forwards;
}

@media (max-width: 600px) {
    #dancer-float {
        width: 64px;
        height: 64px;
        bottom: calc(var(--space-4) + 52px); /* clear back-to-top button */
        right: var(--space-4);
        border-radius: var(--radius-md);
    }
}

/* ────────────────────────────────────────────────────
   HERO TEXT: staggered reveal
──────────────────────────────────────────────────────── */

@keyframes heroReveal {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    opacity: 0;
    animation: heroReveal 0.9s var(--ease-out) forwards;
}

.hero-animate--1 {
    animation-delay: 0.2s;
}

.hero-animate--2 {
    animation-delay: 0.5s;
}

.hero-animate--3 {
    animation-delay: 0.8s;
}

.hero-animate--4 {
    animation-delay: 1.1s;
}

/* ────────────────────────────────────────────────────
   SCROLL REVEAL: Fade up on enter
──────────────────────────────────────────────────────── */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 {
    transition-delay: 0.1s;
}

.reveal--delay-2 {
    transition-delay: 0.2s;
}

.reveal--delay-3 {
    transition-delay: 0.35s;
}

.reveal--delay-4 {
    transition-delay: 0.5s;
}

/* ────────────────────────────────────────────────────
   SPOTIFY MODAL: slide up
──────────────────────────────────────────────────────── */

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}