.gallery-wrapper {
    height: 300vh;
    position: relative;
    background: var(--c-black);
    width: 100%;
}

.gallery-wrapper .titleArea {
    width: 100vw;
    display: flex;
    justify-content: center;
}

.gallery-wrapper h2 {
    font-size: clamp(2.35rem, 4.5vw, 4rem);
    line-height: 1.1;
    font-weight: 500;
    width: 80%;
    max-width: 1400px;
    padding-left: 2rem;
}

.scroll-animations-example {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.scroll-animations-example .scrollsection {
    display: flex;
    align-items: center;
    padding: 0 10vw;
    width: max-content;
    will-change: transform;
}

#gallery-container {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
}

.scroll-animations-example .item {
    position: relative;
    margin: 0 3vh;
    flex-shrink: 0;
}

.scroll-animations-example .item.-big {
    height: 80vh;
    width: 60vh;
}

.scroll-animations-example .item.-big.-horizontal {
    height: 60vh;
    width: 80vh;
}

.scroll-animations-example .item.-normal {
    height: 60vh;
    width: 45vh;
    z-index: 1;
}

.scroll-animations-example .item.-normal.-horizontal {
    height: 45vh;
    width: 60vh;
}

.scroll-animations-example .item.-small {
    height: 40vh;
    width: 30vh;
    z-index: 2;
}

.scroll-animations-example .item.-small.-horizontal {
    height: 30vh;
    width: 40vh;
}

.scroll-animations-example .item.-normal:nth-of-type(3n) {
    margin-bottom: 10vh;
}

.scroll-animations-example .item.-normal:nth-of-type(4n) {
    margin-top: 10vh;
}

.scroll-animations-example .item.-small:nth-of-type(3n) {
    margin-bottom: 26vh;
}

.scroll-animations-example .item.-small:nth-of-type(4n) {
    margin-top: 26vh;
}

.scroll-animations-example .item .image {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 1rem;
    filter: grayscale(1);
    opacity: 0.8;
    transform: scale(1);
    transition: filter 0.4s ease, opacity 0.4s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.scroll-animations-example .item .image:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.02);
}

.scroll-animations-example .item .image.-clicked {
    transform: scale(1.5);
    opacity: 0;
    pointer-events: none;
}

.gamma-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    max-width: 100vw;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gamma-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 8, 0.85);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.gamma-modal:not(.hidden) .modal-content {
    transform: translateY(0) scale(1);
}

.modal-image-container {
    height: 70vh;
    border: 1.5px solid var(--c-lightBorder);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--c-black);
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-legend {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    background: rgba(5, 8, 8, 0.03);
    border: 1px solid var(--c-lightBorder);
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
}

.legend-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item .label {
    font-family: 'sora', monospace;
    font-size: 0.75rem;
    color: var(--c-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-item .value {
    font-size: 1rem;
    color: var(--c-white);
    font-weight: 300;
}

.modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close .line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--c-white);
    transition: background 0.2s ease;
}

.modal-close:hover .line {
    background: var(--c-secondary);
}

.modal-close .line:first-child {
    transform: rotate(45deg);
}

.modal-close .line:last-child {
    transform: rotate(-45deg);
}

@media (max-width: 950px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .gallery-wrapper {
        max-width: 100%;
        overflow-x: hidden;
    }

    .gallery-wrapper {
        height: auto;
        padding: 2rem 0;
    }
    .scroll-animations-example {
        position: relative;
        height: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .scroll-animations-example .scrollsection {
        padding: 0 5vw;
        scroll-snap-type: x mandatory;
    }

    .scroll-animations-example .item {
        scroll-snap-align: center;
        margin: 0 1rem;
    }

    .scroll-animations-example .item.-big,
    .scroll-animations-example .item.-big.-horizontal {
        height: 50dvh;
        width: 75vw;
    }

    .scroll-animations-example .item.-normal,
    .scroll-animations-example .item.-normal.-horizontal {
        height: 40dvh;
        width: 60vw;
    }

    .scroll-animations-example .item.-small,
    .scroll-animations-example .item.-small.-horizontal {
        height: 30dvh;
        width: 45vw;
    }

    .scroll-animations-example .item.-normal:nth-of-type(3n),
    .scroll-animations-example .item.-normal:nth-of-type(4n),
    .scroll-animations-example .item.-small:nth-of-type(3n),
    .scroll-animations-example .item.-small:nth-of-type(4n) {
        margin-top: 0;
        margin-bottom: 0;
    }

    .modal-content {
        width: 90vw;
        max-height: 95dvh;
        gap: 1rem;
        transform: translateY(10px) scale(0.98);
    }

    .modal-image-container {
        height: 45dvh;
    }

    .modal-legend {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .legend-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--c-lightBorder);
        padding-bottom: 0.5rem;
    }

    .legend-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .legend-item .value {
        font-size: 0.9rem;
        text-align: right;
    }

    .modal-close {
        position: fixed;
        top: 1.5rem;
        right: 1.5rem;
        background: rgba(5, 8, 8, 0.6);
        backdrop-filter: blur(8px);
        border-radius: 50%;
        z-index: 10000;
    }
}