/* ═══════════════════════════════════════════════════════════
   Vanessa Echeverria — Academic Website
   Design: refined editorial dark theme
   Fonts: Playfair Display + DM Sans
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --cyan:     #2baffc;
  --cyan-dim: rgba(0,217,255,0.12);
  --cyan-mid: rgba(0, 217, 255, 0.537);
  --mag:      #ff006e;
  --mag-dim:  rgba(255,0,110,0.10);
  --mag-mid:  rgba(255,0,110,0.22);
  --bg:       #f7f7f8a3;
  --surface:  #ffffff;
  --border:   #e4e4e8;
  --border2:  #d0d0d8;
  --text:     #18181f;
  --muted:    #6b6b80;
  --light:    #9494a8;
  --serif:    'Playfair Display', Georgia, serif;
  --sans:     'DM Sans', system-ui, sans-serif;
  --sidebar-w: 260px;
  --gap: 40px;
  --radius: 10px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; transition: color 0.18s; }
a:hover { color: var(--mag); }
img { max-width: 100%; display: block; }

/* ── Top nav bar ────────────────────────────────────────── */
.topnav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(20px, 5vw, 56px);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.topnav-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.topnav-brand span { color: var(--cyan); }
.topnav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.topnav-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  padding: 5px 13px;
  transition: color 0.18s;
}
.topnav-links a::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.topnav-links a:hover {
  color: var(--text);
}
.topnav-links a:hover::after,
.topnav-links a.active::after {
  transform: scaleX(1);
}
.topnav-links a.active {
  color: var(--cyan);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block; width: 20px; height: 1.5px;
  background: var(--muted);
  transition: all 0.25s;
}

/* ── Page wrapper ───────────────────────────────────────── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 48px) 80px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: calc(54px + 24px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sidebar-card {
  background: var(--surface);
  padding: 24px 20px;
}
.photo-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}
.photo-wrap img {
  width: 200px; height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
}
.photo-placeholder {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-dim), var(--mag-dim));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--cyan);
}
.photo-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) 0deg, var(--mag) 180deg, var(--cyan) 360deg);
  z-index: -1;
  opacity: 0.4;
  animation: spin 10s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sidebar-name {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.sidebar-title {
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 16px;
}
.sidebar-social {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sidebar-social a {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  transition: all 0.18s;
}
.sidebar-social a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 10px;
}
.sidebar-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.45;
}
.sidebar-info-row svg { flex-shrink: 0; margin-top: 2px; }
.sidebar-info-row a { color: var(--muted); font-size: 0.8rem; }
.sidebar-info-row a:hover { color: var(--cyan); }

/* Nav wrapper (replaces sidebar-card for nav sections) */
.sidebar-nav-wrap {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  padding: 0;
}

/* Nav pills inside sidebar (page-specific) */
.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin-top: 10px;
  gap: 0;
}
.sidebar-nav li:first-child a {
  color: var(--text);
  font-weight: 500;
}
.sidebar-nav a {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 5px 0;
  font-weight: 400;
  transition: color 0.18s;
  background: none;
  border-radius: 0;
}
.sidebar-nav a:hover { color: var(--text); background: none; }
.sidebar-nav a.active { color: var(--text); font-weight: 500; background: none; }

/* Multi-select topic filter */
.topic-clear {
  float: right;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--cyan);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.topic-clear:hover { color: var(--mag); }
.topic-nav-multi a.topic-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 6px;
  padding: 5px 8px;
  margin-left: -8px;
}
.topic-nav-multi a.topic-opt:hover { background: var(--surface); color: var(--text); }
.topic-check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--border2);
  background: var(--bg);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.topic-check::after {
  content: "";
  position: absolute;
  display: none;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.topic-nav-multi a.topic-opt.checked .topic-check {
  background: var(--cyan);
  border-color: var(--cyan);
}
.topic-nav-multi a.topic-opt.checked .topic-check::after { display: block; }
.topic-nav-multi a.topic-opt.checked { color: var(--text); font-weight: 500; }
.topic-nav-multi a.topic-opt.active:not(.checked) { color: var(--text); font-weight: 500; }
.topic-nav-multi a.topic-opt.active:not(.checked) .topic-check {
  background: var(--mag);
  border-color: var(--mag);
}
.topic-nav-multi a.topic-opt.active:not(.checked) .topic-check::after { display: block; }

/* Page nav links */
.sidebar-pages { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-pages a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 8px;
  transition: all 0.18s;
}
.sidebar-pages a:hover { background: var(--bg); color: var(--text); }
.sidebar-pages a.active { color: var(--cyan); background: var(--cyan-dim); font-weight: 500; }

/* ── Main content ───────────────────────────────────────── */
.content {}

/* ── Section ────────────────────────────────────────────── */
.section { margin-bottom: 56px; }
.section:last-child { margin-bottom: 0; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover { color: var(--mag); }

/* ── Pills ──────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 3px 11px;
  border-radius: 100px;
  border: 1px solid var(--cyan-mid);
  color: #0099bb;
  background: var(--cyan-dim);
  cursor: default;
  transition: all 0.15s;
}
.pill.mag {
  border-color: var(--mag-mid);
  color: #cc0055;
  background: var(--mag-dim);
}
.pill.neutral {
  border-color: var(--border2);
  color: var(--muted);
  background: transparent;
}
.pill.award {
  border-color: rgba(255,190,0,0.35);
  color: #996600;
  background: rgba(255,200,0,0.09);
}

/* ── Pill filter bars (top of page) ─────────────────────── */
.pub-filter-group { margin-bottom: 14px; }
.pub-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 8px;
}
.pill-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-filter {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.18s;
}
.pill-filter:hover {
  border-color: var(--text);
  color: var(--text);
}
.pill-filter.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ── Filter buttons ─────────────────────────────────────── */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
}
.filter-btn:hover { border-color: var(--text); color: var(--text); }
.filter-btn.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}

/* ── Featured publications ──────────────────────────────── */
.feat-pub {
  background: var(--surface);
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feat-pub:hover {
  border-color: var(--cyan-mid);
}
.feat-pub-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.feat-pub-title {
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.42;
  margin-bottom: 5px;
}
.feat-pub-authors {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.feat-pub-authors strong { color: var(--text); font-weight: 500; }
.feat-pub-venue {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}
.feat-pub-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.pub-link {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  color: var(--muted);
  transition: all 0.15s;
}
.pub-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}
.pub-link.bibtex-toggle {
  cursor: pointer;
  background: none;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pub-link.bibtex-toggle:hover {
  border-color: var(--mag);
  color: var(--mag);
  background: var(--mag-dim);
}
.bib-entry {
  display: none;
  margin-top: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.bib-entry.open { display: block; }
/* ── Type badge ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 100px;
}
.badge-journal   { background: var(--cyan-dim); color: #007799; border: 1px solid var(--cyan-mid); }
.badge-conference{ background: var(--mag-dim);  color: #cc0055; border: 1px solid var(--mag-mid);  }
.badge-workshop  { background: rgba(255,195,0,0.1); color: #886600; border: 1px solid rgba(255,195,0,0.3); }
.badge-preprint  { background: rgba(140,100,255,0.1); color: #6633cc; border: 1px solid rgba(140,100,255,0.25); }
.badge-award     { background: rgba(255,140,0,0.1); color: #884400; border: 1px solid rgba(255,140,0,0.25); }

/* ── Full publication list ──────────────────────────────── */
.pub-year-group { margin-bottom: 40px; }
.pub-year-label {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cyan);
  display: inline-block;
}
.pub-item {
  background: var(--surface);
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.pub-item:last-child { margin-bottom: 0; }
.pub-item:hover {
  border-color: var(--cyan-mid);
}
.pub-item-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.42;
  margin-bottom: 5px;
}
.pub-item-authors {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 3px;
}
.pub-item-authors strong { color: var(--text); font-weight: 600; }
.pub-item-venue {
  font-size: 0.82rem;
  color: var(--light);
  font-style: italic;
  margin-bottom: 8px;
}
.pub-award-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #886600;
  background: rgba(255,195,0,0.1);
  border: 1px solid rgba(255,195,0,0.3);
  border-radius: 100px;
  padding: 2px 9px;
  margin-right: 6px;
}
.pub-item[data-hidden="true"] { display: none; }

/* ── Timeline ───────────────────────────────────────────── */
.timeline-item {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}
.timeline-item:last-child { border-bottom: none; }
.tl-dates {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.03em;
  padding-top: 3px;
  line-height: 1.5;
}
.tl-dates .present { color: var(--mag); }
.tl-role {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.tl-org {
  font-size: 0.83rem;
  color: var(--muted);
}
.tl-desc { font-size: 0.85rem; color: var(--muted); }

/* ── Bio hero (index) ───────────────────────────────────── */
.bio-block {
  background: var(--surface);
  padding: 32px 36px;
  margin-bottom: 36px;
}
.bio-block p { font-size: 0.96rem; color: #2a2a36; margin-bottom: 0.9em; }
.bio-block p:last-child { margin-bottom: 0; }
.bio-block strong { color: var(--text); }

/* ── Interests grid ─────────────────────────────────────── */
.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.interest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 20px 24px;
  background: var(--surface);
}
.int-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.int-dot.c { background: var(--cyan); }
.int-dot.m { background: var(--mag); }

/* ── News list ──────────────────────────────────────────── */
.news-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  padding: 5px 0;
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.news-text { font-size: 0.88rem; }

/* ── Award list ─────────────────────────────────────────── */
.award-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.award-item:last-child { border-bottom: none; }
.award-name { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.award-org { font-size: 0.8rem; color: var(--muted); margin-top: 1px; }
.award-year {
  font-size: 0.76rem; font-weight: 600;
  color: var(--mag); letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Compact service / membership lists ─────────────────── */
.service-group { margin-bottom: 22px; }
.service-group:last-child { margin-bottom: 0; }
.service-group-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.service-list { padding-left: 18px; }
.service-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
}
.service-row:last-child { border-bottom: none; }
.service-name { font-size: 0.86rem; color: var(--text); }
.service-meta {
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Projects grid ──────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--mag));
  opacity: 0;
  transition: opacity 0.25s;
}
.project-card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.project-card:hover::before { opacity: 1; }
.project-card h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}
.project-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.6; }
.project-icon { font-size: 1.3rem; margin-bottom: 12px; }

/* ── Grant item ─────────────────────────────────────────── */
.grant-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--cyan);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.grant-title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.grant-funder { font-size: 0.8rem; color: var(--muted); }
.grant-amount { font-size: 0.8rem; font-weight: 600; color: var(--cyan); margin-top: 4px; }

/* ── Project feature cards (projects.html landing grid) ─── */
.project-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.project-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.project-feature-card:hover { color: inherit; }
.project-feature-card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.project-figure {
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyan-dim), var(--mag-dim));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-figure::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 200deg at 80% 20%, var(--cyan-mid), transparent 40%);
  opacity: 0.5;
}
.project-figure-glyph {
  position: relative;
  font-size: 2.4rem;
  z-index: 1;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.08));
}
.project-feature-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-feature-body h3 {
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.project-feature-body p {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
}
.project-feature-link {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.18s, color 0.18s;
}
.project-feature-link:hover { color: var(--mag); gap: 9px; }

/* ── Project detail pages ───────────────────────────────── */
.project-figure-large {
  position: relative;
  height: 240px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}

.project-figure-large img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* fills the box, cropping overflow — use 'contain' to show the whole image with letterboxing */
  display: block;
}

.project-figure-large::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 200deg at 80% 20%, var(--cyan-mid), transparent 45%);
  opacity: 0.5;
}
.project-figure-large .project-figure-glyph {
  font-size: 4rem;
}
.project-figure-caption {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
  padding-left: 14px;
  border-left: 2px solid var(--border2);
}
.project-figure-caption strong { color: var(--text); font-weight: 600; }

.key-papers-list { display: flex; flex-direction: column; gap: 12px; }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--light);
  background: #fff;
  margin-top: 40px;
}
footer a { color: var(--light); }
footer a:hover { color: var(--cyan); }

/* ── Reveal animation ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .page {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }
  .sidebar { position: static; }
  .photo-wrap { width: 100px; height: 100px; }
  .photo-wrap img, .photo-placeholder { width: 100px; height: 100px; }
  .interests-grid, .projects-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .tl-dates { padding-top: 0; }
  .topnav-links { display: none; }
  .topnav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 54px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 12px 16px;
  }
  .hamburger { display: flex; }
}
