:root {
  --ink: #1a241c;
  --muted: #3e4a43;
  --faint: #3e4a43;
  --line: #e3efe4;
  --accent: #0b5328;
  --accent-dark: #083d1c;
  --wash: #e7f6eb;
  --award: #9b2c4a;
  --tag: #1a5560;
  --tag-bg: #e7f3f3;
  --bg: #fffcf6;
  --max: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #fff;
  padding: 8px 12px;
  z-index: 30;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 252, 246, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand,
h1.brand {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand,
h1.brand a {
  color: var(--accent);
  text-decoration: none;
}

.brand:hover,
h1.brand a:hover { color: var(--accent-dark); }

nav { display: flex; gap: 28px; }

nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] { color: var(--accent); }

main { padding: 28px 0 8px; }

.intro { padding-top: 4px; }

.portrait {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: 46% 22%;
  border-radius: 18px;
  background: #e7f6ea;
  box-shadow: 0 12px 28px rgba(18, 138, 62, 0.16);
}

.greeting {
  margin: 0 0 14px;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.45;
}

.intro p { margin: 0 0 12px; }

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 14px 0 0;
}

.contact a {
  font-weight: 600;
  text-decoration: none;
}

.contact a:hover { text-decoration: underline; }

.section { margin-top: 56px; }

.section h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.home {
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-areas:
    "side intro"
    "side pubs";
  column-gap: 48px;
  align-items: start;
}

.side {
  grid-area: side;
  position: sticky;
  top: 84px;
}

.side h2 {
  margin: 18px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.home .intro { grid-area: intro; padding-top: 0; }

#publications { grid-area: pubs; }

.theme h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section > .lede,
.theme .blurb {
  margin: 6px 0 0;
  color: var(--muted);
}

.news {
  margin-top: 8px;
  min-height: 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 8px;
}

.news::-webkit-scrollbar { width: 8px; }
.news::-webkit-scrollbar-thumb { background: #b7d4be; border-radius: 99px; }

.news-item {
  display: block;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.news-item time {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.92rem;
}

.news-item .text p { margin: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 6px;
}

.filters button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfe8d4;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

.filters button:hover { border-color: var(--accent); color: var(--accent); }

.filters button.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filters .count {
  margin-left: 4px;
  font-weight: 600;
  opacity: 0.72;
}

.note {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 0.92rem;
}

.theme { margin-top: 32px; }

.paper {
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
}

.theme .paper:first-of-type { margin-top: 12px; }

.paper h4 {
  margin: 0 0 4px;
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.paper h4 a {
  color: inherit;
  text-decoration: none;
}

.paper h4 a:hover { color: var(--accent); }

.authors {
  margin: 0;
  color: #3c3c3c;
}

.authors strong { color: var(--ink); font-weight: 700; }

.dagger {
  font-size: 0.65em;
  line-height: 0;
  position: relative;
  top: -0.35em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.9em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.meta a { text-decoration: none; }

.award { color: var(--award); font-weight: 600; }

.meta .mark {
  margin-right: 0.2em;
  font-size: 0.92em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.tags:not(:has(li)) { display: none; }

.tags li {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--tag);
  background: var(--tag-bg);
  border: 1px solid #c5dedd;
  border-radius: 999px;
  padding: 2px 8px;
}

.cv-head { padding-top: 18px; }

.cv-head h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
}

.cv-contact a { font-weight: 600; text-decoration: none; }
.cv-contact a:hover { text-decoration: underline; }

.updated {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 0.95rem;
}

.page-cv h2 {
  margin: 2.3rem 0 0.4rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-cv h3 {
  margin: 1.3rem 0 0.2rem;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.page-cv .about p { margin: 0.7rem 0 0; }

.cv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 28px;
  padding: 13px 0;
}

.cv-item h3 { margin: 0; font-size: 1.08rem; }

.cv-item p,
.cv-item ul { margin: 2px 0 0; }

.cv-item ul { padding-left: 1.1rem; }

.cv-item li + li { margin-top: 2px; }

.when {
  text-align: right;
  color: var(--muted);
  font-size: 0.98rem;
}

.when span { display: block; white-space: nowrap; }

.cv-list { padding: 0 0 0 1.25rem; margin: 8px 0 0; }

.cv-list li { padding: 8px 0; }

.cv-list li p { margin: 0; }

.cv-pub .ptitle { font-weight: 600; }

.footnote {
  margin-top: 18px;
  color: var(--faint);
  font-size: 0.92rem;
}

#publications,
#news,
.theme,
.page-cv h2 {
  scroll-margin-top: 88px;
}

@media (max-width: 860px) {
  .home {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "intro"
      "pubs";
    row-gap: 28px;
  }

  .side { position: static; }

  .portrait { width: 220px; height: 250px; }

  .news { max-height: 280px; flex: none; }
}

@media (max-width: 740px) {
  .portrait { width: 200px; height: 230px; }
  .brand,
  h1.brand { font-size: 1.25rem; }
  .bar { gap: 10px; }
  nav { gap: 14px; flex-shrink: 0; }
  nav a { font-size: 0.95rem; }
  .greeting { font-size: 1.08rem; }
  .home { width: min(1120px, calc(100% - 32px)); }
  .cv-item { grid-template-columns: 1fr; }
  .when { text-align: left; }
  .when span { white-space: normal; }
  .cv-head h1 { font-size: 2rem; }
}

.news-page {
  width: min(760px, calc(100% - 40px));
  margin: 8px auto 48px;
}

.news-page h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 20px 4.8rem minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
}

.rail {
  position: relative;
  align-self: stretch;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #d5e6da;
}

.timeline-item:first-child .rail::before { top: 50%; }
.timeline-item:last-child .rail::before { bottom: 50%; }

.node {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  z-index: 1;
  flex: none;
}

.timeline-item.is-latest .node {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px #d7efe0;
}

.timeline-item time {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.timeline-item .card {
  margin: 7px 0;
  background: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: 0 1px 2px rgba(26, 36, 28, 0.04), 0 8px 20px rgba(11, 83, 40, 0.06);
}

.timeline-item .card p { margin: 0; }

@media (max-width: 740px) {
  .timeline-item {
    grid-template-columns: 20px 4.4rem minmax(0, 1fr);
    column-gap: 10px;
  }

  .timeline-item .card { padding: 12px 13px; }
}

@media print {
  .topbar, .skip, .filters, .contact { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: none; }
  .wrap { width: 100%; }
  .page-cv h2 { break-after: avoid; }
  .cv-item, .cv-list li { break-inside: avoid; }
}
