:root {
    --cream: #f4ecd8;
    --cream-line: #e3d6b8;
    --navy: #1b2436;
    --navy-deep: #131a28;
    --gold: #b3924a;
    --ink: #22242b;
    --muted: #6b7280;
    --muted-light: #9aa3b2;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', sans-serif;
    color: var(--ink);
    background: #fff;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

a { color: inherit; }

/* --- Top nav --- */
.site-nav {
    background: var(--cream);
    border-bottom: 1px solid var(--cream-line);
}

.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
}

.site-nav__brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--navy);
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

.site-nav__brand-dept {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--muted);
}

.site-nav__brand-dept::before {
    content: " | ";
}

.site-nav__brand-institution {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--muted-light);
}

@media (max-width: 480px) {
    .site-nav__brand-institution {
        font-size: 0.72rem;
    }
}

.site-nav__links {
    display: flex;
    gap: 1.3rem;
}

.site-nav__links a {
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.2px;
}

.site-nav__links a:hover {
    color: var(--gold);
}

.site-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--navy);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    line-height: 1;
}

@media (max-width: 860px) {
    .site-nav__toggle { display: flex; }
    .site-nav__inner { position: relative; }
    .site-nav__links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: 0.5rem;
    }
    .site-nav__links.is-open { display: flex; }
    .site-nav__links a {
        padding: 0.75rem 0.25rem;
        border-top: 1px solid var(--cream-line);
    }
}

/* --- Page hero banner (used on sub-pages) --- */
.page-hero {
    background: linear-gradient(160deg, var(--navy), var(--navy-deep));
    color: #fff;
    padding: 3.25rem 0;
    text-align: center;
}

.page-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0 0 0.6rem;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
}

/* --- Home hero --- */
.hero {
    background: linear-gradient(160deg, var(--navy), var(--navy-deep));
    color: #fff;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.hero__inner {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.hero__text { flex: 1 1 360px; }

.hero__text .eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.hero__text h1 {
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
    letter-spacing: 0.5px;
}

.hero__text .subtitle {
    font-style: italic;
    color: #d8c88f;
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}

.hero__text .subtitle--institution {
    font-style: italic;
    color: #a8a2c9;
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.hero__text .lead {
    color: #c3c9d6;
    line-height: 1.7;
    max-width: 44ch;
    margin: 0;
}

.hero__text .read-more-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.hero__text .read-more-link:hover {
    text-decoration: underline;
}

.hero__photo {
    flex: 0 0 auto;
}

/* Home hero on narrow screens: portrait first, then the text full-width. */
@media (max-width: 680px) {
    .hero__inner {
        flex-direction: column;
        gap: 1.75rem;
    }

    .hero__photo {
        order: -1;
    }

    .hero__text {
        flex: none;
        width: 100%;
    }

    .hero__text .lead {
        max-width: none;
    }
}

/* --- About page: bio + photo/quick-facts columns --- */
.about-grid {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
}

.about-bio {
    flex: 0 1 60ch;
}

.about-bio .lead {
    color: var(--ink);
    max-width: 60ch;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.about-side {
    flex: 0 0 auto;
    width: 240px;
    max-width: 60vw;
    margin-left: auto;
}

.about-glance {
    margin-top: 1.5rem;
    background: var(--cream);
    border: 1px solid var(--cream-line);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.about-glance h3 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--navy);
}

.about-glance ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.about-glance li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--cream-line);
    font-size: 0.88rem;
}

.about-glance li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.about-glance .label {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-glance .value {
    color: var(--navy);
    font-weight: 600;
}

.hero__photo img {
    width: 240px;
    max-width: 60vw;
    height: 240px;
    max-height: 60vw;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid var(--gold);
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

/* About page — narrow screens: stack the two columns, full-width side panel,
   left-aligned body copy (justified text looks poor on narrow screens).
   Stacks below 900px because the two-column layout needs ~60ch + 240px. */
@media (max-width: 900px) {
    .about-grid {
        flex-direction: column;
        gap: 1.75rem;
    }

    .about-side {
        align-self: stretch;
    }

    .about-bio,
    .about-side {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .about-bio .lead {
        max-width: none;
        text-align: left;
    }

    .about-side .hero__photo {
        text-align: center;
    }

    .about-side .hero__photo img {
        max-width: min(240px, 66vw);
        max-height: min(240px, 66vw);
    }
}

/* --- Sections --- */
.section {
    padding: clamp(2rem, 5vw, 3.5rem) 0;
}

.section--cream {
    background: var(--cream);
}

.section h2 {
    font-size: 1.6rem;
    color: var(--navy);
    margin: 0 0 2rem;
}

/* --- Publication cards --- */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.pub-card {
    background: #fff;
    border: 1px solid var(--cream-line);
    border-radius: 6px;
    padding: 1.25rem;
}

.pub-card h3 {
    font-size: 1.02rem;
    margin: 0 0 0.6rem;
    color: var(--navy);
    line-height: 1.35;
}

.pub-card .meta {
    overflow-wrap: anywhere;
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.pub-card .links a {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    margin-right: 0.9rem;
    border-bottom: 1px solid var(--gold);
}

/* Publications page: one group per type, with jump links */
.pub-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.25rem;
}

.pub-jump a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.4rem 0.95rem;
    background: #fff;
    border: 1px solid var(--cream-line);
    border-radius: 999px;
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.pub-jump a:hover { border-color: var(--gold); }

.pub-jump span {
    color: var(--gold);
    font-weight: 600;
}

.pub-group {
    scroll-margin-top: 1rem;
}

.pub-group + .pub-group {
    margin-top: 3rem;
}

.pub-group h2 {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.pub-group__count {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted);
}

.section-more {
    margin: 1.75rem 0 0;
}

.section-more a {
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
}

/* --- Timeline (education / experience) --- */
.timeline-item {
    border-left: 3px solid var(--navy);
    padding: 0.2rem 0 0.2rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--gold);
}

.timeline-item h3 {
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
    color: var(--navy);
}

.timeline-item .period {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.timeline-item p {
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

/* --- Award cards --- */
.award-card {
    background: #fff;
    border: 1px solid var(--cream-line);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.award-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: var(--navy);
}

.award-card .meta {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.award-card p {
    color: var(--muted);
    margin: 0;
}

/* --- Project cards (reuse .award-card, plus a PI / Co-PI badge) --- */
.project-card {
    position: relative;
    padding-right: 5.5rem;
}

.role-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--gold);
    border-radius: 4px;
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* --- Activities (YouTube embeds) --- */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}

.activity-card {
    margin: 0;
    background: #fff;
    border: 1px solid var(--cream-line);
    border-radius: 6px;
    overflow: hidden;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--navy-deep);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.activity-card figcaption {
    padding: 0.9rem 1.1rem 1rem;
    color: var(--navy);
    font-weight: 600;
    line-height: 1.4;
}

/* --- Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-grid figure {
    margin: 0;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
}

.gallery-grid figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

/* --- Contact --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 2.5rem;
}

@media (max-width: 750px) {
    .contact-grid { grid-template-columns: 1fr; }
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.contact-info ul li {
    margin-bottom: 0.4rem;
}

.contact-info ul li:last-child {
    margin-bottom: 0;
}

.contact-info .contact-links {
    margin-top: 1.5rem;
}

.contact-info .contact-links li {
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--cream-line);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.btn-submit {
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit:hover {
    background: var(--gold);
}

.alert-success {
    background: #eaf5ea;
    border: 1px solid #b7dfb7;
    color: #245c24;
    padding: 0.85rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.text-muted { color: var(--muted); }

/* --- Footer --- */
.site-footer {
    background: var(--navy-deep);
    color: #cbd2e0;
    padding: 3rem 0 2rem;
    margin-top: 0;
}

.site-footer h4 {
    color: var(--gold);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 1rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 700px) {
    .site-footer__grid { grid-template-columns: 1fr; }
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li {
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.site-footer .dot {
    color: var(--gold);
    margin-right: 0.3rem;
}

.site-footer .muted {
    color: var(--muted-light);
}

.site-footer hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 2rem 0 1.25rem;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.88rem;
}

.site-footer__institution {
    color: var(--muted-light);
}

/* --- Print --- */
@media print {
    * {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline !important;
        border-bottom: none !important;
    }

    .site-nav__toggle,
    .video-frame,
    .pub-jump,
    .btn-submit,
    form,
    .alert-success {
        display: none !important;
    }

    .site-nav {
        border-bottom: 2px solid #000;
    }

    .site-nav__links {
        display: none !important;
    }

    .site-nav__brand::after {
        content: " (" attr(href) ")";
        font-size: 0.7rem;
        font-weight: 400;
        color: #333 !important;
    }

    .hero, .page-hero {
        padding: 1rem 0;
        border-bottom: 2px solid #000;
    }

    .hero__photo img {
        border: 1px solid #000;
    }

    .section, .section--cream {
        padding: 1.25rem 0;
    }

    .pub-card, .award-card, .timeline-item {
        border: 1px solid #000;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .timeline-item { border-left: 3px solid #000; }
    .timeline-item::before { background: #000; }

    .gallery-grid img {
        max-height: 3in;
        object-fit: contain;
    }

    .site-footer {
        border-top: 2px solid #000;
    }

    .site-footer a::after {
        content: " (" attr(href) ")";
        font-size: 0.7rem;
    }

    @page {
        margin: 1.5cm;
    }
}
