/* Colors and page defaults */
:root {
  --ink: #222625;
  --muted: #5c6461;
  --accent: #28594a;
  --line: #e3e7e5;
  --paper: #fff;
  --tint: #f5f7f6;
  /* Shared spacing for publications, software, courses, theses, and videos. */
  --item-title-line-height: 1.45;
  --item-line-height: 1.5;
  --item-gap: 0.25rem;
  --item-spacing: 1.3rem;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
a:hover {
  color: #132c24;
  text-decoration-thickness: 2px;
}
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
::selection {
  background: #dceae3;
}

/* Page layout and navigation */
.wrap {
  width: min(100% - 3rem, 960px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 5;
  background: white;
  padding: 0.6rem 1rem;
}
.skip:focus {
  top: 1rem;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
}
nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

/* Profile introduction */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 3.5rem;
  align-items: start;
  padding: 3rem 0 2.5rem;
}
.intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 0.6rem;
}
.role {
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.affiliation {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}
.group-links {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.portrait {
  display: block;
  width: 216px;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin-top: 1.6rem;
  font-size: 0.9rem;
}

/* Homepage sections */
.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.section-heading .section-title {
  margin: 0;
}
.section-heading a {
  font-size: 0.9rem;
  white-space: nowrap;
}
p {
  margin: 0 0 1rem;
}
.research-text {
  max-width: 46rem;
}

/* Publication lists */
.papers {
  list-style: none;
  margin: 0;
  padding: 0;
}
.paper {
  padding: var(--item-spacing) 0;
  border-top: 1px solid var(--line);
}
.paper:first-child {
  border-top: 0;
  padding-top: 0;
}
.paper-title,
.item-title {
  font-size: 1.04rem;
  font-weight: 600;
  line-height: var(--item-title-line-height);
  margin: 0 0 var(--item-gap);
}
.paper-title a,
.item-title a {
  color: var(--ink);
  text-decoration: none;
}
.paper-title a:hover,
.item-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.authors,
.item-detail {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 var(--item-gap);
  line-height: var(--item-line-height);
}
.venue,
.item-meta {
  font-size: 0.9rem;
  margin: 0 0 var(--item-gap);
  line-height: var(--item-line-height);
}
.item-meta {
  color: var(--muted);
}
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.875rem;
  align-items: baseline;
  line-height: var(--item-line-height);
  margin: 0;
}
.paper-links a {
  text-decoration: none;
}
.paper-links a:hover {
  text-decoration: underline;
}
.paper-note {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Theses below the selected papers */
.thesis {
  padding-top: var(--item-spacing);
  border-top: 1px solid var(--line);
}
.thesis + .thesis {
  margin-top: var(--item-spacing);
}
.thesis h3 {
  font-size: 1rem;
  margin: 0 0 var(--item-gap);
  line-height: var(--item-title-line-height);
  font-weight: 600;
}
.thesis-title {
  font-weight: 400;
  font-style: italic;
}

/* Software, teaching, and contact */
.subtle {
  color: var(--muted);
  font-size: 0.94rem;
}
.course-list {
  padding: 0;
  list-style: none;
  margin: 0;
}
.course-list li + li {
  margin-top: 1rem;
}
.course-list strong {
  display: block;
  font-weight: 500;
  line-height: var(--item-title-line-height);
  margin-bottom: var(--item-gap);
}
.course-list span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: var(--item-line-height);
}
/* Static course previews link out; no third-party player is loaded. */
.video-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 1.25rem;
  color: inherit;
  text-decoration: none;
}
.video-preview img {
  display: block;
  width: 160px;
  max-width: 40%;
  height: auto;
  border-radius: 3px;
}
.video-preview-caption {
  display: grid;
  gap: var(--item-gap);
  font-size: 0.875rem;
  line-height: var(--item-line-height);
  color: var(--muted);
}
.video-preview-caption strong {
  font-weight: 500;
  color: var(--ink);
  line-height: var(--item-title-line-height);
}
.video-preview-action {
  font-size: 0.8rem;
  color: var(--accent);
}
.video-preview:hover .video-preview-action {
  text-decoration: underline;
}
.teaching-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
  margin-top: 1rem;
  font-size: 0.875rem;
}
.teaching-channel img {
  flex-shrink: 0;
  width: 29px;
  height: 20px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.contact-grid address {
  font-style: normal;
  font-size: 0.94rem;
  color: var(--muted);
}
.contact-grid .email {
  font-size: 1.1rem;
}
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 1.8rem 0 2.8rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}
.footer a {
  color: var(--muted);
}
.footer nav {
  gap: 0.5rem 1.3rem;
}
.footer nav a {
  font-size: inherit;
  text-decoration: underline;
}
.notice-page {
  max-width: 46rem;
}
.notice-page address {
  font-style: normal;
}

/* Teaching archive */
.teaching-course h3 {
  font-size: 1.04rem;
  font-weight: 500;
  line-height: var(--item-title-line-height);
  margin: 0 0 var(--item-gap);
}
.teaching-course .subtle {
  margin: 0 0 var(--item-gap);
  line-height: var(--item-line-height);
}
.teaching-courses li + li {
  margin-top: var(--item-spacing);
  padding-top: var(--item-spacing);
  border-top: 1px solid var(--line);
}

/* Publications and teaching archive layout */
.page-intro {
  padding: 3.5rem 0 2.1rem;
}
.page-intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 2.6rem;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin: 0 0 0.7rem;
}
.page-intro p {
  color: var(--muted);
}
.year-nav {
  display: flex;
  gap: 0.4rem 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-top: 1.3rem;
}
.year-section {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 2rem;
  scroll-margin-top: 2rem;
}
.year-section h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.5;
}
.year-section .paper-title {
  font-size: 1rem;
}
.citation {
  width: 100%;
}
.citation summary {
  cursor: pointer;
  color: var(--accent);
  width: fit-content;
  font-size: 0.875rem;
}
.citation pre {
  margin: 0.75rem 0 0;
  background: var(--tint);
  padding: 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 3px;
}
body,
main,
article {
  overflow-wrap: break-word;
}

/* Small screens */
@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 2.5rem);
  }
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem 0;
  }
  nav {
    gap: 0.5rem 1.2rem;
  }
  .intro {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 1.2rem;
    padding: 2.8rem 0 2.4rem;
  }
  .portrait {
    width: 112px;
  }
  .intro h1 {
    font-size: 2.4rem;
    max-width: 13rem;
  }
  .intro-body {
    grid-column: 1/-1;
  }
  .intro-name {
    grid-column: 1;
    grid-row: 1;
  }
  .intro-photo {
    grid-column: 2;
    grid-row: 1;
  }
  .role {
    font-size: 0.9rem;
    margin-bottom: 0;
  }
  .section {
    padding: 2rem 0;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .footer {
    flex-direction: column;
    gap: 0.5rem;
  }
  .year-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .page-intro {
    padding: 2.5rem 0 2rem;
  }
  .page-intro h1 {
    font-size: 2.2rem;
  }
}
@media (min-width: 641px) {
  .intro-name {
    grid-column: 1;
    grid-row: 1;
  }
  .intro-photo {
    grid-column: 2;
    grid-row: 1/3;
  }
  .intro-body {
    grid-column: 1;
    grid-row: 2;
  }
  .intro {
    row-gap: 0;
    grid-template-rows: min-content 1fr;
  }
}

/* Accessibility and printing */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  nav,
  .quick-links,
  .year-nav,
  .paper-links,
  .skip,
  .footer {
    display: none;
  }
  .wrap {
    width: 100%;
    max-width: none;
  }
  body {
    font-size: 11pt;
  }
  a {
    color: inherit;
  }
  .intro {
    padding: 1rem 0;
  }
  .section {
    padding: 1rem 0;
  }
  .paper {
    break-inside: avoid;
  }
  .portrait {
    width: 100px;
    height: auto;
  }
}
