:root {
  --stanford-red: rgb(140, 21, 21);
  --stanford-red-dark: rgb(130, 0, 0);
  --ink: rgb(46, 45, 41);
  --muted: rgb(83, 86, 90);
  --line: rgb(222, 222, 218);
  --paper: rgb(255, 255, 255);
  --soft: rgb(247, 248, 248);
  --blue: rgb(54, 96, 118);
  --green: rgb(56, 111, 94);
  --max-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--muted);
  font-family: "Source Sans Pro", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--stanford-red);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--stanford-red);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--stanford-red);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 760px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h3 {
  font-size: 1.16rem;
}

h4 {
  font-size: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 600;
}

.site-nav a.active {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--stanford-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.nav-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--ink);
}

main {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 44px;
  padding: 64px 0 40px;
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(4rem, 12vw, 7.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero h1 span {
  display: block;
}

.eyebrow,
.section-kicker,
.tag {
  color: var(--stanford-red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 560px;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(1.18rem, 2.4vw, 1.5rem);
  line-height: 1.36;
  text-wrap: pretty;
}

.hero-actions,
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
}

.project-card .profile-links,
.publication-row .profile-links,
.person-card .profile-links,
.resource-item .profile-links {
  gap: 14px;
  margin-top: 14px;
  font-size: 0.94rem;
}

.strong-link,
.profile-links a,
.text-link {
  color: var(--ink);
  font-weight: 700;
}

.strong-link::after,
.text-link::after {
  content: "→";
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.strong-link:hover::after,
.text-link:hover::after {
  transform: translateX(4px);
}

.hero-media {
  position: relative;
  margin: 0;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  filter: saturate(0.9) contrast(1.03);
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: -1;
}

.hero-media figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.split-intro {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1fr);
  gap: 48px;
}

.body-copy {
  display: grid;
  gap: 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-top: 10px;
}

.inline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.news-list,
.project-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.news-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.news-item time {
  color: var(--stanford-red);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.news-item h3 {
  margin-bottom: 8px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgb(198, 198, 192);
  box-shadow: 0 12px 28px rgba(46, 45, 41, 0.09);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover img {
  transform: scale(1.025);
}

.project-card div {
  padding: 18px;
}

.project-card h3,
.research-row h3,
.publication-row h3 {
  margin: 8px 0 10px;
}

.connect-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.link-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 26px;
}

.link-columns a {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.2s ease;
}

.link-columns a:hover,
.link-columns a:focus-visible {
  text-decoration: none;
  border-bottom-color: var(--stanford-red);
}

.site-footer {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 10px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.93rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.site-footer p:first-child {
  color: var(--ink);
  font-weight: 700;
}

.page-hero {
  padding: 80px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.7fr);
  gap: 42px;
  align-items: end;
}

.page-hero h1 {
  margin-top: 12px;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  max-width: 780px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-hero img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: 8px;
}

.research-hero {
  display: block;
  max-width: 820px;
}

.profile-feature {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.role {
  margin: 6px 0 14px;
  color: var(--blue);
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.avatar.large,
.portrait.large {
  width: 132px;
  font-size: 2rem;
}

.portrait {
  width: 92px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.people-grid,
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.compact-people-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.person-card,
.theme-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.person-card:hover,
.theme-grid article:hover {
  border-color: rgb(198, 198, 192);
  box-shadow: 0 8px 20px rgba(46, 45, 41, 0.06);
}

.alumni-card {
  padding: 18px;
}

.person-card h3,
.theme-grid h3 {
  margin: 16px 0 8px;
}

.detail-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.research-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.research-row img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

.publication-row {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

.publication-row:hover {
  background: var(--soft);
}

.publication-row h3 {
  font-size: 1.05rem;
}

.publication-row p {
  font-size: 0.95rem;
}

.publication-row .pub-venue {
  font-size: 0.85rem;
}

.publication-row .profile-links {
  font-size: 0.88rem;
}

.pub-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.pub-media img,
.pub-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-venue {
  margin-top: 10px;
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.note {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.9rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
}

.resource-grid h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.resource-item,
.dataset-list {
  padding-top: 18px;
}

.dataset-list {
  display: grid;
  gap: 12px;
}

.dataset-list a {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.2s ease;
}

.dataset-list a:hover,
.dataset-list a:focus-visible {
  text-decoration: none;
  border-bottom-color: var(--stanford-red);
}

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .site-header {
    align-items: center;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 16px 10px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
  }

  .site-nav.open {
    display: grid;
    gap: 14px;
  }

  .hero,
  .page-hero,
  .split-intro,
  .connect-band,
  .profile-feature,
  .research-row,
  .publication-row,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 52px;
  }

  .hero-media::before {
    inset: 12px -10px -10px 12px;
  }

  .project-grid,
  .people-grid,
  .theme-grid,
  .link-columns {
    grid-template-columns: 1fr;
  }

  .inline-heading {
    align-items: start;
    flex-direction: column;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .publication-row {
    gap: 14px;
  }

  .pub-media {
    max-width: 340px;
  }
}

@media (min-width: 560px) and (max-width: 820px) {
  .project-grid,
  .people-grid,
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
