*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:'Hadley', sans-serif;
    overflow-x:hidden;
}

.gallery-page{
    position: relative;
    z-index: 2;
    min-height:100vh;
    padding:120px 80px 100px;
    overflow:hidden;
}

.gallery-bg{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    z-index:-1;
}

/* Heading */
.gallery-content{
    text-align:center;
}

.gallery-content h1{
    font-size:40px;
    font-weight: 400;
    color: #d8d8d8;
}

.gallery-content p{
    color:#ff7a1a;
    margin-top:8px;
     position: relative;
    top: -5px;
    font-size:15px;
}

/* ===== Coverflow Carousel ===== */
.gallery-carousel{
    position: relative;
    width: 100%;
    height: 720px;
    margin-top: -40px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.gallery-stage{
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1800px;
    -webkit-perspective: 1800px;
}

.gallery-track{
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.gallery-card{
    position: absolute;
    top: 50%;
    left: 50%;
    width: 420px;
    height: 600px;
    border-radius: 26px;
    overflow: hidden;
    cursor: pointer;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    box-shadow: 0 30px 70px rgba(0,0,0,0.55);
    transition: transform .7s cubic-bezier(0.22,1,0.36,1), opacity .7s ease;
}

.gallery-card img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display:block;
}

.gallery-card.active{
    box-shadow: 0 40px 90px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.06);
}

/* View Projects button - only shows on the active/centered card */
.card-view-btn{
    position: absolute;
    top: 24px;
    right: 24px;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .4s ease, transform .4s ease;
    pointer-events: none;
}

.gallery-card.active .card-view-btn{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.card-view-btn button{
    padding: 13px 26px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: .35s ease;
}

.card-view-btn button:hover{
    background: rgba(255,140,40,0.25);
    border-color: #ff7a1a;
    box-shadow: 0 0 18px rgba(255,140,40,0.25);
}


/* Name / location caption below the carousel */
.gallery-caption{
    position:absolute;
    bottom:85px;   
    left:50%;
    transform:translateX(-50%);
    text-align:center;
}

.gallery-caption h2{
    font-size: 30px;
    font-weight: 300;
    color: #fff;
}

.gallery-caption p{
    font-size: 20px;
    position: relative;
    top: -4px;
    color: rgba(255,255,255,0.72);
}

/* ===== Fullscreen Blur "View All Images" popup ===== */
.gallery-popup{
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5,5,5,0.55);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 999999;
    padding: 80px;

    transition: opacity .35s ease, visibility .35s ease;
}

.gallery-popup.active{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.close-gallery{
    position: absolute;
    top: 40px;
    right: 55px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    z-index: 1000000;
    transition: .3s ease;
}

.close-gallery:hover{
    background: rgba(255,140,40,0.25);
    border-color: #ff7a1a;
}


.gallery-viewer{
    position:relative;

    width:100%;
    height:100%;

    display:flex;
    justify-content:center;
    align-items:center;
}

#viewerImage{

    max-width:85%;
    max-height:82vh;

    border-radius:20px;

    object-fit:contain;

    box-shadow:
    0 30px 70px rgba(0,0,0,.45);
}

.viewer-arrow{

    position:absolute;

    width:60px;
    height:60px;

    border-radius:50%;

    border:none;

    cursor:pointer;

    background:rgba(255,255,255,.08);

    color:#fff;

    font-size:28px;

    backdrop-filter:blur(15px);
}

.viewer-arrow.left{

    left:70px;

}

.viewer-arrow.right{

    right:70px;

}

.viewer-close{

    position:absolute;

    top:40px;
    right:45px;

    width:50px;
    height:50px;

    border-radius:50%;

    border:none;

    background:rgba(255,255,255,.08);

    color:#fff;

    font-size:22px;

    cursor:pointer;
}

.gallery-card{

    cursor:pointer;

}

.gallery-card.active{

    cursor:default;

}

.gallery-card:not(.active):hover{

    transform-origin:center;

    transition:.45s;

    filter:brightness(1.05);

}

#viewerImage{

    transition:
        opacity .3s ease,
        transform .3s ease;

}


@media (max-width: 900px){
    .gallery-card{
        width: 220px;
        height: 330px;
    }
    .gallery-carousel{
        height: 420px;
    }
    .popup-grid{
        grid-template-columns: repeat(2,1fr);
    }
}