:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #18202b;
  --muted: #667085;
  --line: #d9e0e8;
  --accent: #235b8f;
  --accent-strong: #173f65;
  --shadow: 0 18px 45px rgba(19, 31, 46, 0.08);
  --max: 1160px;
}

html[data-theme="dark"] {
  --bg: #20222c;
  --surface: #282b36;
  --surface-soft: #303440;
  --text: #f5f7fb;
  --muted: #adb5c4;
  --line: #3a3f4d;
  --accent: #91bff1;
  --accent-strong: #bfdcff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 180ms ease, color 180ms ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
}
.nav-wrap {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 760;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 650;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); text-decoration: none; }
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle::before { content: '☾'; font-size: 1.12rem; }
html[data-theme="dark"] .theme-toggle::before { content: '☀'; }

.page-shell {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 80px;
}

/* Home page layout intentionally follows the earlier academic profile design */
.home-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 58px;
  align-items: start;
}
.profile-panel {
  position: sticky;
  top: 106px;
  text-align: center;
}
.profile-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  object-position: 50% 24%;
  border-radius: 50%;
  margin: 0 auto 22px;
  box-shadow: var(--shadow);
  border: 4px solid var(--surface);
}
.profile-name {
  margin: 0 0 7px;
  font-size: 1.95rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
}
.profile-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.profile-unit {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.social-row {
  margin-top: 21px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.social-link {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  transition: transform 150ms ease, background 150ms ease;
}
.social-link:hover {
  text-decoration: none;
  background: var(--surface-soft);
  transform: translateY(-2px);
}
.social-link svg { width: 20px; height: 20px; }

.content-panel h1,
.content-panel h2,
.content-panel h3 { line-height: 1.18; }
.hero-title {
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  margin: 0 0 16px;
  font-weight: 520;
  letter-spacing: -0.035em;
}
.bio-copy {
  margin: 0;
  max-width: 800px;
  font-size: 1.03rem;
}
.bio-copy + .bio-copy { margin-top: 14px; }
.home-details {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 42px;
  margin-top: 34px;
}
.section-title {
  font-size: 1.25rem;
  margin: 0 0 14px;
}
.interest-list,
.education-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.interest-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  color: var(--text);
}
.interest-list svg {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  flex: 0 0 auto;
  color: var(--accent);
}
.education-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin: 0 0 18px;
}
.education-item svg { width: 21px; height: 21px; color: var(--accent); margin-top: 3px; }
.education-item strong { display: block; font-size: 0.98rem; }
.education-meta { display: block; color: var(--muted); font-size: 0.89rem; margin-top: 2px; }
.education-note { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.degree-line { line-height: 1.35; }
.expected-date { font-size: 0.92rem; color: var(--muted); white-space: nowrap; }

/* Project section */
.projects-block {
  margin-top: 58px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}
.projects-heading {
  display: block;
  margin-bottom: 22px;
}
.projects-heading h2 {
  margin: 0 0 7px;
  font-size: 1.7rem;
  letter-spacing: -0.025em;
}
.projects-heading p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.025);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-soft);
}
.project-thumb.top { object-position: center top; }
.project-thumb.contain {
  object-fit: contain;
  padding: 8px;
  background: var(--surface-soft);
}
.project-body {
  padding: 20px 21px 21px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.project-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 14px; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.77rem;
  background: var(--surface-soft);
}

/* Interior pages */
.page-intro { max-width: 820px; margin-bottom: 34px; }
.page-title { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 12px; letter-spacing: -0.035em; font-weight: 560; }
.page-subtitle { color: var(--muted); margin: 0; font-size: 1.02rem; }
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 23px 24px;
}
.publication-list { display: grid; gap: 14px; }
.publication { border-bottom: 1px solid var(--line); padding: 0 0 18px; }
.publication:last-child { border-bottom: 0; }
.publication-title { font-weight: 720; color: var(--text); }
.publication-title:hover { color: var(--accent); }
.publication-authors,
.publication-venue { color: var(--muted); font-size: 0.94rem; margin-top: 4px; }
.group-title { margin: 42px 0 17px; font-size: 1.35rem; }
.group-title:first-of-type { margin-top: 0; }

.conference-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.conference-item:last-child { border-bottom: 0; }
.conference-year { color: var(--accent); font-weight: 750; }
.conference-title { margin: 0; font-weight: 700; }
.conference-detail { margin: 4px 0 0; color: var(--muted); }

.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 26px;
}
.contact-card h2 { margin-top: 0; }
.contact-row { margin: 14px 0; }
.contact-label { display: block; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }

/* News page */
.news-list {
  max-width: 850px;
}
.news-item {
  padding: 0 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
.news-item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.news-date {
  display: block;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 760;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.news-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.3;
}
.news-copy {
  color: var(--muted);
  margin: 0;
  max-width: 800px;
}
.news-copy + .news-copy { margin-top: 10px; }
.news-image-wrap {
  width: min(520px, 100%);
  margin-top: 18px;
}
.news-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(19,31,46,0.06);
}
.news-image.uwrl { object-position: center 42%; }
.news-image.candidacy { object-position: center 38%; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-wrap {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; gap: 38px; }
  .profile-panel { position: static; }
  .home-details { grid-template-columns: 1fr; gap: 24px; }
  .project-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-wrap { flex-wrap: wrap; gap: 10px; padding: 12px 0; }
  .nav-links {
    width: 100%;
    order: 3;
    overflow-x: auto;
    padding-bottom: 2px;
    gap: 16px;
  }
  .theme-toggle { margin-left: auto; }
  .page-shell { padding-top: 44px; }
  .profile-photo { width: 190px; height: 190px; }
  .conference-item { grid-template-columns: 1fr; gap: 4px; }
  .footer-wrap { flex-direction: column; }
}
