/* Custom Cursor Styling */
.custom-cursor {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width var(--transition-fast), height var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
    mix-blend-mode: difference;
    display: none;
}

.custom-cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    transition: transform var(--transition-fast);
    display: none;
}

/* On hover of interactive elements, make cursor expand and blend */
body.cursor-hover .custom-cursor {
    width: 50px;
    height: 50px;
    background-color: rgba(var(--primary-rgb), 0.1);
    border-color: var(--accent);
}

body.cursor-hover .custom-cursor-dot {
    transform: translate(-50%, -50%) scale(2);
}

@media (pointer: fine) {
    .custom-cursor, .custom-cursor-dot {
        display: block;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 10001;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Animations Keyframes */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(3deg);
    }
}

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px -3px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 25px 5px var(--primary-glow);
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

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

/* Animation Classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

.animate-pulse-glow {
    animation: pulse-glow 3s infinite;
}

/* Reveal Animations (ScrollTrigger/IntersectionObserver targets) */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger transition delay helpers (up to 8 elements) */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }

/* Dynamic Glow Card Effect */
.glow-card {
    position: relative;
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(var(--primary-rgb), 0.08), transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-card:hover::before {
    opacity: 1;
}

/* Preloader Animation styling */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Animated Background Keyframes */
@keyframes heroGradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes heroGridPerspective {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.03);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes heroBeamPulse {
    0% {
        transform: scale(0.9) translate(0, 0);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.25) translate(40px, 30px);
        opacity: 0.85;
    }
    100% {
        transform: scale(0.9) translate(0, 0);
        opacity: 0.5;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.2;
    }
    25% {
        transform: translateY(-30px) translateX(20px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-60px) translateX(-15px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-30px) translateX(-30px) scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.2;
    }
}

@keyframes blobMorph1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50% 50% 50% 50%;
    }
    33% {
        transform: translate(40px, -50px) scale(1.15) rotate(120deg);
        border-radius: 40% 60% 70% 30%;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9) rotate(240deg);
        border-radius: 60% 40% 30% 70%;
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(360deg);
        border-radius: 50% 50% 50% 50%;
    }
}

@keyframes blobMorph2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50% 50% 50% 50%;
    }
    33% {
        transform: translate(-50px, 40px) scale(1.2) rotate(-120deg);
        border-radius: 70% 30% 50% 50%;
    }
    66% {
        transform: translate(35px, -40px) scale(0.85) rotate(-240deg);
        border-radius: 30% 70% 40% 60%;
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(-360deg);
        border-radius: 50% 50% 50% 50%;
    }
}

@keyframes blobMorph3 {
    0% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(30px, -30px) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.3;
    }
}
