:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #687386;
  --subtle: #8b95a7;
  --line: #e6e9ef;
  --accent: #2857a4;
  --accent-soft: #eef4ff;
  --note-highlight: #c26a00;
  --shadow: 0 18px 50px rgba(27, 39, 66, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 999px;
  --header-height: 72px;
}

html[data-theme="dark"] {
  --bg: #101319;
  --bg-soft: #171b23;
  --card: #151a23;
  --text: #edf2ff;
  --muted: #a8b1c2;
  --subtle: #7f8ba0;
  --line: #2a3140;
  --accent: #8bb7ff;
  --accent-soft: #1b2940;
  --note-highlight: #ffb86b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(40, 87, 164, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.92em;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transition: transform 0.2s ease;
}

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

/* Header */

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

.nav {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  margin-right: auto;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.nav-links a {
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle,
.menu-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0.65rem;
  border-radius: 12px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 99px;
  background: var(--text);
}

/* Layout */

.page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  padding: 38px 0 64px;
}

.content {
  min-width: 0;
}

/* Profile */

.profile-card {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  align-self: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-photo-wrap {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 18px;
}

.profile-photo,
.photo-fallback {
  width: 156px;
  height: 156px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.photo-fallback {
  display: none;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 800;
}

.profile-card h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.1;
  text-align: center;
  letter-spacing: -0.04em;
}

.role,
.affiliation,
.profile-meta p {
  margin: 0;
  text-align: center;
}

.role {
  margin-top: 0.65rem;
  color: var(--text);
  font-weight: 700;
}

.affiliation {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.profile-links a,
.profile-link-button,
.pub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
}

.profile-link-button {
  font: inherit;
  cursor: pointer;
}

.profile-links a:hover,
.profile-link-button:hover,
.pub-link:hover,
.profile-links a:focus-visible,
.profile-link-button:focus-visible,
.pub-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.icon-links {
  gap: 0.6rem;
}

.icon-link {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.icon-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-link:hover,
.icon-link:focus-visible {
  transform: translateY(-1px);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 1.1rem;
}

.quick-tags span {
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

/* Sections */

.section {
  margin-bottom: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-section {
  padding-top: 36px;
  padding-bottom: 36px;
}

.section h2 {
  margin: 0 0 0.7rem;
  font-size: 1.7rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.section h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.35;
}

.section p {
  color: var(--muted);
}

.section p:last-child {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading p {
  max-width: 34rem;
  font-size: 0.95rem;
  text-align: right;
}

/* About */

.about-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.about-heading h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.about-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    var(--accent),
    color-mix(in srgb, var(--accent) 12%, transparent)
  );
}

.about-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.about-lead a {
  font-weight: 750;
}

/* Research interests */

.research-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.research-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.research-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 14px 36px rgba(27, 39, 66, 0.08);
}

.research-card-blue {
  background: color-mix(in srgb, #dfeaff 58%, var(--card));
}

.research-card-green {
  background: color-mix(in srgb, #e8f5ed 58%, var(--card));
}

.research-card-pink {
  background: color-mix(in srgb, #f5e6ee 58%, var(--card));
}

html[data-theme="dark"] .research-card-blue,
html[data-theme="dark"] .research-card-green,
html[data-theme="dark"] .research-card-pink {
  background: var(--bg-soft);
}

.research-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.research-card p {
  margin: 0.85rem 0 1.1rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.research-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 850;
}

.paper-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: auto;
}

.research-paper-refs {
  margin-top: 0.95rem;
}

.paper-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.16rem 0.52rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--card) 88%, var(--accent-soft));
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.015em;
  box-shadow: 0 1px 0 rgba(27, 39, 66, 0.04);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.paper-ref::before,
.paper-ref::after {
  content: "";
}

.paper-ref:hover,
.paper-ref:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 39, 66, 0.08);
}

/* Publications */

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.filter-btn {
  padding: 0.48rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
}

.filter-btn.active,
.filter-btn:hover,
.filter-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.pub-year {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0 0.8rem;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.pub-year::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.publication-list {
  display: grid;
  gap: 0.9rem;
}

.pub-card {
  scroll-margin-top: calc(var(--header-height) + 24px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.pub-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pub-keywords-top {
  margin-bottom: 0.7rem;
}

.pub-keyword {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.pub-title {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.42;
}

.pub-title-number {
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.pub-authors {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.me {
  color: var(--text);
  font-weight: 900;
}

.pub-venue {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 750;
}

.pub-note {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.note-highlight {
  display: inline;
  color: var(--note-highlight);
  font-weight: 900;
}

.note-ref {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.4;
}

.note-ref::before {
  content: "[";
}

.note-ref::after {
  content: "]";
}

.note-ref:hover,
.note-ref:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

/* Timeline */

.timeline {
  display: grid;
  gap: 0.9rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1rem;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-date {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.timeline-item p {
  margin: 0.3rem 0 0;
}

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 24px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.9rem;
}

/* Print */

@media print {
  :root {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --text: #111111;
    --muted: #333333;
    --subtle: #555555;
    --line: #dddddd;
    --accent: #111111;
    --accent-soft: #f3f3f3;
    --note-highlight: #111111;
    --shadow: none;
  }

  html {
    scroll-padding-top: 0;
  }

  body {
    background: #ffffff;
    color: #111111;
  }

  .site-header,
  .skip-link,
  .theme-toggle,
  .menu-toggle,
  .pub-toolbar,
  .footer,
  .profile-links {
    display: none !important;
  }

  .container {
    width: 100%;
    max-width: none;
  }

  .page-layout {
    display: block;
    padding: 0;
  }

  .profile-card,
  .section {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
  }

  .profile-card {
    position: static;
    text-align: center;
    page-break-after: avoid;
  }

  .profile-photo-wrap {
    width: 120px;
    height: 120px;
  }

  .profile-photo,
  .photo-fallback {
    width: 120px;
    height: 120px;
  }

  .quick-tags {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  .pub-card,
  .research-card {
    page-break-inside: avoid;
    border: 1px solid #dddddd;
    background: #ffffff;
  }

  a {
    color: #111111;
    text-decoration: none;
  }
}

/* Responsive */

@media (max-width: 920px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    inset: var(--header-height) 16px auto 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  body.menu-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0.9rem;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    position: static;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 0.25rem;
    text-align: left;
  }

  .research-card-grid {
    grid-template-columns: 1fr;
  }

  .research-card {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .section,
  .profile-card {
    padding: 22px;
  }

  .about-heading h2 {
    font-size: 1.72rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .footer {
    flex-direction: column;
  }
}
