/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060a10;
  --surface: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.08);
  --text: #e8eaf0;
  --muted: #7a8099;
  --accent: #5b9cf6;
  --accent-dim: rgba(91,156,246,0.12);
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --max: 780px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Starfield canvas ── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6,10,16,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav ul a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

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

/* ── Main layout ── */
main {
  position: relative;
  z-index: 10;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 40px 40px;
}

section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

h2 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-family: var(--mono);
}

/* ── Hero ── */
.hero { padding-top: 28px; }

.hero-inner {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.headshot {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid var(--border);
  filter: grayscale(15%);
}

.hero-text h1 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.title {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: var(--mono);
}

.bio {
  font-size: 13.5px;
  color: #b0b8cc;
  margin-bottom: 10px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.links a {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(91,156,246,0.3);
  padding: 3px 10px;
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.links a:hover {
  background: var(--accent-dim);
  border-color: rgba(91,156,246,0.6);
}

/* ── Experience / Education entries ── */
.entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.entry:first-of-type { border-top: none; }

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}

.company {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.period {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
}

.role {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.grade {
  color: var(--accent);
  font-family: var(--mono);
}

.entry-body p, .entry-body ul {
  font-size: 13px;
  color: #9aa0b5;
}

.entry-body ul {
  padding-left: 16px;
}

.entry-body li {
  margin-bottom: 4px;
}

.entry-body strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Skills row ── */
.skills-row {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.skill-label {
  font-size: 10.5px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 110px;
}

.skill-group span:not(.skill-label) {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
  color: #c0c8dc;
}

/* ── Projects ── */
.section-note {
  font-size: 13.5px;
  color: #9aa0b5;
  margin-bottom: 18px;
}

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

.section-note a:hover { text-decoration: underline; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  transition: border-color 0.15s, background 0.15s;
}

.project-card:hover {
  border-color: rgba(91,156,246,0.35);
  background: rgba(91,156,246,0.04);
}

.project-name {
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.project-name a {
  color: var(--text);
  text-decoration: none;
}

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

.project-card p:last-child {
  font-size: 13px;
  color: var(--muted);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--muted);
}

.project-lang {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Research interests ── */
.research-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.interest-tag {
  font-size: 12px;
  font-family: var(--mono);
  background: var(--accent-dim);
  border: 1px solid rgba(91,156,246,0.2);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── Papers ── */
.papers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
}

.paper-card:hover {
  border-color: rgba(91,156,246,0.35);
  background: rgba(91,156,246,0.04);
}

.paper-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.paper-title a {
  color: var(--text);
  text-decoration: none;
}

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

.paper-meta {
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: 8px;
}

.paper-abstract {
  font-size: 13px;
  color: #9aa0b5;
  margin-bottom: 10px;
}

.paper-link {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--accent);
  text-decoration: none;
}

.paper-link:hover { text-decoration: underline; }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px 20px 36px;
  font-size: 12px;
  color: var(--muted);
}

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

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

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav-inner { padding: 0 20px; }
  .nav-name { display: none; }
  nav ul { gap: 14px; }

  main { padding: 62px 20px 32px; }

  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .links { justify-content: center; }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .entry-meta { flex-direction: row; gap: 10px; align-items: baseline; }
}
