/* Clean single-column style: system sans-serif, black on white, one calm blue for links.
   No framework and no web fonts. Always light: the page stays white even when the
   visitor's system is in dark mode. */

:root {
    --bg: #ffffff;
    --ink: #1d1d1f;
    --soft: #3a3a3c;
    --muted: #6e6e73;
    --rule: #e8e8ed;
    --line: #d2d2d7;
    --link: #0066cc;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 860px text column, the same width the site had before */
.wrap {
    max-width: calc(860px + 3rem);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

a:hover {
    text-decoration: underline;
    text-underline-offset: .2em;
}

/* ---------- header ---------- */

.site-head nav {
    display: flex;
    gap: 2.2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rule);
}

.site-head nav a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.site-head nav a:hover,
.site-head nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: none;
}

/* ---------- shared type ---------- */

main.wrap {
    padding-top: 3.6rem;
    padding-bottom: 5.5rem;
}

h1 {
    font-weight: 700;
    font-size: 2.7rem;
    line-height: 1.12;
    letter-spacing: -.025em;
    margin: 0;
}

.page-title {
    margin-bottom: 1.5rem;
}

/* Each section opens with a hairline, so long pages read as clear blocks */
h2 {
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1.25;
    letter-spacing: -.015em;
    margin: 3.6rem 0 1.6rem;
    padding-top: 2.6rem;
    border-top: 1px solid var(--rule);
    scroll-margin-top: 2.4rem;
}

h3 {
    font-weight: 600;
    font-size: 1.08rem;
    margin: 2.4rem 0 1.1rem;
}

h2 + h3 {
    margin-top: 0;
}

p {
    margin: 0 0 1.1rem;
}

.lede {
    font-size: 1.24rem;
    line-height: 1.65;
    letter-spacing: -.005em;
    margin: 0 0 1.2rem;
}

.note {
    font-size: .94rem;
    color: var(--muted);
    margin: 1.4rem 0 0;
}

/* Rounded outline links: profile links on the home page, section links on Publications */
.elsewhere,
.jump {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.elsewhere a,
.jump a {
    font-size: .9rem;
    line-height: 1.4;
    padding: .34rem .95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
}

.elsewhere a:hover,
.jump a:hover {
    border-color: var(--ink);
    text-decoration: none;
}

/* On Publications the section buttons stay at the top while scrolling */
.jump {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .9rem 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}

/* The bar's own hairline replaces the one above the first section */
.jump + section h2:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 2.6rem;
}

h2 + .elsewhere {
    margin-top: 0;
}

/* ---------- home ---------- */

.hero {
    display: flex;
    align-items: center;
    gap: 2.4rem;
    margin: 0 0 3rem;
}

.hero h1 {
    font-size: 3.1rem;
}

.portrait {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fields {
    font-size: 1.14rem;
    color: var(--muted);
    margin: .7rem 0 0;
}

.fields span {
    white-space: nowrap;
}

.fields i {
    font-style: normal;
    margin: 0 .5em;
}

.elsewhere {
    margin: 1.15rem 0 0;
}

/* Label on the left, text on the right, a hairline between rows */
.ledger {
    display: grid;
    grid-template-columns: 12.5rem 1fr;
    margin: 2.8rem 0 0;
    border-bottom: 1px solid var(--rule);
}

.ledger dt,
.ledger dd {
    margin: 0;
    padding: 1.35rem 0;
    border-top: 1px solid var(--rule);
}

.ledger dt {
    font-weight: 600;
    padding-right: 1.5rem;
}

.ledger dd {
    color: var(--soft);
}

/* ---------- publications ---------- */

.entries {
    list-style: none;
    padding: 0;
    margin: 0;
}

.entries li {
    padding-bottom: 1.6rem;
}

.entries li:last-child {
    padding-bottom: 0;
}

.entries .entry-title {
    font-weight: 600;
}

.entries .entry-meta {
    font-weight: 400;
    color: var(--muted);
}

.entries p {
    margin: .15rem 0 .3rem;
    color: var(--soft);
}

.entries .entry-links {
    font-size: .94rem;
    color: var(--muted);
}

/* Bibliography with a hanging indent */
.refs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.refs li {
    padding-left: 1.6em;
    text-indent: -1.6em;
    margin-bottom: .9rem;
    font-size: .97rem;
    line-height: 1.62;
    color: var(--soft);
}

.refs li strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- about ---------- */

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline li {
    display: grid;
    grid-template-columns: 12.5rem 1fr;
    margin-bottom: 1.8rem;
}

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

.timeline li > * {
    grid-column: 2;
}

.timeline .when {
    grid-column: 1;
    grid-row: 1 / span 3;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding-right: 1.5rem;
}

.timeline .role {
    font-weight: 600;
}

.timeline .org {
    color: var(--soft);
}

.timeline p {
    margin: .2rem 0 0;
    color: var(--soft);
}

/* The section hairline already tops a table that follows a heading */
h2 + .ledger {
    margin-top: 0;
    border-bottom: 0;
}

h2 + .ledger dt:first-of-type,
h2 + .ledger dd:first-of-type {
    border-top: 0;
    padding-top: 0;
}

h2 + .ledger dt:last-of-type,
h2 + .ledger dd:last-of-type {
    padding-bottom: 0;
}

/* Items wrap as whole units with a dot between neighbours; the list is shifted left so the
   dot of the first item on each line is clipped, leaving no stray dot at either end. */
.dots {
    overflow: hidden;
}

.dots ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0 -1.3em;
}

.dots li {
    display: inline-block;
    position: relative;
    max-width: 100%;
    padding-left: 1.3em;
}

.dots li::before {
    content: "\00b7";
    position: absolute;
    left: .5em;
    color: var(--muted);
}

/* ---------- footer ---------- */

.site-foot {
    font-size: .92rem;
    color: var(--muted);
}

.site-foot > * {
    padding-top: 1.6rem;
    padding-bottom: 3rem;
}

.site-foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    position: relative;
}

.site-foot::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    border-top: 1px solid var(--rule);
}

.site-foot nav {
    display: flex;
    gap: 1.6rem;
}

.site-foot a {
    color: var(--muted);
}

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

/* ---------- small screens ---------- */

@media (max-width: 680px) {
    html {
        font-size: 16px;
    }

    .wrap {
        padding: 0 1.25rem;
    }

    .site-head nav {
        gap: 1.5rem;
        padding: 1.1rem 0;
    }

    main.wrap {
        padding-top: 2.2rem;
        padding-bottom: 4rem;
    }

    h1,
    .hero h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.35rem;
        margin-top: 2.8rem;
        padding-top: 2rem;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2.2rem;
    }

    .portrait {
        width: 112px;
        height: 112px;
    }

    .fields {
        font-size: 1.02rem;
    }

    .lede {
        font-size: 1.12rem;
    }

    .ledger,
    .timeline li {
        grid-template-columns: 1fr;
    }

    .ledger dt {
        padding-bottom: .3rem;
    }

    .ledger dd {
        border-top: 0;
        padding-top: 0;
    }

    h2 + .ledger dd {
        padding-bottom: 1.2rem;
    }

    .timeline li > *,
    .timeline .when {
        grid-column: 1;
        grid-row: auto;
    }

    .site-foot::before {
        left: 1.25rem;
        right: 1.25rem;
    }
}
