:root {
  --bg: #faf9f6;
  --bg-alt: #f0eee7;
  --text: #1c1d21;
  --text-muted: #5b5d66;
  --accent: #1d3a5f;
  --accent-soft: #34527c;
  --border: #e2ded3;
  --card-bg: #ffffff;
  --max-width: 880px;
  --font: Futura, "Futura PT", "Century Gothic", CenturyGothic, AppleGothic, "URW Gothic", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1b1e24;
    --text: #eceef1;
    --text-muted: #a3a7b0;
    --accent: #7ea6d8;
    --accent-soft: #9cbce3;
    --border: #2b2f37;
    --card-bg: #1b1e24;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  font-size: 17px;
}

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

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.brand {
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text);
}

.nav a {
  margin-left: 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.nav a:first-child { margin-left: 0; }
.nav a:hover { color: var(--accent-soft); text-decoration: none; }
.nav a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent-soft);
}

/* Hero */
.hero {
  display: flex;
  gap: 40px;
  align-items: center;
  padding: 56px 24px;
  flex-wrap: wrap;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  object-position: 24% top;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.hero-text { flex: 1; min-width: 260px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent-soft);
  margin: 0 0 6px;
  font-weight: 600;
}

.hero-text h1 { font-size: 2.4rem; margin: 0 0 6px; }

.tagline {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 1.05rem;
}

.social-links a {
  display: inline-block;
  margin-right: 16px;
  font-weight: 600;
}

/* Sections */
.section { padding: 48px 24px; }
.hero + .section { border-top: 1px solid var(--border); }
.section.first { padding-top: 56px; }
.section h2 { font-size: 1.8rem; margin-bottom: 28px; }
.section-intro { color: var(--text-muted); margin-top: -14px; margin-bottom: 24px; }

/* Research */
.research-block {
  margin-bottom: 48px;
}
.research-block::after {
  content: "";
  display: table;
  clear: both;
}
.research-block h3 { margin-top: 0; margin-bottom: 14px; }
.research-block p { margin: 0 0 16px; }

.float-img {
  margin: 4px 0 18px;
}
.float-img.left { float: left; margin-right: 28px; }
.float-img.right { float: right; margin-left: 28px; }
.float-img.large { width: 380px; max-width: 46%; }
.float-img.small { width: 220px; max-width: 34%; }
.float-img img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.float-img figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}
.caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.video-embed { margin-top: 8px; }
.video-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  margin-top: 12px;
}
.video-frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Publications */
.pub-group { margin-bottom: 32px; }
.pub-group h3 { margin-bottom: 10px; }
.pub-list { padding-left: 22px; margin: 0; }
.pub-list li { margin-bottom: 10px; }
.filetag {
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Grants */
.grants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.grant-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.grant-card h3 { margin-top: 0; font-size: 1.1rem; }
.grant-card ul { padding-left: 18px; margin: 0; }
.grant-card li { margin-bottom: 8px; font-size: 0.95rem; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}
.gallery-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 460px;
  padding: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  display: block;
  object-fit: contain;
}

/* CV */
.cv-embed {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cv-embed iframe {
  width: 100%;
  height: 700px;
  border: 0;
  display: block;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-inner .social-links a { font-weight: 500; margin-right: 14px; }

@media (max-width: 600px) {
  .hero { text-align: center; justify-content: center; }
  .hero-photo { margin: 0 auto; }
  .float-img.left, .float-img.right { float: none; margin: 0 auto 18px; }
  .float-img.large, .float-img.small { width: 100%; max-width: 320px; }
  .cv-embed iframe { height: 480px; }
  .gallery-item { height: 320px; }
}
