:root {
  --background: #ffffff;
  --surface: #f7f7f7;
  --text: #222222;
  --muted: #666666;
  --faint: #929292;
  --border: #e5e5e5;
  --accent: #2698ba;
  --accent-dark: #18708b;
  --shadow: 0 2px 7px rgba(0, 0, 0, 0.14);
}

body.dark {
  --background: #1c1c1d;
  --surface: #29292b;
  --text: #e8e8e8;
  --muted: #b7b7b7;
  --faint: #929292;
  --border: #3c3c3e;
  --accent: #55b6d3;
  --accent-dark: #87cee3;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { margin: 0; color: var(--text); background: var(--background); font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; font-weight: 300; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.site-header { position: fixed; z-index: 10; top: 0; left: 0; right: 0; background: color-mix(in srgb, var(--background) 94%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.nav-wrap { width: min(calc(100% - 40px), 930px); min-height: 58px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.nav-name { color: var(--text); font-size: 16px; }
.nav-name:hover { color: var(--text); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links > a { color: var(--muted); font-size: 14px; }
.nav-links > a:hover, .nav-links > a.active { color: var(--accent); text-decoration: none; }
.theme-toggle { width: 28px; height: 28px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 16px; }
.theme-toggle:hover { color: var(--accent); background: var(--surface); }
.scroll-progress { height: 2px; background: transparent; }
.scroll-progress span { display: block; width: 0; height: 100%; background: var(--accent); }

.page { width: min(calc(100% - 40px), 930px); min-height: calc(100vh - 150px); margin: 0 auto; padding: 102px 0 60px; }
h1, h2, h3 { color: var(--text); font-family: "Roboto Slab", Georgia, serif; font-weight: 300; }
h1 { margin: 0 0 34px; font-size: 44px; line-height: 1.15; letter-spacing: -0.025em; }
h1 strong { font-weight: 600; }
h2 { margin: 54px 0 25px; font-size: 28px; line-height: 1.3; }
h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.45; font-weight: 500; }
p { margin: 0 0 15px; }
.about-section::after { content: ""; display: table; clear: both; }

.profile-card { float: right; width: 270px; margin: 0 0 25px 45px; }
.profile-photo { position: relative; aspect-ratio: 1 / 1.05; overflow: hidden; border-radius: 5px; background: linear-gradient(145deg, #dde9ed, #e8e6df); box-shadow: var(--shadow); }
.profile-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(30, 91, 108, 0.25); font-family: "Roboto Slab", serif; font-size: 72px; font-weight: 500; }
.profile-info { padding-top: 14px; font-size: 13px; line-height: 1.45; text-align: center; }
.profile-info p { margin: 0 0 3px; }
.intro-copy { max-width: 875px; }
.interest-list { margin: 4px 0 0; padding-left: 22px; }
.interest-list li { margin: 8px 0; padding-left: 2px; }

.content-section { clear: both; }
.news-list { width: 100%; }
.news-row { display: grid; grid-template-columns: 125px 1fr; gap: 22px; padding: 7px 0; }
.news-row time { color: var(--muted); font-size: 13px; font-weight: 400; }
.news-row p { margin: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin-bottom: 25px; }
.section-heading > a { font-size: 13px; }

.publication-list { margin: 0; padding: 0; list-style: none; }
.publication { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; margin-bottom: 34px; }
.paper-preview { position: relative; width: 150px; aspect-ratio: 4 / 3; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 16px; color: #fff; border-radius: 4px; box-shadow: var(--shadow); }
.paper-preview::after { content: ""; position: absolute; width: 90px; height: 90px; right: -34px; bottom: -42px; border: 16px solid rgba(255,255,255,.16); border-radius: 50%; }
.paper-preview span { position: relative; z-index: 1; font-family: "Roboto Slab", serif; font-size: 23px; font-weight: 600; letter-spacing: -0.03em; }
.paper-preview small { position: relative; z-index: 1; margin-top: 5px; font-size: 9px; line-height: 1.25; letter-spacing: .08em; text-transform: uppercase; }
.preview-mudd { background: linear-gradient(135deg, #1d687d, #55b8bd); }
.preview-dcmha { background: linear-gradient(135deg, #554c8b, #8b7bc0); }
.preview-gar { background: linear-gradient(135deg, #a05a42, #dc9b60); }
.preview-pcdc { background: linear-gradient(135deg, #47704f, #88ae71); }
.authors, .venue { margin-bottom: 5px; font-size: 13px; line-height: 1.55; }
.authors { color: var(--muted); }
.authors strong { color: var(--text); font-weight: 500; }
.venue { color: var(--muted); }
.paper-links { display: flex; gap: 7px; margin-top: 10px; }
.paper-links a { padding: 2px 9px; border: 1px solid var(--accent); border-radius: 3px; font-size: 10px; font-weight: 500; letter-spacing: .03em; }
.paper-links a:hover { color: #fff; background: var(--accent); text-decoration: none; }
.links-section { padding-bottom: 15px; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.social-links a { font-weight: 400; }
footer { border-top: 1px solid var(--border); color: var(--faint); background: var(--surface); }
footer > div { width: min(calc(100% - 40px), 930px); margin: 0 auto; padding: 19px 0; font-size: 12px; }

@media (max-width: 700px) {
  .nav-wrap { min-height: 54px; }
  .nav-name { display: none; }
  .nav-links { width: 100%; justify-content: flex-end; gap: 16px; }
  .nav-links > a:nth-child(2) { display: none; }
  .page { padding-top: 88px; }
  h1 { font-size: 38px; }
  .profile-card { float: none; width: min(100%, 330px); margin: 0 auto 30px; }
  .profile-info { text-align: left; }
  .news-row { grid-template-columns: 70px 1fr; gap: 12px; }
  .publication { grid-template-columns: 115px 1fr; gap: 18px; }
  .paper-preview { width: 115px; }
  .paper-preview span { font-size: 18px; }
}

@media (max-width: 480px) {
  .nav-links { justify-content: center; gap: 14px; }
  .nav-links > a { font-size: 13px; }
  .nav-links > a:nth-child(3) { display: none; }
  .page, .nav-wrap, footer > div { width: min(calc(100% - 30px), 930px); }
  .publication { grid-template-columns: 1fr; gap: 14px; }
  .paper-preview { width: 100%; max-width: 180px; aspect-ratio: 16 / 9; }
  .section-heading { display: block; }
  .section-heading > a { display: inline-block; margin: -14px 0 25px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
