@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&display=swap");
:root {
    --ink: #223b53;
    --muted: #63758a;
    --blue: #486b91;
    --line: #dbe4ec;
    --bg: #f8fafc;
    --surface: #fff;
    --pale: #edf3f9;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15.5px/1.7 "DM Sans",Arial,sans-serif;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: #204465;
}

h1,h2,h3,h4,p {
    margin-top: 0;
}

h1,h2 {
    font-family: "Source Serif 4",Georgia,serif;
    letter-spacing: -.025em;
}

h1 {
    font-size: clamp(2.2rem,4.3vw,3.6rem);
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

h2 {
    font-size: clamp(1.85rem,3vw,2.65rem);
    margin-bottom: 0;
}

h3 {
    font-size: 1.18rem;
    line-height: 1.35;
}

h4 {
    font-size: 1.06rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 30px;
    padding-right: 30px;
}

.site-header {
    position: sticky;
    top: 0;
    background: rgba(250,252,254,.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    z-index: 20;
}

.nav-inner {
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.wordmark {
    font-weight: 700;
    color: var(--ink);
    font-size: 1.13rem;
    white-space: nowrap;
}

.nav-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.nav-inner nav a {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
}

.nav-inner nav a:hover {
    color: var(--blue);
}

.intro {
    display: grid;
    grid-template-columns: minmax(0,1.55fr) minmax(230px,.75fr);
    gap: 56px;
    align-items: center;
    padding-top: 85px;
    padding-bottom: 85px;
}

.intro-copy p:not(.eyebrow) {
    max-width: 690px;
    color: #45596b;
    font-size: 1.04rem;
}

.eyebrow {
    font: 700 .73rem/1.5 "DM Sans",sans-serif;
    letter-spacing: .12em;
    color: #6787a9;
    text-transform: uppercase;
    margin-bottom: 13px;
}

.intro-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.btn {
    display: inline-flex;
    padding: 11px 18px;
    border-radius: 8px;
    border: 1px solid #b8c9d8;
    font-weight: 700;
    font-size: .86rem;
}

.btn.primary {
    background: #3b6185;
    color: white;
    border-color: #3b6185;
}

.btn.secondary {
    background: transparent;
    color: #3b6185;
}

.portrait-card {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(29,57,88,.07);
}

.portrait-card img {
    width: 100%;
    height: 325px;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 10px;
    background: #d9e4ef;
}

.portrait-card figcaption {
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.4;
    margin: 9px 5px 2px;
}

.section {
    padding-top: 55px;
    padding-bottom: 70px;
    border-top: 1px solid var(--line);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: end;
    margin-bottom: 28px;
}

.section-heading>p {
    max-width: 330px;
    color: var(--muted);
    margin: 0;
    font-size: .91rem;
}

.content-card,.project-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 25px 27px;
    box-shadow: 0 5px 22px rgba(42,67,92,.025);
}

.content-card p,.project-card p {
    color: #4e6071;
}

.content-card ul {
    padding-left: 19px;
    margin: 0;
    color: #4e6071;
}

.content-card li {
    margin: 0 0 10px;
}

.content-card li:last-child {
    margin-bottom: 0;
}

.research-stack {
    display: grid;
    gap: 16px;
}

.inline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 13px 22px;
    font-size: .87rem;
    font-weight: 700;
    margin-top: 20px;
}

.work-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 19px;
}

.work-head h3 {
    margin-bottom: 2px;
}

.work-head p,.work-head span {
    color: var(--muted);
    font-size: .91rem;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.project-category {
    margin: 30px 0 40px;
}

.project-category>h3 {
    border-left: 3px solid #7295b6;
    padding-left: 12px;
    margin-bottom: 18px;
    color: #314c68;
}

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

.project-meta {
    font-size: .76rem;
    color: #718398 !important;
    letter-spacing: .02em;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.project-card h4 {
    margin-bottom: 9px;
}

.project-card>p:not(.project-meta) {
    margin-bottom: 15px;
}

.tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    display: inline-flex;
    background: var(--pale);
    color: #526d85;
    padding: 4px 9px;
    border: 1px solid #e2eaf2;
    border-radius: 5px;
    font-size: .75rem;
}

.project-link,.minor-link,.no-link {
    font-size: .83rem;
    margin-top: 14px;
    font-weight: 700;
}

.no-link {
    color: #97a2ad;
    font-weight: 400;
}

.minor-link {
    margin-top: 18px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 17px;
}

.degree {
    font-weight: 600;
}

.subtle {
    font-size: .86rem;
    color: var(--muted) !important;
}

.contact-card {
    max-width: 800px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    padding-top: 25px;
    padding-bottom: 40px;
    font-size: .81rem;
    color: var(--muted);
}

.blog-intro {
    padding-top: 74px;
    padding-bottom: 28px;
}

.blog-grid {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 22px;
    align-items: start;
    padding-bottom: 90px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-item {
    display: block;
    border-radius: 9px;
    padding: 13px 15px;
    background: white;
    border: 1px solid var(--line);
    font-weight: 600;
    color: var(--ink);
}

.blog-item.active {
    background: var(--pale);
    border-color: #9fb6ca;
}

.blog-item small {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 400;
}

.markdown-body {
    min-height: 310px;
}

.markdown-body h1,.markdown-body h2 {
    font-size: 1.6rem;
}

.markdown-body pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #edf3f8;
    padding: 15px;
    border-radius: 8px;
}

.markdown-body code {
    background: #edf3f8;
    padding: 2px 5px;
    border-radius: 4px;
}

.markdown-body blockquote {
    border-left: 3px solid #8ba8c1;
    margin-left: 0;
    padding-left: 15px;
    color: #536d82;
}

.markdown-body img {
    max-width: 100%;
}

@media (max-width:900px) {
    .intro {
        gap: 28px;
    }

    .nav-inner {
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
        flex-direction: column;
        gap: 10px;
    }

    .nav-inner nav {
        gap: 9px 16px;
    }

}

@media (max-width:670px) {
    .container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .intro {
        grid-template-columns: 1fr;
        padding-top: 48px;
        padding-bottom: 60px;
    }

    .portrait-card {
        max-width: 290px;
    }

    .two-col,.project-grid,.skills-grid,.blog-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding-top: 44px;
        padding-bottom: 55px;
    }

    .section-heading {
        display: block;
    }

    .section-heading>p {
        margin-top: 12px;
    }

    .footer {
        flex-wrap: wrap;
    }

}

/*Content-first flexible academic layout*/

.two-col,.project-grid,.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,310px),1fr));
    align-items: start;
    gap: 18px;
}

.content-card,.project-card {
    height: auto;
    min-height: 0;
    align-self: start;
    padding: 22px 24px;
}

.project-card {
    display: block;
}

.project-category {
    margin-bottom: 28px;
}

.project-card>p:not(.project-meta) {
    margin-bottom: 12px;
}

.content-card.compact-card {
    max-width: 660px;
}

.intro {
    align-items: start;
    grid-template-columns: minmax(0,1.65fr) minmax(215px,.7fr);
}

.intro-copy p:not(.eyebrow) {
    max-width: 740px;
}

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

    .portrait-card {
        max-width: 290px;
    }

}

/*PhD identity and research interests: restrained academic treatment*/

.interests-inline {
    border-left: 3px solid #8ba9c5;
    padding: 1px 0 1px 17px;
    margin: 23px 0 8px;
}

.interests-inline h2 {
    font-family: "DM Sans",Arial,sans-serif;
    font-size: 1rem;
    letter-spacing: 0;
    margin: 0 0 5px;
    color: #365b7e;
    font-weight: 700;
}

.interests-inline p {
    margin: 0 !important;
    font-size: .98rem !important;
    line-height: 1.6;
}

/*Editorial blog: readable rather than card-dense*/

.writing-page {
    padding-top: 76px;
    padding-bottom: 110px;
    max-width: 1050px;
}

.writing-page h1,.article-paper h1 {
    font-family: "Source Serif 4",Georgia,serif;
    font-weight: 600;
    line-height: 1.15;
}

.writing-page h1 em,.article-paper h1 em {
    font-weight: 500;
    color: #52799d;
}

.writing-subtitle {
    color: #617588;
    font-size: 1.07rem;
    max-width: 620px;
    margin-bottom: 38px;
}

.writing-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 22px;
    align-items: start;
}

.writing-feature {
    color: inherit;
    display: block;
    background: white;
    border: 1px solid #dce6f0;
    border-radius: 16px;
    padding: 29px;
    min-height: 390px;
    box-shadow: 0 10px 36px rgba(38,67,91,.035);
    transition: transform .2s,box-shadow .2s;
}

.writing-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 17px 46px rgba(38,67,91,.09);
}

.writing-kicker {
    font-size: .72rem;
    letter-spacing: .13em;
    color: #7892a9;
    font-weight: 700;
}

.writing-feature h2 {
    font-size: 1.65rem;
    line-height: 1.25;
    margin-bottom: 12px;
}

.writing-feature p {
    color: #586d80;
}

.read-story {
    display: inline-block;
    margin-top: 12px;
    font-size: .88rem;
    font-weight: 700;
    color: #426c92;
}

.feature-diagram {
    background: #f1f6fb;
    border: 1px solid #e0e9f2;
    min-height: 122px;
    margin: 22px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 15px;
    border-radius: 10px;
    font: 600 .78rem "DM Sans",sans-serif;
    color: #4a6f91;
}

.feature-diagram div {
    background: #fff;
    border: 1px solid #c9d9e7;
    border-radius: 7px;
    padding: 9px;
}

.feature-diagram b {
    color: #9cb3c7;
}

.feature-math {
    font-family: Georgia,serif;
    font-size: 3.4rem;
    min-height: 122px;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    color: #557696;
    background: #f1f6fb;
    border: 1px solid #e0e9f2;
    border-radius: 10px;
    margin: 22px 0;
}

.feature-math span {
    font-size: 1.8rem;
    color: #abc0d2;
}

.article-layout {
    display: grid;
    grid-template-columns: 200px minmax(0,1fr);
    gap: 45px;
    align-items: start;
    padding-top: 70px;
    padding-bottom: 110px;
    max-width: 1180px;
}

.article-side {
    position: sticky;
    top: 120px;
    color: #65798b;
    font-size: .85rem;
}

.article-side .minor-link {
    display: block;
    margin: 0 0 35px;
}

.side-label {
    font-weight: 700;
    color: #476b8c;
}

.side-link {
    display: block;
    margin-top: 15px;
    font-size: .83rem;
}

.article-paper {
    background: white;
    padding: clamp(22px,5vw,58px);
    border: 1px solid #e0e8f0;
    border-radius: 13px;
    box-shadow: 0 11px 42px rgba(40,63,85,.03);
    min-width: 0;
}

.article-paper h1 {
    font-size: clamp(2.4rem,5vw,3.7rem);
    margin-top: 4px;
}

.article-lead {
    font-family: "Source Serif 4",Georgia,serif;
    font-size: 1.32rem;
    line-height: 1.48;
    color: #63788b;
    max-width: 620px;
}

.article-divider {
    height: 1px;
    background: #e4ebf2;
    margin: 35px 0 38px;
}

.article-copy {
    font-size: 1rem;
    line-height: 1.85;
    color: #3f5365;
}

.article-copy h2 {
    font-size: 1.75rem;
    margin: 48px 0 17px;
    color: #273e55;
}

.article-copy p {
    margin-bottom: 20px;
}

.article-copy ul {
    padding-left: 24px;
}

.article-copy li {
    margin-bottom: 10px;
}

.article-copy blockquote {
    background: #f4f8fb;
    padding: 17px 20px;
    border-left: 3px solid #8ba9c5;
    margin: 24px 0;
}

.article-copy pre {
    background: #172b40 !important;
    color: #e0edf7;
    border-radius: 11px;
    padding: 22px;
    overflow-x: auto;
    overflow-wrap: normal;
    white-space: pre;
    font-size: .86rem;
    line-height: 1.6;
}

.article-copy pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-copy code {
    font-size: .91em;
}

.article-copy .mermaid {
    margin: 28px 0;
    padding: 20px;
    background: #f6f9fc;
    border-radius: 12px;
    overflow: auto;
    text-align: center;
}

.article-end {
    padding-top: 25px;
    margin-top: 55px;
    border-top: 1px solid #e3ebf3;
    color: #64798b;
}

.math-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr));
    gap: 17px;
    margin-top: 30px;
}

.math-shot {
    display: block;
    background: #f3f6fa;
    border: 1px solid #dae5ef;
    border-radius: 10px;
    padding: 8px;
    color: #567593;
    font-size: .77rem;
}

.math-shot img {
    width: 100%;
    height: 310px;
    object-fit: contain;
    background: #1b1b1b;
    border-radius: 6px;
}

.math-shot span {
    display: block;
    padding: 7px 6px 2px;
}

.math-shot:hover {
    border-color: #94aec5;
}

@media (max-width:850px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .article-side {
        position: static;
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .article-side .minor-link {
        margin: 0;
    }

}

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

    .writing-page {
        padding-top: 42px;
    }

    .article-layout {
        padding-top: 30px;
    }

    .article-paper {
        padding: 21px;
    }

    .article-copy .mermaid {
        padding: 5px;
    }

}

/*Full Timer Dispatcher article*/

.article-toc {
    margin: 20px 0;
    color: #4e6f8d;
}

.article-toc summary {
    cursor: pointer;
    font-weight: 650;
}

.article-toc ol {
    margin: 12px 0;
    padding-left: 20px;
    max-height: 47vh;
    overflow: auto;
}

.article-toc li {
    margin: 5px 0;
    font-size: .78rem;
    line-height: 1.4;
}

.article-copy h2,.article-copy h3 {
    scroll-margin-top: 110px;
}

.article-copy h3 {
    color: #385a77;
    margin-top: 30px;
}

.article-copy table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    margin: 20px 0;
}

.article-copy th,.article-copy td {
    padding: 10px 12px;
    border-bottom: 1px solid #dae6f0;
    text-align: left;
}

.article-copy th {
    background: #edf4fa;
}

.article-copy .mermaid {
    max-width: 100%;
    overflow-x: auto;
}

.article-copy pre {
    max-width: 100%;
}

.article-copy pre code {
    white-space: pre;
}

/*Blog additions — pages adapt to content instead of equal-height cards*/

.writing-grid {
    align-items: start;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,290px),1fr));
}

.writing-feature {
    min-height: 0;
    height: auto;
}

.math-article {
    overflow-wrap: anywhere;
}

.math-article .mermaid {
    max-width: 100%;
    overflow-x: auto;
}

.math-article .MathJax {
    max-width: 100%;
}

.article-copy h1,.article-copy h2,.article-copy h3 {
    overflow-wrap: anywhere;
}

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

}

.experience-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.experience-stack .content-card {
    width: 100%;
    box-sizing: border-box;
}

/*=========================================

   PROFESSIONAL EXPERIENCE TIMELINE

   =========================================*/

.experience-timeline {
    max-width: 100%;
}

/*Company heading*/

.experience-company {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    margin-bottom: 28px;
    background: #edf3f9;
    border: 1px solid #d5e1ec;
    border-radius: 14px;
}

.experience-company h3 {
    margin: 0 0 5px;
    font-size: 1.25rem;
    color: #274969;
}

.experience-company p {
    margin: 0;
    color: #69819b;
}

.experience-date {
    font-size: 0.9rem;
    color: #466991;
    font-weight: 600;
    white-space: nowrap;
}

/*Timeline*/

.timeline-items {
    position: relative;
    margin-left: 15px;
    padding-left: 34px;
    border-left: 2px solid #c1d2e2;
}

/*Each project*/

.timeline-item {
    position: relative;
    margin-bottom: 28px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/*Timeline circles*/

.timeline-marker {
    position: absolute;
    left: -43px;
    top: 27px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6589ae;
    border: 4px solid #f7fafd;
    box-shadow: 0 0 0 2px #91aec8;
}

/*Project cards*/

.timeline-card {
    background: #ffffff;
    border: 1px solid #dbe5ee;
    border-radius: 15px;
    padding: 26px 30px;
    box-shadow: 0 3px 14px rgba(38, 68, 100, 0.045);
    transition: transform 0.2s ease,

      box-shadow 0.2s ease;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(38, 68, 100, 0.09);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.timeline-card h3 {
    margin: 0;
    font-size: 1.17rem;
    color: #274969;
}

.timeline-card .project-meta {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #7692ad;
}

.timeline-card ul {
    padding-left: 21px;
    margin: 0 0 20px;
}

.timeline-card li {
    margin-bottom: 11px;
    line-height: 1.7;
    color: #40566e;
}

.timeline-card li:last-child {
    margin-bottom: 0;
}

.timeline-card .tags {
    margin-top: 18px;
}

.timeline-card .project-link {
    display: inline-block;
    margin-top: 20px;
}

/*Ongoing status*/

.timeline-status {
    padding: 5px 12px;
    border-radius: 20px;
    background: #e7f0f8;
    color: #456c92;
    font-size: 0.76rem;
    font-weight: 600;
}

/*Mobile*/

@media (max-width: 700px) {
    .experience-company {
        padding: 18px;
    }

    .timeline-items {
        margin-left: 9px;
        padding-left: 24px;
    }

    .timeline-marker {
        left: -33px;
        width: 14px;
        height: 14px;
    }

    .timeline-card {
        padding: 20px;
    }

}

/*Contact section*/

.contact-links {
    display: grid;
    grid-template-columns: repeat(

        auto-fit,

        minmax(min(100%, 220px), 1fr)

    );
    gap: 14px;
    margin: 24px 0;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    background: #f7fafd;
    border: 1px solid #dce6ef;
    border-radius: 12px;
    transition: border-color 0.2s ease,

        transform 0.2s ease,

        box-shadow 0.2s ease;
}

.contact-link:hover {
    transform: translateY(-2px);
    border-color: #9bb6cd;
    box-shadow: 0 5px 16px rgba(34, 67, 99, 0.07);
}

.contact-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #e9f1f8;
    color: #42698e;
    font-size: 17px;
    font-weight: 700;
}

.contact-detail {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.contact-detail strong {
    font-size: 0.88rem;
    color: #2e4c6a;
}

.contact-detail > span {
    font-size: 0.82rem;
    color: #647d94;
    overflow-wrap: anywhere;
}

.contact-arrow {
    color: #7793ac;
    flex-shrink: 0;
}

.contact-link:focus-visible {
    outline: 2px solid #42698e;
    outline-offset: 3px;
}

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

}

.experience-next {
    margin-top: 42px;
}

/* Completed internship label */
.timeline-completed {
    background: #f0f3f6;
    color: #637588;
}

/* Research internship description */
.timeline-card > p {
    color: #40566e;
    line-height: 1.75;
    margin-bottom: 18px;
}

/* Keep timeline groups comfortable on mobile */
@media (max-width: 700px) {
    .experience-next {
        margin-top: 30px;
    }
}


/* Mobile: Show portrait before introduction */
@media (max-width: 670px) {
    .intro {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .intro .portrait-card {
        order: -1;
        width: 100%;
        max-width: 280px;
        align-self: center;
    }

    .intro .portrait-card img {
        display: block;
        width: 100%;
        height: 280px;
        object-fit: cover;
        object-position: center 20%;
    }

    .intro .intro-copy {
        order: 1;
        width: 100%;
    }
}