/*==================================================
    GOOGLE FONT
==================================================*/

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

:root{

    --background:#0f172a;
    --background2:#1e293b;

    --card:#182235;

    --primary:#06b6d4;

    --primary-hover:#22d3ee;

    --white:#ffffff;

    --gray:#cbd5e1;

    --border:rgba(255,255,255,.08);

    --shadow:0 10px 30px rgba(0,0,0,.35);

    --radius:18px;

    --transition:.35s ease;

    /* Theme */
    --nav-background:rgba(15,23,42,.65);
}


/*==================================================
    LIGHT MODE
==================================================*/

body.light-mode{

    --background:#f8fafc;

    --background2:#e2e8f0;

    --card:#ffffff;

    --primary:#0891b2;

    --primary-hover:#06b6d4;

    --white:#0f172a;

    --gray:#475569;

    --border:rgba(15,23,42,.10);

    --shadow:0 10px 30px rgba(15,23,42,.12);

    --nav-background:rgba(248,250,252,.80);

}


/*==================================================
    BODY
==================================================*/

body{

    background:var(--background);

    color:var(--white);

    font-family:'Poppins',sans-serif;

    overflow-x:hidden;

    line-height:1.7;

    transition:
        background-color .35s ease,
        color .35s ease;

}


/*==================================================
    THEME TRANSITIONS
==================================================*/

.about-container,
.skill-card,
.timeline-item,
.project-card,
.certificate-card,
.achievement-card,
.contact-card,
footer{

    transition:
        background-color .35s ease,
        color .35s ease,
        border-color .35s ease,
        box-shadow .35s ease,
        transform .35s ease;

}


/*==================================================
    IMAGES
==================================================*/

img{

    width:100%;

    display:block;

}

a{

    text-decoration:none;

    color:inherit;

}

.section{

    width:min(1150px,90%);

    margin:auto;

    padding:110px 0;

}

.section-title{

    text-align:center;

    font-size:2.5rem;

    margin-bottom:70px;

    font-weight:700;

}

/*==================================================
    PRELOADER
==================================================*/

#preloader{

    position:fixed;

    inset:0;

    background:var(--background);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:99999;

}

.loader{

    width:70px;

    height:70px;

    border-radius:50%;

    border:6px solid rgba(255,255,255,.15);

    border-top:6px solid var(--primary);

    animation:spin 1s linear infinite;

}

@keyframes spin{

    to{

        transform:rotate(360deg);

    }

}

/*==================================================
    NAVBAR
==================================================*/

header{

    position:fixed;

    width:100%;

    top:0;

    left:0;

    z-index:999;

}

.navbar{

    width:min(1200px,92%);

    margin:auto;

    margin-top:18px;

    padding:16px 30px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    border-radius:100px;

    backdrop-filter:blur(18px);

    background:var(--nav-background);

    border:1px solid var(--border);

}


.logo{

    font-size:1.35rem;

    font-weight:700;

    color:var(--primary);

}

.nav-links{

    display:flex;

    gap:35px;

    list-style:none;

}

.nav-links a{

    font-size:.95rem;

    transition:var(--transition);

}

.nav-links a:hover{

    color:var(--primary);

}

.menu-btn{

    display:none;

    font-size:1.4rem;

    cursor:pointer;

}

/*==================================================
    THEME TOGGLE
==================================================*/

.theme-toggle{

    width:42px;

    height:42px;

    border-radius:50%;

    border:1px solid var(--border);

    background:transparent;

    color:var(--white);

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    font-size:1rem;

    transition:var(--transition);

    margin-left:25px;

}

.theme-toggle:hover{

    background:var(--primary);

    color:#ffffff;

    transform:rotate(20deg) scale(1.08);

}

.theme-toggle i{

    transition:transform .3s ease;

}


/*==================================================
    HERO
==================================================*/

.hero{

    min-height:100vh;

    width:min(1200px,90%);

    margin:auto;

    display:grid;

    grid-template-columns:1fr 420px;

    align-items:center;

    gap:80px;

}

.hero h3{

    color:var(--primary);

    font-size:1.2rem;

}

.hero h1{

    font-size:4rem;

    margin:10px 0;

    line-height:1.1;

}

.hero h2{

    font-size:2rem;

    color:var(--gray);

    margin-bottom:20px;

    min-height:45px;

}

.hero p{

    max-width:650px;

    color:var(--gray);

    margin-bottom:35px;

}

.hero-buttons{

    display:flex;

    gap:18px;

    flex-wrap:wrap;

}

.hero-image{

    position:relative;

}

.hero-image img{

    border-radius:25px;

    box-shadow:var(--shadow);

    border:4px solid rgba(255,255,255,.08);

    transition:var(--transition);

}

.hero-image img:hover{

    transform:translateY(-8px);

}

/*==================================================
    BUTTONS
==================================================*/

.btn{

    display:inline-block;

    background:var(--primary);

    color:white;

    padding:15px 28px;

    border-radius:100px;

    transition:var(--transition);

    font-weight:600;

}

.btn:hover{

    background:var(--primary-hover);

    transform:translateY(-4px);

}

.btn-outline{

    background:transparent;

    border:2px solid var(--primary);

}

.btn-outline:hover{

    background:var(--primary);

}

/*==================================================
    SCROLLBAR
==================================================*/

::-webkit-scrollbar{

    width:10px;

}

::-webkit-scrollbar-track{

    background:var(--background);

}

::-webkit-scrollbar-thumb{

    background:var(--primary);

    border-radius:100px;

}

/*==================================================
    ABOUT
==================================================*/

.about-container{

    max-width:850px;

    margin:auto;

    text-align:center;

    background:var(--card);

    padding:45px;

    border-radius:var(--radius);

    border:1px solid var(--border);

    box-shadow:var(--shadow);

}

.about-container p{

    color:var(--gray);

    font-size:1.05rem;

    line-height:1.9;

}

/*==================================================
    SKILLS
==================================================*/

.skills-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
    justify-content: center;
    gap: 30px;
}

.skill-card{

    background:var(--card);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:40px 20px;

    text-align:center;

    transition:var(--transition);

    box-shadow:var(--shadow);

}

.skill-card:hover{

    transform:translateY(-10px);

    border-color:var(--primary);

}

.skill-card i{

    font-size:3rem;

    color:var(--primary);

    margin-bottom:18px;

}

.skill-card h3{

    font-size:1.1rem;

}

/*==================================================
    EDUCATION
==================================================*/

.timeline{

    position:relative;

    max-width:850px;

    margin:auto;

    padding-left:35px;

}

.timeline::before{

    content:"";

    position:absolute;

    left:8px;

    top:0;

    width:3px;

    height:100%;

    background:var(--primary);

}

.timeline-item{

    position:relative;

    background:var(--card);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:28px;

    margin-bottom:35px;

    box-shadow:var(--shadow);

}

.timeline-item::before{

    content:"";

    position:absolute;

    width:18px;

    height:18px;

    border-radius:50%;

    background:var(--primary);

    left:-36px;

    top:35px;

}

.timeline-item h3{

    margin-bottom:10px;

}

.timeline-item p{

    color:var(--gray);

}

.timeline-item span{

    display:inline-block;

    margin-top:15px;

    color:var(--primary);

    font-weight:600;

}

/*==================================================
    PROJECT
==================================================*/

.project-card{
    display: grid;
    grid-template-columns: 1.3fr 1fr;   /* Image gets more space */
    gap: 50px;
    align-items: center;

    max-width: 1000px;
    margin: 40px auto;

    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: var(--shadow);
}

.project-images{
    width: 100%;
}

.project-images img{
    display: block;
    width: 100%;
    border-radius: 14px;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.project-images img:hover{
    transform: scale(1.03);
}

.project-info h3{
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.project-info p{
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 30px;
}

/* Mobile */
@media (max-width: 768px){

    .project-card{
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
        text-align: center;
    }

    .project-images{
        max-width: 600px;
        margin: 0 auto;
    }
}

/*==================================================
    SCROLL ANIMATION
==================================================*/

.section{

    opacity:0;

    transform:translateY(50px);

    transition:1s ease;

}

.section.show{

    opacity:1;

    transform:translateY(0);

}

/*==================================================
    CERTIFICATES
==================================================*/

.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.certificate-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);

    /* Makes all card content align properly */
    display: flex;
    flex-direction: column;
}

.certificate-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
}

.certificate-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.certificate-content {
    padding: 25px;

    /* Allows buttons to stay at the bottom */
    display: flex;
    flex-direction: column;
    flex: 1;
}

.certificate-content h3 {
    margin-bottom: 10px;
}

.certificate-content p {
    color: var(--gray);
}

.certificate-content span {
    display: block;
    margin: 15px 0;
    color: var(--primary);
    font-weight: 600;
}

.certificate-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;

    /* Pushes buttons to the bottom of every card */
    margin-top: auto;
}

/*==================================================
    ACHIEVEMENT
==================================================*/

.achievement-card{

    max-width:900px;

    margin:auto;

    display:grid;

    grid-template-columns:320px 1fr;

    gap:35px;

    background:var(--card);

    border:1px solid var(--border);

    border-radius:var(--radius);

    overflow:hidden;

    box-shadow:var(--shadow);

}

.achievement-card img{

    width:100%;

    height:100%;

    object-fit:cover;

}

.achievement-content{

    padding:35px;

}

.achievement-content h3{

    margin-bottom:15px;

}

.achievement-content p{

    color:var(--gray);

}

.achievement-content span{

    display:block;

    margin:20px 0;

    color:var(--primary);

    font-weight:600;

}

/*==================================================
    CONTACT
==================================================*/

.contact-container{

    display:flex;

    justify-content:center;

    gap:30px;

    flex-wrap:wrap;

}

.contact-card{

    width:220px;

    background:var(--card);

    border:1px solid var(--border);

    border-radius:var(--radius);

    text-align:center;

    padding:35px;

    transition:var(--transition);

    box-shadow:var(--shadow);

}

.contact-card:hover{

    transform:translateY(-8px);

    border-color:var(--primary);

}

.contact-card i{

    font-size:3rem;

    color:var(--primary);

    margin-bottom:20px;

}

/*==================================================
    FOOTER
==================================================*/

footer{

    text-align:center;

    padding:50px 20px;

    background:var(--background2);

    margin-top:100px;

}

footer h3{

    color:var(--primary);

    margin-bottom:10px;

}

footer p{

    color:var(--gray);

    margin:8px 0;

}

/*==================================================
    IMAGE MODAL
==================================================*/

.modal{

    display:none;

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.9);

    z-index:99999;

    justify-content:center;

    align-items:center;

}

.modal img{

    width:90%;

    max-width:1000px;

    max-height:90vh;

    object-fit:contain;

}

.close-modal{

    position:absolute;

    top:25px;

    right:40px;

    font-size:3rem;

    cursor:pointer;

    color:white;

}

/*==================================================
    BACK TO TOP
==================================================*/

#backToTop{

    position:fixed;

    right:25px;

    bottom:25px;

    width:55px;

    height:55px;

    border:none;

    border-radius:50%;

    background:var(--primary);

    color:white;

    cursor:pointer;

    display:none;

    box-shadow:var(--shadow);

    transition:var(--transition);

}

#backToTop:hover{

    transform:translateY(-5px);

}

/*==================================================
    SCROLL PROGRESS
==================================================*/

#progressBar{

    position:fixed;

    top:0;

    left:0;

    height:4px;

    width:0;

    background:var(--primary);

    z-index:99999;

}

/*==================================================
    RESPONSIVE
==================================================*/

@media(max-width:992px){

    .hero{

        grid-template-columns:1fr;

        text-align:center;

        padding-top:130px;

    }

    .hero-image{

        order:-1;

        max-width:350px;

        margin:auto;

    }

    .project-card{

        grid-template-columns:1fr;

    }

    .achievement-card{

        grid-template-columns:1fr;

    }

}

@media(max-width:768px){

    .navbar{

        padding:12px 18px;

    }

    .nav-links{

        position:absolute;

        top:75px;

        left:5%;

        width:90%;

        background:var(--background2);

        flex-direction:column;

        text-align:center;

        padding:30px;

        border-radius:20px;

        display:none;

        border:1px solid var(--border);

        box-shadow:var(--shadow);

    }

    .nav-links.active{

        display:flex;

    }

    .theme-toggle{

        margin-left:auto;

        margin-right:15px;

        width:38px;

        height:38px;

    }

    .menu-btn{

        display:block;

    }

    .hero h1{

        font-size:2.8rem;

    }

    .hero h2{

        font-size:1.5rem;

    }

    .section-title{

        font-size:2rem;

    }

}


@media(max-width:500px){

    .hero-buttons{

        flex-direction:column;

    }

    .btn{

        width:100%;

        text-align:center;

    }

    .certificate-buttons{

        flex-direction:column;

    }

    .contact-card{

        width:100%;

    }

}

.nav-links a.active{

    color: var(--primary);

    font-weight: 600;

}

.skill-icon{

    width:70px;

    height:70px;

    object-fit:contain;

    margin:0 auto 20px;

    display:block;

    transition:0.3s ease;

}

.skill-card:hover .skill-icon{

    transform:scale(1.12);

}
