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

:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-light: #eef0ff;
  --on-accent: #ffffff;
  --text: #17171c;
  --text-muted: #5d6070;
  --bg: #fafafc;
  --surface: #ffffff;
  --border: #e6e6ec;
  --radius: 12px;
  --max-width: 1000px;
  --nav-height: 56px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #9aa2ff;
    --accent-dark: #b9beff;
    --accent-light: #22244a;
    --on-accent: #11122a;
    --text: #ececf2;
    --text-muted: #a3a6b4;
    --bg: #0f1015;
    --surface: #17181f;
    --border: #2a2c37;
  }
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Hero ── */
.hero {
  background:
    radial-gradient(55% 90% at 90% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 70% at 0% 0%, color-mix(in srgb, #a855f7 9%, transparent), transparent 70%);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--nav-height);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 28px;
  line-height: 1.75;
}

.hero-links {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.hero-contact {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-avatar {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  box-shadow:
    0 0 0 6px var(--surface),
    0 0 0 7px var(--border),
    0 18px 40px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

/* ── Main container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* ── Sections: title on the left, content on the right ── */
section {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 40px;
  padding: 56px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: var(--nav-height);
}

section:first-child {
  border-top: none;
}

.section-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
  padding-top: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

/* ── Cards ── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(23, 23, 28, 0.04);
}

.card h3,
.entry h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ── Entries (education, research) ── */
.entry + .entry {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.institution {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.date-badge {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Bullet list ── */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.bullet-list li {
  font-size: 14.5px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}

.bullet-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.bullet-list strong {
  color: var(--text);
  font-weight: 600;
}

.entry-sub {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 20px;
}

.entry-header + .entry-sub {
  margin-top: 12px;
}

.entry-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.entry .pub-link {
  margin-top: 10px;
}

/* ── Publication card ── */
.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pub-venue {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 999px;
}

.pub-highlight {
  color: var(--on-accent);
  background: var(--accent);
}
.card .pub-title {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

.pub-authors {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

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

.pub-authors:last-child {
  margin-bottom: 0;
}

.pub-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pub-figure {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 0 16px;
}

.pub-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.pub-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Skills ── */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.skill-row dt {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 11px;
  border-radius: 999px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.visitor-map {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 0;
  }

  .section-title {
    position: relative;
    top: auto;
  }
}

@media (max-width: 640px) {
  .nav-name {
    display: none;
  }

  .nav-inner {
    padding: 0 12px;
    overflow-x: auto;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 6px 7px;
    font-size: 13px;
  }

  .hero-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 28px;
    padding: 48px 24px 44px;
  }

  .hero-text h1 {
    font-size: 38px;
  }

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

  .entry-header {
    flex-direction: column;
    gap: 2px;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .card {
    padding: 20px;
  }
}
