:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --text: #2c2c2c;
  --muted: #6c6c6c;
  --line: #e7e7e7;
  --accent: #1593a5;
  --accent-dark: #0c7180;
  --oral-accent: #2563eb;
  --author-accent: #3f83d8;
  --nav-bg: rgba(255, 255, 255, 0.94);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1c1c1d;
  --surface: #262628;
  --text: #e8e8e8;
  --muted: #aaaaad;
  --line: #3a3a3d;
  --accent: #4fc3d2;
  --accent-dark: #81dbe6;
  --oral-accent: #60a5fa;
  --author-accent: #8ab4f8;
  --nav-bg: rgba(28, 28, 29, 0.94);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.62;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover, a:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
}

.container {
  width: calc(100% - 2rem);
  max-width: 930px;
  margin-inline: auto;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  min-height: 3.75rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--text); text-decoration: none; }
.brand strong { font-weight: 700; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.45rem;
}

.nav-links > a {
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
}

.nav-links > a:hover,
.nav-links > a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-links > a.active::after {
  position: absolute;
  right: 0;
  bottom: -1.18rem;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.theme-toggle {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
}

.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 1.15rem; fill: currentColor; }

main { padding-top: 7.2rem; }

.about-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 3.1rem;
  align-items: start;
}

.profile-wrap { padding-top: 1.1rem; text-align: center; }

.profile-photo {
  display: block;
  width: 205px;
  height: 205px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
  object-fit: cover;
  object-position: center 28%;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.82rem;
  margin-top: 1rem;
}

.social-links a {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  color: var(--muted);
  place-items: center;
}

.social-links a:hover { color: var(--accent); }
.social-links svg { width: 1.2rem; fill: currentColor; }

.bio h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 4vw, 2.62rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.bio { min-width: 0; }
.bio p { overflow-wrap: anywhere; }
.bio h1 strong { font-weight: 700; }
.bio p { margin: 0 0 1rem; }
.bio strong { font-weight: 500; }

.content-section {
  margin-top: 3.55rem;
  scroll-margin-top: 5rem;
}

.content-section h2 {
  margin: 0 0 1.35rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.62rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.content-section h3 {
  margin: 1.6rem 0 0.7rem;
  font-size: 1.03rem;
  font-weight: 500;
}

.table-wrap { overflow-x: auto; }

.timeline-table {
  width: 100%;
  border-collapse: collapse;
}

.timeline-table th,
.timeline-table td {
  padding: 0.38rem 0.5rem 0.38rem 0;
  border: 0;
  vertical-align: top;
  text-align: left;
}

.timeline-table th {
  width: 156px;
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 400;
  white-space: nowrap;
}

.news-icon {
  display: inline-block;
  width: 1.65rem;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.news-oral { color: var(--oral-accent); }

.selection-rate {
  color: var(--muted);
  font-size: 0.85em;
}

.selection-rate strong,
#honors strong { font-weight: 700; }

.education-table th { width: 190px; }

.publication-list {
  margin: 0;
  padding-left: 1.55rem;
}

.publication-list li {
  margin: 0 0 1.65rem;
  padding-left: 0.2rem;
}

.paper-title {
  font-weight: 500;
  line-height: 1.45;
}

.authors { margin-top: 0.12rem; }
.authors strong {
  color: var(--author-accent);
  font-weight: 500;
}
.venue { color: var(--muted); }
.venue em { color: var(--text); }

.highlight {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 500;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.paper-links a {
  padding: 0.13rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.5;
}

.paper-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.compact-list li { margin-bottom: 0.9rem; }

.experience-group { margin-bottom: 1.3rem; }
.experience-group h3 { margin-top: 0; }
.experience-table th { width: 190px; }
.experience-group strong { font-weight: 500; }

footer {
  margin-top: 4.2rem;
  padding: 1.35rem 0 2.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

footer p { margin: 0; }

@media (max-width: 700px) {
  .container { width: calc(100% - 2.2rem); }
  main { padding-top: 6.4rem; }

  .about-section {
    grid-template-columns: 1fr;
    gap: 1.7rem;
  }

  .profile-wrap { padding-top: 0; }
  .profile-photo { width: 180px; height: 180px; margin: 0 auto; }
  .bio h1 { text-align: center; }
  .content-section { margin-top: 3rem; }
  .timeline-table th { width: 120px; white-space: normal; }
  .education-table th,
  .experience-table th { width: 145px; }
}

@media (max-width: 470px) {
  .brand { font-size: 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links > a { font-size: 0.85rem; }
  .nav-links > a.active::after { bottom: -1.2rem; }

  .timeline-table tr {
    display: grid;
    margin-bottom: 0.65rem;
  }

  .timeline-table th,
  .timeline-table td { width: auto; padding: 0; }
  .timeline-table th { margin-bottom: 0.12rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
