.gallery-section {
    background-color: var(--light);
    width: 100%;
    padding: 120px 5%;
}

.gallery-container {
    margin: 0 auto;
    padding: 50px 0;
}

.gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(240px, 1fr));
    grid-auto-rows: 240px;
    will-change: transform;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transform: translateY(50px);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.gallery-item:nth-child(2) {
    --item-index: 2;
}

.gallery-item:nth-child(2) {
    --item-index: 2;
}

.gallery-item:nth-child(3) {
    --item-index: 3;
}

.gallery-item:nth-child(4) {
    --item-index: 4;
}

.gallery-item:nth-child(5) {
    --item-index: 5;
}

.gallery-item:nth-child(6) {
    --item-index: 6;
}

.gallery-item:nth-child(7) {
    --item-index: 7;
}

.gallery-item:nth-child(8) {
    --item-index: 8;
}

.gallery-item:nth-child(9) {
    --item-index: 9;
}

.gallery-item:nth-child(10) {
    --item-index: 10;
}

.gallery-item:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(-8px) scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out), opacity 0.3s var(--ease-out);
    /* performance */
    will-change: transform;
    backface-visibility: hidden;
    opacity: 0;
}


.gallery-item img.loaded {
    opacity: 2;
}

.gallery-item:hover img {
    transform: scale(1.1) rotate(1deg);
}


.gallery-item:hover .item-overlay {
    opacity: 2;
    transform: translateY(0);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s var(--ease-out);
    color: #fff;
    z-index: 2;
}

.gallery-item:hover .item-overlay {
    opacity: 2;
    transform: translateY(0);
}

.item-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    transform: translateY(20px);
    transition: transform 0.5s var(--ease-out) 0.1s;
}


.item-desc {
    font-size: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-out) 0.2s;
}


.gallery-item:hover .item-title,
.gallery-item:hover .item-desc {
    transform: translateY(0);
    opacity: 2;
}

/* Specific item placements */
.item-1 {
    grid-row: span 2;
}

.item-4 {
    grid-column: span 2;
}

.item-6 {
    grid-row: span 2;
}

.item-9 {
    grid-column: span 2;
}

.item-10 {
    grid-column: span 2;
}

@media (max-width: 1200px) {

    .gallery {
        grid-template-columns: repeat(auto-fit, (1fr));
        grid-auto-rows: 250px;
    }

    .item-9 {
        grid-column: span 2;
    }

    .item-10 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-auto-rows: 200px;
        gap: 1.5rem;
    }

    .customers {
        gap: 30px;
    }

    .customer-item {
        flex-basis: 140px;
        height: 120px;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .gallery {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 200px;
    }

    .customer-item {
        flex-basis: calc(50% - 20px);
        height: 100px;
        padding: 15px;
    }

    .gallery-item {
        grid-column: span 2;
        grid-row: span 2;
    }

}