:root {
    --page-bg: #e6ebf4;
    --surface: #ffffff;
    --text: #12141a;
    --text-muted: #5c6470;
    --link: #2c56d8;
    --link-hover: #1d3fb4;
    --accent: #2c56d8;
    --peach: #f3b48a;
    --sky: #7eb8d8;
    --border: #e3e8f0;
    --selection: #d7e3ff;
    --chip: #ffffff;
    --nav-active: #dde6ff;
    --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --measure: 44rem;
    --rail: 18.5rem;
    --radius: 1rem;
    --shadow: 0 1px 2px rgba(18, 20, 26, 0.04), 0 10px 28px rgba(18, 20, 26, 0.05);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(44rem 30rem at 10% -12%, rgba(255, 255, 255, 0.92), transparent 58%),
        radial-gradient(36rem 26rem at 92% 4%, rgba(44, 86, 216, 0.1), transparent 62%),
        radial-gradient(42rem 32rem at 78% 108%, rgba(92, 140, 196, 0.09), transparent 58%),
        radial-gradient(28rem 20rem at 6% 72%, rgba(180, 198, 230, 0.18), transparent 70%),
        var(--page-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
}

.shape-orb {
    width: 30rem;
    height: 30rem;
    right: -9rem;
    top: -11rem;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(44, 86, 216, 0.22), transparent 68%);
}

.shape-glow {
    width: 24rem;
    height: 24rem;
    left: -8rem;
    bottom: 8%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(243, 180, 138, 0.28), transparent 70%);
}

.shape-disc {
    width: 13rem;
    height: 13rem;
    right: 10%;
    bottom: -3.5rem;
    border-radius: 50%;
    background: rgba(126, 184, 216, 0.22);
}

.shape-bar {
    width: 16rem;
    height: 16rem;
    left: 42%;
    top: 38%;
    border-radius: 2.4rem;
    background: rgba(44, 86, 216, 0.07);
    transform: rotate(18deg);
}

.shape-ring {
    width: 18rem;
    height: 18rem;
    left: -3.5rem;
    top: 16%;
    border-radius: 50%;
    border: 1.5px solid rgba(44, 86, 216, 0.16);
}

.page {
    position: relative;
    z-index: 1;
    width: min(72rem, calc(100% - 2.5rem));
    margin: 0 auto;
    padding: 2.25rem 0 3.25rem;
}

.site-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.site-photo {
    display: block;
    width: 17.25rem;
    height: 17.25rem;
    margin: 0 0 1.35rem;
    object-fit: cover;
    object-position: center 12%;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow:
        0 0 0 1px var(--border),
        0 16px 40px rgba(18, 20, 26, 0.1);
}

.site-title {
    margin: 0;
    font-size: 2.3rem;
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: var(--link);
    text-decoration: none;
}

.site-place {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1.15rem;
}

nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.78rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.15s ease, background 0.15s ease;
}

nav a[aria-current="page"] {
    background: var(--nav-active);
    color: var(--text);
}

nav a:hover {
    color: var(--link);
    text-decoration: none;
    background: rgba(44, 86, 216, 0.08);
}

h1,
h2,
h3 {
    line-height: 1.25;
    text-wrap: balance;
}

.markdown-content h2 {
    margin: 2.85rem 0 1.05rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3a4a72;
}

.markdown-content h2::after {
    content: "";
    display: block;
    width: 1.55rem;
    height: 2px;
    margin-top: 0.5rem;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.6;
}

.markdown-content h2:first-child {
    margin-top: 0.1rem;
}

.markdown-content h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 0.18em;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
    border-radius: 2px;
}

.markdown-content p {
    margin: 0 0 1.1rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content h2:first-child + p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #3a3f48;
    text-wrap: pretty;
}

.job,
.honors,
.pubs {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.job {
    --logo: 4.75rem;
    --logo-gap: 0.95rem;
    margin: 0 0 0.85rem;
    padding: 1.15rem 1.2rem 1.2rem;
}

.job:last-of-type {
    margin-bottom: 0;
}

.job-head {
    display: grid;
    grid-template-columns: var(--logo) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--logo-gap);
    margin-bottom: 0.55rem;
}

.org-logo {
    display: block;
    width: var(--logo);
    height: var(--logo);
    padding: 0.22rem;
    object-fit: contain;
    background: var(--chip);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.job-id {
    min-width: 0;
}

.job-head h3 {
    font-size: 1.1rem;
    text-align: left;
}

.job-place {
    display: block;
    margin-top: 0.14rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    text-align: left;
}

.role-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 1rem;
    margin: 0 0 0.16rem;
    padding-left: calc(var(--logo) + var(--logo-gap));
    font-size: 0.84rem;
}

.role-line.has-team {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.role-line .role,
.role-line .team,
.role-line .when {
    font-size: 0.84rem;
}

.role-line .role {
    font-weight: 500;
    font-variant: small-caps;
    letter-spacing: 0.05em;
}

.role-line .team {
    color: var(--text-muted);
    min-width: 0;
}

.role-line .when {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    justify-self: end;
}

.points {
    margin: 0.7rem 0 0;
    padding-left: calc(var(--logo) + var(--logo-gap) + 1rem);
    font-size: 0.72rem;
    color: var(--text);
}

.points li {
    margin: 0 0 0.38rem;
    padding: 0;
    line-height: 1.55;
}

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

.honors {
    margin: 0;
    padding: 1.05rem 1.25rem 1.05rem 2.2rem;
    font-size: 0.72rem;
    color: var(--text);
}

.honors li {
    margin: 0 0 0.45rem;
    padding: 0;
    line-height: 1.55;
}

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

.pubs {
    list-style: none;
    margin: 0;
    padding: 0.25rem 1.2rem 0.35rem;
    counter-reset: pub;
    font-size: 0.84rem;
}

.pubs li {
    counter-increment: pub;
    position: relative;
    margin: 0;
    padding: 0.8rem 0 0.8rem 1.7rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.55;
}

.pubs li:last-child {
    border-bottom: 0;
}

.pubs li::before {
    content: counter(pub);
    position: absolute;
    left: 0;
    top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

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

.markdown-content a {
    overflow-wrap: break-word;
}

.markdown-content pre {
    background: rgba(44, 86, 216, 0.06);
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
}

.markdown-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92em;
}

.markdown-content > p:has(> strong),
.disclaimer {
    margin-top: 2.25rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

footer {
    margin-top: 2.25rem;
    padding-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

footer p {
    margin: 0;
}

::selection {
    background: var(--selection);
}

@media (min-width: 840px) {
    .page {
        display: grid;
        grid-template-columns: var(--rail) minmax(0, var(--measure));
        justify-content: center;
        column-gap: 4.25rem;
        padding: 4.5rem 0 5.5rem;
        align-items: start;
    }

    .site-header {
        position: sticky;
        top: 4.5rem;
        margin: 0;
        padding: 0;
        border: 0;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        margin-top: 1.45rem;
    }

    main {
        min-width: 0;
    }

    footer {
        grid-column: 2;
        margin-top: 2.5rem;
    }
}

@media (max-width: 839px) {
    .page {
        width: min(42rem, calc(100% - 1.75rem));
        padding: 1.5rem 0 2.5rem;
    }

    .site-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 1.35rem;
    }

    .site-photo {
        width: 11.25rem;
        height: 11.25rem;
        margin: 0 0 1rem;
    }

    .site-title {
        font-size: 1.9rem;
    }

    .site-place {
        margin-top: 0.25rem;
    }

    nav {
        margin-top: 0.85rem;
    }

    .job {
        --logo: 4.25rem;
        --logo-gap: 0.8rem;
        padding: 1rem 1.05rem 1.1rem;
    }

    .honors,
    .pubs {
        padding-left: 1.15rem;
        padding-right: 1.05rem;
    }

    .honors {
        padding-left: 1.9rem;
    }

    .role-line,
    .role-line.has-team {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.08rem;
    }

    .role-line .when {
        justify-self: start;
    }

    .shape-orb {
        width: 22rem;
        height: 22rem;
        right: -10rem;
        top: -9rem;
    }

    .shape-glow {
        width: 16rem;
        height: 16rem;
        left: -8rem;
        bottom: 18%;
    }

    .shape-disc {
        width: 9rem;
        height: 9rem;
        right: -2rem;
    }

    .shape-bar {
        width: 11rem;
        height: 11rem;
        left: 48%;
        top: 52%;
    }

    .shape-ring {
        width: 12rem;
        height: 12rem;
        top: 28%;
    }
}
