:root {
    --ink: #1d1d1f;
    --muted: #6b6b70;
    --rule: #e4e2dd;
    --link: #3f3f6d;
    --accent: #8c1515; /* Stanford cardinal, used only for award tags */
    --bg: #fdfcfa;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8e6e1;
        --muted: #9a988f;
        --rule: #33322f;
        --link: #a9a9e0;
        --accent: #e07a7a;
        --bg: #161615;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    /* Jason Wei's pairing: Adobe Garamond Pro for text, Orpheus Pro for display.
       Both are Adobe Fonts; EB Garamond and Cormorant Garamond are the free stand-ins. */
    font-family: 'adobe-garamond-pro', 'EB Garamond', Garamond, Georgia, serif;
    font-size: 18px;
    line-height: 1.4;
    font-variant-numeric: oldstyle-nums;
}

header nav a, h2 {
    font-family: 'orpheus-pro', 'Cormorant Garamond', 'EB Garamond', serif;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 2px; }

/* Header: name left, plain-word nav right */
header {
    max-width: 700px;
    margin: 0 auto;
    padding: 28px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 24px;
}

header .name {
    color: var(--ink);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

header nav a {
    color: var(--muted);
    margin-left: 18px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}
header nav a:first-child { margin-left: 0; }
header nav a:hover { color: var(--ink); }

main {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px 56px;
}

/* Intro: bio left, portrait right */
.intro {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 36px;
    align-items: start;
    margin-top: 40px;
}

.portrait {
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: 2px;
}

p { margin: 0 0 0.8em; }

.lede {
    font-size: 1.3rem;
    line-height: 1.35;
}

.links { margin-top: 1em; }

h2 {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    margin: 52px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
}

h3 {
    font-weight: 500;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--muted);
    margin: 24px 0 10px;
}

.note { color: var(--muted); font-size: 0.85em; margin-top: -4px; }

ul.work, ul.papers, ul.service {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.work li, ul.papers li { margin-bottom: 1.15em; }

ul.papers li { font-size: 0.95em; }

ul.service li {
    margin-bottom: 0.6em;
    padding-left: 1em;
    text-indent: -1em;
}
ul.service li::before { content: "– "; color: var(--muted); }

.ptitle { color: var(--ink); font-weight: 600; }
a.ptitle:hover { color: var(--link); text-decoration: none; }

.venue { font-style: italic; color: var(--muted); }

.award {
    font-style: normal;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-left: 4px;
}

.actions { font-size: 0.92em; }

b { font-weight: 600; }

/* Dated list for talks */
table.dated { border-collapse: collapse; }
table.dated td { padding: 3px 0; vertical-align: baseline; }
table.dated td.date {
    width: 92px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.88em;
    font-variant-numeric: tabular-nums;
}

footer {
    margin-top: 56px;
    color: var(--muted);
    font-size: 0.85em;
}

@media (max-width: 640px) {
    body { font-size: 18px; }
    header { padding-top: 20px; }
    header nav a { margin-left: 14px; }
    .intro {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 28px;
    }
    .portrait { order: -1; width: 140px; height: 140px; }
}
