/* ==========================================================================
   O'Reilly-Shah Lab
   shahlab.org
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --navy: #0f1729;
  --navy-mid: #162038;
  --navy-light: #1d2a4a;
  --teal: #16a085;
  --teal-glow: #1dd1a1;
  --teal-dim: rgba(22, 160, 133, 0.12);
  --amber: #d4a574;
  --amber-dim: rgba(212, 165, 116, 0.12);
  --text: #1a1a2e;
  --text-secondary: #5a6270;
  --text-tertiary: #8b919a;
  --surface: #ffffff;
  --surface-raised: #fafbfc;
  --surface-alt: #f3f4f6;
  --border: #e2e5e9;
  --border-light: #eef0f2;

  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-w: 1180px;
  --max-w-prose: 780px;
  --header-h: 60px;
  --radius: 6px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.35s;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--header-h);
}

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

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--teal-glow); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  color: var(--navy);
  margin-bottom: 0.5em;
}

h1 { font-size: 2.6rem; letter-spacing: -0.01em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1em; }

::selection {
  background: var(--teal);
  color: white;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 0.3em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  font-weight: 400;
}

.text-center { text-align: center; }
.text-accent { color: var(--teal); }

.badge {
  display: inline-block;
  padding: 0.25em 0.7em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 50px;
  background: var(--teal);
  color: white;
  letter-spacing: 0.02em;
}

.badge-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  transition: all var(--duration) var(--ease);
}

.badge-outline:hover {
  background: var(--teal);
  color: white;
}

/* Divider between sections */
.section + .section {
  border-top: 1px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navy);
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: white;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-logo img { height: 32px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  position: relative;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  letter-spacing: 0.01em;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 0;
  height: 1.5px;
  background: var(--teal);
  transition: width var(--duration) var(--ease-out), left var(--duration) var(--ease-out);
}

.site-nav a:hover {
  color: white;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 60%;
  left: 20%;
}

.site-nav a.active { color: white; }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: white;
  border-radius: 1px;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--navy);
  overflow: hidden;
  padding: 5rem 2rem;
}

/* Attractor SVG overlay */
.hero-attractor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.attractor-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: tracePath 6s var(--ease) forwards;
}

.attractor-path-1 { animation-delay: 0.2s; }
.attractor-path-2 { animation-delay: 0.8s; }
.attractor-path-3 { animation-delay: 2.5s; stroke-dasharray: 600; stroke-dashoffset: 600; animation-duration: 3s; }
.attractor-path-4 { animation-delay: 1.5s; }
.attractor-path-5 { animation-delay: 2s; }

@keyframes tracePath {
  to { stroke-dashoffset: 0; }
}

/* Fine grain texture for depth */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  opacity: 0.6;
}

/* Subtle ambient glow behind attractor */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 500px 250px at 30% 55%, rgba(22,160,133,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 400px 350px at 70% 40%, rgba(29,209,161,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1 {
  color: white;
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 400;
  margin-bottom: 0.4em;
  letter-spacing: -0.01em;
}

.hero .tagline {
  color: var(--teal);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.hero p {
  color: rgba(255,255,255,0.65);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-inner { min-height: 28vh; }

/* CTA buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.8rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-glow);
  border-color: var(--teal-glow);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22,160,133,0.3);
}

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.25);
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.6);
  color: white;
  background: rgba(255,255,255,0.05);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--teal), var(--teal-glow));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.card:hover {
  border-color: var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.card:hover::before { opacity: 1; }

.card-title {
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 0.3em;
  color: var(--navy);
}

.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--teal); }

.card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.card-meta {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   Research Grid
   -------------------------------------------------------------------------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.research-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-glow));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.research-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-3px);
}

.research-card:hover::before { opacity: 1; }

.research-card .card-icon { font-size: 2.5rem; margin-bottom: 1.25rem; }
.research-card .card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.6em;
}
.research-card .card-text { flex: 1; }

.research-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: 1.5rem;
  transition: gap var(--duration) var(--ease);
}

.research-card:hover .card-link { gap: 0.6rem; }

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */
.publications { max-width: var(--max-w); margin: 0 auto; }

.pub-year-group { margin-bottom: 3rem; }

.pub-year {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--surface-alt);
  padding: 0.65rem 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  border-bottom: 2px solid var(--teal);
  margin-bottom: 1.25rem;
}

.pub-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.65rem;
  transition: all var(--duration) var(--ease);
}

.pub-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.pub-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 650;
  color: var(--navy);
  margin-bottom: 0.25em;
  line-height: 1.45;
}

.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--teal); }

.pub-authors {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  margin-bottom: 0.2em;
  line-height: 1.5;
}

.pub-journal {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.5em;
}

.pub-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pub-link {
  display: inline-block;
  padding: 0.18em 0.6em;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 50px;
  transition: all var(--duration) var(--ease);
}

.pub-link-doi  { background: var(--teal-dim); color: var(--teal); }
.pub-link-doi:hover  { background: var(--teal); color: white; }
.pub-link-pmid { background: rgba(15,23,41,0.06); color: var(--text-secondary); }
.pub-link-pmid:hover { background: var(--navy); color: white; }
.pub-link-pdf  { background: rgba(231,76,60,0.08); color: #c0392b; }
.pub-link-pdf:hover  { background: #c0392b; color: white; }
.pub-link-code { background: rgba(142,68,173,0.08); color: #8e44ad; }
.pub-link-code:hover { background: #8e44ad; color: white; }
.pub-link-oa { background: rgba(243,156,18,0.1); color: #e67e22; }
.pub-link-oa:hover { background: #e67e22; color: white; }

/* --------------------------------------------------------------------------
   Software
   -------------------------------------------------------------------------- */
.software-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.software-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.software-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.software-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.software-card:hover::before { opacity: 1; }

.software-card .card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.software-card .card-text { flex: 1; margin-bottom: 1.25rem; }

.software-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.software-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3em 0.75em;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}

.software-badge-github { background: rgba(15,23,41,0.06); color: var(--text-secondary); }
.software-badge-github:hover { background: var(--navy); color: white; }
.software-badge-pypi { background: var(--teal-dim); color: var(--teal); }
.software-badge-pypi:hover { background: var(--teal); color: white; }
.software-badge-docs { background: rgba(52,152,219,0.08); color: #2980b9; }
.software-badge-docs:hover { background: #2980b9; color: white; }
.software-badge-cran { background: rgba(52,152,219,0.08); color: #2980b9; }
.software-badge-cran:hover { background: #2980b9; color: white; }

/* --------------------------------------------------------------------------
   Collaborators
   -------------------------------------------------------------------------- */
.collaborators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.collaborator-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  text-align: center;
  transition: all var(--duration) var(--ease);
}

.collaborator-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.collaborator-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  background: var(--surface-alt);
  border: 2px solid var(--border-light);
}

.collaborator-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.2em;
}

.collaborator-name a { color: inherit; }
.collaborator-name a:hover { color: var(--teal); }

.collaborator-affiliation {
  font-size: 0.84rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5em;
}

.collaborator-topic {
  font-size: 0.82rem;
  color: var(--teal);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   PI Profile
   -------------------------------------------------------------------------- */
.pi-profile {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.pi-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pi-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border-light);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.pi-photo-fun {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.pi-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pi-bio h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin-bottom: 0.1em;
}

.pi-bio .pi-title {
  font-size: 1rem;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

.pi-bio p { font-size: 1rem; line-height: 1.75; }

/* Education timeline */
.education-timeline {
  margin-top: 2.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.education-entry {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.education-entry:last-child { padding-bottom: 0; }

.education-entry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2.5px solid var(--surface);
  margin-left: -4px;
  box-shadow: 0 0 0 2px var(--border);
}

.education-degree {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}

.education-institution {
  font-size: 0.88rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 3.5rem 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.65;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  color: white;
  margin-bottom: 1rem;
}

.footer-affiliation p { margin-bottom: 0.35em; }
.footer-affiliation a { color: var(--teal); }
.footer-affiliation a:hover { color: var(--teal-glow); }

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.45em; }
.footer-links a {
  color: rgba(255,255,255,0.6);
  transition: color var(--duration) var(--ease);
}
.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

.footer-bottom a { color: rgba(255,255,255,0.45); }
.footer-bottom a:hover { color: white; }

/* --------------------------------------------------------------------------
   Content Pages (Prose)
   -------------------------------------------------------------------------- */
.content {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.content h1 {
  font-size: 2.2rem;
  margin-bottom: 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--border);
}

.content h2 { font-size: 1.6rem; margin-top: 2.5em; margin-bottom: 0.6em; }
.content h3 { font-size: 1.25rem; margin-top: 2em; margin-bottom: 0.5em; }

.content blockquote {
  border-left: 3px solid var(--teal);
  margin: 1.5em 0;
  padding: 0.75em 1.5em;
  background: var(--surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.content blockquote p:last-child { margin-bottom: 0; }

.content pre {
  background: var(--navy);
  color: #c8ccd4;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.5em 0;
}

.content code { font-family: var(--font-mono); font-size: 0.88em; }

.content p code,
.content li code {
  background: var(--surface-alt);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.85em;
  color: #c0392b;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}

.content thead th {
  background: var(--surface-alt);
  font-weight: 700;
  text-align: left;
  padding: 0.7em 1em;
  border-bottom: 2px solid var(--border);
  color: var(--navy);
}

.content tbody td {
  padding: 0.65em 1em;
  border-bottom: 1px solid var(--border-light);
}

.content tbody tr:hover { background: var(--surface-raised); }

.content hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

.content figure { margin: 2em 0; text-align: center; }
.content figcaption {
  margin-top: 0.5em;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Publication Filters
   -------------------------------------------------------------------------- */
.filter-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-tertiary);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.filter-btn.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .research-grid,
  .software-grid,
  .collaborators-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid { grid-template-columns: 1fr 1fr; }

  .pi-profile {
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
  }

  .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  :root { --header-h: 54px; }

  body { font-size: 16px; }
  .container { padding: 0 1.25rem; }
  .section { padding: 3.5rem 0; }

  .menu-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--duration) var(--ease-out), opacity var(--duration) var(--ease), visibility var(--duration);
  }

  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .site-nav a::after { display: none; }

  .hero { min-height: 38vh; padding: 3rem 1.25rem; }
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 0.9rem; letter-spacing: 0.06em; }
  .hero p { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; align-items: center; }

  .research-grid,
  .software-grid,
  .collaborators-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .pi-profile {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .pi-photo { width: 180px; height: 180px; }
  .pi-bio h2 { text-align: center; }
  .pi-bio .pi-title { text-align: center; }
  .education-timeline { margin-left: 0.5rem; text-align: left; }

  .content { padding: 1.5rem 1.25rem; }
  .content h1 { font-size: 1.7rem; }

  .pub-year { font-size: 1.25rem; }
  .pub-card { padding: 1rem 1.15rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .btn { width: 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .menu-toggle, .hero::before, .hero::after { display: none; }
  body { padding-top: 0; color: #000; font-size: 11pt; }
  .hero { min-height: auto; background: none; color: #000; padding: 1rem 0; }
  .hero h1, .hero .tagline { color: #000; }

  .card, .research-card, .pub-card, .software-card, .collaborator-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  a { color: #000; text-decoration: underline; }
}
