:root {
  --bg: #ffffff;
  --surface: #f5f6f7;
  --text: #4a4d50;
  --heading: #34373a;
  --muted: #73787c;
  --link: #4d91ad;
  --line: #e1e3e5;
  --max-width: 1240px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  scroll-behavior: smooth;
}

:root[data-theme="dark"] {
  --bg: #181a1b;
  --surface: #222527;
  --text: #c8cbcd;
  --heading: #f0f1f2;
  --muted: #969b9f;
  --link: #78b7d0;
  --line: #34383b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  width: min(var(--max-width), calc(100% - 40px));
  height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 70px;
}

.site-name {
  height: 70px;
  display: flex;
  align-items: center;
  color: var(--heading);
  font-size: 20px;
  font-weight: 700;
}

.site-name.active { border-bottom: 2px solid var(--heading); }

.nav-links { display: flex; align-items: center; gap: 42px; }
.nav-links a { color: var(--heading); font-size: 17px; }

#theme-toggle,
#lang-toggle {
  border: 0;
  padding: 5px;
  color: var(--heading);
  background: transparent;
  cursor: pointer;
}

#theme-toggle { font-size: 22px; }
#lang-toggle { font-size: 16px; font-weight: 700; }

.layout {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 70px;
  padding: 55px 0 90px;
}

.profile { position: sticky; top: 125px; align-self: start; }
.avatar { width: 190px; height: 190px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; padding: 5px; }
.profile h1 { margin: 18px 0 4px; color: var(--heading); font-size: 24px; }
.tagline { margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.profile-links { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.profile-links li { display: grid; grid-template-columns: 20px 1fr; gap: 7px; margin: 9px 0; }
.profile-links li span { color: var(--muted); text-align: center; }

.content { max-width: 850px; }
.content section { margin-bottom: 48px; scroll-margin-top: 95px; }
.content h2 { margin: 0 0 12px; color: var(--heading); font-size: 30px; line-height: 1.25; }
.content p { margin: 0 0 14px; }
.interest-list { margin: 14px 0 0; padding-left: 30px; }
.interest-list li { margin: 7px 0; }

.publication { padding-left: 22px; border-left: 3px solid var(--line); }
.publication h3 { margin: 0 0 6px; color: var(--heading); font-size: 18px; line-height: 1.45; }
.venue { color: var(--muted); font-style: italic; }

.honor-list { margin: 0; padding: 0; list-style: none; }
.honor-list li { display: grid; grid-template-columns: 190px 1fr; gap: 8px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.honor-list li:first-child { border-top: 1px solid var(--line); }
.honor-list strong { color: var(--heading); }
.honor-list small { grid-column: 2; color: var(--muted); font-size: 14px; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 25px max(20px, calc((100% - var(--max-width)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-wrap { height: 60px; }
  .site-name { height: 60px; }
  .nav-links { margin-left: auto; gap: 16px; }
  .nav-links a:not(:last-of-type) { display: none; }
  .layout { grid-template-columns: 1fr; gap: 40px; padding-top: 35px; }
  .profile { position: static; display: grid; grid-template-columns: 105px 1fr; column-gap: 20px; }
  .avatar { grid-row: 1 / 4; width: 105px; height: 105px; }
  .profile h1 { margin: 4px 0 0; }
  .tagline { margin: 0; }
  .profile-links { grid-column: 1 / -1; margin-top: 20px; }
  .content h2 { font-size: 27px; }
  .honor-list li { grid-template-columns: 1fr; gap: 3px; }
  .honor-list small { grid-column: 1; }
  footer { flex-direction: column; gap: 4px; }
}

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