/* ===== VARIABLES ===== */
/* Sitzmann-inspired palette + Inter (free Messina Sans substitute) + user's Crimson accent */
:root {
  color-scheme: light;
  --bg: #FAFAFA;                       /* hsl(0, 0%, 98%) — Sitzmann bg */
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --text: #131822;                     /* hsl(211, 25%, 10%) — Sitzmann near-black */
  --text-secondary: #5C636B;           /* hsl(211, 10%, 40%) — Sitzmann muted */
  --text-tertiary: #8B919A;            /* lighter muted */
  --accent: #A51C30;                   /* user-chosen Crimson */
  --accent-hover: #7A1322;
  --accent-subtle: rgba(165, 28, 48, 0.05);
  --accent-light: rgba(165, 28, 48, 0.12);
  --border: #DCDFE2;                   /* hsl(211, 10%, 88%) */
  --border-light: rgba(19, 24, 34, 0.07);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1115;
  --bg-elevated: #181B22;
  --bg-card: #181B22;
  --text: #E6E8EC;
  --text-secondary: #A0A6AE;
  --text-tertiary: #6B7280;
  --accent: #E04760;
  --accent-hover: #F26079;
  --accent-subtle: rgba(224, 71, 96, 0.08);
  --accent-light: rgba(224, 71, 96, 0.18);
  --border: #2A2F38;
  --border-light: rgba(230, 232, 236, 0.08);
}

/* Tone down monochrome emblem logos in dark mode (HKUST / ZJU). Ant Group's
   colored mark stays untouched via the file-name selector. */
:root[data-theme="dark"] img[src*="emblem"] {
  filter: invert(0.92) hue-rotate(180deg);
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
}

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

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

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

::selection {
  background: var(--accent-light);
  color: var(--text);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 32px 0;
}

/* ===== STICKY HEADER (name + inline nav) ===== */
.hero-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

.hero-header > .container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.hero-info h1 {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}

.hero-info .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-sections {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-sections a {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}

.nav-sections a:hover {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text);
  cursor: pointer;
  transition: color var(--transition);
}

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

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }

.cn-name {
  font-family: 'Zen Old Mincho', 'STSong', 'Songti SC', serif;
  font-size: 0.6em;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-left: 4px;
}

/* ===== HERO / INTRO (Sitzmann-style) ===== */
.hero {
  padding: 32px 0;
}

.greeting {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  display: inline-block;
  border-bottom: 2px solid var(--text);
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.hero-content {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.hero-text {
  flex: 1;
}

.hero-bio {
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 14px;
}

.hero-bio a {
  color: var(--accent);
}

.hero-bio b {
  color: var(--text);
  font-weight: 600;
}

/* Pill-button links (Email / CV / Scholar / Twitter / GitHub) */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  transition: border-color var(--transition), color var(--transition);
}

.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-links a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hero-photo {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== SECTION HEADERS (Sitzmann-style: heavy underline only under text) ===== */
.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  display: inline-block;
  border-bottom: 2px solid var(--text);
  padding-bottom: 4px;
}

/* ===== NEWS ===== */
.news-section {
  padding: 32px 0;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 32px;
  padding: 1px 0;
}

.news-date {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
  letter-spacing: 0;
}

.news-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.news-text b {
  color: var(--text);
  font-weight: 600;
}

/* ===== RESEARCH PAPERS ===== */
.pub-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.pub-tab {
  background: none;
  border: none;
  padding: 0 0 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}

.pub-tab:hover {
  color: var(--text-secondary);
}

.pub-tab.is-active {
  color: var(--text);
}

.pub-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.pub-panel[hidden] {
  display: none;
}

.pub-note {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pub-item .pub-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 2px;
}

.pub-item .pub-authors {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.pub-item .pub-authors .me {
  color: var(--text);
  font-weight: 600;
}

.pub-item .pub-venue {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
  margin-top: 1px;
}

.papers {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.paper-card {
  display: flex;
  gap: 24px;
}

.paper-media {
  flex-shrink: 0;
  width: 180px;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: center;
}

.paper-media img {
  width: 100%;
  border-radius: var(--radius-sm);
}

.paper-media video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-sm);
}

.paper-card:hover .paper-media video {
  opacity: 1;
}

.paper-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.paper-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
}

a.paper-title:hover {
  color: var(--accent);
}

.paper-authors {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.55;
}

.paper-authors .me {
  color: var(--text);
  font-weight: 600;
}

.paper-authors a {
  color: var(--text-secondary);
}

.paper-authors a:hover {
  color: var(--accent);
}

.paper-venue {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--text);
  margin-bottom: 10px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.paper-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.paper-links a:hover {
  color: var(--accent-hover);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
  gap: 20px;
}

.proj-card {
  display: flex;
  flex-direction: column;
}

.proj-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 2px;
}

.proj-card h3 a {
  color: var(--text);
}

.proj-card h3 a:hover {
  color: var(--accent);
}

.proj-status {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
}

.proj-status.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.proj-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  flex: 1;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proj-tags span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.proj-tags span::before {
  content: '#';
  margin-right: 1px;
  opacity: 0.6;
}

/* ===== EXPERIENCE ===== */
.timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
}

.timeline-item-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timeline-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.timeline-info h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.timeline-role {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-advisor {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.timeline-period {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

@media (max-width: 600px) {
  .timeline { grid-template-columns: 1fr; }
}

/* ===== AWARDS ===== */
.awards-list {
  display: flex;
  flex-direction: column;
}

.award-item {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.award-item:last-child {
  border-bottom: none;
}

.award-title {
  font-size: 14px;
  color: var(--text);
}

.award-detail {
  color: var(--text-tertiary);
  font-size: 13px;
}

.award-year {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  white-space: nowrap;
}

/* ===== MISC ===== */
.misc-content {
  font-size: 16px;
  color: var(--text);
  line-height: 1.55;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .hero-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-top: 24px;
  }

  .nav-sections {
    gap: 16px;
  }

  .nav-sections a {
    font-size: 14px;
  }

  .hero-content {
    flex-direction: column-reverse;
    gap: 24px;
  }

  .hero-photo {
    width: 140px;
    height: 140px;
  }

  .paper-card {
    flex-direction: column;
    gap: 14px;
  }

  .paper-media {
    width: 100%;
  }

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

  section {
    padding: 24px 0;
  }

  .news-item {
    flex-direction: column;
    gap: 2px;
  }

  .news-date {
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-info h1 {
    font-size: 1.75rem;
  }

  .nav-sections {
    gap: 12px;
  }

  .nav-sections a {
    font-size: 13px;
  }

  .hero-photo {
    width: 120px;
    height: 120px;
  }
}
