/* ============================================================
   Design tokens — edit these to re-theme the whole site
   ============================================================ */
:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #1a1a2e;
  --text-muted: #5c5c70;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e5e5ec;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  --font-sans: "Avenir Next", "Avenir", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-elevated: #171a23;
  --text: #e8e8f0;
  --text-muted: #9a9ab0;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --border: #262a36;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Base
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

a:hover {
  text-decoration: underline;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
}

.nav-logo:hover {
  text-decoration: none;
  background: var(--accent-soft);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.925rem;
  font-weight: 500;
}

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

#theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

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

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.hero-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-cn {
  margin-top: 0.35rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.hero-tagline {
  margin-top: 1rem;
  max-width: 32rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero-socials {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 2rem;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.hero-socials-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 0.35rem;
}

.hero-socials a {
  color: var(--text-muted);
}

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

.hero-photo img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.about-text {
  max-width: 42rem;
}

.about-text p + p {
  margin-top: 1rem;
}

.about-text a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
}

.about-text a:hover {
  text-decoration-color: var(--accent);
}

.about-text .btn {
  margin-top: 1.5rem;
  text-decoration: none;
}

.skills-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.skills-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.skills-list li {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.skills-list li::before {
  content: "▸ ";
  color: var(--accent);
}

/* ---- Publications ---- */
.pub-list {
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.pub-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.pub-thumb {
  flex-shrink: 0;
  width: 180px;
  height: auto;
  aspect-ratio: 16 / 9;
  /* contain, not cover: paper figures shouldn't be cropped */
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.pub-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.pub-authors {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-top: 0.25rem;
}

.pub-venue {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.35rem;
}

.pub-links {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }


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

  .pub-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .pub-thumb {
    width: 100%;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }
}
