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

html, body {
    background-color: #ffffff;
}

body {
    font-family: "Helvetica", "Arial", sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.4;
    font-size: 1.2rem;

    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;

    text-align: left;
    font-weight: 400;
}

p {
    text-align-last: left;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligns text to top if lines wrap */
    padding: 1.6rem 0;

    border-bottom: none;

    top: 0;
    z-index: 1000;

    background-color: #ffffff;
    position: -webkit-sticky;
    position: sticky;
    transform: translate3d(0,0,0);
}

.logo a {
    font-size: 1.4rem;
    font-weight: 600;

    text-decoration: none;
    color: #000;
    text-transform: uppercase;
}

nav a {
    margin-left: 2.4rem;
    text-decoration: none;
    color: #808080;

    font-weight: 400;
    font-size: 1rem;
}

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

.mobile-only {
    display: none !important;
}

/* Content Sections */
section {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    scroll-margin-top: 100px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.content-block {
    max-width: 100%;
    font-size: 1rem;
}

.about-layout {
    display: flex;

    flex-direction: row-reverse;

    align-items: flex-start;
    gap: 1.5rem;

    justify-content: space-between;
}

.bio-image-wrapper {
    width: 250px;
    flex-shrink: 0;
    text-align: center;
}

.bio-pic {
    width: 250px;
    display: block;
}

.image-caption {
    font-size: 1rem;
    margin-top: 0.3rem;
    line-height: 1.4;
    color: #808080;
}

/* Bold */
b {
    color: #000000;
    font-weight: 600;
}

/* Gray text */
g {
    color: #808080;
    font-weight: 400;
}

/* Yellow text */
y {
    color: #F4BB44;
    font-weight: 400;
}

/* Paragraph */
p {
    margin-bottom: 1.5rem;
}

ul {
    list-style: none;
    margin: 2rem 0 0 0;
}

li {
    margin-bottom: 0.5rem;
}

/* Typical hyperlink */
p a, li a {
    color: #808080;
    text-decoration: underline;
    transition: color 0.1s;
}

p a:hover, li a:hover {
    color: #F4C430;
}

/* Yellow hyperlink */
a.yellow-link {
    color: #F4BB44;
    text-decoration: underline;
    transition: color 0.1s;
}

a.yellow-link:hover {
    color: #808080;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

.research-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.research-img {
    width: 250px;
    height: auto;
    flex-shrink: 0;
}

footer {
    padding: 1.5rem 0;
    font-size: 1rem;
    color: #808080;

    text-align: left;
}

a.design-link {
    color: #F4C430;
}

a.design-link:hover {
    color: #F4C430;
    text-decoration: underline;
}

.design-grid {
    display: grid;
    /* Keeps columns strict 200px wide */
    grid-template-columns: repeat(auto-fill, 210px);
    /* Centers the grid block */
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

/* The container for the image and text */
.design-item.hover-effect {
    position: relative; /* Essential for positioning the overlay */
    width: 100%;
    height: 210px; /* Force the container to be a square */
    background-color: #fff; /* Background color visible when image fades */
}

/* Makes the anchor tag fill the container */
.link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    color: #000; /* Sets text color to black */
    text-decoration: none; /* Removes underline from links */
}

/* The Image Styles */
.design-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the square perfectly */
    display: block;
    /* Smooth transition for the fade effect */
    transition: opacity 0.3s ease;
    /* Fixes flicker in some browsers */
    backface-visibility: hidden;
}

/* The Text Overlay Container */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Centers text vertically and horizontally */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;

    /* Hidden by default */
    opacity: 0;
    /* Smooth transition for text appearing */
    transition: opacity 0.3s ease;
}

/* The Text Style */
.overlay .text {
    font-size: 1rem;
    line-height: 1.3;
    /* Optional: Add a slight shadow to make text pop against busy images */
    /* text-shadow: 0px 0px 4px rgba(255, 255, 255, 0.8); */
}

/* --- HOVER TRIGGERS --- */

/* When hovering the item, fade the image to 50% */
.link-wrapper:hover .design-img {
    opacity: 0.3; /* 0.3 makes it lighter, 0.5 is darker. Adjust to taste. */
}

/* When hovering the item, show the overlay text */
.link-wrapper:hover .overlay {
    opacity: 1;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .about-layout {
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    nav {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }

    nav a {
        margin-left: 0;
        padding: 0.2rem 0;
    }

    .bio-image-wrapper {
        margin: 0 auto;  /* This pushes the wrapper to the middle */
        width: 250px;    /* Keep your fixed width */
        max-width: 100%;
        text-align: center;
    }

    .research-item {
        flex-direction: column;
        gap: 1.5rem;
    }

    #research .research-img {
        width: 250px;
        max-width: 100%;
        display: block;
        margin: 0 auto;
        height: auto;
    }

    section {
    scroll-margin-top: 30px;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

}
