/* ============================================================
   ETHMAN EVERGREEN ENVIRONMENT — Animations
   ============================================================ */

/* --- Scroll-Triggered Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* Direction Variants */
.fade-up {
    transform: translateY(40px);
}

.fade-down {
    transform: translateY(-40px);
}

.fade-right {
    transform: translateX(-50px);
}

.fade-left {
    transform: translateX(50px);
}

.fade-right.visible,
.fade-left.visible {
    transform: translateX(0);
}

/* Delay Classes */
.delay-1 {
    transition-delay: 0.15s;
}

.delay-2 {
    transition-delay: 0.3s;
}

.delay-3 {
    transition-delay: 0.45s;
}

.delay-4 {
    transition-delay: 0.6s;
}

/* --- Floating Particles --- */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0);
    }

    10% {
        opacity: 0.6;
        transform: scale(1);
    }

    90% {
        opacity: 0.2;
    }

    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(50px) scale(0.3);
    }
}

/* --- Typing / Reveal Effect --- */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(110%);
    animation: textReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* --- Staggered Card Entrance --- */
.stagger-enter .sbu-card:nth-child(1) {
    transition-delay: 0.05s;
}

.stagger-enter .sbu-card:nth-child(2) {
    transition-delay: 0.12s;
}

.stagger-enter .sbu-card:nth-child(3) {
    transition-delay: 0.19s;
}

.stagger-enter .sbu-card:nth-child(4) {
    transition-delay: 0.26s;
}

.stagger-enter .sbu-card:nth-child(5) {
    transition-delay: 0.33s;
}

/* --- Glow Hover Effect --- */
.glow-hover {
    position: relative;
}

.glow-hover::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from var(--glow-angle, 0deg),
            transparent 0%,
            rgba(82, 183, 136, 0.4) 10%,
            transparent 20%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: glowRotate 4s linear infinite;
}

.glow-hover:hover::after {
    opacity: 1;
}

@keyframes glowRotate {
    to {
        --glow-angle: 360deg;
    }
}

/* --- Morphing Background Blobs --- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blobMorph 12s ease-in-out infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--emerald);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--tech-teal);
    bottom: -50px;
    left: -50px;
    animation-delay: -4s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-gold);
    top: 40%;
    left: 30%;
    animation-delay: -8s;
}

@keyframes blobMorph {
    0% {
        border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        border-radius: 30% 70% 50% 50% / 50% 40% 60% 50%;
        transform: translate(-20px, 20px) rotate(240deg);
    }

    100% {
        border-radius: 50% 50% 40% 60% / 60% 50% 50% 40%;
        transform: translate(10px, -10px) rotate(360deg);
    }
}

/* --- Number Counter Shimmer --- */
.counter.counting {
    background: linear-gradient(90deg,
            var(--emerald-light) 0%,
            var(--mint) 50%,
            var(--emerald-light) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 1.5s ease-in-out;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* --- Dashboard Bar Animation --- */
.dashboard-preview.visible .bar-fill {
    height: 100%;
    transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-preview.visible .chart-bar:nth-child(1) .bar-fill {
    transition-delay: 0.1s;
}

.dashboard-preview.visible .chart-bar:nth-child(2) .bar-fill {
    transition-delay: 0.2s;
}

.dashboard-preview.visible .chart-bar:nth-child(3) .bar-fill {
    transition-delay: 0.3s;
}

.dashboard-preview.visible .chart-bar:nth-child(4) .bar-fill {
    transition-delay: 0.4s;
}

.dashboard-preview.visible .chart-bar:nth-child(5) .bar-fill {
    transition-delay: 0.5s;
}

.dashboard-preview.visible .chart-bar:nth-child(6) .bar-fill {
    transition-delay: 0.6s;
}

/* --- Progress Bar Animation --- */
.impact-card.visible .progress-bar {
    transition: width 2s cubic-bezier(0, 0, 0.2, 1) 0.5s;
}

/* --- Smooth Link Underline --- */
.underline-hover {
    position: relative;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--emerald);
    transition: width 0.3s ease;
}

.underline-hover:hover::after {
    width: 100%;
}

/* --- Card Tilt (subtle) --- */
@media (hover: hover) {
    .tilt-card {
        transition: transform 0.4s ease;
        transform-style: preserve-3d;
        perspective: 1000px;
    }
}

/* --- Ripple Click Effect --- */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple.active::after {
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }

    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* --- Magnetic Cursor Attraction (for buttons) --- */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--forest-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes loadingPulse {

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

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--emerald), var(--mint));
    border-radius: 2px;
    animation: loadingProgress 1.8s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% {
        width: 0;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

.loading-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* --- Parallax Subtle --- */
.parallax-element {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* --- SBU Card Hidden State for Filtering --- */
.sbu-card.hidden-filter {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.sbu-card {
    transition:
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Smooth Section Transitions --- */
section {
    position: relative;
}

/* --- Mobile Menu Animation --- */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}