* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header {
    padding: 2rem;
    text-align: center;
    background: white;
    position: fixed;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 2rem 2rem;
}

.gallery {
    columns: 4 300px;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Staggered animation delays */
.gallery-item:nth-child(4n + 1) { transition-delay: 0.1s; }
.gallery-item:nth-child(4n + 2) { transition-delay: 0.2s; }
.gallery-item:nth-child(4n + 3) { transition-delay: 0.3s; }
.gallery-item:nth-child(4n + 4) { transition-delay: 0.4s; }

/* Custom heights for variety */
/* .gallery-item:nth-child(7n + 1) img { aspect-ratio: 3/4; }
.gallery-item:nth-child(7n + 2) img { aspect-ratio: 1/1; }
.gallery-item:nth-child(7n + 3) img { aspect-ratio: 4/3; }
.gallery-item:nth-child(7n + 4) img { aspect-ratio: 1/1; }
.gallery-item:nth-child(7n + 5) img { aspect-ratio: 1/2; }
.gallery-item:nth-child(7n + 6) img { aspect-ratio: 1.5; }
.gallery-item:nth-child(7n + 7) img { aspect-ratio: 0.6; } */

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transform-origin: 0 50%;
    transform: scaleX(0);
    transition: transform 0.2s ease;
    z-index: 1000;
}

@media (max-width: 1200px) {
    .gallery {
        columns: 3 250px;
    }
}

@media (max-width: 768px) {
    .gallery {
        columns: 2 200px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .gallery-container {
        padding: 100px 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .gallery {
        columns: 1 auto;
    }
}


/* Popup styles */
.image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-popup.active {
    opacity: 1;
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-content.active {
    transform: scale(1);
}

.popup-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s ease;
}

.popup-close {
    position: absolute;
    top: -40px;
    right: -40px;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    outline: none;
    transition: color 0.2s;
}

.popup-close:hover {
    color: #f8f8f8;
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.popup-prev {
    left: -80px;
}

.popup-next {
    right: -80px;
}

.popup-caption {
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 16px;
}

@media (max-width: 768px) {
    .popup-nav {
        width: 40px;
        height: 40px;
    }
    
    .popup-prev {
        left: 20px;
    }
    
    .popup-next {
        right: 20px;
    }
    
    .popup-close {
        top: -30px;
        right: 0;
    }
}