:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --text: #18181B;
  --text-secondary: #71717A;
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-light: #EEF2FF;
  --border: #E4E4E7;
  --tag-bg: #F4F4F5;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1140px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
}

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

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

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Navigation ========== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.925rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== Hero ========== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

#graph-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
}

.hero-headshot {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.75rem;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hero-name {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-status {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-hlf {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero-aside {
  font-size: 0.825rem;
  color: var(--text-secondary);
  opacity: 0.75;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.hero-location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.hero-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.hero-link svg {
  flex-shrink: 0;
}

/* ========== Sections ========== */

.section {
  padding: 7rem 0;
}

.section-alt {
  background: var(--surface);
}

.section-heading {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 2rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ========== Project Grid ========== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(79, 70, 229, 0.3);
}

.project-card.featured {
  grid-column: span 2;
  border-left: 3px solid var(--accent);
  padding-left: calc(2rem - 2px);
}

.project-card.minor {
  padding: 1.5rem;
}

.project-card .card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.project-card.featured .card-title {
  font-size: 1.5rem;
}

.project-card.minor .card-title {
  font-size: 1.1rem;
}

.project-card .card-tagline {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-card .card-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.project-card.minor .card-description {
  font-size: 0.875rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--tag-bg);
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
}

.card-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s;
}

.card-link:hover {
  gap: 0.5rem;
}

.card-link .arrow {
  transition: transform 0.2s;
}

.card-link:hover .arrow {
  transform: translateX(2px);
}

/* ========== Experience ========== */

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.exp-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

.exp-meta {
  padding-top: 0.125rem;
}

.exp-org {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.exp-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.exp-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exp-body li {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.exp-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* ========== Subsections (Leadership, Education) ========== */

.subsection-heading {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.exp-award {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
}

.exp-award::before {
  content: '★';
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

.leadership-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.leadership-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.leadership-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.leadership-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.education-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.edu-line {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== Publications ========== */

.publications-page {
  padding-top: calc(var(--nav-height) + 4rem);
  min-height: 80vh;
}

.pub-category {
  margin-bottom: 2.5rem;
}

.pub-category:last-child {
  margin-bottom: 0;
}

.pub-category-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.pub-item:last-child {
  border-bottom: none;
}

.pub-authors {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.pub-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pub-link {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ========== Footer ========== */

.footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.footer-location {
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

/* ========== Responsive ========== */

@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 250, 249, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: 90vh;
    padding: 5rem 1.5rem 3rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section-heading {
    margin-bottom: 2rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: span 1;
  }

  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .leadership-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .hero-headshot {
    width: 110px;
    height: 110px;
    margin-bottom: 1.25rem;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .hero-link {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .project-card {
    transition: none;
  }

  .card-link, .card-link .arrow {
    transition: none;
  }
}
