:root {
    --primary: rgb(27, 133, 184);
    --bgDark: rgb(12, 12, 12);
    --white: rgb(250, 250, 250);
    --secondary: rgb(0, 59, 50);
    --bgLight: rgb(190, 181, 181);
    --linkedin: #0A66C2;
    --ub-blue: #004C97;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

header.top {
    background-color: var(--bgDark);
}

header.bottom {
    background-color: var(--bgDark);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 73% 94%, 0 96%);
}

.large-image {
    width: 400px;
    height: 400px;
}

/* HIDE MOBILE MENU BY DEFAULT ON DESKTOP/LARGE SCREENS */
.mobile-menu {
    display: none;
}

header nav .left a {
    color: var(--white);
    text-decoration: none;
    margin-right: 2rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

header nav .left a:hover {
    color: var(--primary);
}

header nav {
    padding: 2rem 0;
}

header nav .logo {
    margin-right: 3rem;
}

body {
    font-family: "Poppins", sans-serif;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 80%;
    margin: 0 auto;
}

.card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 3%;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.card-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.card-link:hover {
    color: var(--secondary);
}

.container {
    max-width: 1152px;
    padding: 0 15px;
    margin: 0 auto;
}

.hero {
    padding-top: 0rem;
    padding-bottom: 1rem;
}

.hero .left img {
    width: 700px;
    height: 700px;
}

.hero .right {
    color: var(--white);
}

.hero .right h6 {
    font-size: 4vw;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.hero .right h1 {
    font-size: 3vw;
    font-weight: 100;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.hero .right h1 span {
    color: var(--primary);
}

.hero .right p {
    line-height: 1.9;
    margin-bottom: 1rem;
}

section {
    padding: 3rem;
}

section.about h1 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 600;
}

section.about h1 span {
    color: var(--primary);
}

section.about h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

section.about p {
    font-family: "Lato", sans-serif;
    color: var(--secondary);
    line-height: 1.2rem;
    margin-bottom: 2rem;
}

section.about .socials {
    display: flex;
}

section.about .socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    margin-right: 0.8rem;
    border-radius: 50%;
}

section.about .socials a:hover {
    background: var(--primary);
}

section.services {
    background: rgb(17, 17, 17);
}

.services-head {
    color: rgb(10, 9, 9);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 0.5rem;
    color: var(--primary);
}

.services-head + p {
    color: var(--white);
    font-family: "Lato", sans-serif;
    margin-bottom: 1rem;
    text-align: center;
    margin-bottom: 6rem;
    font-weight: 400;
}

.card img {
    background: white;
}

section.services .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 2rem;
}

section.services .card-grid .card {
    background: var(--white);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

section.services .card-grid .card img {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var();
}

section.services .card-grid .card h2 {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

section.services .card-grid .card p {
    font-family: "Lato", sans-serif;
    color: var(--seconday);
    line-height: 1.6;
}

section.services .card-grid .card:hover {
    background: var(--primary);
}

section.services .card-grid .card:hover h2 {
    color: var(--white);
}

section.services .card-grid .card:hover p {
    color: var(--white);
}

.flex {
    display: flex;
}

.items-centre {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-right {
    justify-content: right;
}

.btn {
    padding: 0.6rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

/* Primary Button (Contact) */
.btn-primary {
    background-color: var(--primary);
    color: var(--secondary);
    margin-top: -15rem;
}

.btn-primary:hover {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.flex-1 {
    flex: 1;
}

/* Secondary Button (Download CV) */
.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--secondary);
}

/* Tertiary Buttons (Faculty & LinkedIn) - Matches secondary/CV button style */
.btn-tertiary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    padding: 0.6rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 1rem;
}

.btn-tertiary:hover {
    background: var(--white);
    color: var(--bgDark);
}

.hero .right .btn-secondary {
    margin-left: 1rem;
}

/* INTERMEDIATE MEDIA QUERY TO PREVENT HERO IMAGE OVERLAP */
@media(max-width: 1152px) {
    .hero .left img {
        width: 100%;
        height: auto;
        max-width: 450px;
    }

    .hero .left {
        width: 40%;
    }

    .hero .right {
        width: 60%;
        padding-right: 15px;
    }

    .hero .right h6 {
        font-size: 6vw;
    }

    .hero .right h1 {
        font-size: 4vw;
        margin-bottom: 1rem;
    }

    .hero .right p {
        font-size: 1rem !important;
    }
}


/* --- Mobile Menu & Hamburger Base Styles (Hidden on Desktop) --- */
.nav-toggle {
    display: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    position: relative;
    transition: all 0.3s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s ease-in-out;
}

.hamburger::before {
    transform: translateY(-8px);
}

.hamburger::after {
    transform: translateY(8px);
}

/* --- Mobile Styles (max-width: 600px) --- */
@media(max-width: 600px) {

    /* HIDE THE DESKTOP NAV ITEMS */
    header nav .left {
        display: none;
    }

    header nav .right {
        display: none;
    }

    /* SHOW HAMBURGER */
    .nav-toggle {
        display: block;
        order: -1;
        margin-left: 15px;
    }

    header nav {
        justify-content: space-between;
        padding: 1rem 0;
    }
    
    /* MOBILE MENU STYLES - FIX APPLIED HERE */
    .mobile-menu {
        display: flex; /* Ensure it's visible on mobile */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bgDark);
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .mobile-menu.open {
        /* THIS IS THE CRITICAL FIX: Explicitly define the final, non-transformed state */
        transform: translateX(0);
    }
    
    /* HAMBURGER 'X' STYLES */
    .nav-toggle.active .hamburger {
        background-color: transparent;
    }

    .nav-toggle.active .hamburger::before {
        transform: rotate(45deg);
    }

    .nav-toggle.active .hamburger::after {
        transform: rotate(-45deg);
    }
    
    .mobile-menu a {
        color: var(--white);
        text-decoration: none;
        font-size: 1.5rem;
        padding: 1rem 0;
        width: 80%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* HERO SECTION ADJUSTMENTS */
    .hero .left {
        display: none;
    }

    .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero .right {
        flex: unset;
        width: 100%;
        padding: 0 15px;
        margin-top: 0;
        margin-bottom: 1rem;
    }

    /* TEXT SIZING ADJUSTMENTS */
    .hero .right h6 {
        font-size: 8vw;
    }

    .hero .right h1 {
        font-size: 6vw;
        margin-bottom: 1rem;
    }

    .hero .right p {
        font-size: 1rem;
        line-height: 1.5;
        padding-right: 0 !important;
    }

    /* BUTTON ADJUSTMENTS */
    .hero .right div a {
        display: block;
        margin: 10px auto;
    }

    .hero .right .btn-tertiary,
    .hero .right .btn-secondary {
        width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .btn-tertiary {
        border-color: var(--primary);
        color: var(--white);
    }
    
    .btn-tertiary:hover {
        background: var(--primary);
        color: var(--secondary);
    }

    .btn-primary {
        margin-top: 0;
    }


    /* OTHER MOBILE SECTION ADJUSTMENTS */
    section.services {
        width: 100%;
        padding: 3rem 15px;
        box-sizing: border-box;
    }

    section.services .card-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
        margin: 0 auto;
    }

    section.services .card-grid .card {
        padding: 1rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .card-container {
        width: 100%;
    }

    .card {
        padding: 1rem 1rem;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .card h2 {
        font-size: 1.2rem;
    }
}
