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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.7;
    color: #1f2933;
    background: #ffffff;
}

.container {
    width: min(92%, 1100px);
    margin: 0 auto;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #006747;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 18px 0;
}

header h1 {
    font-size: 1.6rem;
}

header p {
    font-size: .88rem;
    opacity: .9;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: .92rem;
}

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

section {
    padding: 80px 0;
    scroll-margin-top: 100px;
}

.hero {
    min-height: 72vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8faf9, #eef6f2);
}

.eyebrow {
    color: #006747;
    font-weight: 800;
    letter-spacing: .12em;
    font-size: .78rem;
    margin-bottom: 8px;
}

h2 {
    color: #006747;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    margin-bottom: 24px;
}

h3 {
    color: #006747;
    margin-bottom: 10px;
}

.lead {
    max-width: 780px;
    font-size: 1.08rem;
    margin-bottom: 18px;
}

.button {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 20px;
    background: #006747;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
}

.button:hover {
    background: #005239;
}

.section-alt {
    background: #f5f7f6;
}

.bio-page {
    min-height: calc(100vh - 150px);
}

.bio-layout {
    max-width: 940px;
}

.section-heading {
    text-align: center;
    margin-bottom: 32px;
}

.byline {
    color: #5f6b67;
    font-weight: 700;
}

.bio-card {
    background: #ffffff;
    border-radius: 14px;
    padding: clamp(26px, 5vw, 52px);
    box-shadow: 0 10px 30px rgba(0, 80, 60, .08);
    border-top: 6px solid #006747;
}

.bio-card p {
    margin-bottom: 1.3rem;
    font-size: 1rem;
}

.references {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid #dce4e0;
}

.references ul {
    padding-left: 1.4rem;
}

.references li {
    margin-bottom: 10px;
}

.back-home {
    margin-top: 28px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card,
.education-box {
    background: #ffffff;
    padding: 24px;
    border: 1px solid #dbe5e1;
    border-radius: 10px;
}

#contact a {
    color: #006747;
}

footer {
    background: #1f2933;
    color: #ffffff;
    text-align: center;
    padding: 26px 16px;
}

@media (max-width: 800px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        gap: 12px;
    }

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

    section {
        padding: 60px 0;
    }
}


/* Keep the four academic project cards balanced on desktop. */
#projects .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#projects .card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#projects .card p { flex: 1; }
#projects .project-label {
    color: #5f6b67;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 8px;
}
@media (max-width: 800px) {
    #projects .card-grid { grid-template-columns: 1fr; }
    section { scroll-margin-top: 160px; }
}

/* Homepage portrait. */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 330px);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}
.hero-portrait {
    width: 100%;
    max-width: 330px;
    justify-self: center;
    padding: 7px;
    background: #ffffff;
    border: 1px solid #dbe5e1;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,80,60,.12);
}
.hero-portrait img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 67% center;
    border-radius: 10px;
}
a:focus-visible { outline: 3px solid #b59b56; outline-offset: 4px; }
@media (max-width: 800px) {
    .hero-layout { grid-template-columns: 1fr; }
    .hero-portrait { grid-row: 1; max-width: 230px; }
    .hero { min-height: auto; }
}
@media (min-width: 801px) and (max-width: 1100px) {
    .header-content { gap: 18px; }
    nav { gap: 10px 14px; }
    section { scroll-margin-top: 150px; }
}
@media (max-width: 420px) {
    section { scroll-margin-top: 190px; }
}

/* Keep the sticky navigation compact on smaller screens. */
@media (min-width: 1101px) { section { scroll-margin-top: 115px; } }
@media (max-width: 800px) {
    .header-content { gap: 10px; padding: 12px 0; }
    header h1 { font-size: 1.4rem; }
    header p { font-size: .8rem; }
    nav { gap: 6px 12px; }
    nav a { font-size: .85rem; }
    section { scroll-margin-top: 175px; }
}
