:root {
  color-scheme: light;
  --background: #fff;
  --text: #494e52;
  --muted: #646b70;
  --link: #26758a;
  --border: #eceeef;
  --footer: #f5f6f6;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #202328;
  --text: #e1e4e7;
  --muted: #b3bac2;
  --link: #83cadb;
  --border: #3a4048;
  --footer: #191c20;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
button { font: inherit; }
svg { display: block; width: 18px; height: 18px; flex-shrink: 0; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--background);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 52px;
  width: 100%;
  max-width: 1280px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 18px;
}
.masthead a { color: var(--text); text-decoration: none; }
.site-name { flex-shrink: 0; font-weight: 700; }
.masthead nav { display: flex; align-items: center; }
.nav-link { position: relative; display: inline-block; padding: 18px 0; }
.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 11px;
  left: 0;
  height: 2px;
  background: var(--link);
  content: "";
  opacity: 0;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { opacity: 1; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -24px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--footer); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.site-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 790px);
  align-content: start;
  gap: 44px;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 18px 76px;
}
.profile { position: sticky; top: 100px; align-self: start; }
.portrait {
  display: block;
  width: 175px;
  height: 175px;
  margin-bottom: 12px;
  padding: 5px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 50%;
}
.profile-name { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.profile-bio { margin: 0; font-size: 14px; line-height: 1.5; }
.profile-bio + .profile-bio { margin-top: 8px; }
.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
}
.profile-links a { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.profile-links a:hover { text-decoration: underline; }
.profile-links svg { width: 15px; height: 15px; }

main { min-width: 0; overflow-wrap: break-word; }
h1 { margin: -4px 0 12px; font-size: 28px; line-height: 1.3; }
main p { margin: 0 0 24px; }
h2 { margin: 26px 0 12px; font-size: 28px; line-height: 1.3; }
strong { font-weight: 650; }
.research-interests { margin-bottom: 0; }
.recent-news { margin-top: 32px; }
.recent-news h2 { margin-top: 0; }
.news-list { margin: 0; padding: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.news-list li:last-child { margin-bottom: 0; }
.news-date { padding-top: 3px; color: var(--muted); font-size: 14px; }
.news-list p { margin: 0; }
.publications-intro { margin-bottom: 28px; }
.publication-group + .publication-group { margin-top: 36px; }
.publication-group h2 { margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 22px; }
.publications { margin: 0; padding-left: 22px; }
.publication { margin: 0 0 26px; padding-left: 3px; }
.publication:last-child { margin-bottom: 0; }
.publication h3 { display: inline; margin: 0; font-size: 18px; font-weight: 600; line-height: 1.5; }
.publication .authors { margin: 5px 0 2px; font-size: 16px; line-height: 1.5; }
.publication .venue { margin: 0; color: var(--muted); font-size: 16px; }
.publication .paper-links { margin: 5px 0 0; font-size: 15px; }
.paper-links span { margin: 0 7px; color: var(--muted); }

.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--footer); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 24px 18px 28px; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0; }
.footer-inner p + p { margin-top: 4px; }

@media (max-width: 1000px) {
  .site-main { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding-right: 24px; padding-left: 24px; }
  .masthead-inner, .footer-inner { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .masthead-inner { gap: 28px; min-height: 62px; padding: 0 20px; font-size: 16px; }
  .theme-toggle { margin-left: auto; width: 36px; height: 36px; }
  .site-main { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 28px 20px 48px; }
  .profile { position: static; display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 18px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .portrait { width: 92px; height: 92px; margin: 0; padding: 3px; }
  .profile-name { margin-bottom: 6px; }
  .profile-bio { font-size: 13px; }
  .profile-bio + .profile-bio { margin-top: 4px; }
  .profile-links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 12px 20px; margin-top: 20px; font-size: 13px; }
  .profile-links a { gap: 6px; }
  h1, h2 { font-size: 26px; }
  .news-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .news-date { padding-top: 0; font-size: 13px; }
  .publication-group h2 { font-size: 21px; }
  .publication h3 { font-size: 17px; }
  .publication .authors, .publication .venue { font-size: 15px; }
  .footer-inner { padding: 22px 20px; }
}

@media (max-width: 360px) {
  .masthead-inner { gap: 20px; padding: 0 16px; font-size: 15px; }
  .theme-toggle { width: 30px; height: 30px; }
  .site-main { padding-right: 16px; padding-left: 16px; }
}

@media print {
  :root { color-scheme: light; --background: #fff; --text: #000; --muted: #444; --link: #000; --border: #ccc; }
  .masthead, .site-footer, .skip-link { display: none; }
  .site-main { display: block; padding: 0; }
  .profile { position: static; margin-bottom: 24px; }
  .portrait { float: left; width: 90px; height: 90px; margin: 0 20px 15px 0; }
  .profile-links { flex-direction: row; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
  main { clear: both; }
  .publication { break-inside: avoid; }
  h2 { break-after: avoid; }
}
