/* Performance Optimizations and Effects */

/* Enable hardware acceleration for better performance */
.hero, .project-card, .planet, .morphing-blob, .floating-particles {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize animations to use transform and opacity only */
.particle {
    will-change: transform, opacity;
}

.nav-link, .btn {
    will-change: transform;
}

/* Optimized particle animations */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--aurora-green);
    border-radius: 50%;
    opacity: 0.6;
    animation: particle-float 20s linear infinite;
    will-change: transform;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
        transform: translateY(90vh) translateX(10px) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateY(10vh) translateX(-10px) scale(1);
    }
    100% {
        transform: translateY(-10vh) translateX(0) scale(0);
        opacity: 0;
    }
}

/* Optimized morphing blob styles */
.morphing-blob {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(103, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 50%;
    filter: blur(40px);
    animation: blob-morph 20s ease-in-out infinite;
    will-change: transform;
    z-index: 0;
}

@keyframes blob-morph {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
        border-radius: 50%;
    }
    25% {
        transform: translateX(20px) translateY(-20px) scale(1.1);
        border-radius: 45% 55% 60% 40%;
    }
    50% {
        transform: translateX(-20px) translateY(20px) scale(0.9);
        border-radius: 60% 40% 30% 70%;
    }
    75% {
        transform: translateX(20px) translateY(10px) scale(1.05);
        border-radius: 40% 60% 70% 30%;
    }
}

/* Stagger animation classes */
.stagger-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.stagger-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .morphing-blob, .floating-particles, .cosmic-dust {
        display: none;
    }
}

/* Optimize scrollbar for performance */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--aurora-green) var(--deep-space);
}

/* Use containment for better performance */
.project-card, .blog-card, .stat-card {
    contain: layout style;
}

.hero {
    contain: layout;
}

/* Disable complex animations on lower-end devices */
@media (max-width: 768px) {
    .morphing-blob, .floating-particles {
        display: none;
    }
    
    .project-card:hover {
        transform: none;
    }
    
    * {
        animation-duration: 0.1s !important;
    }
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
