* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

/* Smooth scrolling for in-page anchors */
html { scroll-behavior: smooth; }

/* Prevent anchored sections from hiding under a fixed header */
section:not(.header) { scroll-margin-top: 80px; }
@media (max-width: 700px) { section:not(.header) { scroll-margin-top: 60px; } }

/* SOCIAL ICONS/EMAIL */
.socials {
    position: fixed;
    left: 4%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 999;
}
.socials a {
    color: #e0e0e0;
    font-size: 25px;
    transition: 0.3s ease;
}
.socials a:hover {
    color: #b5b5b5;
    transform: translateY(5px);
}
.socials::after {
    content: "";
    width: 2px;
    height: 250px;
    background: #e0e0e0;
    margin-top: 15px;
}
.email {
    position: fixed;
    right: 4%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 999;
}
.email span {
    writing-mode: vertical-rl;
    color: #e0e0e0;
    font-size: 18px;
    letter-spacing: 2px;
    transition: 0.3s ease;
    transform: translateY(-50%);
}
.email span:hover {
    color: #b5b5b5;
}
.email::after {
    content: "";
    width: 2.5px;
    height: 220px;
    background: #e0e0e0;
    transform: translateY(-50%);
}


/* HEADER */
.header {
    min-height: 100vh;
    width: 100%;
    background-image: linear-gradient(rgba(4,9,30,0.7),rgba(4,9,30,0.7)), url('../images/background.JPG');
    background-position: center;
    background-size: cover;
    position: relative;
}

/* NAVIGATION */
nav {
    display: flex;
    padding: 2% 6%;
    justify-content: space-between;
    align-items: center;
}
nav img {
    width: 50px;
}
.nav-links {
    flex: 1;
    text-align: right;
}
.nav-links ul li {
    list-style: none;
    display: inline-block;
    padding: 8px 12px;
}
.nav-links ul li a {
    color: white;
    text-decoration: none;
    font-size: 13px;
}
.nav-links ul li::after {
    content: '';
    width: 0%;
    height: 2px;
    background: #020b57;
    display: block;
    margin: auto;
    transition: 0.5s;
}
.nav-links ul li:hover::after {
    width: 100%;
}

/* HERO TEXT/BUTTON */
.text-box {
    width: 90%;
    max-width: 800px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
}
.text-box h1 {
    font-size: 62px;
    margin-bottom: 1rem;
}
.text-box p {
    margin: 0 0 1rem 0;
    font-size: 16px;
    color: #f2f2f2;
}
.hero-btn {
    display: inline-block;
    text-decoration: none;
    color: #333;
    border: 1px solid #d0d0d0;
    padding: 12px 34px;
    font-size: 14px;
    background: #e8e8e8;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 8px;
    transition: 0.25s ease;
}
.hero-btn:hover {
    border-color: #b8b8b8;
    background: #d0d0d0;
    transform: translateY(-2px);
}
body {
    background: #474d6d; 
    overflow-x: hidden;
}


/* PROJECTS SECTION */
.projects {
    max-width: 1100px;
    margin: 120px auto;
    padding: 0 6%;
    color: white;
}
.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 60px;
    color: #ffffff;
    display: flex;
    align-items: center;
}
.section-title::after {
    content: "";
    display: inline-block;
    width: 500px;
    height: 2px;
    background: #ffffff;
    margin-left: 15px;
}

/*PROJECT CARD*/
.project-card {
    position: relative;
    display: grid;
    grid-template-columns: 55% 45%;
    align-items: center; 
    overflow: visible; 
    gap: 20px;
    padding-top: 40px;
}
.project-image {
    position: relative; 
    min-width: 0; 
}
.project-image img {
    width: 100%;
    height: auto; 
    object-fit: cover; 
    aspect-ratio: 16/9; 
    border-radius: 1px;
    opacity: 0.95;
    display: block;
    z-index: 1;
}
.project-info-container {
    min-width: 0;
    padding-top: 40px;
    position: relative;
    padding-left: 40px;
}
.featured-label {
    color: #ffffff;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-align: right;
}
.project-title {
    font-size: 1.8rem;
    margin-bottom: 300px;
    text-align: right;
}

/* DESCRIPTION CARD*/
.project-description {
    background: #112240; 
    padding: 25px;
    border-radius: 1px;
    line-height: 1.6;
    font-size: 1rem;
    width: 115%;
    position: absolute;
    z-index: 10;
    left: -20%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.highlight {
    color: #bcbcbc;
}
.project-links {
    position: absolute;
    bottom: 65px;
    right: 0;
}
.project-links a {
    color: #bcbcbc;
    font-size: 20px;
    margin-left: 18px;
}

/*REVERSE PROJECT CARD*/
.project-card.reverse {
    grid-template-columns: 45% 55%; 
}
.project-card.reverse .project-image {
    order: 2; 
}
.project-card.reverse .project-info-container {
    order: 1; 
    padding-left: 0;
    padding-right: 40px; 
    text-align: left;
}
.project-card.reverse .featured-label,
.project-card.reverse .project-title {
    text-align: left; 
}
.project-card.reverse .project-description {
    left: auto;         
    right: -20%;        
    width: 115%;        
}
.project-card.reverse .project-links,
.project-card.reverse .project-links a {
    right: auto;       
    left: 0;           
}


/*CERTIFICATIONS SECTION*/
.certifications .cert-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #e6f1ff;
}
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 80%;
    margin: 0 auto;
}
@media (max-width: 700px) {
    .cert-grid {
        grid-template-columns: 1fr;
        width: 90%;
    }
}
.cert-card {
    background: #112240;
    border-radius: 8px;
    padding: 1.7rem;
    transition: 0.25s ease;
    border: 1px solid #233554;
}
.cert-card:hover {
    transform: translateY(-6px);
    border-color: #bcbcbc;
}
.cert-icon {
    font-size: 1.8rem;
    color: #bcbcbc;
    margin-bottom: 1rem;
}
.cert-title {
    color: #e6f1ff;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}
.cert-desc {
    color: #a8b2d1;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}
.cert-tags span {
    font-size: 0.75rem;
    color: #bcbcbc;
    background: rgba(188, 188, 188, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 5px;
}
.certifications {
    text-align: center;
}
.certifications .hero-btn {
    display: inline-block;
    margin: 2rem auto 0;
}
.cert-grid .hero-btn {
    grid-column: 1 / -1;    
    justify-self: center;   
    margin: 2rem 0 0;       
}
 

/* CONTACT SECTION */
.contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 6%;
    gap: 50px;
    text-align: center;

    background: #112240;
    border-radius: 7px;
    max-width: 950px;
    margin: 60px auto;
    margin-top: 120px;
    color: #e6f1ff;

    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}


/* ABOUT SECTION */
.about {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 70px 6%;
    gap: 50px;

    background: #112240;
    border-radius: 7px;
    max-width: 950px;  
    margin: 60px auto;

    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.about-img img {
    width: 100%;
    max-width: 420px;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.about-text {
    max-width: 520px;
}
.about-text h1 {
    font-size: 2.4rem;
    margin-bottom: 18px;
    font-weight: 700;
    color:#e6f1ff;
}
.about-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #b5b5b5;
    margin-bottom: 22px;
}
.about-text h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #e6f1ff;
}
.about-text ul {
    list-style-position: inside;
    margin-left: 0;
}
.about-text ul li {
    font-size: 1rem;
    line-height: 1.8;
    color: #a8b2d1;
    margin-bottom: 8px;
}


/* FOOTER */
.footer {
    text-align: center;
    width: 100%;
    padding: 30px 0;
    background: #474d6d;
}
.footer h4 {
    font-weight: 600;
    margin-bottom: 15px;
}
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: transparent;     
    color: #ffffff;              
    font-size: 24px;            
    padding: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease, color 0.2s ease;
    display: none; 
    z-index: 999;
    border: none;
}
.back-to-top::before {
    content: "↑";
    display: inline-block;
    line-height: 1;
}
.back-to-top:hover {
    color: #0c1155;
    transform: translateY(-3px);
}

/* MOBILE NAV */
nav .fa {
    display: none;
}

/* RESPONSIVE */
@media (max-width: 700px) {

    /* HERO */
    .header {
        min-height: 60vh;
    }

    .text-box {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 90%;
        max-width: 720px;
        margin: 6vh auto;
        text-align: center;
        padding: 0 4%;
    }

    .text-box h1 {
        font-size: 32px;
        line-height: 1.1;
        margin-bottom: 0.6rem;
    }

    .text-box p {
        font-size: 15px;
    }

    .hero-btn {
        padding: 10px 22px;
        font-size: 14px;
    }

    /* SECTIONS: stack and center content */
    .about,
    .featured,
    .contact {
        flex-direction: column;
        text-align: center;
        padding: 40px 5%;
    }

    .about-text,
    .featured-text,
    .contact-info {
        max-width: 95%;
        margin: 0 auto;
    }

    /* NAVIGATION mobile */
    .nav-links ul li {
        display: block;
    }

    .nav-links {
        position: absolute;
        background: hsl(216, 2%, 55%);
        height: 100vh;
        width: 240px;
        top: 0;
        right: 0;
        transform: translateX(100%);
        z-index: 2000;
        transition: transform 0.35s ease;
        text-align: left;
        will-change: transform;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    nav .fa {
        display: block;
        color: white;
        margin: 10px;
        font-size: 22px;
        cursor: pointer;
    }

    .nav-links ul {
        padding: 30px;
    }

    /* hide fixed sidebars on small screens to avoid overlap/scroll */
    .socials, .email {
        display: none;
    }

    /* PROJECTS: stack cards and make descriptions flow naturally on small screens */
    .project-card {
        display: block;
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 20px;
    }

    .project-card .project-image,
    .project-card .project-info-container {
        position: static;
        padding-left: 0;
        padding-right: 0;
        order: initial;
    }

    .project-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
    }

    .project-info-container {
        padding-top: 20px;
    }

    .project-title {
        text-align: center;
        margin-bottom: 0.4rem;
    }

    .project-description {
        position: static;
        width: 100%;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        margin: 8px 0 0 0;
        box-shadow: none;
        padding: 16px;
    }

    .project-links {
        position: static;
        margin-top: 10px;
        text-align: center;
    }

    .project-links a {
        margin: 0 8px;
        font-size: 20px;
    }

    .project-card.reverse .project-description {
        right: auto;
        left: auto;
    }

    /* CERTIFICATIONS: make grid single-column */
    .cert-grid {
        grid-template-columns: 1fr;
        width: 95%;
    }

    /* Reduce paddings for very small screens */
    @media (max-width: 420px) {
        .text-box h1 { font-size: 28px; }
        .text-box { margin: 4vh auto; padding: 0 6%; }
        .projects { margin: 80px auto; padding: 0 4%; }
        .about, .contact { padding: 30px 4%; }
    }

}