main {
    background:var(--color-creme);
    display:flex;
}
header {

}


.popup {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    backdrop-filter: blur(20px);
    z-index:10;
    display:flex;
    align-items: center;
    justify-content: center;

    & > .inner {
        background:var(--color-creme);
        border-radius:30px;
        text-align:center;
        max-width:500px;
        padding:60px;

        & p {
            margin:20px 0;
        }
    }
}

.nav {
    position:absolute;
    bottom:30px;
    left:0;
    display:flex;
    justify-content: center;
    width:100%;

    & > div {
        background:var(--color-creme);
        border-radius:100px;
        padding:4px;
    }

    & button {
        background: none;
        -webkit-appearance: none;
        color: var(--color-sea);
        border: none;
        padding: 12px;
        min-width: 110px;
        cursor:pointer;
        border-radius: 100px;
        
    }
    & button.active {
        background:var(--color-sea);
        color:var(--color-creme);
    }
}

.popup.hidden {
    display:none;
}

.model {
    height:100vh;
    width:100vw;
    overflow:hidden;
    display:flex;
    align-items:center;

    & .background {
        width:100vw;
        height:100vh;
    }

    & video {
        height:100%;
        width:100%;
        object-fit:cover;
    }

    & img {
        height:100%;
        width:100%;
        object-fit:cover;
    }

    
    & .dots {
        position: absolute;
        left: 0;
        display:none;
        top: 0;
        width:100%;
        height:100%;
        cursor:pointer;

        & .dot {
            position:absolute;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #ff8e00;
            transform: translate(-50%, -50%);
            z-index: 1;                    /* keep above the pulses */
            box-shadow: 0 0 0 2px rgba(0,0,0,.15); /* subtle outline for contrast */

            & span {
                pointer-events:none;
                opacity:0;
                position:absolute;
                white-space:nowrap;
                display:inline-block;
                background:var(--color-creme);
                padding:8px;
                border-radius:100px;
                top:-30px;
                right:-30px;
                font-size:14px;
            }
            &:hover span {
                opacity:1;

            }
        }
    }
    & .dots.active {
        display:block;
    }




    .dot::before,
    .dot::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: rgba(255,255,255,.45);
        transform: translate(-50%, -50%) scale(1);
        z-index: -1;                   /* sit under the solid dot */
        animation: dotpulse 2.2s ease-out infinite;
    }
    .dot::after {
        background: rgba(255,255,255,.25);
        animation-delay: 1.1s;
    }




}


.modals {

    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    overflow: visible;
    z-index: 200;


    & section {
        
        position: absolute;
        height: 100vh;
        overflow-y: scroll;
        right: 0;
        z-index: 10;
        padding:60px 32px;
        transform: translateX(100%);
        color: var(--color-dark-sea);
        min-width: 500px;
        max-width:1100px;
        padding-bottom:120px;
        box-sizing:border-box;
        width:50vw;
        transition: transform 0.18s ease-out;
        background: var(--color-creme);



        color:var(--color-dark-sea);
        & > img {
            width:100%;
            height: auto;
            border-radius: 20px;
            margin-bottom: 20px;
            max-height: 50vh;
            object-fit: cover;
        }
        & video {
            width:100%;
            height:auto;
            border-radius:20px;
            margin-bottom: 20px;
            max-height:50vh;
        }

        & hr {
            border:none;
            height:1px;
            background:var(--color-sea);
            width:100%;
            margin-bottom:12px;
        }
        & .button-container {
            display:flex;
            justify-content: flex-end;
            position:sticky;
            top:0;
            & .button {
                border-radius:100px;
                background:transparent;
            }
        }

        & .image-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
            grid-auto-flow: dense;
            grid-auto-rows: 160px;
            margin-top:30px;
        }

        & .image-grid img {
            height:100%;
            object-fit:cover;
            width:100%;
            border-radius:20px;
        }
        /* Pattern A: items 1–3 in each group of 6 */
        & .image-grid > img:nth-child(6n + 1) {
            grid-column: 1;        /* large left */
            grid-row: span 2;
        }
        & .image-grid > img:nth-child(6n + 2) {
            grid-column: 2;        /* top right small */
        }
        & .image-grid > img:nth-child(6n + 3) {
            grid-column: 2;        /* bottom right small */
        }

        /* Pattern B: items 4–6 in each group of 6, mirrored */
        & .image-grid > img:nth-child(6n + 4) {
            grid-column: 2;        /* large right */
            grid-row: span 2;
        }
        & .image-grid > img:nth-child(6n + 5) {
            grid-column: 1;        /* top left small */
        }
        & .image-grid > img:nth-child(6n + 6) {
            grid-column: 1;        /* bottom left small */
        }
    }

    & section.active {
        transform:translateX(0%);
    }
}


@keyframes dotpulse {
    0%   { opacity: .7; transform: translate(-50%, -50%) scale(1); }
    70%  { opacity: .2; transform: translate(-50%, -50%) scale(3); }
    100% { opacity: 0;  transform: translate(-50%, -50%) scale(3.5); }
}



@media screen and (max-width:800px){
    header {
        flex-wrap:wrap;
    }

    .model {
        height: 70vh;
        overflow:hidden;
        position:relative;

        & .background {
            height:70vh;
        }

        & .dots {
            overflow:hidden;
        }
    }

    .modals {
        left:0;
        top:100vh;

        & section {
            transform:translateX(0%);
            min-width:0;
            width:100%;
        }
        & section.active {
            transform: translateY(-90dvh);
            height: 90dvh;
            overflow:scroll;
        }
        & .button-container {
            top: -40px !important;
            z-index: 10;
            margin-bottom: 20px;
            margin-top: -40px;
        }
    }


}