:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #0d5e57;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  --nav-bg: rgba(250, 250, 250, 0.88);
  --radius: 12px;
  --radius-sm: 8px;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-elevated: #111827;
  --bg-subtle: #1e293b;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-faint: #94a3b8;
  --border: #1e293b;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 24px -4px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(11, 15, 23, 0.88);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

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

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

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

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

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.menu-toggle {
  display: none;
}

/* Compact Hero */
.hero {
  padding: 36px 0 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: center;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.2vw, 2.45rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.career-strip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 12px;
}

.hero-bio {
  color: var(--text-muted);
  margin: 0 0 16px;
  max-width: 72ch;
  font-size: 0.94rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.pill-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pill-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Sections */
.section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.section-subtitle {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin: 0;
}

/* 4-Across Research Visuals Strip */
.visuals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.visual-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.visual-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.visual-thumb {
  position: relative;
  background: #ffffff;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.visual-thumb img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.visual-meta {
  padding: 10px 12px;
}

.visual-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.3;
}

.visual-venue {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* Compact Publications List */
.pub-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pub-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.pub-row:last-child {
  border-bottom: none;
}

.pub-row:hover {
  background: var(--accent-soft);
}

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

.pub-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pub-info {
  min-width: 0;
  flex: 1;
}

.pub-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.venue-badge {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.pub-title {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
}

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

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

.pub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.pub-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.toggle-all-btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

/* Compact Peer Reviewing Band */
.service-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-pill {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.service-pill span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-left: 4px;
}

/* Minimal Footer */
.footer {
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  font-size: 0.83rem;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-dialog {
  max-width: 960px;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.lightbox-img-wrap {
  background: #ffffff;
  padding: 16px;
  display: flex;
  justify-content: center;
  max-height: 74vh;
}

.lightbox-img-wrap img {
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-bar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
}

.lightbox-caption {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
}

.lightbox-close {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 860px) {
  .visuals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 24px 0 22px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .avatar {
    width: 112px;
    height: 112px;
  }
  .pub-main {
    flex-direction: column;
    gap: 10px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 24px;
    gap: 12px;
  }
  .nav-links.open {
    display: flex;
  }
  .menu-toggle {
    display: inline-flex;
  }
}
