/* Image Optimization for Fast Loading */

/* Base image optimization */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Lazy loading images */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

.lazy-image.loaded {
    opacity: 1;
}

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

/* Optimized background images */
.bg-image-optimized {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
}

/* Service card image optimization */
.service-image {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    margin-bottom: 15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    will-change: transform;
}

.service-image:hover {
    transform: scale(1.05);
}

/* Portfolio image optimization */
.portfolio-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    transition: transform 0.3s ease;
    will-change: transform;
}

.portfolio-image:hover {
    transform: scale(1.02);
}

/* Founder image optimization */
.founder-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 20px;
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    will-change: transform;
}

.founder-image:hover {
    transform: scale(1.05);
}

/* Responsive image sizing */
@media (max-width: 768px) {
    .founder-image {
        width: 160px;
        height: 160px;
    }
    
    .service-image {
        height: 120px;
    }
    
    .portfolio-image {
        height: 130px;
    }
}

/* Image loading states */
.image-container {
    position: relative;
    overflow: hidden;
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: image-loading 1.5s infinite;
    z-index: 1;
}

.image-container.loaded::before {
    display: none;
}

@keyframes image-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Critical image optimization */
.hero-background {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
}

/* Mobile optimization - disable fixed background for performance */
@media (max-width: 768px) {
    .hero-background {
        background-attachment: scroll;
    }
}