:root {
  --ink:#111; --muted:#666; --line:#eee; --bg:#fafafa; --brand:#111;
  --wrap: 1000px; --radius: 16px;
}
* { box-sizing: border-box; }
html,body { margin:0; padding:0; font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif; color:var(--ink); background:var(--bg); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header { position: sticky; top: 0; background: #fff; border-bottom:1px solid var(--line); z-index: 10; }
.nav { display:flex; align-items:center; gap:16px; padding: 14px 18px; max-width: var(--wrap); margin: 0 auto; }
.brand { font-weight: 700; }
.spacer { flex: 1; }
.hero { padding: 14vh 0 10vh; background: linear-gradient(180deg, #fff, #f7f7f7); border-bottom:1px solid var(--line); }
.hero h1 { font-size: clamp(36px, 6vw, 56px); margin: 0 0 8px; }
.hero p { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 720px; }
.cta-row { margin-top: 18px; display: flex; gap: 12px; }
.btn { display:inline-block; padding: 12px 18px; border-radius: 999px; background:#111; color:#fff; border:1px solid #111; }
.btn.ghost { background: transparent; color:#111; }
.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section h2 { font-size: 28px; margin: 0 0 16px; }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:16px; }
.card { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding:16px; }
.card h3 { margin:0 0 8px; }
.card p { color:var(--muted); }
.link { display:inline-block; margin-top:8px; }
.site-footer { padding: 32px 0; color: var(--muted); }

/* --- Images (headshot + gallery) --- */
.hero-inner { display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
.headshot { width:160px; height:160px; object-fit:cover; border-radius:50%; border:2px solid var(--line); }

.gallery { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:16px; margin-top:20px; }
.gallery figure { margin:0; background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.gallery img { width:100%; height:220px; object-fit:cover; display:block; }
.gallery figcaption { padding:10px; font-size:14px; color:var(--muted); }

/* --- Headshot cleanup --- */
.headshot {
  width: 140px;       /* fixed width */
  height: 140px;      /* fixed height */
  object-fit: cover;  /* crop rather than stretch */
  border-radius: 50%; /* circle */
  border: 2px solid var(--line);
  flex-shrink: 0;
}

/* --- About section with sidebar image --- */
.about-with-image {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-text {
  flex: 2 1 300px;
}

.sci-side {
  flex: 1 1 200px;
  max-width: 250px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  text-align: center;
}
.sci-side img {
  width: 100%;
  height: auto;
  display: block;
}
.sci-side figcaption {
  font-size: 13px;
  padding: 6px;
  color: var(--muted);
}

/* --- Headshot cleanup --- */
.headshot {
  width: 140px;       /* fixed width */
  height: 140px;      /* fixed height */
  object-fit: cover;  /* crop rather than stretch */
  border-radius: 50%; /* circle */
  border: 2px solid var(--line);
  flex-shrink: 0;
}

/* --- About section with sidebar image --- */
.about-with-image {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-text {
  flex: 2 1 300px;
}

.sci-side {
  flex: 1 1 200px;
  max-width: 250px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  text-align: center;
}
.sci-side img {
  width: 100%;
  height: auto;
  display: block;
}
.sci-side figcaption {
  font-size: 13px;
  padding: 6px;
  color: var(--muted);
}

/* --- Final overrides for image sizing --- */

/* Headshot: perfect circle, never stretched, tidy size */
.headshot {
  width: 128px !important;
  height: 128px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
}

/* Sidebar scientific image: small, never too wide */
.sci-side { max-width: 240px; }
.sci-side img { width: 100%; height: auto; }

/* If any legacy gallery markup remains, make it small & unobtrusive */
.gallery { display: inline-block; max-width: 520px; }
.gallery img { max-width: 240px; height: auto; }
.gallery figure { display: inline-block; vertical-align: top; margin: 0 8px 8px 0; }

/* --- Headshot pinned in hero --- */
.hero { position: relative; }
.headshot-fixed {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Sidebar scientific images: two stacked thumbs */
.sci-side { max-width: 240px; }
.sci-side .thumb {
  margin: 0 0 10px 0;
  background:#fff;
  border:1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sci-side .thumb img {
  display:block;
  width:100%;
  height:auto;
}
.sci-side .thumb figcaption {
  font-size: 13px;
  padding: 6px;
  color: var(--muted);
}

/* Responsive: move pinned headshot into flow on small screens */
@media (max-width: 700px) {
  .headshot-fixed {
    position: static;
    display: block;
    margin: 0 auto 12px auto;
  }
}

/* --- FORCE circular, pinned headshot in hero --- */
.hero { position: relative; padding: 10vh 0 7vh; } /* slightly tighter */
.headshot-fixed {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 140px !important;
  height: 140px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Tighter global section spacing */
.section { padding: 40px 0; }        /* was larger before */
.section h2 { margin: 0 0 12px; }

/* About block: ensure compact spacing */
.about-with-image { gap: 20px; margin-bottom: 0; }
.about-text p { margin: 0 0 10px; }
.sci-side { max-width: 240px; }
.sci-side .thumb { margin-bottom: 10px; }

/* If any legacy headshot style lingers, neutralize it */
.headshot { width: auto !important; height: auto !important; border-radius: 0 !important; border: none !important; }

/* Mobile: place headshot above text, centered */
@media (max-width: 700px) {
  .headshot-fixed {
    position: static;
    display: block;
    margin: 0 auto 12px auto;
  }
  .hero { padding: 8vh 0 6vh; }
}

/* === FINAL OVERRIDES (keep at end of file) === */

/* Hero: tighter padding; headshot pinned, circular, never stretched */
.hero { position: relative; padding: 9vh 0 6vh; }
.hero .headshot-fixed{
  position: absolute !important;
  top: 24px !important;
  right: 24px !important;
  width: 140px !important;
  height: 140px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid var(--line) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}

/* About: reduce space below; compact inner gaps */
.section { padding: 40px 0; }
#about.section { padding: 28px 0 24px; }
.about-with-image { gap: 18px; }
.about-text p { margin: 0 0 10px; }

/* Sidebar scientific thumbs: small, consistent width */
.sci-side { max-width: 240px; }
.sci-side .thumb { margin: 0 0 10px 0; }
.sci-side .thumb img { width: 100%; height: auto; display:block; }

/* Kill any legacy .headshot rules that might conflict */
.headshot { all: unset; }  /* neutralize old class if present */

/* Mobile stacking */
@media (max-width: 700px){
  .hero { padding: 7vh 0 5vh; }
  .hero .headshot-fixed{
    position: static !important;
    display: block !important;
    margin: 0 auto 12px auto !important;
  }
  .about-with-image { flex-direction: column; }
  .sci-side { max-width: 100%; }
}

/* --- Scientific images row under About --- */
.sci-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.sci-row figure {
  margin: 0;
  background:#fff;
  border:1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}
.sci-row img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.sci-row figcaption {
  font-size: 13px;
  padding: 6px;
  color: var(--muted);
}

/* === OVERRIDE scientific row sizing === */
.sci-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;  /* stack nicely on small screens */
}

.sci-row figure {
  flex: 0 0 200px;   /* fixed width for thumbnails */
  max-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}

.sci-row img {
  width: 100%;
  height: 140px;       /* smaller thumbnail height */
  object-fit: cover;   /* crop nicely */
  display: block;
}

.sci-row figcaption {
  font-size: 12px;
  padding: 4px;
  color: var(--muted);
}

/* --- Featured Image section --- */
.featured-figure {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.featured-figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.featured-figure figcaption {
  font-size: 14px;
  color: var(--muted);
  padding-top: 6px;
}
