@font-face {
  font-family: Avenir;
  src: local('Avenir-Book'), local('Avenir Book');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Avenir;
  src: local('Avenir-Medium'), local('Avenir Medium');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Avenir;
  src: local('Avenir-Heavy'), local('Avenir Heavy');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #f7f1e7;
  --surface: #fffbf4;
  --surface-hover: #efe4d5;
  --text: #35251d;
  --body-text: #503d32;
  --muted: #6c5748;
  --line: #dfd0bf;
  --control-border: #957c68;
  --accent: #874820;
  --accent-hover: #633218;
  --on-accent: #fffbf4;
  --gutter: clamp(1rem, 4vw, 3rem);
  --header-height: 4.5rem;
  font-family: Avenir, 'Avenir Next', system-ui, sans-serif;
  line-height: 1.55;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
}

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

[hidden] {
  display: none !important;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--body-text);
  background: var(--background);
}

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

h1, h2, h3, h4, strong {
  color: var(--text);
}

h1, h2, h3, h4 {
  line-height: 1.14;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 65%, transparent);
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  color: var(--on-accent);
  background: var(--accent);
}

sup {
  line-height: 0;
}

.site-width {
  width: min(69rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 3;
  top: 0.75rem;
  left: var(--gutter);
  padding: 0.5rem 0.75rem;
  background: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--background);
  background: color-mix(in srgb, var(--background) 96%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner,
.site-nav {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: calc(var(--header-height) - 1px);
  gap: 0.75rem;
  justify-content: space-between;
}

.wordmark {
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.07em;
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.site-nav {
  gap: clamp(0.75rem, 2.75vw, 2.25rem);
}

.site-nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--body-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--accent);
}

.site-nav a[aria-current='location'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

.site-nav .nav-cv {
  min-height: 2.4rem;
  padding-inline: 0.9rem;
  border: 1px solid var(--control-border);
  border-radius: 0.25rem;
  color: var(--text);
}

.site-nav .nav-cv:hover,
.site-nav .nav-cv[aria-current] {
  border-color: var(--accent);
}

main {
  flex: 1;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 7.4vw, 6.5rem);
  padding-block: clamp(3.25rem, 6vw, 5.25rem);
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.intro h1 {
  font-size: clamp(3.25rem, 7.4vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.intro-role {
  margin-block: 1.35rem 0.75rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.25vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.intro-copy > p {
  max-width: 33rem;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--control-border);
  border-radius: 0.25rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.button-primary {
  border-color: var(--accent);
  color: var(--on-accent);
  background: var(--accent);
}

.button-primary:hover {
  border-color: var(--accent-hover);
  color: var(--on-accent);
  background: var(--accent-hover);
}

.portrait-frame {
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--surface);
}

.portrait-crop {
  --crop-width: 1170;
  --crop-height: 1300;
  position: relative;
  overflow: hidden;
  border-radius: 0.125rem;
  aspect-ratio: var(--crop-width) / var(--crop-height);
}

.portrait-crop img {
  /* Place the eye midpoint near the horizontal center and at the upper third. */
  position: absolute;
  top: calc(100% / 3 - 100% * 1156 / var(--crop-height));
  left: calc(46% - 100% * 868 / var(--crop-width));
  width: calc(100% * 3000 / var(--crop-width));
  height: auto;
}

.section {
  padding-block: clamp(2.25rem, 4.5vw, 4rem);
  border-top: 1px solid var(--line);
}

.section > h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 630;
  letter-spacing: -0.06em;
}

.section-intro {
  max-width: 44rem;
}

.updates {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 3fr);
  align-items: start;
  gap: 1.75rem;
}

.updates h2 {
  margin-bottom: 0;
}

.timeline li,
.experience-list li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
}

.timeline li {
  align-items: baseline;
  padding-block: 0.7rem;
}

.timeline li:first-child {
  padding-top: 0.35rem;
}

.timeline li + li,
.experience-list li + li {
  border-top: 1px solid var(--line);
}

.updates-scroll {
  max-height: var(--updates-height, 30rem);
  min-width: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 0.75rem;
  border-block: 1px solid var(--line);
}

.timeline time,
.experience-date,
.paper-meta {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.selected-papers {
  margin-top: 1.75rem;
}

.selected-papers > h3 {
  font-size: 1.4rem;
}

.selected-papers .papers {
  margin-top: 0.85rem;
}

@media (width > 54rem) {
  .selected-papers .paper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.papers {
  margin-top: 1.75rem;
}

.paper-filters,
.filter-options,
.papers-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.paper-filters {
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.filter-options label {
  position: relative;
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.filter-options label::after {
  position: absolute;
  right: 0.9rem;
  bottom: 1.2rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1px solid var(--body-text);
  border-bottom: 1px solid var(--body-text);
  pointer-events: none;
  transform: rotate(45deg);
  content: '';
}

.filter-options select {
  min-height: 2.75rem;
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: 0.25rem;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 1rem;
  appearance: none;
}

.filter-options select:hover {
  border-color: var(--accent);
}

.paper-count,
.contribution-note {
  color: var(--muted);
  font-size: 0.875rem;
}

.paper-count {
  margin-bottom: 0.55rem;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.paper-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: clamp(1rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.paper-thumbnail {
  position: relative;
  display: block;
  margin-bottom: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: #fff;
  aspect-ratio: 16 / 9;
}

.paper-thumbnail:hover {
  border-color: var(--accent);
}

.paper-thumbnail img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.55rem;
  object-fit: contain;
}

.paper-card h2,
.paper-card h4 {
  font-size: 1.1rem;
  font-weight: 630;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.paper-authors,
.paper-note {
  font-size: 0.925rem;
}

.author-order,
.paper-note {
  color: var(--muted);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.3rem;
}

.paper-links a {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--control-border);
  border-radius: 0.2rem;
  font-size: 0.875rem;
  text-decoration: none;
}

.paper-links a:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.papers-footer {
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.experience-list {
  max-width: 52rem;
}

.experience-list li {
  align-items: baseline;
  padding-block: 1rem;
}

.experience-list h3 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.experience-role {
  color: var(--text);
}

.experience-mentors {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.standalone {
  padding-block: clamp(2.75rem, 7vw, 5rem);
  border-top: 0;
}

.standalone h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  font-weight: 650;
  letter-spacing: -0.078em;
}

.cv-page .intro-links {
  margin-top: 1.75rem;
}

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
}

.footer-inner {
  justify-content: space-between;
}

.footer-name {
  color: var(--text);
  font-weight: 600;
}

.footer-inner a {
  font-size: 0.9rem;
}

@media (max-width: 54rem) {
  .paper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .updates {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

@media (max-width: 40rem) {
  :root {
    --header-height: 3.75rem;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .wordmark {
    font-size: 1.4rem;
  }

  .site-nav {
    gap: clamp(0.45rem, 2.1vw, 0.9rem);
  }

  .site-nav a {
    font-size: clamp(0.75rem, 3.4vw, 0.9rem);
  }

  .site-nav .nav-cv {
    min-height: 2.15rem;
    padding-inline: 0.45rem;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .intro h1 {
    font-size: clamp(3rem, 12vw, 5rem);
  }

  .portrait-frame {
    width: min(100%, 25rem);
  }

  .portrait-crop {
    --crop-height: 1170;
  }

  .timeline li {
    grid-template-columns: 6.75rem minmax(0, 1fr);
    gap: 0.7rem;
  }

  .experience-list li {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

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

@media (forced-colors: active) {
  .filter-options select {
    appearance: auto;
  }

  .filter-options label::after {
    display: none;
  }
}
