/* ==========================================================================
   POORNAPRAJNA CENTRE FOR ENVIRONMENTAL & SDGS-2030 AWARENESS (PCEA)
   Cinematic Animations & Scroll Motion Engine
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scroll Reveal Animation Base Classes (Controlled by IntersectionObserver)
   -------------------------------------------------------------------------- */

[data-reveal] {
    opacity: 0;
    transition-property: opacity, transform, filter;
    transition-duration: 0.85s;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform;
}

[data-reveal="fade-up"] {
    transform: translateY(40px);
}

[data-reveal="fade-down"] {
    transform: translateY(-40px);
}

[data-reveal="fade-left"] {
    transform: translateX(-40px);
}

[data-reveal="fade-right"] {
    transform: translateX(40px);
}

[data-reveal="scale-up"] {
    transform: scale(0.88);
}

[data-reveal="blur-in"] {
    transform: translateY(25px) scale(0.96);
    filter: blur(8px);
}

/* Active In-View State */
[data-reveal].is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: blur(0);
}

/* Reverse Scroll Out State (Smooth exit without flickering) */
[data-reveal].is-hidden-above {
    opacity: 0.9;
    transform: translate(0, 0);
}

/* Stagger Delays */
.delay-100 { --delay: 0.1s; }
.delay-200 { --delay: 0.2s; }
.delay-300 { --delay: 0.3s; }
.delay-400 { --delay: 0.4s; }
.delay-500 { --delay: 0.5s; }
.delay-600 { --delay: 0.6s; }
.delay-700 { --delay: 0.7s; }
.delay-800 { --delay: 0.8s; }

/* --------------------------------------------------------------------------
   Hero Staggered Cinematic Keyframes
   -------------------------------------------------------------------------- */

@keyframes heroZoom {
    0% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1.0);
    }
}

.hero-bg-anim {
    animation: heroZoom 14s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatGentle {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 25px rgba(154, 216, 43, 0.3), 0 0 10px rgba(79, 174, 36, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 45px rgba(154, 216, 43, 0.6), 0 0 20px rgba(79, 174, 36, 0.7);
        transform: scale(1.03);
    }
}

.animate-float {
    animation: floatGentle 6s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatGentle 9s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 4s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   Animated Falling & Floating Leaves System (Canvas & CSS Overlays)
   -------------------------------------------------------------------------- */

#leaves-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none !important;
    user-select: none !important;
    z-index: 25;
    overflow: hidden;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.real-leaf-item {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none !important;
    user-select: none !important;
    will-change: transform, opacity;
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    backface-visibility: visible;
}

.real-leaf-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none;
}

/* --------------------------------------------------------------------------
   3D Tilt Physics for Selected Feature Cards
   -------------------------------------------------------------------------- */

.tilt-element {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.15s ease-out;
}

.tilt-inner {
    transform: translateZ(24px);
}

/* --------------------------------------------------------------------------
   Shimmer & Glow Effects
   -------------------------------------------------------------------------- */

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

.text-shimmer {
    background: linear-gradient(90deg, #9AD82B 0%, #ffffff 50%, #9AD82B 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s infinite linear;
}

/* --------------------------------------------------------------------------
   Mobile Menu Transition Styles
   -------------------------------------------------------------------------- */

#mobile-menu-drawer {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

#mobile-menu-drawer.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

#mobile-menu-drawer.is-closed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Morphing Hamburger Icon */
.hamburger-line {
    transition: all 0.35s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    transform-origin: center;
}

.hamburger.is-active .line-1 {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.is-active .line-2 {
    opacity: 0;
    transform: scale(0.2);
}

.hamburger.is-active .line-3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion Preference
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    
    #leaves-canvas-container {
        display: none !important;
    }
    
    .hero-bg-anim {
        animation: none !important;
    }
}
