:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --ink: #14171a;
  --muted: #525c68;
  --border: #e3e7ec;
  --accent: #1d4e89;
  --accent-soft: rgba(29, 78, 137, 0.1);
  --code-bg: #eef1f5;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-alt: #151b22;
  --surface: #1a222c;
  --ink: #ecf0f4;
  --muted: #98a4b3;
  --border: #26303d;
  --accent: #6ea8fe;
  --accent-soft: rgba(110, 168, 254, 0.14);
  --code-bg: #1e2733;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 0;
}

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

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

code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

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

.container.narrow {
  max-width: 900px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.brand {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
  opacity: 0.8;
}

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

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

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

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

.theme-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
  background: var(--bg-alt);
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--ink);
}

.sub-heading {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.75rem 0 1rem;
}

.sub-heading:first-of-type {
  margin-top: 0;
}

.hero {
  padding: 4.25rem 0 3.75rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 3.25rem;
  align-items: start;
}

.profile-col {
  text-align: center;
}

.avatar {
  width: 196px;
  height: 196px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.15rem;
}

.profile-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.profile-role {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.profile-org {
  margin: 0.15rem 0 1.2rem;
  font-size: 0.94rem;
  color: var(--muted);
}

.social-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.05rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

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

.cv-pill {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.greeting {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.bio-col p {
  margin: 0 0 0.95rem;
  font-size: 1.02rem;
}

.bio-col .lead {
  font-size: 1.08rem;
}

.about-subgrid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.about-subgrid h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.clean-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
}

.clean-list li {
  margin-bottom: 0.4rem;
  font-size: 0.96rem;
}

.edu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.edu-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.edu-icon {
  color: var(--accent);
  margin-top: 0.25rem;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.edu-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.edu-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.news-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.98rem;
}

.news-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 1.75rem;
}

.timeline-item {
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.timeline-head h3 {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.timeline-org {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.timeline-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
}

.bullet-list {
  margin: 0;
  padding-left: 1.2rem;
}

.bullet-list li {
  margin-bottom: 0.45rem;
  font-size: 0.97rem;
}

.pub-list {
  display: grid;
  gap: 1.35rem;
}

.pub-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem 1.3rem;
}

.pub-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

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

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

.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--muted);
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

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

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

.pub-desc {
  margin: 0 0 0.7rem;
  font-size: 0.94rem;
  color: var(--muted);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.24rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  text-decoration: none;
}

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2.5rem;
}

.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
  font-size: 0.94rem;
}

.compact-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.65rem;
  align-items: baseline;
}

.year-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.reading-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 22, 0.6);
}

.modal-card {
  position: relative;
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cite-pre {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.95rem;
  border-radius: 7px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

[data-theme="dark"] .btn-primary {
  color: #0f1419;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-subgrid,
  .two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .timeline-head {
    flex-direction: column;
    gap: 0.25rem;
  }
  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .nav-links {
    gap: 0.85rem;
  }
}

