/* Top navigation, one reading column, serif headings (Source Serif 4) with a sans (Inter) for body text and
   labels, and a deep teal accent. Every color is a token so the page reads in light and dark themes. */
:root {
  --bg: #fcfcfb; --surface: #f3f6f5; --fg: #1b1f22; --muted: #5d6968; --rule: #dfe5e3;
  --accent: #1f5f5a; --accent-ink: #ffffff; --accent-soft: #d7e7e4;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121616; --surface: #1a2020; --fg: #e8ebe9; --muted: #a3aeac; --rule: #2b3433;
    --accent: #8fd0c7; --accent-ink: #0f1514; --accent-soft: #223331; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121616; --surface: #1a2020; --fg: #e8ebe9; --muted: #a3aeac; --rule: #2b3433;
  --accent: #8fd0c7; --accent-ink: #0f1514; --accent-soft: #223331; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.6;
  padding-block: 0; padding-inline: 20px; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; margin: 0; }

/* Top bar */
.top { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap; padding-block: 18px 16px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--fg); text-decoration: none; }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: .86rem; }
.top nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--fg); }
.top nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.bar-rule { border: 0; border-top: 1px solid var(--accent-soft); margin: 0; }

/* Page frame */
.page { max-width: 1000px; margin: 0 auto; padding-block: 44px 56px; }
.reading { max-width: 760px; }
.kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 10px; }
h1.title { font-size: 2.3rem; line-height: 1.15; margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: .95rem; margin: 0 0 28px; }
.intro { font-size: 1rem; margin: 10px 0 30px; max-width: 64ch; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 48px; align-items: start; padding-bottom: 40px; }
.hero h1 { font-size: 2.6rem; line-height: 1.1; margin-bottom: 10px; }
.role { color: var(--muted); font-size: .92rem; line-height: 1.5; margin: 0 0 22px; }
.tagline { font-size: 1.5rem; line-height: 1.3; margin: 0 0 14px; max-width: 34ch; }
.lede { font-size: 1.02rem; margin: 0 0 12px; max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; margin-top: 24px; }
.btn { display: inline-block; font-size: .86rem; font-weight: 500; padding: 9px 14px; border-radius: 3px; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn.outline { background: transparent; color: var(--accent); }
.btn:hover { filter: brightness(1.08); }
.arrow { font-size: .88rem; text-decoration: none; }
.arrow:hover { text-decoration: underline; }
.portrait { display: grid; gap: 14px; }
.photo { width: 200px; height: 250px; object-fit: cover; border-radius: 3px; display: block; }
.initials { width: 200px; height: 250px; border-radius: 3px; background: var(--surface); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 44px; letter-spacing: .04em; }
.fields { font-size: .84rem; }
.fields .label { font-weight: 600; margin: 0 0 4px; }
.fields ul { list-style: none; margin: 0; padding: 0; color: var(--muted); display: grid; gap: 2px; }

/* Home page blocks: label on top, one column */
.block { max-width: 760px; padding-block: 36px; border-top: 1px solid var(--rule); }
.block .kicker { margin-bottom: 12px; }
.paper-title { font-size: 1.8rem; line-height: 1.2; margin: 0 0 12px; max-width: 32ch; }
.paper-title a { color: var(--fg); text-decoration: none; }
.paper-title a:hover { text-decoration: underline; }
.block .summary { margin: 0 0 14px; font-size: .98rem; max-width: 66ch; }
.block .links { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; }
/* Label-column sections (unused on the home page now, kept for other layouts) */
.section { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 32px; padding-block: 36px; border-top: 1px solid var(--rule); }
.section .label { font-size: .84rem; color: var(--muted); padding-top: 4px; }
.section h3 { font-size: 1.3rem; line-height: 1.3; margin-bottom: 8px; }
.section h3 a { color: var(--accent); text-decoration: none; }
.section h3 a:hover { text-decoration: underline; }
.section p { margin: 0 0 12px; font-size: .95rem; max-width: 64ch; }
.section .links { display: flex; flex-wrap: wrap; gap: 18px; }
.mini + .mini { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 20px; }
.mini .kicker { color: var(--muted); margin-bottom: 6px; font-weight: 500; letter-spacing: .08em; }
.mini h3 { font-size: 1.12rem; }
.titles p { margin: 0 0 10px; font-size: .95rem; max-width: 66ch; }
.titles p a { color: var(--accent); text-decoration: none; }
.titles p a:hover { text-decoration: underline; }
.titles .sub { color: var(--muted); font-size: .88rem; }
.titles .links { margin-top: 16px; }
.edu { display: grid; gap: 10px; }
.edu .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; font-size: .95rem; }
.edu .when { color: var(--muted); font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.edu .sub { color: var(--muted); font-size: .88rem; }

/* Research */
.jump { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; margin: 0 0 36px; }
.jump a { text-decoration: none; border-bottom: 1px solid var(--rule); color: var(--muted); padding-bottom: 2px; }
.jump a:hover { color: var(--accent); border-bottom-color: var(--accent); }
h2.section-head { font-family: var(--sans); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; margin: 44px 0 6px; }
h2.section-head:first-of-type { margin-top: 0; }
.entry { padding-block: 22px; border-bottom: 1px solid var(--rule); }
.entry h3 { font-size: 1.3rem; line-height: 1.3; margin-bottom: 6px; }
.entry h3 a { color: var(--accent); text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry .status { font-size: .78rem; color: var(--muted); margin: 0 0 8px; }
.entry .summary { margin: 0 0 12px; font-size: .95rem; max-width: 66ch; }
.entry .abstract-open { margin: 0 0 14px; font-size: .95rem; max-width: 66ch; }
.entry .links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: .88rem; }
details { max-width: 66ch; }
details summary { cursor: pointer; font-size: .88rem; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform .15s ease; }
details[open] summary::before { transform: rotate(90deg); }
details .abstract { margin: 12px 0 4px; font-size: .95rem; color: var(--fg); }
.pubs { display: grid; gap: 14px; margin: 0; padding: 18px 0 0; list-style: none; }
.pub { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; font-size: .92rem; }
.pub .year { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.pub .with { color: var(--muted); font-size: .88rem; display: block; margin-top: 2px; }

/* Teaching and experience */
.group { padding-block: 26px 10px; border-top: 1px solid var(--rule); }
.group h2 { font-size: 1.3rem; line-height: 1.3; margin-bottom: 2px; }
.group .org { color: var(--muted); font-size: .84rem; margin: 0 0 14px; }
.group p { font-size: .95rem; max-width: 66ch; margin: 0 0 14px; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: baseline; padding: 9px 0;
  border-bottom: 1px solid var(--rule); font-size: .9rem; }
.crow:last-of-type { border-bottom: 0; }
.crow .when { color: var(--muted); font-size: .84rem; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.crow .sub { grid-column: 1 / -1; color: var(--muted); font-size: .84rem; margin-top: -4px; }
.endnote { font-size: .9rem; color: var(--muted); margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); }

/* Contact and CV */
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; padding-block: 28px; border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); }
.contact .k { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.contact p { margin: 0 0 16px; font-size: .95rem; overflow-wrap: anywhere; }
.contact p:last-child { margin-bottom: 0; }

footer { max-width: 1000px; margin: 0 auto; padding-block: 20px 40px; border-top: 1px solid var(--accent-soft); display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 8px 24px; font-size: .78rem; color: var(--muted); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .page { padding-block: 28px 40px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: 2.1rem; }
  .tagline { font-size: 1.3rem; }
  .paper-title { font-size: 1.5rem; }
  .portrait { grid-template-columns: auto 1fr; align-items: end; gap: 18px; }
  .photo, .initials { width: 140px; height: 175px; font-size: 32px; }
  .section { grid-template-columns: 1fr; gap: 10px; padding-block: 28px; }
  .section .label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding-top: 0; }
  .contact { grid-template-columns: 1fr; }
  .edu .item { grid-template-columns: 1fr; gap: 0; }
  h1.title { font-size: 2rem; }
}
