/* Mobile Performance Optimizations */

/* Disable animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch action optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

a, button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Prevent text selection on UI elements */
button, .gallery-item, .contact-button-menu {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-item-icon,
    .particle,
    .triangle {
        animation: none !important;
        transition: none !important;
    }
}

/* Performance: GPU acceleration for animations */
.gallery-item,
.gallery-item-inner,
.header-video,
.section-video {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Optimize font rendering on mobile */
@media (max-width: 768px) {
    body {
        text-rendering: optimizeSpeed;
    }
    
    h1, h2, h3 {
        text-rendering: optimizeLegibility;
    }
}

/* Reduce layout shifts */
img, video {
    aspect-ratio: attr(width) / attr(height);
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Reduce particle count on mobile */
    .particle {
        display: none;
    }
    
    /* Simplify gradients on mobile */
    .gallery-item-inner::before {
        opacity: 0.1 !important;
    }
    
    /* Disable parallax on mobile for performance */
    .gallery-item {
        transform: none !important;
        --scroll-y: 0 !important;
    }
}

/* Battery saving: Reduce animations on low battery */
@media (prefers-reduced-motion: reduce) {
    .gallery-item:hover {
        transform: translateY(-5px) !important;
    }
}

