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

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #eef2f8;
  --text: #101521;
  --muted: #556074;
  --line: #d7ddea;
  --brand: #1f4bb8;
  --brand-deep: #17357d;
  --accent: #0f766e;
  --max: 1120px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
}

html[data-theme="dark"] {
  --bg: #0d1423;
  --surface: #141d2f;
  --surface-alt: #101828;
  --text: #e8edf7;
  --muted: #a4b2c9;
  --line: #26344f;
  --brand: #7aa2ff;
  --brand-deep: #9db9ff;
  --accent: #2dd4bf;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-deep);
}

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

.container {
  width: min(var(--max), 100% - 2.5rem);
  margin-inline: auto;
}

.narrow {
  width: min(760px, 100% - 2.5rem);
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -90px;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  top: 14px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 88%, white 12%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.93rem;
}

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

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--surface);
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 3rem;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(130% 120% at 0% 0%, color-mix(in oklab, var(--surface) 75%, white 25%), var(--bg));
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(1.4rem, 3.2vw, 3.5rem);
  align-items: center;
}

.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.kicker {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 0.9rem;
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.015em;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.05rem, 4.4vw, 3.3rem);
}

.hero-copy h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
}

.page-title {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
}

.lead {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.2vw, 1.16rem);
  max-width: 62ch;
}

.hero-actions {
  margin-top: 1.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.58rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
}

.btn:hover {
  border-color: color-mix(in oklab, var(--brand) 45%, var(--line));
  color: var(--text);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}


/* Sections */
.section {
  padding: clamp(3rem, 6vw, 4.8rem) 0;
  border-bottom: 1px solid var(--line);
}

.section-alt {
  background: color-mix(in oklab, var(--surface-alt) 80%, var(--bg));
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
}

.section-intro {
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 78ch;
}

#education.section {
  padding-bottom: clamp(1.5rem, 3vw, 2.4rem);
}

.education-list {
  list-style: none;
  margin-top: 0.25rem;
  display: grid;
  gap: 0.7rem;
}

.education-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.education-list p {
  margin: 0;
}

.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.05rem;
}

.panel-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
}

.panel-card p {
  color: var(--muted);
}

.publication-grid {
  list-style: none;
  margin: 1.2rem auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.pub-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.pub-card h3 {
  font-size: 1.17rem;
  margin-bottom: 0.7rem;
}

.pub-topline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.pub-year,
.pub-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.21rem 0.56rem;
}

.pub-status {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
  color: color-mix(in oklab, var(--accent) 82%, black 18%);
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
}

.pub-authors {
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pub-venue {
  color: var(--text);
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.course-list,
.service-list {
  list-style: none;
  margin-top: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.course-list li,
.service-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.course-list li {
  display: grid;
  gap: 0.35rem;
}

.course-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.course-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.course-about summary {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.course-about p {
  color: var(--muted);
  font-size: 0.93rem;
  margin-top: 0.35rem;
}

/* ── Service section ── */

.service-subhead {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-subhead:first-of-type {
  margin-top: 0.5rem;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-list li {
  padding: 0.35rem 0;
  font-size: 0.93rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 50%, transparent);
}

.service-list li:last-child {
  border-bottom: none;
}

.service-year {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.service-highlight {
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  background: color-mix(in oklab, var(--brand) 6%, var(--surface));
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 0.4rem 0 0.6rem;
}

.service-journals {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.8;
}

.service-details summary {
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-details .service-list {
  margin-top: 0.3rem;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.links-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Explorer-specific */
.explorer-intro {
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--surface) 70%, white 30%), var(--bg));
}

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.38rem 0.76rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.chip.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

#pubSearch {
  margin-left: auto;
  min-width: min(340px, 100%);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.55rem 0.75rem;
  font-size: 0.93rem;
  background: var(--surface);
  color: var(--text);
}

#pubSearch::placeholder {
  color: color-mix(in oklab, var(--muted) 80%, white 20%);
}

#pubSearch:focus,
.chip:focus,
.theme-toggle:focus,
.menu-toggle:focus,
.btn:focus,
a:focus {
  outline: 2px solid color-mix(in oklab, var(--brand) 75%, white 25%);
  outline-offset: 2px;
}

.publication-groups {
  display: grid;
  gap: 1.3rem;
}

.pub-group h3 {
  font-size: 1.24rem;
}

.pub-group .citation-list {
  margin-top: 0.65rem;
}

.citation-list {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  gap: 1.1rem;
}

.citation-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(12,20,30,0.03);
  padding: 1.25rem 1.4rem;
  transition: box-shadow 0.15s;
}

.citation-item:hover {
  box-shadow: 0 4px 16px rgba(12,20,30,0.06);
}

.citation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.citation-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.citation-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.citation-authors,
.citation-venue,
.citation-note {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.citation-note {
  margin-top: 0.35rem;
}

.citation-summary {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.citation-abstract {
  margin-top: 0.55rem;
}

.citation-abstract summary {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  user-select: none;
}

.citation-abstract summary:hover {
  text-decoration: underline;
}

.citation-abstract p {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.pub-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  vertical-align: middle;
}

.pub-badge--forthcoming {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}

.pub-badge--award {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.citation-actions {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.small-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--brand);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
  letter-spacing: 0.01em;
}

.small-btn:hover {
  background: #f0f4fa;
  border-color: #d0dff5;
}

a.small-btn {
  display: inline-block;
}

.small-btn--accent {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
  font-weight: 700;
}

.small-btn--accent:hover {
  background: #f0f4fa;
  border-color: #d0dff5;
}

/* Media callout on publication cards */
.citation-media {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Standalone media section */
.media-list {
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.media-item {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(12,20,30,0.03);
  transition: box-shadow 0.15s;
}

.media-item:hover {
  box-shadow: 0 4px 16px rgba(12,20,30,0.06);
}

.media-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.media-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.media-outlet {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.3;
}

.media-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.media-headline {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--brand);
  text-decoration: none;
}

a.media-headline:hover {
  text-decoration: underline;
}

span.media-headline {
  color: var(--text);
}

.media-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 640px) {
  .media-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

.pipeline-list,
.card-grid,
.service-grid,
.plain-list {
  margin-top: 0.6rem;
}

.pipeline-list {
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.pipeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.pipeline-status {
  margin-bottom: 0.45rem;
  display: inline-flex;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, var(--line));
  color: color-mix(in oklab, var(--accent) 85%, black 15%);
  border-radius: 999px;
  font-size: 0.73rem;
  padding: 0.18rem 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.pipeline-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.pipeline-item p {
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.teaching-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.85rem;
}

.teaching-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.teaching-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.plain-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.plain-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.58rem;
}

.site-footer {
  padding: 1.4rem 0 1.8rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

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

@media (max-width: 1000px) {
  .hero-grid,
  .split-grid,
  .service-grid,
  .publication-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #pubSearch {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    right: 1.25rem;
    min-width: 220px;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: var(--shadow);
  }

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

  .hero {
    padding-top: 2.4rem;
  }


  .container,
  .narrow {
    width: min(var(--max), 100% - 1.5rem);
  }
}
