:root {
  --text: #1f1f1f;
  --muted: #666666;
  --line: #d8d8d8;
  --accent: #24406e;
  --max-width: 920px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: #ffffff;
}

a {
  color: inherit;
}

.site-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 28px 56px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: "Spectral", serif;
  font-size: 1.8rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  position: relative;
}

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

.site-nav a.active::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

.page {
  display: grid;
  gap: 36px;
}

.hero,
.page-intro {
  padding: 0;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 280px);
  gap: 40px;
  align-items: start;
}

.page-layout-home > .page-intro {
  grid-column: 1;
  grid-row: 1;
}

.page-layout-home > .page-sidebar {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.page-layout-home > .home-positions {
  grid-column: 1;
  grid-row: 2;
}

.page-main {
  min-width: 0;
  display: grid;
  gap: 36px;
}

.page-main > section + section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.page-sidebar {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 18px;
}

.page-sidebar-quiet {
  width: min(100%, 220px);
  justify-self: end;
  top: 40px;
}

.home-intro {
  padding-top: 0;
  border-top: 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 280px);
  gap: 40px;
  align-items: start;
}

.hero-copy {
  min-width: 0;
}

.hero h1,
.page-intro h1,
.panel h2,
.contact-card h2,
.topic-group h2,
.sidebar-block h2 {
  font-family: "Spectral", serif;
  font-weight: 600;
  line-height: 1.18;
  margin: 0;
}

.hero h1,
.page-intro h1 {
  max-width: none;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin-top: 8px;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 600;
}

.lede {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--muted);
}

.hero-note {
  margin: 14px 0 0;
  max-width: 56ch;
  line-height: 1.72;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
}

.button,
.text-link {
  display: inline;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
}

.button {
  padding: 0;
  background: none;
}

.button-secondary {
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.button:hover,
.button-secondary:hover,
.text-link:hover,
.inline-link:hover {
  border-bottom-color: var(--accent);
}

.page-actions {
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 28px;
}

.page > .content-block,
.page > .split-section,
.page > .grid,
.page > .cv-grid {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.page > .page-figure {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.contact-card,
.content-block,
.topic-group,
.page-figure,
.sidebar-block {
  padding: 0;
}

.panel p,
.content-block p,
.topic-group p,
.stack-list li,
.timeline li,
.publication-list li {
  line-height: 1.72;
  color: var(--muted);
}

.panel h2,
.contact-card h2,
.topic-group h2,
.sidebar-block h2 {
  font-size: 1.45rem;
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  overflow-wrap: anywhere;
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.contact-links li {
  margin: 0;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contact-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
}

.contact-icon-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.contact-icon-badge {
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.contact-icon-orcid {
  background: #a6ce39;
}

.contact-icon-arxiv {
  background: var(--accent);
}

.hero-media {
  justify-self: end;
  width: min(100%, 280px);
}

.portrait-frame {
  padding: 0;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.portrait-caption {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

.page-figure {
  margin: 0;
}

.page-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.page-figure figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.85fr);
  gap: 42px;
  align-items: start;
}

.publication-list,
.stack-list,
.timeline {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.publication-list li,
.timeline li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.publication-list li:last-child,
.timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pub-year,
.timeline-date {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
}

.stack-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stack-list li:first-child,
.timeline li:first-child,
.publication-list li:first-child {
  padding-top: 0;
}

.stack-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline.compact li {
  grid-template-columns: 112px minmax(0, 1fr);
}

.topic-group + .topic-group {
  margin-top: 24px;
}

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

.cv-column {
  display: grid;
  gap: 36px;
}

@media (max-width: 860px) {
  .site-header,
  .page-layout,
  .hero-layout,
  .split-section,
  .two-up,
  .three-up,
  .cv-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    justify-content: start;
    align-items: flex-start;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    gap: 8px 14px;
  }

  .hero h1,
  .page-intro h1 {
    max-width: none;
  }

  .page {
    gap: 28px;
  }

  .page-main {
    gap: 30px;
  }

  .hero-media {
    justify-self: start;
    width: min(100%, 260px);
  }

  .page-sidebar {
    position: static;
  }

  .page-layout-home > .page-intro,
  .page-layout-home > .page-sidebar,
  .page-layout-home > .home-positions {
    grid-column: auto;
    grid-row: auto;
  }

  .page-home .page-sidebar {
    width: min(100%, 240px);
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 22px 16px 40px;
  }

  .site-header {
    padding-bottom: 16px;
  }

  .wordmark {
    font-size: 1.55rem;
  }

  .site-nav {
    gap: 6px 12px;
  }

  .site-nav a {
    padding: 6px 0;
    font-size: 0.92rem;
  }

  .publication-list li,
  .timeline li,
  .timeline.compact li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero h1,
  .page-intro h1 {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
    line-height: 1.12;
  }

  .lede {
    margin-top: 14px;
    font-size: 0.97rem;
    line-height: 1.68;
  }

  .hero-note {
    line-height: 1.64;
  }

  .page {
    gap: 24px;
  }

  .page-main,
  .cv-column {
    gap: 28px;
  }

  .page-main > section + section,
  .page > .content-block,
  .page > .split-section,
  .page > .grid,
  .page > .cv-grid,
  .page > .page-figure {
    padding-top: 18px;
  }

  .stack-list li,
  .timeline li,
  .publication-list li {
    padding: 14px 0;
  }

  .timeline-date,
  .pub-year {
    display: block;
    margin-bottom: 2px;
  }

  .cv-grid {
    gap: 28px;
  }

  .page-home .portrait-frame {
    width: min(100%, 220px);
  }
}
