:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --card: #f7f7f9;
  --accent: #76b900; /* NVIDIA green */
  --link: #1a6fd1;
}
/* Dark theme: follows the system setting unless the visitor picks one with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --fg: #ececf0;
    --muted: #9a9aa2;
    --line: #2a2a2f;
    --card: #1a1a1e;
    --link: #6cb2ff;
  }
}
:root[data-theme="dark"] {
  --bg: #111113;
  --fg: #ececf0;
  --muted: #9a9aa2;
  --line: #2a2a2f;
  --card: #1a1a1e;
  --link: #6cb2ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 600; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.brand { font-weight: 700; color: var(--fg); }
.nav-links a { color: var(--muted); margin-left: 20px; font-size: 0.92rem; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-right { display: flex; align-items: center; }
.theme-toggle {
  margin-left: 18px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }

/* Intro */
.intro { display: flex; gap: 40px; align-items: center; padding: 48px 0 16px; }
.intro-text { flex: 1; }
h1 { font-size: 2.2rem; margin: 0 0 4px; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); margin-bottom: 16px; }
.links { margin-top: 12px; font-weight: 500; }
.links .sep { color: var(--line); margin: 0 10px; }
.photo {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; flex-shrink: 0;
}
.photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #2f8fdd);
}

/* Sections */
section { padding: 28px 0; border-top: 1px solid var(--line); margin-top: 16px; }
.intro + section { border-top: none; }
h2 { font-size: 1.4rem; margin: 0 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0 0 8px; }

/* News */
.news { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.news li { display: flex; gap: 16px; padding: 4px 0; }
.news .date { flex: 0 0 80px; color: var(--muted); font-variant-numeric: tabular-nums; }
.news.talks { max-height: none; }
.talks li { padding: 6px 0; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.chip {
  --c: var(--fg);
  font: inherit; font-size: 0.85rem; font-weight: 500;
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--c); }
.chip.active { background: var(--c); border-color: var(--c); color: var(--bg); }

/* Publications */
.pub { display: flex; gap: 24px; padding: 16px 0; }
.thumb {
  flex: 0 0 260px; height: 150px; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
}
/* contain, not cover: thumbnails are often wide paper figures that must not be cropped */
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; font-weight: 700; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #000));
}
.pub-body { flex: 1; min-width: 0; }
.pub-title { font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.pub-authors { font-size: 0.92rem; }
.venue-badge {
  display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
}
.venue-badge.conf { background: var(--fg); color: var(--bg); }
.venue-badge.preprint { color: var(--muted); border: 1px solid var(--line); }
.venue-badge.soon { color: #b7791f; border: 1px dashed currentColor; }
.award { font-size: 0.9rem; color: #c0392b; font-weight: 600; margin-top: 2px; }
.award a { color: inherit; }
.pub-links { font-size: 0.9rem; margin-top: 4px; }
.bib { position: relative; margin-top: 8px; }
.bib pre {
  margin: 0; padding: 10px 12px; max-height: 220px; overflow: auto;
  font-size: 0.75rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.bib-copy {
  position: absolute; top: 6px; right: 6px; padding: 2px 10px; cursor: pointer;
  font: inherit; font-size: 0.75rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
.tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.75rem; font-weight: 500; padding: 1px 8px; border-radius: 999px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}

/* Experience timeline */
.timeline { list-style: none; padding: 0 0 0 20px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 8px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.exp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.org { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.exp-logo {
  height: 26px; width: auto; min-width: 26px; max-width: 80px; object-fit: contain; padding: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.exp-head .date { color: var(--muted); font-size: 0.9rem; }
.role { font-size: 0.95rem; }
.timeline .muted { font-size: 0.9rem; }

/* Honors */
.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 2px 0; font-size: 0.95rem; }

.footer { padding: 32px 24px 48px; text-align: center; }

/* Mobile */
@media (max-width: 680px) {
  .intro { flex-direction: column-reverse; align-items: flex-start; gap: 20px; padding-top: 28px; }
  .photo { width: 120px; height: 120px; }
  .photo.placeholder { font-size: 2.2rem; }
  .brand { display: none; }
  .nav-inner { justify-content: center; }
  .nav-right { min-width: 0; max-width: 100%; }
  .nav-links { white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav .wrap { padding: 0 12px; }
  .nav-links a { margin: 0 5px; font-size: 0.8rem; }
  .theme-toggle { margin-left: 4px; width: 28px; height: 28px; font-size: 0.9rem; }
  .pub { flex-direction: column; gap: 12px; }
  .thumb { flex-basis: auto; width: 100%; height: 180px; }
  .two-col { grid-template-columns: 1fr; }
}
