:root {
    --ink: #17243d;
    --ink-soft: #536078;
    --paper: #f7f4ed;
    --surface: #fffdf8;
    --accent: #ef6f61;
    --accent-dark: #cf5146;
    --blue: #24446f;
    --line: rgba(23, 36, 61, 0.13);
    --shadow: 0 18px 48px rgba(29, 42, 67, 0.10);
    --radius: 22px;
    --publication-gap: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 94px;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 8% 4%, rgba(239, 111, 97, 0.10), transparent 27rem),
        radial-gradient(circle at 92% 18%, rgba(36, 68, 111, 0.08), transparent 31rem),
        var(--paper);
    color: var(--ink);
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.72;
}

a {
    color: var(--blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 160ms ease;
}

a:hover {
    color: var(--accent-dark);
}

/* Sticky header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 72px;
    padding: 0 5vw;

    background: rgba(247, 244, 237, 0.92);
    border-bottom: 1px solid rgba(23, 36, 61, 0.08);
    backdrop-filter: blur(16px);
}

.site-header .site-brand {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 10px;
    width: auto;
    min-width: max-content;
    white-space: nowrap;

    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.site-header .site-brand-icon {
    display: block;
    flex: 0 0 64px;

    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;

    object-fit: contain;
    margin: 0;
}

.site-header .site-brand span {
    display: inline-block;
    margin: 0;
}

.site-nav,
.section-links,
.profile-links {
    display: flex;
    align-items: center;
}

.site-nav {
    gap: 1.65rem;
}

.section-links,
.profile-links {
    gap: 1.05rem;
}

.profile-links {
    padding-left: 1.35rem;
    border-left: 1px solid var(--line);
}

.site-nav a {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.profile-links a {
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-nav a:hover,
.profile-links a:hover {
    color: var(--accent-dark);
}
.icon-links {
    gap: 12px;
}

.icon-links a {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    text-decoration: none;
}

.icon-links img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.icon-links a:hover {
    background: rgba(239, 111, 97, 0.1);
}
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 0;
    background: transparent;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--ink);
}

/* Main page */

#ContainerDiv {
    width: 100%;
}

#MainDiv {
    width: min(1120px, calc(100% - 42px));
    margin: 0 auto;
    padding: 62px 0 96px;
}

/* Hero */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(42px, 8vw, 100px);
    align-items: center;
    min-height: 610px;
    padding: clamp(42px, 7vw, 78px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 34px;
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -180px;
    width: 430px;
    height: 430px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.09;
}

.hero-text {
    position: relative;
    z-index: 2;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-name {
    margin: 0 0 20px;
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(3.7rem, 7.5vw, 6.6rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 0.92;
}

.hero-name span {
    color: var(--accent);
}

.hero-role {
    max-width: 700px;
    margin: 0 0 22px;
    color: var(--ink);
    font-size: 1.13rem;
    font-weight: 600;
    line-height: 1.55;
}

.hero-about {
    max-width: 720px;
    margin: 18px 0 20px;
    color: var(--ink-soft);
}

.hero-about p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
}

.hero-photo {
    position: relative;
    z-index: 2;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 10px solid #ffffff;
    border-radius: 170px 170px 26px 26px;
    box-shadow: 0 22px 50px rgba(29, 42, 67, 0.18);
    transform: rotate(1.6deg);
}

/* Section headings */

.separator {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 104px 0 30px;
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(2.1rem, 5vw, 3.5rem);
    letter-spacing: -0.035em;
}

.separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

.section-intro {
    max-width: 900px;
    color: var(--ink-soft);
}

/* Publication carousel */

.publication-shell {
    position: relative;
    width: 100%;
}

.pub-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (2 * var(--publication-gap))) / 3);
    gap: var(--publication-gap);
    width: 100%;
    margin: 0;
    padding: 8px 4px 26px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 36, 61, 0.25) transparent;
    list-style: none;
}

.pub-list::-webkit-scrollbar {
    height: 8px;
}

.pub-list::-webkit-scrollbar-thumb {
    background: rgba(23, 36, 61, 0.22);
    border-radius: 999px;
}

.pub-list li {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-snap-align: start;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.pub-list li:hover {
    border-color: rgba(239, 111, 97, 0.35);
    box-shadow: 0 15px 35px rgba(29, 42, 67, 0.08);
    transform: translateY(-2px);
}

.pub-image-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(239, 111, 97, 0.14),
            rgba(36, 68, 111, 0.12)
        ),
        var(--surface);
    border-bottom: 1px solid var(--line);
}

.pub-image-wrap.image-missing::after {
    content: "Add publication image";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pub-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px 25px 25px;
}

.pub-title {
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.16rem;
    font-weight: 700;
    line-height: 1.35;
}

.pub-authors {
    margin-top: 10px;
    color: var(--ink-soft);
    font-size: 0.87rem;
}

.pub-venue {
    margin-top: 7px;
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 700;
}

.publinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
}

.publinks a,
.contact-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.publinks a:hover,
.contact-links a:hover {
    border-color: rgba(239, 111, 97, 0.55);
    color: var(--accent-dark);
}

.abstract {
    display: none;
    margin-top: 18px;
    padding: 20px 22px;
    background: rgba(36, 68, 111, 0.055);
    border-radius: 14px;
    color: var(--ink-soft);
    font-size: 0.93rem;
}

.scroll-button {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 28px rgba(29, 42, 67, 0.14);
    font-size: 1.2rem;
    transform: translateY(-50%);
    cursor: pointer;
}

.scroll-button:hover {
    color: var(--accent-dark);
}

.scroll-left {
    left: -23px;
}

.scroll-right {
    right: -23px;
}

.scroll-hint {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 0.82rem;
    text-align: right;
}

/* Projects */

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

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(29, 42, 67, 0.07);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.project-card:hover {
    box-shadow: 0 20px 45px rgba(29, 42, 67, 0.12);
    transform: translateY(-4px);
}

.project-image {
    width: 100%;
    height: 260px;
    object-fit: contain;
    padding: 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.project-content {
    padding: 26px 28px 30px;
}

.project-content h3 {
    margin: 0 0 9px;
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.35rem;
}

.project-tags {
    margin-bottom: 14px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.project-content p {
    margin-bottom: 0;
    color: var(--ink-soft);
}
/* Public engagement carousel */

.engagement-shell {
    position: relative;
    width: 100%;
}

.engagement-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 22px) / 2);
    gap: 22px;
    width: 100%;
    margin: 0;
    padding: 8px 4px 26px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 36, 61, 0.25) transparent;
}

.engagement-list::-webkit-scrollbar {
    height: 8px;
}

.engagement-list::-webkit-scrollbar-thumb {
    background: rgba(23, 36, 61, 0.22);
    border-radius: 999px;
}

.engagement-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-snap-align: start;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.engagement-card:hover {
    border-color: rgba(239, 111, 97, 0.35);
    box-shadow: 0 15px 35px rgba(29, 42, 67, 0.08);
    transform: translateY(-2px);
}

.engagement-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid var(--line);
}

.engagement-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.engagement-media img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    object-fit: contain !important;
    object-position: center;
}

.engagement-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px 25px 25px;
}

.engagement-type {
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.engagement-card h3 {
    margin: 7px 0 10px;
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.16rem;
    line-height: 1.4;
}

.engagement-card p {
    margin: 0 0 16px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.engagement-link {
    margin-top: auto;
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.engagement-link:hover {
    color: var(--accent-dark);
}

.engagement-scroll-button {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 28px rgba(29, 42, 67, 0.14);
    font-size: 1.2rem;
    transform: translateY(-50%);
    cursor: pointer;
}

.engagement-scroll-button:hover {
    color: var(--accent-dark);
}

.engagement-scroll-left {
    left: -23px;
}

.engagement-scroll-right {
    right: -23px;
}

@media screen and (max-width: 950px) {
    .engagement-list {
        grid-auto-columns: calc((100% - 22px) / 2);
    }
}

@media screen and (max-width: 700px) {
    .engagement-scroll-button {
        display: none;
    }
}

@media screen and (max-width: 640px) {
    .engagement-list {
        grid-auto-columns: 100%;
        gap: 16px;
    }
}
/* Talks */

.talks-list {
    display: grid;
    gap: 14px;
}

.talk-card {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 25px;
    align-items: start;
    padding: 25px 28px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.talk-date {
    color: var(--accent);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.45rem;
    font-weight: 700;
}

.talk-type {
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.talk-content h3 {
    margin: 5px 0;
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.2rem;
}

.talk-content p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.talk-links {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.talk-links a {
    font-size: 0.85rem;
    font-weight: 700;
}


/* One-slide-at-a-time PDF presentation */

.presentation-viewer {
    width: 520px;
    max-width: 100%;
    justify-self: start;
    margin: 18px 0 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(29, 42, 67, 0.08);
}

.presentation-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
}

.presentation-slide canvas {
    display: block;
    width: 100%;
    height: auto;
}

.presentation-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-align: center;
}

.presentation-controls button {
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.presentation-controls button:first-child {
    justify-self: start;
}

.presentation-controls button:last-child {
    justify-self: end;
}

.presentation-controls button:hover:not(:disabled) {
    border-color: rgba(239, 111, 97, 0.55);
    color: var(--accent-dark);
}

.presentation-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

@media screen and (max-width: 700px) {
    .presentation-controls {
        grid-template-columns: 1fr 1fr;
    }

    .presentation-controls span {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .presentation-controls button:first-child {
        grid-column: 1;
        grid-row: 2;
    }

    .presentation-controls button:last-child {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Contact and footer */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: min(1120px, calc(100% - 42px));
    margin: 0 auto;
    padding: 28px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.84rem;
}

/* Reveal animation */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 550ms ease,
        transform 550ms ease;
}

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

/* Tablet */

@media screen and (max-width: 950px) {
    .site-nav {
        gap: 0.9rem;
    }

    .section-links,
    .profile-links {
        gap: 0.7rem;
    }

    .profile-links {
        padding-left: 0.9rem;
    }

    .profile-links a {
        font-size: 0.68rem;
    }

    .pub-list {
        grid-auto-columns: calc((100% - var(--publication-gap)) / 2);
    }
}

@media screen and (max-width: 880px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-photo {
        width: min(300px, 82%);
        grid-row: 1;
        margin: 0 auto;
    }

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

/* Mobile */

@media screen and (max-width: 700px) {
    body {
        font-size: 16px;
    }

    .site-header {
        padding: 0 21px;
    }

    .menu-toggle {
        display: block;
    }
    .site-brand {
    gap: 8px;
    font-size: 1.05rem;
    }
    
    .site-brand-icon {
        width: 38px;
        height: 38px;
    }
    .site-nav {
        position: absolute;
        top: 64px;
        right: 18px;
        display: none;
        width: 230px;
        padding: 14px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: grid;
    }

    .section-links,
    .profile-links {
        display: grid;
        gap: 0;
    }

    .profile-links {
        margin-top: 8px;
        padding: 8px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .site-nav a {
        padding: 8px 10px;
    }

    #MainDiv {
        width: min(100% - 28px, 1120px);
        padding-top: 28px;
    }

    .hero {
        padding: 32px 24px 38px;
        border-radius: 24px;
    }

    .hero-name {
        font-size: clamp(3.2rem, 18vw, 5rem);
    }

    .separator {
        margin-top: 74px;
    }

    .scroll-button {
        display: none;
    }

    .talk-card {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 22px;
    }

    .talk-date {
        font-size: 1.15rem;
    }

    .project-image {
        height: 220px;
    }

    .slide-viewer {
        height: 430px;
    }

    .site-footer {
        flex-direction: column;
        width: min(100% - 28px, 1120px);
    }
    .icon-links {
        grid-template-columns: repeat(5, 32px);
        justify-content: start;
        gap: 8px;
        padding: 12px 8px 4px;
    }
    
    .icon-links a {
        padding: 0;
    }
}


@media screen and (max-width: 640px) {
    .pub-list {
        --publication-gap: 16px;
        grid-auto-columns: 100%;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
