:root {
  --bg: #fbfaf8;
  --text: #1c1b1a;
  --text-soft: #4a4643;
  --border: #e4e0da;
  --accent: #6e3b3b;
  --sidebar-w: 240px;
  --max-w: 760px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 0.15s ease, border-color 0.15s ease; }
}

a {
  color: var(--text);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 28px;
}

.topnav a {
  color: var(--text-soft);
  text-decoration: none;
}
.topnav a:hover { color: var(--accent); }

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.sidebar {
  text-align: center;
}

.portrait {
  border-radius: 50%;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-top: 20px;
  margin-bottom: 18px;
}

.sidebar h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.role {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.role-sub {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 15px;
}

.location {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

.sidebar .links {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.sidebar .links a {
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sidebar .links a:hover { border-bottom-color: var(--accent); }

.interests {
  margin-top: 28px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.interests h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 0 0 10px;
  font-weight: 600;
}

.interests ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  color: var(--text);
}
.interests li { padding: 3px 0; }

main { min-width: 0; }

main section { margin-bottom: 44px; }

main h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

main p { margin: 0 0 14px; max-width: 66ch; }

.pub-year-group { margin-bottom: 8px; }

.pub-year {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 4px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.pub-year-group:first-child .pub-year { margin-top: 0; }

.pub {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }

.pub-title {
  margin: 0 0 4px;
  font-weight: 600;
}

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

.pub-venue {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.pub-venue a { color: var(--accent); }

.exp { margin-bottom: 26px; }
.exp:last-child { margin-bottom: 0; }

.exp-head h3 {
  margin: 0 0 2px;
  font-size: 16.5px;
}

.exp-meta {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.exp ul {
  margin: 0;
  padding-left: 20px;
}
.exp li { margin-bottom: 6px; font-size: 15px; }

.exp > p { margin: 0; font-size: 15px; max-width: none; }

.edu {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.edu:last-child { border-bottom: none; }

.edu-logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 130px;
  height: 64px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.edu-logo {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.edu h3 { margin: 0 0 2px; font-size: 16px; }
.edu p { margin: 0; font-size: 14.5px; color: var(--text-soft); }

.awards-list {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
}
.awards-list li { margin-bottom: 6px; }

.minor-section {
  margin-bottom: 24px !important;
  padding-top: 12px;
}

.minor-section h2 {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  border-bottom: none;
  margin: 0 0 14px;
  padding-bottom: 0;
}

.minor-group {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  opacity: 0.75;
  margin: 18px 0 8px;
}
.minor-group:first-of-type { margin-top: 0; }

.minor-item { margin-bottom: 12px; }
.minor-item:last-child { margin-bottom: 0; }

.minor-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.minor-org {
  font-weight: 400;
  color: var(--text-soft);
}

.minor-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  max-width: 60ch;
}

.minor-meta { white-space: nowrap; }

.site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  font-size: 13px;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.site-footer a { color: var(--text-soft); }

@media (min-width: 800px) {
  .page {
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 56px;
    padding-top: 60px;
  }
  .sidebar {
    text-align: left;
    position: sticky;
    top: 40px;
    align-self: start;
  }
  .sidebar .links { align-items: flex-start; }
  main { max-width: var(--max-w); }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --text: #eae6e0;
    --text-soft: #a9a29a;
    --border: #322e28;
    --accent: #d99a9a;
  }
}

:root[data-theme="dark"] {
  --bg: #15130f;
  --text: #eae6e0;
  --text-soft: #a9a29a;
  --border: #322e28;
  --accent: #d99a9a;
}

.theme-toggle {
  margin-left: auto;
  font: inherit;
  font-size: 13px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
