:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --accent: #8b2d2d;
  --border: #e6e2dc;
  --max-width: 920px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151a;
    --text: #e8e6e1;
    --muted: #a5a29c;
    --accent: #e0a672;
    --border: #2c2a30;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { max-width: 100%; overflow-x: hidden; }
body.lightbox-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.6;
  font-size: 19px;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: currentColor; }

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav a { color: var(--text); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 24px;
}

section { margin-bottom: 56px; }
section h2 {
  font-family: var(--sans);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.hero {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-text { min-width: 0; }

.portrait {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.hero-text h1 {
  margin: 0 0 4px;
  font-size: 38px;
}

.title {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text);
  font-size: 19px;
}

.affiliation {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
}

.icon-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.icon-links a {
  display: flex;
  color: var(--muted);
  border-bottom: none;
}
.icon-links a:hover { color: var(--accent); }
.icon-links svg {
  width: 24px;
  height: 24px;
}

.bio p { margin: 0 0 14px; }
.interests { color: var(--muted); font-size: 17px; }

.pub {
  display: flex;
  gap: 28px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }

.pub-thumb-button {
  appearance: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: zoom-in;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
}

.pub-thumb {
  display: block;
  width: 280px;
  height: 165px;
  object-fit: fill;
  background: color-mix(in srgb, var(--border) 32%, var(--bg));
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pub-thumb-button:hover .pub-thumb,
.pub-thumb-button:focus-visible .pub-thumb {
  border-color: var(--accent);
}

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

.pub-body { min-width: 0; }

.pub h3 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.pub .authors {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--muted);
}

.pub .authors strong {
  color: var(--accent);
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 3px;
  padding: 0 3px;
}

.pub .venue {
  margin: 0 0 6px;
  font-size: 16px;
  font-style: italic;
  color: var(--muted);
}

.pub-links {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-links a {
  border-bottom: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}

.pub-links a:hover {
  border-color: currentColor;
}

.pub-links .project-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list li {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.news-list li:last-child { border-bottom: none; }

.year {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  width: 78px;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 48px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgb(0 0 0 / .82);
}

.image-lightbox[hidden] {
  display: none;
}

.lightbox-image {
  display: block;
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 20px 80px rgb(0 0 0 / .45);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: 50%;
  background: rgb(0 0 0 / .35);
  color: #ffffff;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 28px;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: #ffffff;
  background: rgb(0 0 0 / .6);
}

@media (max-width: 560px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .portrait { width: 120px; height: 120px; }
  .hero-text h1 { font-size: 30px; }

  .pub { flex-direction: column; }
  .pub-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .pub-thumb-button { width: 100%; }
  .image-lightbox { padding: 16px; }
  .lightbox-image { max-width: 96vw; max-height: 82vh; }
}
