/* Base styles for desktop and larger screens */
header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

header nav ul li {
    margin: 0 1em;
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1em;
    line-height: 1.5;
}

/* Hamburger menu hidden by default on desktop */
.menu-toggle {
    display: none;
}

/* Responsive styling for mobile screens */
@media screen and (max-width: 600px) {

    body {
        padding: 10px;
    }

    /* Ensure sections are centered */
    section {
        width: 100%;
        margin: 0 auto;
    }


    header {
        padding: 0.5em;
        position: relative; /* Ensure the hamburger is placed relative to the header */
    }

    .menu-toggle {
        display: block;
        cursor: pointer;
        font-size: 1.5em;
        color: white;
        position: absolute;
        left: 15px; /* Position it on the left */
        top: 50%;
        transform: translateY(-50%); /* Vertically center the hamburger */
    }

    header nav ul {
        padding: 0;
        margin: 0;
        width: 100%;
        flex-direction: column;
        align-items: flex-start; /* Align items to the left */
        display: none; /* Initially hide the menu */
        margin-left: 40px; /* Add margin to avoid overlap with the hamburger icon */
    }

    header nav ul.show {
        display: flex; /* Show menu when toggle is clicked */
    }

    header nav ul li {
        margin: 0.5em 0;
        text-align: left;
        width: 100%; /* Make sure the items take full width */
    }

    header nav ul li a {
        font-size: 1em;
        padding: 0.5em;
        display: block;
    }

    /* Other responsive styles */
    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-img {
        margin: 0 0 1em 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .timeline-event {
        margin-left: 0;
        padding-left: 1em;
        border-left: none;
        border-top: 4px solid #333;
    }

    .timeline-event .event-date {
        position: static;
        text-align: left;
        margin-bottom: 0.5em;
    }

    #course-interest-link {
        padding: 20px;
    }
}

/* Portfolio refresh */
#home {
    min-height: 85vh;
    padding: 140px 24px 80px;
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
    align-items: stretch;
}

#home .centered {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

#home .hero-eyebrow {
    margin: 0 0 24px;
    color: #2563eb;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

#home h1 {
    margin: 0;
    max-width: 1000px;
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

#home .hero-description {
    max-width: 660px;
    margin: 28px 0 0;
    color: #475569;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 36px;
}

#home .hero-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    font-weight: 500;
}

#home .hero-button-primary {
    color: #fff;
    background: #2563eb;
}

#home .hero-button-primary:hover {
    background: #1d4ed8;
}

#home .hero-button-secondary {
    color: #0f172a;
    background: #fff;
    border-color: #cbd5e1;
}

#home .hero-button-secondary:hover {
    background: #e2e8f0;
}

#home .hero-contact {
    padding: 12px 4px;
    color: #2563eb;
}

#home .hero-contact:hover {
    color: #1d4ed8;
    background: transparent;
    text-decoration: underline;
}

#home .social-icons {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 36px;
}

#home .social-icon {
    margin: 0;
    color: #475569;
    font-size: 1.5rem;
}

#home .social-icon:hover {
    color: #2563eb;
    background: transparent;
}

@media (max-width: 600px) {
    #home {
        min-height: auto;
        padding: 120px 20px 64px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    #home .hero-contact {
        text-align: center;
    }
}

/* Forest hero */
#home {
    background:
        linear-gradient(
            90deg,
            rgba(5, 20, 17, 0.86) 0%,
            rgba(5, 20, 17, 0.58) 60%,
            rgba(5, 20, 17, 0.25) 100%
        ),
        url("../images/background.jpg") center 65% / cover no-repeat;
    color: #f8fafc;
}

#home h1 {
    color: #f8fafc;
}

#home .hero-eyebrow {
    color: #a7dbc5;
}

#home .hero-description {
    color: #dce8e2;
}

#home .hero-button-primary {
    background: #b9e4cf;
    border-color: #b9e4cf;
    color: #102b22;
}

#home .hero-button-primary:hover {
    background: #d1efdf;
    border-color: #d1efdf;
}

#home .hero-button-secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.45);
}

#home .hero-button-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

#home .hero-contact,
#home .social-icon {
    color: #dce8e2;
}

#home .hero-contact:hover,
#home .social-icon:hover {
    color: #b9e4cf;
    background: transparent;
}

header {
    background: #10231d;
}

#contact {
    min-height: auto;
    padding: 96px 24px;
    background: #edf3ef;
    color: #10231d;
}

.contact-content {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

#contact h2 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

#contact p {
    color: #475b51;
    font-size: 1.125rem;
    line-height: 1.7;
}

.contact-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 32px;
}

.contact-button {
    padding: 14px 26px;
    border-radius: 8px;
    background: #10231d;
    color: #fff;
    font-weight: 500;
}

.contact-button:hover {
    background: #244b3c;
}

.contact-link {
    color: #244b3c;
}

.contact-link:hover {
    color: #10231d;
    background: transparent;
    text-decoration: underline;
}

footer {
    padding: 32px 24px;
    background: #10231d;
    color: #dce8e2;
}

footer a {
    color: #b9e4cf;
}

footer a:hover {
    color: #fff;
    background: transparent;
    text-decoration: underline;
}

/* Navigation */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    padding: 0;
    background: rgba(16, 35, 29, 0.96);
    border-bottom: 1px solid rgba(185, 228, 207, 0.12);
    backdrop-filter: blur(12px);
}

.site-nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    min-height: 76px;
    margin: 0 auto;
    padding: 0 28px;
}

.site-nav .nav-brand {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.nav-brand span {
    color: #b9e4cf;
}

.site-nav .nav-brand:hover {
    background: transparent;
    color: #b9e4cf;
}

.site-nav #nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav #nav-menu li {
    flex: none;
    margin: 0;
    text-align: left;
}

.site-nav #nav-menu a {
    display: block;
    padding: 10px 0;
    color: #dce8e2;
    font-size: 0.95rem;
    font-weight: 500;
}

.site-nav #nav-menu a:hover {
    color: #b9e4cf;
    background: transparent;
}

.site-nav #nav-menu .nav-contact {
    padding: 10px 18px;
    border: 1px solid rgba(185, 228, 207, 0.45);
    border-radius: 8px;
}

.site-nav #nav-menu .nav-contact:hover {
    background: rgba(185, 228, 207, 0.1);
}

.nav-toggle {
    display: none;
    padding: 9px 14px;
    border: 1px solid #6b8d7e;
    border-radius: 6px;
    background: transparent;
    color: #f8fafc;
    font: inherit;
    cursor: pointer;
}

.site-nav a:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid #b9e4cf;
    outline-offset: 5px;
}

section[id] {
    scroll-margin-top: 90px;
}

@media (max-width: 760px) {
    .site-nav {
        min-height: 68px;
        padding: 0 20px;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav #nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 16px 20px 24px;
        background: #10231d;
        border-bottom: 1px solid #355346;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .site-nav #nav-menu.show {
        display: flex;
    }

    .site-nav #nav-menu a {
        padding: 12px;
    }
}

/* Selected projects */
#projects {
    min-height: auto;
    padding: 96px 24px;
    background: #f7f9f7;
    color: #10231d;
    text-align: left;
    align-items: stretch;
}

.selected-projects {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.projects-eyebrow {
    margin: 0 0 12px;
    color: #476657;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

#projects h2 {
    margin: 0 0 20px;
    text-align: left;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.projects-intro {
    max-width: 680px;
    margin: 0 0 40px;
    color: #526359;
    line-height: 1.7;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
}

.case-card {
    padding: 32px;
    border: 1px solid #dce5de;
    border-radius: 16px;
    background: #fff;
}

.case-category {
    margin: 0 0 20px;
    color: #526e5e;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.case-card h3 {
    margin: 0 0 16px;
    font-size: 1.4rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.case-card > p:not(.case-category),
.case-card details p {
    color: #526359;
    line-height: 1.75;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 24px 0;
    list-style: none;
}

.case-tags li {
    padding: 5px 10px;
    border-radius: 6px;
    background: #edf3ef;
    color: #355443;
    font-size: 0.8rem;
}

.case-card details {
    border-top: 1px solid #e4ebe6;
    padding-top: 18px;
}

.case-card summary {
    cursor: pointer;
    color: #244b3c;
    font-weight: 500;
}

.case-card summary:hover {
    color: #10231d;
}

.case-card summary:focus-visible {
    outline: 2px solid #476657;
    outline-offset: 5px;
}

.case-card details p {
    margin: 18px 0 0;
}

@media (max-width: 760px) {
    #projects {
        padding: 64px 20px;
    }

    .case-grid {
        grid-template-columns: 1fr;
    }

    .case-card {
        padding: 24px;
    }
}
/* AI-generated project illustrations */
.case-card .case-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    margin: 0 0 24px;
    border-radius: 10px;
    background: #10231d;
}

.more-projects {
    margin-top: 72px;
    padding-top: 48px;
    border-top: 1px solid #dce5de;
}

.more-projects-title {
    margin: 0 0 12px;
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.more-projects-intro {
    margin: 0 0 32px;
    color: #526359;
}

.more-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.mini-project {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    background: #fff;
    border: 1px solid #dce5de;
    border-radius: 12px;
}

.mini-project img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
}

.mini-project > div {
    min-width: 0;
}

.mini-project h4 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.mini-project p {
    margin: 0 0 12px;
    color: #526359;
    font-size: 0.95rem;
    line-height: 1.7;
}

.mini-project span {
    color: #476657;
    font-size: 0.8rem;
}

.teaching-note {
    margin-top: 48px;
    padding: 32px;
    background: #e8f0ea;
    border-radius: 12px;
}

.teaching-note h3 {
    margin: 0 0 12px;
}

.teaching-note p {
    max-width: 760px;
    color: #526359;
    line-height: 1.7;
}

.teaching-note a {
    color: #244b3c;
    font-weight: 500;
}

.teaching-note a:hover {
    color: #10231d;
    background: transparent;
    text-decoration: underline;
}

@media (max-width: 760px) {
    .more-projects-grid {
        grid-template-columns: 1fr;
    }

    .mini-project {
        padding: 20px;
        gap: 16px;
    }
}

@media (max-width: 400px) {
    .mini-project {
        flex-direction: column;
    }
}