:root {
  --bg: #fdfcfb;
  --surface: #ffffff;
  --border: #e5e3df;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #0f5f4f;
  --accent-soft: #e6f2ef;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 6px 20px rgba(28, 25, 23, 0.05);
  --shadow-hover: 0 2px 4px rgba(28, 25, 23, 0.06), 0 12px 28px rgba(28, 25, 23, 0.09);
  --max-width: 900px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16140f;
    --surface: #1e1c17;
    --border: #34302a;
    --text: #f2efe9;
    --text-muted: #b8b2a7;
    --accent: #4fd1ae;
    --accent-soft: #1c332c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #16140f;
  --surface: #1e1c17;
  --border: #34302a;
  --text: #f2efe9;
  --text-muted: #b8b2a7;
  --accent: #4fd1ae;
  --accent-soft: #1c332c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
  flex-wrap: wrap;
}

.nav .brand {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav a { color: var(--text-muted); font-size: 0.92rem; }
.nav a:hover { color: var(--accent); }

section { padding: 56px 0; }
section + section { border-top: 1px solid var(--border); }

.hero {
  padding-top: 76px;
  padding-bottom: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px 360px at 88% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(480px 320px at 6% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)), var(--bg) 85%);
}
.hero::before {
  /* faint dot grid for texture, purely decorative */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, black, transparent 75%);
  mask-image: linear-gradient(180deg, black, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { justify-self: center; order: -1; }
  .links { justify-content: center; }
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.hero .role {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.hero .location {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}
.hero .bio {
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.hero-photo-img,
.hero-photo-fallback {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  border: 4px solid var(--surface);
}
.hero-photo-img { object-fit: cover; display: block; }
.hero-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #0a2e26));
  color: #fdfcfb;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.links a {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }

.links a.links-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfcfb;
  font-weight: 600;
}
.links a.links-primary:hover {
  color: #fdfcfb;
  box-shadow: var(--shadow-hover);
  filter: brightness(1.08);
}

h2.section-title {
  font-size: 1.4rem;
  margin: 0 0 24px;
  letter-spacing: -0.005em;
  position: relative;
  padding-left: 16px;
}
h2.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.card p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.card a { font-size: 0.86rem; font-weight: 600; }

.impact-list {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-muted);
}
.impact-list li { margin-bottom: 12px; }
.impact-list li::marker { color: var(--accent); }

.timeline { border-left: 2px solid var(--border); padding-left: 22px; }
.timeline-item { position: relative; margin-bottom: 26px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item .role { font-weight: 600; margin: 0; }
.timeline-item .meta { color: var(--text-muted); font-size: 0.88rem; margin: 2px 0 0; }

.subsection-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 48px 0 18px;
}

/* Education, Affiliations, Volunteer Affiliations, and Certifications each
   as their own full-width row, stacked below one another, rather than
   squeezed into a multi-column grid. A carousel needs real width to be worth
   scrolling, and each list grows independently, so each gets its own row. */
.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Defensive: a flex item containing a max-content track (the carousel)
   should not be allowed to grow past its own row's width on the item's
   account. Harmless, and cheap insurance against the exact class of overflow
   bug a CSS grid column hit here previously. */
.meta-card { min-width: 0; }

.meta-card h3 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meta-primary { margin: 0 0 4px; font-weight: 600; font-size: 0.98rem; }
.meta-sub { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

.badge {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

/*
  Publications and Media Coverage render as a slow, seamless, auto-scrolling
  carousel (setupCarousel in app.js). The track is duplicated content, so
  translating it exactly -50% loops with no visible seam. Hovering, tabbing
  a link into focus, or touching a card pauses it; prefers-reduced-motion
  turns it into a plain swipeable row with no motion at all.
*/
.carousel {
  position: relative;
  overflow: hidden;
  padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 20px, black calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, black 20px, black calc(100% - 20px), transparent);
}
.carousel-track {
  display: flex;
  gap: 18px;
  width: max-content;
}
.carousel-animated .carousel-track {
  animation: marquee var(--marquee-duration, 40s) linear infinite;
}
.carousel-track.paused { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* No JS, reduced motion requested, or too few items to loop: an ordinary,
   swipeable row instead of an animated one. */
.carousel:not(.carousel-animated) {
  overflow-x: auto;
  -webkit-mask-image: none;
  mask-image: none;
}

/*
  Same mechanism, sized for a row of badges contained inside a card (used by
  Affiliations and Certifications) rather than a full-bleed row of large
  thumbnail cards. No breakout padding, since it already sits inside the
  card's own padding; a narrower edge fade and tighter gap to match the
  smaller items.
*/
.carousel-compact {
  padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 14px, black calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, black 14px, black calc(100% - 14px), transparent);
}
.carousel-compact .carousel-track { gap: 8px; }

.pub-item {
  flex: 0 0 auto;
  width: 280px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.pub-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.pub-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--accent-soft);
}

.pub-body { padding: 16px 18px; flex: 1; }

.pub-item .pub-title { font-weight: 600; margin: 0 0 4px; line-height: 1.35; }
.pub-item .pub-status {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.pub-item p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.empty-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

footer {
  padding: 32px 0 56px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

[hidden] { display: none !important; }
