:root {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5e6670;
  --line: #dad6cc;
  --accent: #1f6f78;
  --accent-dark: #164f56;
  --link-bg: #e9f3f4;
  --shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
  --max-width: 1060px;
}

html[data-theme="dark"] {
  --bg: #17191c;
  --surface: #202328;
  --text: #f0f2f4;
  --muted: #aab2bd;
  --line: #343941;
  --accent: #73c5cf;
  --accent-dark: #8bd7df;
  --link-bg: #203438;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

a:hover,
a:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(218, 214, 204, 0.9);
  background: rgba(248, 247, 243, 0.94);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .site-header {
  border-bottom-color: rgba(52, 57, 65, 0.95);
  background: rgba(23, 25, 28, 0.94);
}

.site-title {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-dark);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--accent-dark);
  border-color: rgba(31, 111, 120, 0.35);
  outline: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.section {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

#updates {
  padding-top: 35px;
  padding-bottom: 20px;
}

.profile-section {
  padding-top: 35px;
  padding-bottom: 20px;
}

.profile-summary {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: 0;
}

h1,
h2 {
  font-family: "Source Serif 4", Georgia, serif;
}

h1 {
  max-width: 100%;
  font-size: clamp(1.9rem, 3.5vw, 3rem);
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h3 {
  font-size: 1.05rem;
}

.role {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.role span {
  display: inline;
}

.role span:not(:last-child)::after {
  content: " | ";
  color: var(--muted);
}

.role a {
  color: var(--accent-dark);
}

.email-line {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.98rem;
}

.email-line svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.interest-line {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}

.interest-line strong {
  color: var(--text);
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.intro-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(31, 111, 120, 0.2);
  border-radius: 6px;
  background: var(--link-bg);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.intro-links svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.intro-links span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.profile {
  margin: 0;
  max-width: 210px;
}

.profile img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.18;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.bio-section {
  margin-top: 22px;
  padding-top: 0;
}

.bio-section .bio-copy {
  display: grid;
  gap: 8px;
}

.bio-section .bio-copy p {
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.page-section {
  padding-top: 56px;
  padding-bottom: 34px;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.heading-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.publication-list p,
.news-list p {
  margin: 0;
  color: var(--text);
}

.publication-list {
  font-size: 0.95rem;
  line-height: 1.5;
}

.publication-list h2 {
  margin: 30px 0 10px;
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.16rem;
  font-weight: 700;
}

.publication-list h2:first-child {
  margin-top: 0;
}

.publication-list ol,
.publication-list ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
}

.publication-list li {
  padding-left: 5px;
}

.paper-title-line {
  color: var(--text);
  font-weight: 600;
}

.paper-title-line a:first-child {
  color: var(--accent-dark);
  font-weight: 700;
}

.paper-title-line a:not(:first-child) {
  color: var(--accent-dark);
  font-weight: 500;
}

.paper-authors {
  margin-top: 2px;
  color: var(--text);
}

.paper-venue {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.95rem;
}

.publication-list a {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: inherit;
  font-weight: 500;
  text-decoration: none;
}

.publication-list a:hover,
.publication-list a:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.publication-list strong {
  font-weight: 700;
}

.text-red {
  color: #ff0000;
}

.activity-page {
  display: grid;
  gap: 0;
}

.activity-section {
  display: grid;
  gap: 14px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.activity-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.activity-section:last-of-type {
  padding-bottom: 0;
}

.activity-section h2 {
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.24rem;
  font-weight: 700;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--text);
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 16px;
}

.activity-date {
  color: var(--accent-dark);
  font-weight: 700;
  white-space: nowrap;
}

.activity-detail-list {
  display: grid;
  gap: 2px;
  margin: 5px 0 0 1.05rem;
  padding: 0;
  color: var(--muted);
  line-height: 1.5;
  list-style: disc;
}

.activity-detail-list li {
  display: list-item;
}

.news-list {
  display: grid;
  gap: 18px;
}

.news-list article {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 3px 0;
}

.news-year {
  display: grid;
  gap: 8px;
}

.news-year h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 1.25rem;
}

.news-list time {
  color: var(--accent-dark);
  font-weight: 700;
}

.site-footer {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .site-header {
    padding-inline: 18px;
  }

  .site-nav {
    position: absolute;
    inset: 68px 18px auto 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 11px 10px;
  }

  .site-nav .theme-toggle {
    margin: 8px 10px 6px;
  }

  .nav-toggle {
    display: block;
  }

  .section {
    width: min(100% - 34px, var(--max-width));
    padding: 52px 0;
  }

  .page-section {
    padding-top: 42px;
    padding-bottom: 34px;
  }

  #updates {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .profile-section {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .profile-summary {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .profile {
    max-width: 210px;
  }

  .news-list article {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .activity-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
