:root {
    --blue: #003b71;
    --blue-dark: #002b54;
    --gold: #f2b705;
    --text: #252a30;
    --muted: #5b6570;
    --rule: #d9dfe5;
    --page-width: 900px;
    /* Used to be 820px */
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: #075f9f;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover,
a:focus {
    color: var(--blue-dark);
    text-decoration-thickness: 2px;
}

.site-header {
    background: #f5f7fa;
    border-top: 5px solid var(--gold);
    border-bottom: 1px solid var(--rule);
}

.header-content,
main,
footer {
    width: min(var(--page-width), calc(100% - 2 * clamp(14px, 3vw, 20px)));
    margin: 0 auto;
}

.header-content {
    padding: clamp(18px, 3.5vw, 24px) 0 20px;
}

.department-mark {
    display: inline-block;
}

.department-mark img {
    display: block;
    max-width: min(100%, 440px);
    height: auto;
}

h1,
h2,
h3 {
    color: var(--blue);
    line-height: 1.25;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: end;
    gap: 16px clamp(12px, 2.5vw, 32px);
}

.identity-primary {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.name-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.25rem 0.6rem;
}

.name-line h1 {
    min-width: 0;
}

.preferred-name {
    white-space: nowrap;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.affiliation {
    min-width: 0;
    text-align: right;
}

.role,
.institution,
.office,
.email {
    margin: 0;
}

.role {
    color: var(--text);
    font-size: 1.18rem;
    font-weight: 600;
}

.institution {
    color: var(--muted);
    /* font-size: 0.9rem; */
}

.office {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.email {
    /* margin-top: 8px; */
    color: var(--muted);
    font-size: 0.95rem;
}

.email a,
.course p a {
    color: inherit;
    text-decoration: none;
    &:hover {
        text-decoration: underline;
        /* blue color */
        color: var(--text);
        text-decoration-thickness: 2px;
    }
}

main {
    flex: 1;
    padding-bottom: 24px;
}

section {
    padding: clamp(25px, 4.5vw, 30px) 0;
    border-top: 1px solid var(--rule);
}

.introduction {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(110px, 22vw, 175px);
    gap: clamp(20px, 3vw, 32px);
    align-items: center;
    padding: 32px 0;
    border-top: 0;
}

.introduction p {
    grid-column: 1;
    grid-row: 1;
    max-width: 760px;
    margin: 0;
    color: #343a41;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.18rem;
    line-height: 1.7;
}

.profile-photo {
    grid-column: 2;
    grid-row: 1;
    display: block;
    align-self: start;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
}

h2 {
    margin: 0 0 15px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 600;
}

h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

p {
    margin: 0 0 12px;
}

ul,
ol {
    margin: 0;
    padding-left: 1.4rem;
}

.research-interests {
    columns: 2;
    column-gap: 42px;
}

.research-interests li {
    margin-bottom: 7px;
    break-inside: avoid;
}

.supporting-text {
    margin: 12px 0 0;
    color: var(--muted);
}

.publication-list li {
    padding-left: 5px;
}

.publication-list li + li {
    margin-top: 22px;
}

cite {
    font-style: italic;
}

.publication-title,
.publication-authors,
.publication-details {
    display: block;
}

.publication-title {
    font-weight: 650;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 6px 0 0;
}

.publication-links a {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 0.94rem;
    font-weight: 650;
}

.project + .project,
.course + .course {
    margin-top: 20px;
}

.project p,
.course p {
    margin: 0;
}

.course p {
    color: var(--muted);
}

.course .course-offering + .course-offering {
    margin-top: 4px;
}

.label {
    color: var(--text);
    font-weight: 650;
}

footer {
    padding: 10px 0 12px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
}

footer p {
    margin: 0;
}

/* One breakpoint for the compact header and introduction. */
@media (max-width: 585px) {
    .identity {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 8px;
    }

    .affiliation {
        text-align: right;
    }

    .research-interests {
        columns: 1;
    }

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

    .introduction p,
    .profile-photo {
        grid-column: 1;
        grid-row: auto;
    }

    .profile-photo {
        display: none;
    }

    .publication-links {
        display: flex;
        margin: 6px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
