:root {
    --bg: #fdfcfa;
    --text: #1f1d1a;
    --muted: #6b665e;
    --rule: #e6e2da;
    --link: #2f5d8a;
    --award: #a4521f;
    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
    --bg: #151413;
    --text: #ebe7e0;
    --muted: #a39d93;
    --rule: #2e2b28;
    --link: #8db8e3;
    --award: #e59a66;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.page { position: relative; max-width: 760px; margin: 0 auto; padding: 72px 24px 48px; }
.page > .theme-toggle { position: absolute; top: 24px; right: 24px; }

/* Intro */
.intro { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 56px; }
.intro-text { flex: 1; min-width: 0; }
h1 { font-size: 44px; font-weight: 500; line-height: 1.1; margin: 0 0 4px; letter-spacing: -0.01em; }
.role { font-family: var(--sans); font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.bio { margin: 0 0 20px; }
.portrait { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex: none; }

.links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--sans); font-size: 14px; }
.links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.links a:hover { color: var(--link); text-decoration: none; }
.links svg { width: 16px; height: 16px; }

/* Sections */
section { margin-bottom: 48px; }
h2 {
    font-size: 24px; font-weight: 500; margin: 0 0 16px;
    padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 0 0 4px; }

/* News and list entries */
.news, .entries { list-style: none; margin: 0; padding: 0; }
.news li, .entries li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; margin-bottom: 10px; }
.date { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-top: 4px; }

/* Publications */
.pub { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; margin-bottom: 32px; align-items: start; }
.pub img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.pub p { margin: 0; }
.authors { font-size: 16px; }
.venue { font-style: italic; font-size: 16px; color: var(--muted); }
.award { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--award); margin-top: 4px !important; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.pills a {
    font-family: var(--sans); font-size: 12px; color: var(--text);
    border: 1px solid var(--rule); border-radius: 999px; padding: 2px 10px;
}
.pills a:hover { border-color: var(--link); color: var(--link); text-decoration: none; }

.more summary {
    font-family: var(--sans); font-size: 14px; color: var(--link);
    cursor: pointer; list-style: none; margin-bottom: 24px;
}
.more summary::-webkit-details-marker { display: none; }
.more summary .open, .more[open] summary .closed { display: none; }
.more[open] summary .open { display: inline; }

footer { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-top: 24px; border-top: 1px solid var(--rule); }

@media (max-width: 640px) {
    body { font-size: 17px; }
    .page { padding: 40px 16px 32px; }
    .page > .theme-toggle { top: 16px; right: 16px; }
    .intro { flex-direction: column-reverse; gap: 20px; margin-bottom: 40px; }
    .portrait { width: 120px; height: 120px; }
    h1 { font-size: 36px; }
    .pub { grid-template-columns: 1fr; gap: 12px; }
    .pub img { max-width: 360px; }
    .news li, .entries li { grid-template-columns: 1fr; gap: 0; }
    .date { padding-top: 0; }
}

a.plain, a.plain:hover { color: inherit; text-decoration: none; }
.news li.nodate, .entries li.nodate { grid-template-columns: minmax(0, 1fr); }

/* Theme toggle */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; border: 1px solid var(--rule); border-radius: 999px;
    background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.job-market {
    margin: 0 0 20px; padding: 10px 14px; border-radius: 8px;
    background: rgba(240, 196, 70, 0.18);
    font-family: var(--sans); font-size: 15px; line-height: 1.6;
}
[data-theme="dark"] .job-market { background: rgba(240, 196, 70, 0.12); }
