/* Liquid glass theme — single page scroll */

body {
    background: #fff;
    min-height: 100vh;
    width: 87.5%;
    max-width: 1200px;
    margin-left: 5%;
    margin-right: auto;
    padding-left: 0;
    overflow-x: hidden;
}

/* Sticky glass nav bar */

nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    padding: 0.8rem max(7.5%, calc(95% - 1200px)) 0.8rem 5%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    box-sizing: border-box;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

nav.visible {
    transform: translateY(0);
    opacity: 1;
}


nav .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    flex: 1;
}

nav .nav-spacer {
    flex-grow: 1;
    order: 1;
}

/* Desktop: reorder so utility links sit left, section links right */
nav .nav-links .nav-btn {
    order: 2;
}

nav .nav-links .nav-btn.nav-utility {
    order: 0; /* utility links go left, before spacer */
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 0.3em 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: #555;
    transform: none;
    margin-right: 1rem;
}

nav .nav-links .nav-btn.nav-utility:hover {
    background: none;
    color: #1a6db5;
    transform: none;
    box-shadow: none;
}

/* Hamburger - hidden on desktop */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4em;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

nav .nav-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    margin-right: 1.5rem;
    text-decoration: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Nav button — subtle pill */

.nav-btn {
    display: inline-block;
    padding: 0.45em 1.2em;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none !important;
    text-decoration-line: none !important;
    color: #333;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: #111;
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.03);
}

.nav-btn:active {
    background: rgba(0, 0, 0, 0.06);
}

.nav-btn:focus-visible {
    outline: 2px solid #1a6db5;
    outline-offset: 2px;
}

/* Section links below intro */

.section-links {
    display: flex;
    gap: clamp(0.3rem, 1vw, 1rem);
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Sub-page nav pills */

.nav-pills {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}


.cv-short {
    display: none;
}

.cv-link.wrapped .cv-full {
    display: none;
}

.cv-link.wrapped .cv-short {
    display: inline;
}

/* In-text links */

.content p a {
    color: #1a6db5;
    text-decoration: none !important;
    text-decoration-line: none !important;
    background: none;
    border-bottom: 1px solid rgba(26, 109, 181, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.content p a:hover {
    color: #134d80;
    border-bottom-color: rgba(26, 109, 181, 0.6);
}

/* Hero header */

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-header .section-links {
    margin-top: 0;
}

.about-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

a.about-link,
a.about-link:link,
a.about-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45em 1em;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
}

a.about-link:hover {
    color: #111;
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.03);
    text-decoration: none;
}

.about-link svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Hero name */

.hero-name {
    font-size: clamp(1.8rem, 4.5vw, 4rem);
    margin-bottom: 0.1rem;
    transition: opacity 0.4s ease;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.hero-section .subtitle {
    font-size: 0.85rem;
    color: #595959;
    letter-spacing: 0.02em;
}

nav.scrolled ~ article .hero-name {
    /* keeps it in place but nav takes over */
}

/* Article / sections */

article {
    padding: 0 !important;
    margin-top: 0;
}

.glass-section {
    background: #fff;
    border: none;
    border-radius: 0;
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    margin-top: 0;
}

.glass-section + .glass-section {
    margin-top: 0;
}

/* Header row */

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* Typography */

h1 {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 0.2rem;
}

h2 {
    font-size: 2rem;
    margin-top: 1rem;
}

.subtitle {
    font-size: 1.25rem;
}

/* CV button */

.cv-btn {
    display: inline-block;
    padding: 0.45em 1.3em;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #444;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    text-decoration: none !important;
    text-decoration-line: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.cv-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #222;
}

/* Footer */

footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: #595959;
    text-align: center;
}

footer a {
    color: #666 !important;
}

/* Lists */

section > ol {
    list-style-position: outside;
}

section > ol > li,
section > ul > li {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}

section > ol > li > ul > li {
    font-size: 0.9em;
    margin-top: 0.3rem;
}

/* Photo */

.photo {
    float: right;
    width: 280px;
    margin: 1.2rem 0 1.5rem 2rem;
}

.photo.photo-wide {
    width: 380px;
}

.photo img {
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.hero-section .photo img {
    filter: none;
}

.photo figcaption {
    float: none !important;
    max-width: 100% !important;
    width: 100%;
    display: block;
    font-size: 0.8rem;
    color: #595959;
    margin-top: 0.5rem;
    line-height: 1.4;
    text-align: left;
}

/* Content */

.content {
    width: 100%;
    overflow: hidden;
}

.content p {
    font-size: 1.15rem;
    line-height: 1.6;
}



/* Research subsections */

/* Logos inside floated photo figure */

.photo-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.photo-logos a {
    display: block;
    flex: 1;
    min-width: 0;
    transition: opacity 0.2s ease;
}

.photo-logos a:hover {
    opacity: 0.7;
}

.photo-logos img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

/* FP logos floated right */

.fp-section-logos {
    float: right;
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 0 0 1rem 2rem;
}

.fp-section-logos a {
    display: block;
    transition: opacity 0.2s ease;
}

.fp-section-logos a:hover {
    opacity: 0.7;
}

.fp-section-logos img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

.research-subsection {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.research-subsection h3 {
    margin-top: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.research-subsection h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    margin-top: 1.8rem;
    margin-bottom: 0.3rem;
}

/* Working papers */

.working-paper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wp-left {
    flex: 1;
    min-width: 0;
}

.wp-right {
    flex-shrink: 0;
    width: 400px;
    display: flex;
    flex-direction: column;
    align-self: center;
    align-items: center;
    justify-content: center;
}

.working-paper:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

h3 + .working-paper,
h4 + .working-paper,
.working-paper:first-child {
    margin-top: 0;
}

.working-paper strong a {
    color: #111;
    text-decoration: none !important;
    text-decoration-line: none !important;
    font-size: 1.1rem;
}

.working-paper strong a:hover {
    color: #1a6db5;
}

.wp-img-stack {
    width: 100%;
    position: relative;
}

.wp-img-stack img {
    width: 75%;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: block;
    position: relative;
}

.wp-img-stack img:first-child {
    margin-left: 0;
    z-index: 1;
}

.wp-img-stack img + img {
    margin-top: -25%;
    margin-left: 25%;
    width: 75%;
    z-index: 2;
}

.wp-img-stack-flip img:first-child {
    margin-left: 25%;
}

.wp-img-stack-flip img + img {
    margin-left: 0;
}

.wp-img-vertical {
    display: flex;
    flex-direction: column;
}

.wp-img-vertical img {
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wp-img-vertical img + img {
    margin-top: -10%;
}

.wp-single-img {
    width: 80%;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: contrast(1.3) brightness(1.05);
}


.wp-authors {
    font-size: 0.95rem;
    color: #666;
    display: block;
    margin-top: 0.4rem;
}

.wp-authors a {
    color: #1a6db5;
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.wp-authors a:hover {
    text-decoration: underline !important;
}

.wp-caption {
    font-size: 0.8rem;
    color: #595959;
    margin-top: 0.5rem;
    line-height: 1.4;
    text-align: left;
    align-self: stretch;
}

.wp-abstract {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin-top: 0.4rem;
}

.wp-links {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
}

.wp-links a.about-link {
    font-size: 0.8rem;
    padding: 0.35em 0.8em;
}

.wp-contributors {
    margin-top: 0.8rem !important;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.85rem !important;
    color: #595959;
    font-style: italic;
}

/* Teaching */

.teaching-institution {
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: 0.3rem;
}

/* Smooth scroll */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* Responsive — tablet */

@media (max-width: 1024px) {
    .wp-right {
        width: 280px;
    }
    .photo {
        width: 220px;
    }
    .photo.photo-wide {
        width: 280px;
    }
    .fp-section-logos {
        width: 20%;
    }
    .section-links .nav-btn {
        padding: 0.45em 1em;
        font-size: 0.9rem;
    }
}

/* Responsive — mobile */

@media (max-width: 768px) {
    .glass-section {
        padding: 1.5rem 0;
        border-radius: 0;
        margin-top: 0;
    }

    .glass-section + .glass-section {
        margin-top: 0;
    }

    /* Hide hero section links and hero name on mobile — nav handles navigation */
    .section-links {
        display: none;
    }

    .hero-name {
        display: none;
    }

    /* Push hero below fixed nav (single-row hamburger nav) */
    .hero-section {
        margin-top: 4rem;
    }

    /* Scroll offset to account for fixed nav */
    html {
        scroll-padding-top: 5rem;
    }

    /* Show sticky nav on mobile: name + hamburger on one row */
    nav {
        transform: translateY(0) !important;
        opacity: 1 !important;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-align-items: center;
        align-items: center;
        gap: 0;
        padding: 0.6rem 5%;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    nav .nav-name {
        display: block;
        font-size: 1.3rem;
        font-weight: 700;
        line-height: 1.2;
        -webkit-flex: 1;
        flex: 1;
        margin-right: auto;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: -webkit-flex;
        display: flex;
    }

    /* Hide nav links by default; show when open */
    nav .nav-links {
        display: none !important;
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 0;
        width: 100%;
        -webkit-flex: 0 0 100%;
        flex: 0 0 100%;
        padding-top: 0.8rem;
    }

    nav.open {
        background: #fff;
        padding-bottom: 0.8rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    nav.open .nav-links {
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-align-items: flex-start;
        align-items: flex-start;
    }

    /* Show utility links in hamburger */
    nav.open .nav-utility {
        display: inline-block !important;
    }

    /* Hide spacer on mobile */
    .nav-spacer {
        display: none !important;
    }

    /* Divider between section links and utility links */
    nav .nav-links .nav-spacer + .nav-btn {
        margin-top: 0.5rem;
        padding-top: 0.7rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Hamburger → X animation */
    nav.open .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    nav.open .hamburger span:nth-child(2) {
        opacity: 0;
    }
    nav.open .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Comfortable paragraph spacing on mobile */
    .content p {
        margin-top: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Reset desktop order for mobile — section links first, utility links second */
    nav .nav-links .nav-btn {
        order: 0 !important;
    }
    nav .nav-links .nav-btn.nav-utility {
        order: 2 !important;
    }
    nav .nav-links .nav-spacer {
        order: 1 !important;
    }

    /* Override glass-bubble style for hamburger dropdown links */
    nav .nav-links .nav-btn {
        background: none;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
        padding: 0.55em 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: #222;
        transform: none;
        display: block;
        width: 100%;
        text-align: left;
        margin-right: 0;
    }

    /* Utility links: smaller and lighter */
    nav .nav-links .nav-btn.nav-utility {
        font-size: 0.95rem;
        font-weight: 400;
        color: #555;
        margin-right: 0;
    }

    nav .nav-links .nav-btn:hover,
    nav .nav-links .nav-btn:active {
        background: none;
        color: #1a6db5;
        transform: none;
        box-shadow: none;
    }

    /* About section: reorder photo after first two paragraphs */
    .about-content {
        display: flex;
        flex-direction: column;
    }

    .about-content p:nth-of-type(1) { order: 1; }
    .about-content p:nth-of-type(2) { order: 2; }
    .about-content p:nth-of-type(n+3) { order: 3; }
    .about-content .about-links { order: 4; }
    .about-content .photo { order: 5; }

    /* Photos: stack instead of hiding */
    .photo {
        float: none;
        width: 100%;
        max-width: none;
        margin: 1rem 0;
    }

    .photo img {
        aspect-ratio: auto;
        object-fit: contain;
        max-height: 50vh;
        width: auto;
        max-width: 65%;
        margin: 0 auto;
        display: block;
    }

    .photo.photo-wide {
        max-width: none;
        width: 100%;
    }

    .photo.photo-wide img {
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center;
    }

    .photo-logos {
        display: none;
    }

    /* Engagement section: photo after paragraphs */
    .engagement-content {
        display: flex;
        flex-direction: column;
    }

    .engagement-content p:nth-of-type(1) { order: 1; }
    .engagement-content p:nth-of-type(2) { order: 2; }
    .engagement-content p:nth-of-type(3) { order: 3; }
    .engagement-content .photo { order: 4; }

    /* Working papers: stack images below text */
    .working-paper {
        flex-direction: column;
    }

    .wp-right {
        width: 100%;
        max-width: 360px;
        margin: 1rem auto 0;
    }

    .wp-right[style] {
        width: 100% !important;
        max-width: 200px;
    }

    /* FP logos: keep floated right on mobile, just smaller */
    .fp-section-logos {
        width: 120px;
    }

    .fp-section-logos img {
        max-height: none;
        max-width: 100%;
    }

    .header-row {
        flex-direction: column;
    }

    /* Tighter list spacing on mobile */
    section > ol > li,
    section > ul > li {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    /* Footer */
    footer {
        margin-top: 1rem;
        padding: 1rem 0;
    }

    /* Research subsections */
    .research-subsection {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }

    /* Working paper spacing */
    .working-paper {
        margin-top: 1.25rem;
        padding-bottom: 1.25rem;
        gap: 1rem;
    }

    /* About links */
    .about-links {
        margin-top: 1rem;
    }
}

/* === Accessibility: Skip link === */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 0.8em 1.5em;
    background: #1a6db5;
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* === Awards heading (h3 styled as h2) === */

#awards-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2.8rem;
    margin-bottom: 1rem;
    color: #111;
}

/* === Hamburger touch target === */

.hamburger {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* === Accessibility: Focus styles === */

*:focus-visible {
    outline: 2px solid #1a6db5;
    outline-offset: 3px;
    border-radius: 4px;
}


/* === Accessibility: Reduced motion === */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Responsive — large screens: bigger nav buttons */

@media (min-width: 1200px) {
    .nav-btn {
        padding: 0.6em 1.6em;
        font-size: 1.05rem;
    }
}
