:root {
  --background: #f7f8f7;
  --surface: #ffffff;
  --surface-muted: #fbfcfb;
  --text: #17211f;
  --muted: #5f6b68;
  --accent: #087b67;
  --accent-dark: #055b4d;
  --accent-soft: #e8f5f1;
  --border: #dfe6e3;
  --shadow: 0 8px 30px rgba(22, 44, 38, 0.07);
  --radius: 13px;
  --content-width: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 5%, rgba(8, 123, 103, 0.055), transparent 24rem),
    var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
svg { width: 1.18rem; height: 1.18rem; fill: currentColor; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--text);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.page-shell {
  width: min(calc(100% - 1rem), var(--content-width));
  margin: 0.55rem auto;
  padding: clamp(1rem, 1.8vw, 1.65rem);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 230, 227, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* Compact overview: profile and research share one row on larger screens. */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(410px, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(1.5rem, 3vw, 2.6rem);
  align-items: stretch;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.profile {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: clamp(1.15rem, 2.4vw, 1.8rem);
  align-items: center;
  min-width: 0;
}

.portrait-wrap {
  width: 108px;
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-soft), #f2f6f5);
  box-shadow: 0 8px 22px rgba(16, 54, 45, 0.11);
}
.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.portrait-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.profile-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(2rem, 3.25vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.role {
  margin: 0.22rem 0 0.58rem;
  color: var(--muted);
  font-size: 0.96rem;
}
.email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--accent); }

.research-section {
  display: grid;
  align-content: center;
  gap: 0.55rem;
  min-width: 0;
  padding-left: clamp(1.35rem, 2.5vw, 2.1rem);
  border-left: 1px solid var(--border);
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.section-heading h2 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.section-icon { display: inline-flex; color: var(--accent); }
.book-icon { color: var(--text); }
.research-text {
  margin: 0;
  color: #34413e;
  max-width: 760px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.publications-section { padding-top: 0.95rem; }
.publications-toolbar {
  display: grid;
  grid-template-columns: auto minmax(560px, 1fr);
  gap: 1.35rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.publications-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.publication-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}
.search-field { position: relative; min-width: 0; }
.search-field svg {
  position: absolute;
  left: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  color: var(--muted);
  pointer-events: none;
}
.filter-options {
  display: grid;
  grid-template-columns: 128px 145px auto;
  gap: 0.55rem;
  align-items: center;
}
.filter-toggle { display: none; }
input, select {
  width: 100%;
  min-height: 37px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}
input { padding: 0.52rem 0.7rem 0.52rem 2.35rem; }
select { padding: 0.52rem 2rem 0.52rem 0.72rem; }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.reset-button {
  min-height: 37px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 0.3rem;
}
.reset-button:hover { color: var(--accent); }

.year-group + .year-group { margin-top: 1.45rem; }
.year-heading {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin: 0 0 0.55rem;
  color: var(--accent-dark);
  font-size: 0.95rem;
}
.year-heading::after {
  content: "";
  width: 62px;
  height: 1px;
  background: var(--border);
}
.publication-stack { display: grid; gap: 0.6rem; }
.publication-card {
  padding: clamp(0.82rem, 1.4vw, 1.05rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-muted));
  box-shadow: 0 2px 8px rgba(22, 44, 38, 0.035);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.publication-card:hover {
  transform: translateY(-2px);
  border-color: #c6d7d1;
  box-shadow: 0 8px 22px rgba(22, 44, 38, 0.075);
}
.publication-title {
  margin: 0 0 0.28rem;
  color: var(--accent-dark);
  font-size: clamp(0.98rem, 1.45vw, 1.08rem);
  line-height: 1.3;
}
.publication-title a { text-decoration: none; }
.publication-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.authors, .venue { margin: 0; font-size: 0.82rem; }
.authors { color: #2f3a38; }
.venue { margin-top: 0.18rem; color: var(--muted); }
.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.52rem;
}
.topic-chip {
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.64rem;
  font-weight: 600;
}
.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 31px;
  padding: 0.34rem 0.6rem;
  border: 1px solid #c9d6d2;
  border-radius: 7px;
  background: white;
  color: var(--accent-dark);
  text-decoration: none;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}
.action-link svg { width: 0.86rem; height: 0.86rem; }
.action-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}
footer a { color: var(--accent-dark); text-decoration: none; }

.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;
}

@media (max-width: 1040px) {
  .intro-grid {
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.8fr);
    gap: 1.4rem;
  }
  .publications-toolbar {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .publications-title-row { justify-content: space-between; }
}

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.8rem 1rem 1.15rem;
  }
  .intro-grid {
    display: block;
    padding-bottom: 0.75rem;
  }
  .profile {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 0.78rem;
  }
  .portrait-wrap { width: 78px; border-radius: 9px; }
  .eyebrow { display: none; }
  h1 { font-size: clamp(1.42rem, 6.5vw, 1.7rem); line-height: 1.05; }
  .role { margin: 0.12rem 0 0.38rem; font-size: 0.8rem; }
  .email-link { gap: 0.36rem; font-size: 0.65rem; }
  .email-link svg { flex: 0 0 auto; width: 0.92rem; height: 0.92rem; }
  .research-section {
    margin-top: 0.72rem;
    padding: 0.72rem 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    gap: 0.36rem;
  }
  .section-heading { gap: 0.52rem; }
  .section-heading h2 { font-size: 0.88rem; }
  .research-text {
    padding-left: 1.7rem;
    font-size: 0.74rem;
    line-height: 1.42;
  }
  .publications-section { padding-top: 0.75rem; }
  .publications-toolbar { gap: 0.55rem; margin-bottom: 0.65rem; }
  .publication-count { font-size: 0.7rem; }

  /* Search stays visible; secondary filters are collapsed into one button. */
  .filters {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.48rem;
  }
  .filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-height: 37px;
    padding: 0.48rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
  }
  .filter-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .filter-toggle svg { width: 0.95rem; height: 0.95rem; }
  .filter-badge {
    display: grid;
    min-width: 1.05rem;
    height: 1.05rem;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 0.62rem;
    line-height: 1;
  }
  .filter-badge[hidden] { display: none; }
  .filter-options {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.48rem;
    padding-top: 0.05rem;
  }
  .filters.is-open .filter-options { display: grid; }
  .reset-button { padding-inline: 0.5rem; }
  input, select { min-height: 37px; font-size: 0.78rem; }

  .year-group + .year-group { margin-top: 1.2rem; }
  .year-heading { margin-bottom: 0.45rem; font-size: 0.9rem; }
  .publication-card { padding: 0.82rem; border-radius: 10px; }
  .publication-title { font-size: 0.94rem; }
  .authors, .venue { font-size: 0.76rem; }
  .topic-list { display: none; }
  .publication-actions { margin-top: 0.58rem; }
}

@media (max-width: 430px) {
  .page-shell { padding-inline: 0.85rem; }
  .profile { grid-template-columns: 70px minmax(0, 1fr); gap: 0.7rem; }
  .portrait-wrap { width: 70px; }
  h1 { font-size: 1.36rem; }
  .role { font-size: 0.76rem; }
  .email-link { font-size: 0.61rem; }
  .research-text { font-size: 0.71rem; }
  .filter-options { grid-template-columns: 1fr 1fr; }
  .filter-options .reset-button { grid-column: 1 / -1; min-height: 29px; }
  .publication-title { font-size: 0.91rem; }
  .authors, .venue { font-size: 0.73rem; }
  .action-link { font-size: 0.7rem; padding-inline: 0.52rem; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
