/* ===== Theme tokens — Maize & Blue ===== */
:root {
  --bg:           #fafbfd;
  --bg-elev:      #ffffff;
  --bg-soft:      #eff2f8;
  --text:         #15203a;
  --text-soft:    #51607e;
  --text-faint:   #84909f;
  --accent:       #1452b8;
  --accent-soft:  #e8effc;
  --maize:        #ffcb05;
  --border:       #e2e7f0;
  --shadow:       0 1px 2px rgba(16,32,64,.05), 0 8px 24px rgba(16,32,64,.06);
  --shadow-hover: 0 4px 10px rgba(16,32,64,.08), 0 18px 40px rgba(16,32,64,.12);
  --radius:       16px;
  --radius-sm:    10px;
  --maxw:         920px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
}
html[data-theme="dark"] {
  --bg:           #0d1320;
  --bg-elev:      #141d30;
  --bg-soft:      #1b2638;
  --text:         #e9edf5;
  --text-soft:    #a4b1c9;
  --text-faint:   #6d7a96;
  --accent:       #6ea8ff;
  --accent-soft:  #182b4d;
  --maize:        #ffd23f;
  --border:       #24304a;
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.45);
  --shadow-hover: 0 6px 14px rgba(0,0,0,.5), 0 22px 48px rgba(0,0,0,.55);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; color: var(--text); letter-spacing: -.01em; }
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--text-soft); font-weight: 500; font-size: .92rem;
  padding: 8px 12px; border-radius: 8px; transition: background .2s, color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }

.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--border); cursor: pointer;
  border-radius: 9px; color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle { width: 38px; height: 38px; margin-left: 6px; transition: color .2s, border-color .2s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle { display: none; width: 40px; height: 40px; flex-direction: column; gap: 4px; padding: 0; }
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }

/* ===== Hero ===== */
.hero {
  display: grid; grid-template-columns: 1fr 200px; gap: 44px; align-items: start;
  padding-top: 64px; padding-bottom: 28px;
}
.hero-photo { position: relative; width: 200px; }
.hero-photo img {
  width: 200px; aspect-ratio: 3 / 4; height: auto; border-radius: 24px; object-fit: cover;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
/* cat on top; hover cross-fades to the human underneath */
.hp-cat { position: absolute; top: 0; left: 0; transition: opacity .5s ease; }
.hero-photo:hover .hp-cat { opacity: 0; }
.hero-photo-note {
  margin: 8px 0 0; font-size: .8rem; font-style: italic;
  color: var(--text-faint); text-align: center;
}
.hero-text h1 {
  font-family: var(--font-serif); font-weight: 600; font-size: 3rem;
  margin: 0 0 6px; letter-spacing: -.02em; line-height: 1.05;
}
.hero-role { font-size: 1.12rem; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.hero-affil { color: var(--text-faint); font-size: .96rem; margin: 0 0 18px; }
.hero-bio { color: var(--text-soft); font-size: 1.02rem; margin: 0 0 14px; }
.hero-bio strong { color: var(--text); font-weight: 600; }

/* ===== Social links ===== */
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.social-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s, color .18s;
}
.social-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: var(--accent); border-color: var(--accent); text-decoration: none; }
.social-link svg { width: 17px; height: 17px; fill: currentColor; }

/* ===== Sections ===== */
.section { padding-top: 52px; }
.section-title {
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em;
  margin: 0 0 20px; padding-bottom: 10px; position: relative;
}
/* signature: blue underline with a maize tip */
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0 72%, var(--maize) 72% 100%);
  border-radius: 3px;
}
.section-note { color: var(--text-faint); font-size: .9rem; margin: -8px 0 22px; }
.star { color: var(--accent); font-weight: 700; }

/* ===== News ===== */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: grid; grid-template-columns: 80px 1fr; gap: 18px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.news-list li:last-child { border-bottom: none; }
.news-date { font-weight: 700; color: var(--accent); font-size: .92rem; white-space: nowrap; }
.news-date::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--maize); margin-right: 8px; vertical-align: 1px;
}
.news-body { color: var(--text-soft); }
.news-body strong { color: var(--text); }

/* ===== Publications ===== */
.pubs { display: flex; flex-direction: column; gap: 18px; }
.pub {
  display: flex; gap: 22px; align-items: center;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  scroll-margin-top: 90px;
}
.pub:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pub-thumb {
  position: relative; display: block;
  flex: 0 0 240px; width: 240px; aspect-ratio: 16 / 9; height: auto;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.pub-thumb video, .pub-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.pub-thumb:hover video, .pub-thumb:hover img { transform: scale(1.04); }
/* poster sits above the video and cross-fades out while it plays */
.pub-thumb video { z-index: 0; }
.thumb-poster { z-index: 2 !important; opacity: 1; transition: opacity .45s ease, transform .35s ease; }
.pub.playing .thumb-poster { opacity: 0; }
.pub-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pub-venue {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.pub-title { font-size: 1.08rem; font-weight: 700; margin: 0 0 6px; line-height: 1.35; letter-spacing: -.01em; }
.pub-authors { font-size: .9rem; color: var(--text-soft); margin: 0 0 8px; }
.pub-authors strong { color: var(--text); }
.pub-desc { font-size: .92rem; color: var(--text-faint); margin: 0 0 12px; }
.pub-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a {
  font-size: .82rem; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--border); padding: 5px 13px; border-radius: 8px;
  transition: background .18s, color .18s, border-color .18s;
}
.pub-links a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.project {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.project-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.project-title a { color: var(--text); display: inline-flex; align-items: baseline; }
.project-title a:hover { color: var(--accent); text-decoration: none; }
.project-desc { font-size: .92rem; color: var(--text-soft); margin: 0 0 14px; }
.project-link { margin-top: auto; font-size: .86rem; font-weight: 600; width: max-content; }
.project-links { margin-top: auto; }

/* nerfstudio wordmark: light/dark swap, slight lift on hover */
.ns-logo { height: 24px; width: auto; align-self: center; transition: transform .18s ease; }
.project-title a:hover .ns-logo { transform: translateY(-1px); }
.ns-logo-dark { display: none; }
html[data-theme="dark"] .ns-logo-light { display: none; }
html[data-theme="dark"] .ns-logo-dark { display: block; }
.ns-suffix { font-weight: 700; margin-left: 2px; }

/* project card with banner media (e.g. ControlledDreamGaussian) */
.project-banner {
  width: 100%; height: auto; margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff;
}

/* ===== Contact ===== */
.contact-text { color: var(--text-soft); max-width: 60ch; }

/* ===== Footer ===== */
.site-footer {
  margin-top: 72px; border-top: 1px solid var(--border);
  padding: 26px 0; background: var(--bg-elev);
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.site-footer p { margin: 0; color: var(--text-faint); font-size: .88rem; }
.to-top { font-size: .88rem; font-weight: 600; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { display: block; padding: 12px; }
  .nav-links li:last-child { display: flex; justify-content: flex-end; padding-top: 6px; }

  .hero { grid-template-columns: 1fr; gap: 22px; text-align: center; padding-top: 40px; }
  .hero-photo { margin: 0 auto; order: -1; }
  .hero-bio { text-align: left; }
  .social { justify-content: center; }
  .hero-text h1 { font-size: 2.3rem; }

  .pub { flex-direction: column; }
  .pub-thumb { flex: 0 0 auto; width: 100%; height: 190px; }
  .news-list li { grid-template-columns: 72px 1fr; gap: 12px; }
  .projects { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
