@font-face {
    font-family: "Inter";
    src: url("/fonts/inter-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}
:root {
    color-scheme: light;
    --bg: #faf9f6;
    --text: #2c302c;
    --muted: #74766f;
    --border: #e6e5de;
    --accent: #657557;
    --surface: #f0f1ea;
    --surface-border: #e7e9df;
    --selection: #e2e7d8;
    --underline: #c7ccc0;
    --detail-border: #d8dfcf;
    --book-icon: #7e886e;
    --chart-a: #58705f;
    --chart-b: #9a704c;
    --chart-c: #58758b;
    --chart-d: #936b7c;
}
:root[data-theme="dark"],
:root:not([data-theme]):has(.theme-toggle:checked) {
    color-scheme: dark;
    --bg: #151914;
    --text: #e6e9df;
    --muted: #a9b09e;
    --border: #2e3728;
    --accent: #b3c58e;
    --surface: #252d1e;
    --surface-border: #445237;
    --selection: #435233;
    --underline: #63724c;
    --detail-border: #657b49;
    --book-icon: #a0b67c;
    --chart-a: #a9c28e;
    --chart-b: #d0a06c;
    --chart-c: #87acc3;
    --chart-d: #c995ab;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
::selection {
    background: var(--selection);
}
a {
    color: inherit;
    text-decoration-color: var(--underline);
    text-underline-offset: 4px;
}
a:hover {
    color: var(--accent);
}
a:focus-visible, summary:focus-visible, .theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
    border-radius: 2px;
}
.site {
    width: min(100% - 48px, 608px);
    margin: 46px auto 48px;
}
.header {
    display: flex;
    align-items: baseline;
    gap: 24px;
    margin-bottom: 27px;
}
.wordmark {
    margin-right: auto;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.6px;
    text-decoration: none;
}
.header nav {
    display: flex;
    gap: 22px;
}
.header nav a, .header-email {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}
.header a:hover {
    color: var(--text);
}
.header nav a[aria-current="page"] {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--underline);
    text-underline-offset: 6px;
}
.header-email span {
    font-size: 11px;
}
.theme-toggle {
    appearance: none;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    align-self: center;
    border: 1px solid var(--muted);
    border-radius: 50%;
    background: linear-gradient(90deg, var(--muted) 50%, transparent 50%);
    background-clip: content-box;
    padding: 4px;
    cursor: pointer;
}
.theme-toggle:hover {
    border-color: var(--accent);
}
.arrow {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.painting {
    margin: 0 0 33px;
    overflow: hidden;
    border-radius: 3px;
    background: #e6e4db;
}
.painting img {
    display: block;
    width: 100%;
    height: 184px;
    object-fit: cover;
    object-position: 50% 48%;
}
h1, h2, h3, p {
    margin: 0;
}
.introduction h1 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.7px;
    line-height: 1.35;
}
.introduction .byline {
    margin: 5px 0 21px;
    color: var(--muted);
    font-size: 13px;
}
.introduction p + p {
    margin-top: 12px;
}
.chapter {
    margin-top: 38px;
}
.chapter-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}
.chapter h2, .invitation h2 {
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.1px;
}
.aside {
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
}
.career {
    border-top: 1px solid var(--border);
}
.career details {
    border-bottom: 1px solid var(--border);
}
.career summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 75px 12px;
    column-gap: 15px;
    padding: 13px 0;
    cursor: pointer;
    list-style: none;
}
.career summary::-webkit-details-marker {
    display: none;
}
.career-name {
    font-weight: 500;
    font-size: 13px;
}
.former {
    color: var(--muted);
    font-weight: 400;
}
.career-subtitle {
    grid-column: 1;
    color: var(--muted);
    font-size: 12px;
}
.career-period {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    text-align: right;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.expand {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    color: #979b90;
    font-size: 16px;
    transition: transform 150ms ease;
}
details[open] .expand {
    transform: rotate(45deg);
}
summary:hover .career-name, summary:hover .expand {
    color: var(--accent);
}
.career-detail {
    margin: 0 0 19px;
    padding: 0 20px 0 14px;
    border-left: 2px solid var(--detail-border);
    font-size: 13px;
}
.career-detail .detail-label {
    font-size: 11px;
    color: var(--muted);
    margin: 12px 0 5px;
}
.footnote {
    margin-top: 10px;
    font-size: 11px;
    color: var(--muted);
}
.note-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.note-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    text-decoration: none;
    font-size: 13px;
}
.note-status {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--muted);
}
.home-research .note-list {
    gap: 0;
    border-top: 1px solid var(--border);
}
.home-research .note-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.note-title {
    display: block;
    font-weight: 500;
}
.note-description {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}
.code-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.code-list a {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 12px;
    gap: 15px;
    text-decoration: none;
    font-size: 12px;
}
.code-list code {
    font-family: "SFMono-Regular", Consolas, monospace;
    color: var(--text);
    font-size: 11px;
}
.code-list a > span {
    color: var(--muted);
}
.code-list a:hover code, .code-list a:hover > span {
    color: var(--accent);
}
.personal > p {
    color: var(--muted);
    font-size: 13px;
}
.reading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    margin-top: 15px;
    text-decoration: none;
    font-size: 13px;
}
.book-symbol {
    font-size: 25px;
    color: var(--book-icon);
}
.reading-label {
    display: block;
    color: var(--muted);
    font-size: 10px;
}
.reading em {
    font-family: Georgia, serif;
    font-size: 15px;
}
.book-author {
    color: var(--muted);
    font-size: 12px;
}
.reading-arrow {
    margin-left: auto;
    color: var(--accent);
}
.invitation {
    margin-top: 37px;
}
.invitation p {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}
.invitation p a {
    color: var(--text);
}
footer {
    margin-top: 35px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 11px;
}
footer div {
    display: flex;
    gap: 20px;
}
footer a {
    text-decoration: none;
}

/* Inner pages share the homepage's section rhythm. */
.page-head {
    padding: 28px 0 4px;
}
.page-head h1 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.7px;
    margin-bottom: 12px;
}
.page-head > p {
    color: var(--muted);
    font-size: 13px;
}
.paper {
    padding: 17px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.paper h3, .book h3, .project-list h3 {
    font-size: 14px;
    font-weight: 500;
}
.paper + .paper {
    border-top: 0;
}
.paper h3 a {
    text-decoration: none;
}
.paper p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}
.paper .item-meta {
    margin: 0 0 7px;
    font-size: 11px;
}
.paper .paper-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 20px;
    margin-top: 13px;
    font-size: 12px;
}
.paper-actions a {
    white-space: nowrap;
}
.paper-actions .paper-action-primary {
    color: var(--text);
}
.book-list, .project-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border);
}
.book, .project-list a {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    text-decoration: none;
}
.book p, .project-list p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.book > .aside, .project-list .arrow {
    flex-shrink: 0;
    color: var(--muted);
}
.book-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 19px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 4px;
}
.book-feature h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    font-style: italic;
    font-weight: 400;
}
.book-feature p {
    color: var(--muted);
    font-size: 12px;
}

/* Research notes */
.article-site {
    width: min(100% - 48px, 608px);
}
.article-head {
    margin: 42px 0 38px;
}
.back-link {
    color: var(--muted);
    font-size: 11px;
    text-decoration: none;
}
.article-head h1 {
    max-width: 620px;
    margin-top: 20px;
    font-size: 31px;
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -1px;
}
.article-deck {
    max-width: 590px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}
.article-meta {
    margin-top: 18px;
    color: var(--muted);
    font-size: 11px;
}
.article-meta .primary-paper-link {
    color: var(--text);
    font-size: 13px;
}
.research-note > p,
.research-note > section {
    max-width: 640px;
}
.research-note > .lead {
    font-size: 15px;
    line-height: 1.7;
}
.research-note > section {
    margin-top: 42px;
}
.research-note > section h2 {
    margin-bottom: 13px;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.25px;
}
.research-note > section p + p,
.research-note > section p + .equation,
.research-note > section .equation + p,
.research-note > section .table-wrap + p,
.research-note > section figure + p {
    margin-top: 14px;
}
.research-note math {
    font-family: "STIX Two Math", "Times New Roman", serif;
}
.equation {
    max-width: 100%;
    margin: 15px 0;
    padding: 12px 18px;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 3px;
}
.equation math {
    font-size: 18px;
}
.equation-result {
    border-color: var(--detail-border);
}
.table-wrap {
    margin: 20px 0;
    overflow-x: auto;
}
.research-note table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.research-note th,
.research-note td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}
.research-note th {
    color: var(--muted);
    font-weight: 400;
}
.research-note th:first-child,
.research-note td:first-child {
    padding-left: 0;
    text-align: left;
}
.chart-figure {
    margin: 24px 0 18px;
}
.research-chart {
    display: block;
    width: 100%;
    height: auto;
    color: var(--muted);
    overflow: hidden;
}
.research-chart text {
    fill: var(--muted);
    font-family: "Inter", sans-serif;
    font-size: 10px;
}
.research-chart .chart-axis {
    font-size: 9px;
}
.research-chart .chart-label {
    font-size: 10px;
}
.chart-grid {
    stroke: var(--border);
    stroke-width: 1;
}
.chart-tick,
.chart-axis-line {
    stroke: var(--muted);
    stroke-width: 0.75;
}
.chart-origin {
    stroke: var(--muted);
    stroke-width: 0.75;
    stroke-dasharray: 3 4;
}
.chart-line {
    fill: none;
    stroke-width: 1.8;
    vector-effect: non-scaling-stroke;
}
.series-a { stroke: var(--chart-a); }
.series-b { stroke: var(--chart-b); }
.series-c { stroke: var(--chart-c); }
.series-d { stroke: var(--chart-d); }
.chart-figure figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}
.article-footer {
    max-width: 608px;
    margin-top: 44px;
    padding: 0;
    border-top: 0;
    font-size: 12px;
}
.article-footer p {
    color: var(--muted);
}
@media (max-width: 480px) {
    .site {
        width: calc(100% - 40px);
        margin-top: 25px;
    }
    .header {
        gap: 10px;
    }
    .header nav {
        gap: 12px;
    }
    .header nav a, .header-email {
        font-size: 11px;
    }
    .painting img {
        height: 152px;
    }
    .introduction .byline {
        max-width: 280px;
    }
    .chapter {
        margin-top: 32px;
    }
    .career summary {
        grid-template-columns: minmax(0, 1fr) 75px 10px;
        column-gap: 9px;
    }
    .career-subtitle {
        font-size: 11px;
    }
    .note-row {
        flex-wrap: wrap;
        gap: 1px 12px;
    }
    .code-list a {
        grid-template-columns: 76px minmax(0, 1fr) 10px;
        gap: 9px;
    }
    .book {
        flex-direction: column;
        gap: 4px;
    }
    .book-author {
        display: block;
    }
    .article-site {
        width: calc(100% - 40px);
    }
    .article-head {
        margin-top: 30px;
    }
    .article-head h1 {
        font-size: 27px;
    }
    .article-deck,
    .research-note > .lead {
        font-size: 14px;
    }
    .equation {
        margin-right: -4px;
        margin-left: -4px;
        padding: 10px 12px;
    }
    .equation math {
        font-size: 16px;
    }
    footer {
        font-size: 10px;
        gap: 12px;
    }
    footer div {
        gap: 14px;
    }
}
@media (prefers-reduced-motion: no-preference) {
    a, .career-name {
        transition: color 150ms ease, text-decoration-color 150ms ease;
    }
}

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