:root {
  color-scheme: light;
  --page: #f7f8fb;
  --surface: #ffffff;
  --text: #263142;
  --heading: #111a27;
  --muted: #657084;
  --faint: #8b94a4;
  --border: #e1e5ec;
  --link: #215fa5;
  --link-hover: #163e6c;
  --accent: #b74634;
  --photo-ring: #ffffff;
  --shadow: 0 18px 45px rgba(31, 42, 59, 0.08);
  --max-width: 1160px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111721;
  --surface: #171e2a;
  --text: #d9dee7;
  --heading: #f3f5f8;
  --muted: #a7b0bf;
  --faint: #8691a2;
  --border: #2b3544;
  --link: #76afe9;
  --link-hover: #acd2f6;
  --accent: #ed8879;
  --photo-ring: #253142;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 140ms ease;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 65%, transparent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: 0.45rem;
  background: var(--heading);
  color: var(--surface);
  padding: 0.55rem 0.8rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 3rem), var(--max-width));
  min-height: 4.25rem;
  margin: 0 auto;
}

.site-brand {
  flex: 0 0 auto;
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--link);
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1.25rem;
}

.section-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1.55rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  flex: 0 0 auto;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  text-decoration: none;
}

.section-nav a:hover {
  color: var(--link);
}

.theme-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--heading);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

:root[data-theme="light"] .sun-icon,
:root[data-theme="dark"] .moon-icon {
  display: none;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(230px, 285px) minmax(0, 1fr);
  gap: clamp(3.5rem, 7vw, 7rem);
  width: min(calc(100% - 3rem), var(--max-width));
  margin: 0 auto;
  padding: clamp(4.5rem, 8vw, 7.5rem) 0 5rem;
}

.profile {
  position: sticky;
  top: 6.5rem;
  align-self: start;
  text-align: center;
}

.profile-photo {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto 1.55rem;
  border: 5px solid var(--photo-ring);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 38%;
  box-shadow: var(--shadow);
}

.profile h1 {
  margin: 0;
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.role {
  margin: 0.65rem 0 0.05rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 650;
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.affiliation a {
  color: inherit;
  text-decoration: none;
}

.affiliation a:hover {
  color: var(--link);
}

.email {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.94rem;
  text-decoration: none;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.45rem;
  margin-top: 0.7rem;
  color: var(--faint);
  font-size: 0.9rem;
  line-height: 1.55;
}

.profile-links a {
  text-decoration: none;
}

.content {
  min-width: 0;
  max-width: 760px;
}

.content > section {
  padding: 0.2rem 0 clamp(3.2rem, 6vw, 5rem);
  scroll-margin-top: 6rem;
}

.content > section + section {
  border-top: 1px solid var(--border);
  padding-top: clamp(2.7rem, 5vw, 4.25rem);
}

.content p {
  margin: 0 0 1.15rem;
}

.content h2 {
  margin: 0 0 1.8rem;
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.intro {
  font-size: 1.04rem;
}

.intro .welcome {
  margin-bottom: 1.4rem;
  color: var(--heading);
  font-size: clamp(1.12rem, 2vw, 1.28rem);
  font-weight: 650;
}

.pronunciation {
  color: var(--muted);
  font-size: 0.92em;
  font-weight: 450;
}

.news-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: baseline;
}

.news-list time {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.news-list p {
  margin: 0;
}

.section-label {
  margin: 0 0 1.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.publications-label {
  margin-top: 3.1rem;
}

.paper {
  margin: 0 0 2.25rem;
}

.paper-card {
  margin-bottom: 1.5rem;
  padding: clamp(1.2rem, 2.5vw, 1.55rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 42, 59, 0.055);
}

:root[data-theme="dark"] .paper-card {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

.paper-card .paper-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--link) 11%, var(--surface));
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.paper-card h4 {
  margin-bottom: 0.8rem;
}

.paper-card .paper-summary {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.68;
}

.paper-card .authors {
  margin-top: 0;
}

.paper-card .paper-award {
  margin: 0.7rem 0 0;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.5;
}

.paper h4 {
  margin: 0 0 0.38rem;
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 2vw, 1.28rem);
  font-weight: 600;
  line-height: 1.42;
}

.paper h4 a {
  color: var(--heading);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
}

.paper h4 a:hover {
  color: var(--link);
  text-decoration-color: currentColor;
}

.paper .authors,
.paper .status {
  margin: 0.08rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.paper .status {
  color: var(--text);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.paper-links a {
  border-bottom: 1px solid color-mix(in srgb, var(--link) 32%, transparent);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-decoration: none;
}

.paper-links a:hover {
  border-color: currentColor;
}

.compact-paper {
  margin-bottom: 1.4rem;
}

.teaching-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.teaching-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--border);
}

.teaching-list li:first-child {
  border-top: 1px solid var(--border);
}

.teaching-list li span:first-child {
  color: var(--heading);
  font-weight: 650;
}

.teaching-list li span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.teaching-subsection {
  margin-top: 2.5rem;
}

.teaching-note {
  margin-top: 1rem !important;
  color: var(--muted);
  font-size: 0.92rem;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.experience-grid article {
  padding-top: 1.1rem;
  border-top: 2px solid var(--border);
}

.experience-years {
  margin-bottom: 0.4rem !important;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.experience-grid h3 {
  margin: 0;
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.experience-role {
  margin: 0.1rem 0 0.7rem !important;
  color: var(--muted);
  font-size: 0.9rem;
}

.experience-grid article > p:last-child {
  margin: 0;
  font-size: 0.94rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
}

footer p {
  margin: 0 !important;
}

footer a {
  text-decoration: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 820px) {
  .header-inner {
    width: min(calc(100% - 2.3rem), 690px);
  }

  .site-brand {
    font-size: 1.3rem;
  }

  .header-actions,
  .section-nav {
    gap: 1rem;
  }

  .page-shell {
    grid-template-columns: 1fr;
    gap: 3.75rem;
    width: min(calc(100% - 2.3rem), 690px);
    padding-top: 4.8rem;
  }

  .profile {
    position: static;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    text-align: left;
  }

  .profile-photo {
    width: 150px;
    margin: 0;
  }

  .profile-links {
    justify-content: flex-start;
  }

  .content {
    max-width: none;
  }
}

@media (max-width: 540px) {
  .header-inner {
    width: calc(100% - 1.25rem);
    min-height: 3.75rem;
  }

  .site-brand {
    display: none;
  }

  .header-actions {
    width: 100%;
    gap: 0.7rem;
  }

  .section-nav {
    flex: 1 1 auto;
    gap: 1rem;
  }

  .section-nav a {
    font-size: 0.94rem;
  }

  .page-shell {
    width: min(calc(100% - 2rem), 690px);
    padding: 4.4rem 0 3rem;
  }

  .profile {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 1.1rem;
  }

  .profile-photo {
    width: 108px;
    border-width: 4px;
  }

  .profile h1 {
    font-size: 1.65rem;
  }

  .role,
  .affiliation,
  .email,
  .profile-links {
    font-size: 0.84rem;
  }

  .content > section {
    padding-bottom: 3rem;
  }

  .content > section + section {
    padding-top: 2.65rem;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .paper-card {
    padding: 1.2rem;
    border-radius: 0.85rem;
  }

  .teaching-list li {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }

  .teaching-list li span:last-child {
    white-space: normal;
  }

  .experience-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
