/* ===========================================
   SCROLL REVEAL ANIMATIONS
   =========================================== */

[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
    opacity: 1;
    transform: none !important;
}

/* Direction variants */
[data-animate="fade-up"]    { transform: translateY(40px); }
[data-animate="fade-down"]  { transform: translateY(-40px); }
[data-animate="fade-left"]  { transform: translateX(-40px); }
[data-animate="fade-right"] { transform: translateX(40px); }
[data-animate="scale-in"]   { transform: scale(0.9); }
[data-animate="fade-in"]    { /* opacity only */ }

/* Stagger delays */
[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }

/* ===========================================
   HERO PLOP-IN ANIMATION (Perspective-inspired)
   =========================================== */

@keyframes plopIn {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(-15deg) scale(0.95);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        transform: translateY(-4px) rotateX(0deg) scale(1.01);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
        filter: blur(0);
    }
}

.hero-plop {
    opacity: 0;
    display: inline-block;
}

.hero-plop.is-visible {
    animation: plopIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-plop[data-plop-delay="0"].is-visible { animation-delay: 0.1s; }
.hero-plop[data-plop-delay="1"].is-visible { animation-delay: 0.3s; }
.hero-plop[data-plop-delay="2"].is-visible { animation-delay: 0.5s; }
.hero-plop[data-plop-delay="3"].is-visible { animation-delay: 0.8s; }
.hero-plop[data-plop-delay="4"].is-visible { animation-delay: 1.1s; }

/* ===========================================
   HERO ROTATING WORD
   =========================================== */

.hero__rotating-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.hero__rotating-word {
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(135deg, var(--color-blue), var(--color-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.hero__rotating-word.is-active {
    opacity: 1;
    transform: translateY(0);
}

.hero__rotating-word.is-exiting {
    opacity: 0;
    transform: translateY(-100%);
}

/* Hidden sizer: keeps wrapper at the width of the widest word */
.hero__rotating-sizer {
    visibility: hidden;
    display: block;
    height: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* ===========================================
   HERO BACKGROUND ORBS
   =========================================== */

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -20px) scale(1.05); }
    66%      { transform: translate(-20px, 15px) scale(0.95); }
}

.hero__orb {
    animation: float 8s ease-in-out infinite;
}

.hero__orb--2 {
    animation-delay: -3s;
    animation-duration: 10s;
}

/* ===========================================
   SCROLL INDICATOR BOUNCE
   =========================================== */

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(10px); }
}

.hero__scroll {
    animation: bounce 2s ease-in-out infinite;
}

/* ===========================================
   BUTTON GRADIENT SHIMMER
   =========================================== */

@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.btn--primary:hover {
    background-size: 200% auto;
    animation: shimmer 2s linear infinite;
}

/* ===========================================
   REDUCED MOTION
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate],
    .hero-plop {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero__rotating-word {
        transition: none !important;
    }
}
