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

html,body{
    width: 100%;
    height: 100%;
    font-family: "Segoe UI", sans-serif;
}

main{
    background: #0f1115;
    color: #e6e6e6;
    position: relative;
}

#hero{
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#hero h1{
    font-size: 10vh;
    letter-spacing: 2px;
}

#hero p{
    font-size: 2vh;
    opacity: 0.7;
}

#gallery,
#models{
    padding: 5% 8%;
}

.gallery-grid{
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(4, 1fr);
}

.gallery-grid img{
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    transition: 0.3s;
}

.gallery-grid img:hover{
    transform: scale(1.05);
}

.filters{
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filters button{
    padding: 8px 16px;
    background: #1a1d24;
    color: #ccc;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters button:hover{
    background: #222633;
    color: #fff;
    border-color: #4f8cff;
    transform: translateY(-2px);
}

.filters button.active{
    background: #4f8cff;
    color: #fff;
    box-shadow: 0 5px 15px rgba(79,140,255,0.4);
}

.model-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
    gap: 20px;
}

.card{
    background: #1a1d24;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.card:hover{
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(79,140,255,0.2);
}

.card::before{
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79,140,255,0.2), transparent);
    top: -50%;
    left: -50%;
    opacity: 0;
    transition: 0.5s;
}

.card:hover::before{
    opacity: 1;
}

.viewer{
    position: relative;
}

.viewer model-viewer{
    width: 100%;
    height: 250px;
}

.card-content{
    position: relative;
    z-index: 2;   /* 🔥 brings link above */
}

.card a{
    display: inline-block;
    margin-top: 10px;
    color: #4f8cff;
    text-decoration: none;
    cursor: pointer;
    pointer-events: all;
}

footer{
    text-align: center;
    padding: 20px;
    background: #111;
}

#imgModal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

#modalImg{
    max-width: 85%;
    max-height: 85%;
    border-radius: 12px;
    transition: transform 0.4s ease;
}

#closeBtn{
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

.nav{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    cursor: pointer;
    padding: 10px;
    user-select: none;
}

.prev{ left: 20px; }
.next{ right: 20px; }

#counter{
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 14px;
    opacity: 0.7;
}

@media (max-width: 900px){
    .gallery-grid{
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px){
    .gallery-grid{
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid img{
        height: 140px;
    }

    .filters{
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}


.model-detail{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5% 8%;
    min-height: 100vh;
    gap: 60px;
}


.left{
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left model-viewer{
    width: 100%;
    height: 550px;
    background: radial-gradient(circle at center, #1a1d24, #0f1115);
    border-radius: 20px;
}

.right{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* 🔥 FIX */
    justify-content: center;
}


.right h1{
    font-size: 42px;
    margin-bottom: 15px;
}


.desc{
    opacity: 0.7;
    margin-bottom: 25px;
    line-height: 1.6;
    max-width: 400px;
}


.info{
    margin-bottom: 25px;
}

.info p{
    margin: 6px 0;
}

.info span{
    color: #4f8cff;
    margin-right: 10px;
}


.features h3{
    margin-bottom: 10px;
}

.features ul{
    padding-left: 18px;
    line-height: 1.8;
}


.features ul li{
    list-style: disc;
}


@media (max-width: 900px){
    .model-detail{
        flex-direction: column;
        text-align: center;
    }

    .right{
        align-items: center;
    }

    .desc{
        max-width: 100%;
    }

    .left model-viewer{
        height: 400px;
    }
}



.model-detail{
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 5% 10%;
    min-height: 100vh;
}


.left{
    display: flex;
    justify-content: center;
    align-items: center;
}

.left model-viewer{
    width: 100%;
    max-width: 600px;
    height: 500px;
    background: radial-gradient(circle at center, #1a1d24, #0f1115);
    border-radius: 20px;
}


.right{
    max-width: 420px;
}

.right h1{
    font-size: 36px;
    margin-bottom: 15px;
}

.desc{
    opacity: 0.7;
    margin-bottom: 25px;
    line-height: 1.6;
}


.info{
    margin-bottom: 25px;
}

.info p{
    display: flex;
    gap: 10px;
    margin: 6px 0;
}

.info span{
    color: #4f8cff;
    min-width: 90px;
}


.features h3{
    margin-bottom: 10px;
}

.features ul{
    padding-left: 18px;
    line-height: 1.8;
}


@media (max-width: 900px){
    .model-detail{
        grid-template-columns: 1fr;
        text-align: center;
    }

    .right{
        max-width: 100%;
    }

    .info p{
        justify-content: center;
    }

    .left model-viewer{
        height: 400px;
    }
}


.back-btn a{
    position: absolute;
    top: 20px;
    left: 30px;
    padding: 8px 14px;
    background: #1a1d24;
    color: #ccc;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn a:hover{
    background: #222633;
    color: #fff;
    border-color: #4f8cff;
    transform: translateY(-2px);
}
.back-btn a{
    display: flex;
    align-items: center;
    gap: 6px;
}