* {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

:root {
    /* colours */
    --main-bg-color: #FFFFFF;
    --text-color: #1A1A1A;
    --secondary-text-color: #FFFFFF;
    --primary-color: #006989;
    --secondary-color: #01A7C2;
    --card-bg-color: #EAEBED;
    --chip-bg-color: #B8B4B4;

    /* font styles */
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Source Serif 4', serif;

    /* font sizes (mobile) 1rem = 16px */
    --fs-nav: 0.875rem;
    --fs-h1: 2rem;
    --fs-h2: 1.5rem;
    --fs-h3: 1rem;
    --fs-chips: 1rem;
    --fs-proj-desc: 1rem;
    --fs-card-btn: 1rem;

    /* font weights */
    --fw-regular: 400;
    --fw-semi-bold: 600;
    --fw-bold: 700;

    /* image sizes */
    --about-img-dia: 80px;
    --contact-link-dia: 40px;

    /*heights */
    --nav-height: 3.625rem;
}

body {
    background-color: var(--main-bg-color);
}

/* MOBILE FIRST */

/* navigation */
header {
    position: fixed;
    background-color: var(--main-bg-color);
    width: 100%;
    top: 0px;
}

nav ul {
    height: var(--nav-height);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    font-family: var(--font-sans);
    font-size: var(--fs-nav);
}

nav a {
    text-decoration: none;
    color: var(--text-color);
}

nav a:hover {
    color: var(--secondary-color);
}

nav a:active {
    text-decoration: underline;
}

/* hero section */
#home {
    height: 13.9375rem;
    margin-top: var(--nav-height);
    scroll-margin-top: var(--nav-height);
    background-color: var(--primary-color);
    color: var(--secondary-text-color);
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 10% 30% 20% 30% 10%;
    justify-items: center;
    align-items: center;
    font-family: var(--font-sans);
    box-shadow: 0 0 15px 0.5px rgba(0, 105, 137, 0.5);
    background-image:
        linear-gradient(rgba(0, 20, 50, 0.45), rgba(0, 20, 50, 0.45)),
        url("./images/hero_image.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

h1 {
    font-weight: var(--fw-bold);
    font-size: var(--fs-h1);
}

#home p {
    font-weight: var(--fw-regular);
    font-size: 0.875rem;
}

.btn {
    font-weight: var(--fw-semi-bold);
    font-size: 0.875rem;
    width: 80%;
    max-width: 248px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 4px 0 #00000040;
    text-decoration: none;
    color: var(--secondary-text-color);
}

/* projects section */

h2 {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-h2);
    height: 3.75rem;

    display: flex;
    justify-content: center;
    align-items: center;
}

#card-container {
    padding: 0 1rem;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

article {
    background-color: var(--card-bg-color);
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-sans);
    font-size: var(--fs-chips);
    box-shadow: 0 4px 4px 0 #00000040;
    min-width: 250px;
    max-width: 300px;
}

#projects img {
    background-color: var(--main-bg-color);
    width: 100%;
    aspect-ratio: 311/175;
    border-radius: 10px;
}

article p {
    font-family: var(--font-serif);
}

article ul {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

article li {
    background-color: var(--chip-bg-color);
    padding: 3px 10px;
    font-weight: var(--fw-semi-bold);
    border-radius: 5px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

article a {
    background-color: var(--primary-color);
    color: var(--secondary-text-color);
    padding: 0.5rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: var(--fw-semi-bold);
    box-shadow: 0 4px 4px 0 #00000040;
}

/* about section */

#about {
    padding: 0px 1rem;
}

.about-container {
    display: grid;
    grid-template-columns: var(--about-img-dia) 1fr;
    column-gap: 1rem;
    font-family: var(--font-serif);
}

#about img {
    background-color: greenyellow;
    width: var(--about-img-dia);
    height: var(--about-img-dia);
    border-radius: 40px;
}

/* tech skills section */
#tech-skills {
    padding: 0 1rem;
    font-family: var(--font-sans);
    font-weight: var(--fw-semi-bold);
}

#tech-skills ul {
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
}

#tech-skills li {
    background-color: var(--chip-bg-color);
    padding: 3px 10px;
    border-radius: 5px;
}

/* contact section */
#contact p {
    text-align: center;
    font-family: var(--font-serif);
}

#contact ul {
    display: flex;
    justify-content: center;
    gap: 1.875rem;
    padding: 1rem 0;
}

#contact img {
    width: var(--contact-link-dia);
    height: var(--contact-link-dia);
    /* border-radius: var(--contact-link-dia); */
}

/* footer section */
footer {
    background-color: var(--primary-color);
    color: var(--secondary-text-color);
    height: 5.8125rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 0.625rem;
    font-style: italic;
}

/* MEDIA QUERIES */

/* mobile */
@media (min-width:768px) {
    :root {
        --fs-h1: 2.25rem;
        --fs-h2: 2rem;

        --nav-height: 4rem;

        --about-img-dia: 150px;
    }

    #home {
        height: 22.3125rem;
    }

    h2 {
        height: 6.25rem;
    }

    #card-container {
        padding: 0 1.75rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.375rem;
        max-width: 50rem;
        margin: 0 auto;
    }

    #about {
        padding: 0 3.875rem;
    }

    .about-container {
        gap: 1.8125rem;
    }

    #about img {
        border-radius: var(--about-img-dia);
    }
}

@media (min-width: 1024px) {

    nav ul {
        justify-content: flex-start;
        padding: 0 1rem;
    }

    nav li {
        padding: 1rem;
    }

    #home {
        grid-template-columns: 3fr 2fr;
    }

    h1 {
        grid-column-start: 2;
        grid-column-end: 3;
        grid-row-start: 2;
        grid-row-end: 3;
    }

    #home p {
        grid-column-start: 2;
        grid-column-end: 3;
        grid-row-start: 3;
        grid-row-end: 4;
    }

    #home a {
        grid-column-start: 2;
        grid-column-end: 3;
        grid-row-start: 4;
        grid-row-end: 5;
    }

    #card-container {
        max-width: none;
    }

    article {
        max-width: 25vw;
    }
}

/* Standardize project card heights */
#card-container {
    align-items: stretch;
}

/* Make each project card the same layout internally */
#card-container article {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Standardize project image area */
#projects article img {
    width: 100%;
    height: 180px;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: top center;
    border-radius: 10px;
    background-color: var(--main-bg-color);
}

/* Give project titles a consistent minimum height */
#projects article h3 {
    min-height: 2.6rem;
    display: flex;
    align-items: center;
}

/* Give chips area consistent spacing */
#projects .chips-container {
    min-height: 3.1rem;
    align-content: flex-start;
}

/* Make descriptions take up the flexible middle space */
#projects article p {
    flex-grow: 1;
    line-height: 1.5;
}

/* Optional: limit descriptions so one long card doesn't dominate */
#projects article > p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Push buttons to the bottom of every card */
#projects .project-links {
    margin-top: auto;
    gap: 0.75rem;
}

/* Make project buttons consistent */
#projects .project-links a {
    flex: 1;
    text-align: center;
    padding: 0.5rem 1rem;
}

/* Desktop: force cards in the same row to have equal visual height */
@media (min-width: 768px) {
    #card-container {
        align-items: stretch;
    }

    #card-container article {
        min-height: 440px;
    }
}

@media (min-width: 1024px) {
    #projects article img {
        height: 190px;
    }

    #card-container article {
        min-height: 470px;
    }
}