:root {
  --bg: #ffffff;
  --bg-muted: #f6f5f2;
  --bg-card: #fbfaf7;
  --text: #1a1a1a;
  --text-muted: #5a6a7a;
  --text-faint: #8a8a8a;
  --border: #e3e1dc;
  --accent: #2c5f7f;
  --accent-hover: #1f4a66;
  --max-w: 1080px;
  --pad: clamp(1rem, 3vw, 2rem);

  --font-serif: "Charter", "Iowan Old Style", "Georgia", "Cambria", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, nav, .meta {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
a:hover { color: var(--accent-hover); border-bottom-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ---------- layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

main { padding-bottom: 4rem; }

/* ---------- top nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-nav .brand {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text);
  border: 0;
  letter-spacing: -0.01em;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.site-nav ul a {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
}
.site-nav ul a:hover,
.site-nav ul a[aria-current="page"] {
  color: var(--text);
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem 0.5rem;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav ul {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    gap: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav ul.open { display: flex; }
  .site-nav ul li { padding: 0.6rem var(--pad); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  width: 100%;
  height: clamp(280px, 50vh, 520px);
  overflow: hidden;
  background: #2a2a2a;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.0) 0%,
    rgba(0, 0, 0, 0.35) 65%,
    rgba(0, 0, 0, 0.55) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(1.25rem, 4vh, 3rem);
}
.hero h1 {
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}
.hero .subtitle {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  margin-top: 0.35rem;
}

/* ---------- bio / two-column intro ---------- */
.intro {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin: 3rem 0;
}
.intro .recruiting {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-muted);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}
.sidebar {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 0.5rem;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.sidebar li { margin: 0.15rem 0; }
.sidebar a { border: 0; }
.sidebar a:hover { border-bottom: 1px solid currentColor; }

@media (max-width: 720px) {
  .intro { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- project cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 3rem;
}
.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--accent);
}
.card .thumb {
  aspect-ratio: 16 / 10;
  background: #d8d6d0;
  overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 0.9rem 1rem 1.1rem; }
.card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* ---------- project subpage ---------- */
.project-header {
  margin: 2.5rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.project-header .tag {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.project-figure {
  margin: 2rem 0;
}
.project-figure img {
  border-radius: 4px;
  border: 1px solid var(--border);
}
.project-figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 2rem 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer a { color: var(--text-muted); border: 0; }
.site-footer a:hover { color: var(--text); }

/* ---------- utility ---------- */
.muted { color: var(--text-muted); }
.center { text-align: center; }
.small { font-size: 0.9rem; }
.calendar-wrap {
  position: relative;
  width: 100%;
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.calendar-wrap iframe {
  width: 100%;
  height: 700px;
  border: 0;
  display: block;
}

/* ---------- trainees ---------- */
.trainees {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2rem;
  margin: 1.5rem 0 3rem;
  font-family: var(--font-sans);
}
.trainee-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.trainee-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.trainee-col li {
  margin: 0 0 0.35rem;
  color: var(--text);
}
.trainee-col li.current {
  font-weight: 600;
}
.trainee-col li.current::after {
  content: "current";
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0 0.3rem;
  vertical-align: 2px;
}
.trainee-col .now-at {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}
.trainee-col a { border: 0; }
.trainee-col a:hover { border-bottom: 1px solid currentColor; }

/* Undergrad list is much longer than the others; span the full grid width
   and flow as multi-column CSS based on column-width so it adapts. */
.trainee-col-undergrad { grid-column: 1 / -1; }
.trainee-col-undergrad ul {
  columns: 190px;
  column-gap: 2rem;
}
.trainee-col-undergrad li {
  break-inside: avoid;
}

/* ---------- inline section figures (e.g. Blue Sky) ---------- */
.bs-item { display: flow-root; margin-bottom: 1rem; }
.bs-item .bs-fig {
  float: right;
  max-width: 300px;
  margin: 0.3rem 0 1rem 1.5rem;
}
.bs-item .bs-fig.portrait { max-width: 190px; }
.bs-item .bs-fig img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.bs-item .bs-fig figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: center;
}
@media (max-width: 600px) {
  .bs-item .bs-fig,
  .bs-item .bs-fig.portrait { float: none; max-width: 100%; margin: 1rem 0; }
}

/* ---------- photo gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  margin: 2rem 0;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.gallery figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
