:root {
  --bg: #fcfcfa;
  --bg-elev: #ffffff;
  --text: #1b1b1a;
  --text-muted: #6a6a66;
  --border: #e6e4de;
  --accent: #3b5bdb;
  --accent-soft: rgba(59, 91, 219, 0.08);
  --max: 900px;
  --radius: 8px;
}

[data-theme="dark"] {
  --bg: #14151a;
  --bg-elev: #1b1d24;
  --text: #e7e7e4;
  --text-muted: #9a9b98;
  --border: #2a2c34;
  --accent: #8ea2ff;
  --accent-soft: rgba(142, 162, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav__brand {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.9rem;
}

.nav__links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  flex: none;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--accent-soft);
}

/* Layout */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section__title {
  font-size: 1.4rem;
  margin: 0 0 0.35rem;
}

.section__sub {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

/* Intro */
.intro {
  padding: 3.5rem 0 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.intro__text {
  flex: 1;
  min-width: 0;
}

.intro__photo {
  flex: none;
  width: 200px;
  margin: 0.35rem 0 0;
}

.intro__photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: block;
  background: var(--bg-elev);
}

.intro__name {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.intro__role {
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 1.5rem;
}

.intro__bio {
  margin: 0 0 1.25rem;
}

.intro__interests {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1.5rem;
}

.label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin-right: 0.5rem;
}

.intro__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
}

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.project__media {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}

.media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media::after {
  content: attr(data-label);
  padding: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.media img,
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project__title {
  font-size: 1.12rem;
  margin: 0 0 0.4rem;
}

.project__desc {
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.project__links {
  margin: 0;
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Publications */
.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.pub {
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.pub__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
}

.pub__venue {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.pubs__note {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 1.75rem 0 0;
}

/* Experience */
.exp {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exp__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
}

.exp__date {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-top: 0.15rem;
}

.exp__role {
  font-size: 1.05rem;
  margin: 0;
}

.exp__loc {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.exp__org {
  margin: 0.1rem 0 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.exp__note {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Contact */
.contact__text {
  margin: 0;
  max-width: 55ch;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
}

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Responsive */
@media (max-width: 560px) {
  .nav__links {
    display: none;
  }
  .intro {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }
  .intro__photo,
  .intro__photo img {
    width: 120px;
    height: 120px;
  }
  .project {
    grid-template-columns: 1fr;
  }
  .project__media {
    max-width: 260px;
  }
  .exp__item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}
