/* ============================================================
   RESET & CUSTOM PROPERTIES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --clr-primary:      #0f172a;
  --clr-accent:       #2563eb;
  --clr-accent-dark:  #1d4ed8;
  --clr-accent-light: #eff6ff;
  --clr-text:         #334155;
  --clr-muted:        #64748b;
  --clr-bg:           #ffffff;
  --clr-bg-alt:       #f8fafc;
  --clr-border:       #e2e8f0;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  --nav-h:        66px;
  --section-pad:  88px;
  --max-w:        920px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: 200ms ease;
}

/* ============================================================
   BASE
   ============================================================ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
}

img   { max-width: 100%; display: block; }
a     { color: var(--clr-accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--clr-accent-dark); text-decoration: underline; }
ul    { list-style: none; }
strong { color: var(--clr-primary); font-weight: 600; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  color: var(--clr-primary);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: 2rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--clr-border);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.25em;
  background: var(--clr-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.section       { padding: var(--section-pad) 0; }
.section-alt   { background: var(--clr-bg-alt); }

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--clr-primary);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-size: .9rem;
  font-weight: 600;
  color: #fff !important;
  letter-spacing: -.01em;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: rgba(255,255,255,.65);
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color var(--ease);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: var(--ease);
}

/* ============================================================
   HERO
   ============================================================ */
.section-hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 64px 0;
  background: linear-gradient(140deg, #f0f7ff 0%, #fafcff 60%, #f8fafc 100%);
  border-bottom: 1px solid var(--clr-border);
}

.section-hero .container { width: 100%; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
}

.hero-info h1 {
  font-size: 2.4rem;
  margin-bottom: .2rem;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--clr-accent);
  margin-bottom: .2rem;
}

.hero-institution {
  font-size: .88rem;
  color: var(--clr-muted);
  margin-bottom: 1.4rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.85rem;
}

.hero-tag {
  background: var(--clr-accent-light);
  color: var(--clr-accent);
  padding: 3px 11px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 1.5px solid;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
  white-space: nowrap;
}

.hero-link-primary {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}

.hero-link-primary:hover {
  background: var(--clr-accent-dark);
  border-color: var(--clr-accent-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

.hero-link-outline {
  background: #fff;
  color: var(--clr-text);
  border-color: var(--clr-border);
}

.hero-link-outline:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}

/* Photo */
.hero-photo-wrap { flex-shrink: 0; }

.hero-photo {
  width: 195px;
  height: 195px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 4px solid #fff;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-body p {
  margin-bottom: 1rem;
  font-size: .95rem;
}

.about-body p:last-child { margin-bottom: 0; }

/* ============================================================
   RESEARCH
   ============================================================ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.research-card {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease);
}

.research-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,.2);
}

.research-icon {
  font-size: 1.65rem;
  margin-bottom: .75rem;
  line-height: 1;
}

.research-card h3 {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}

.research-card p {
  font-size: .82rem;
  color: var(--clr-muted);
  line-height: 1.65;
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.6rem;
}

.pub-filter-btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1.5px solid var(--clr-border);
  background: var(--clr-bg);
  color: var(--clr-muted);
  cursor: pointer;
  transition: all var(--ease);
}

.pub-filter-btn:hover { border-color: var(--clr-accent); color: var(--clr-accent); }
.pub-filter-btn.active {
  border-color: var(--clr-accent);
  color: #fff;
  background: var(--clr-accent);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.pub-item {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
  position: relative;
  transition: box-shadow var(--ease);
}

.pub-item:hover { box-shadow: var(--shadow-md); }

.pub-item.featured {
  border-left: 3px solid var(--clr-accent);
}

.pub-title {
  font-size: .925rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: .3rem;
  line-height: 1.45;
  padding-right: 80px; /* room for badge */
}

.pub-authors {
  font-size: .8rem;
  color: var(--clr-muted);
  margin-bottom: .25rem;
}

.pub-venue {
  font-size: .8rem;
  color: var(--clr-text);
  margin-bottom: .75rem;
}

.pub-venue strong { color: var(--clr-accent); font-weight: 600; }

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .7rem;
}

.pub-tag {
  background: var(--clr-bg-alt);
  color: var(--clr-muted);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 500;
  border: 1px solid var(--clr-border);
}

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

.pub-link {
  display: inline-flex;
  align-items: center;
  font-size: .76rem;
  font-weight: 600;
  color: var(--clr-accent);
  border: 1px solid var(--clr-accent);
  padding: 3px 11px;
  border-radius: var(--radius-full);
  transition: background var(--ease), color var(--ease);
  text-decoration: none !important;
}

.pub-link:hover {
  background: var(--clr-accent);
  color: #fff;
}

.pub-badge {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: var(--clr-accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ============================================================
   AWARDS
   ============================================================ */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.award-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  transition: box-shadow var(--ease);
}

.award-item:hover { box-shadow: var(--shadow-sm); }

.award-year {
  font-size: .78rem;
  font-weight: 700;
  color: var(--clr-accent);
  min-width: 44px;
  padding-top: 2px;
  flex-shrink: 0;
}

.award-content {}
.award-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--clr-primary);
  margin-bottom: .15rem;
}

.award-org {
  font-size: .8rem;
  color: var(--clr-muted);
}

.award-desc {
  font-size: .8rem;
  color: var(--clr-muted);
  margin-top: .2rem;
  font-style: italic;
}

/* ============================================================
   EDUCATION (TIMELINE)
   ============================================================ */
.edu-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.edu-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--clr-border);
  border-radius: 2px;
}

.edu-item {
  position: relative;
  padding-bottom: 2.25rem;
}

.edu-item:last-child { padding-bottom: 0; }

.edu-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-light);
}

.edu-degree {
  font-size: .95rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: .2rem;
}

.edu-institution {
  font-size: .875rem;
  color: var(--clr-text);
  margin-bottom: .15rem;
}

.edu-year {
  font-size: .8rem;
  color: var(--clr-accent);
  font-weight: 600;
  margin-bottom: .3rem;
}

.edu-meta {
  font-size: .82rem;
  color: var(--clr-muted);
  line-height: 1.55;
}

.edu-meta em { color: var(--clr-text); }

/* ============================================================
   RESEARCH PROJECTS (horizontal image cards)
   ============================================================ */
.rp-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rp-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}

.rp-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.rp-image {
  overflow: hidden;
  flex-shrink: 0;
}

.rp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.rp-card:hover .rp-image img { transform: scale(1.05); }

.rp-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-content: center;
}

.rp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.rp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-primary);
  line-height: 1.4;
  margin: 0;
}

.rp-status {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
  align-self: flex-start;
}

.rp-status--ongoing   { background: #dcfce7; color: #15803d; }
.rp-status--completed { background: var(--clr-bg-alt); color: var(--clr-muted); border: 1px solid var(--clr-border); }

.rp-description {
  font-size: .875rem;
  color: var(--clr-muted);
  line-height: 1.65;
  margin: 0;
}

/* Work experience highlights list (reuses edu-timeline) */
.work-highlights {
  list-style: none;
  margin-top: .4rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.work-highlights li {
  font-size: .82rem;
  color: var(--clr-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.55;
}

.work-highlights li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--clr-accent);
  font-weight: 900;
}

/* Publication summary stats bar */
.pub-summary {
  display: flex;
  gap: 0;
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.pub-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--clr-border);
}

.pub-summary-stat:last-child { border-right: none; }

.pub-summary-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--clr-accent);
  line-height: 1;
  margin-bottom: .3rem;
}

.pub-summary-label {
  font-size: .73rem;
  color: var(--clr-muted);
  font-weight: 500;
  text-align: center;
  letter-spacing: .01em;
}

/* ============================================================
   NEWS
   ============================================================ */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: .75rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: .875rem;
  align-items: baseline;
}

.news-item:last-child { border-bottom: none; }

.news-date {
  font-size: .76rem;
  font-weight: 700;
  color: var(--clr-accent);
  letter-spacing: .02em;
  padding-top: 2px;
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--clr-primary);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 2.25rem 24px;
  font-size: .8rem;
  line-height: 1.8;
}

#site-footer a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
}

#site-footer a:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   SCROLL-TO-TOP BUTTON
   ============================================================ */
#scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scroll-top.visible { opacity: 1; pointer-events: auto; }
#scroll-top:hover   { transform: translateY(-3px); background: var(--clr-accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .research-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  :root { --section-pad: 60px; }

  /* Nav */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--clr-primary);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: .5rem 0 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
  }

  .nav-links.open { display: flex; }
  .nav-links a    { display: block; padding: .7rem 28px; width: 100%; }
  .nav-toggle     { display: flex; }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-photo-wrap { order: -1; display: flex; justify-content: center; }
  .hero-tags       { justify-content: center; }
  .hero-links      { justify-content: center; }
  .hero-info h1    { font-size: 1.9rem; }
}

@media (max-width: 520px) {
  :root { --section-pad: 48px; }

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

  .news-item {
    grid-template-columns: 1fr;
    gap: .2rem;
  }

  .pub-title { padding-right: 0; }
  .pub-badge { position: static; display: inline-block; margin-bottom: .5rem; }
}

/* ============================================================
   SUB-PAGE LAYOUT
   ============================================================ */
.page-banner {
  background: linear-gradient(135deg, var(--clr-primary) 0%, #1a3a6b 100%);
  padding: 44px 0 40px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .76rem;
  color: rgba(255,255,255,.45);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color var(--ease);
}

.breadcrumb a:hover { color: #fff; }
.breadcrumb-sep    { opacity: .4; }

.page-banner h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: .3rem;
  letter-spacing: -.03em;
}

.page-banner-meta {
  color: rgba(255,255,255,.55);
  font-size: .875rem;
}

.page-main {
  padding: 64px 0 88px;
  min-height: 60vh;
}

/* Type filter row (publications sub-page) */
.pub-filter-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.pub-filter-label {
  font-size: .76rem;
  font-weight: 600;
  color: var(--clr-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pub-filter-group .pub-filters { margin-bottom: 0; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.gallery-card:hover img { transform: scale(1.07); }

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: .85rem 1rem;
  opacity: 0;
  transition: opacity .25s ease;
}

.gallery-card:hover .gallery-card-overlay { opacity: 1; }

.gallery-card-caption {
  color: #fff;
  font-size: .79rem;
  line-height: 1.45;
  margin: 0;
}

.gallery-card-cat {
  position: absolute;
  top: .65rem;
  left: .65rem;
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.9);
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: min(88vw, 1000px);
  width: 100%;
}

.lightbox-img {
  max-height: 78vh;
  max-width: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
  display: block;
}

.lightbox-caption {
  color: rgba(255,255,255,.7);
  font-size: .84rem;
  text-align: center;
  max-width: 560px;
  line-height: 1.55;
}

.lightbox-counter {
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  letter-spacing: .06em;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--ease);
  padding: 4px 8px;
}

.lightbox-close:hover { color: #fff; }

.lightbox-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
  backdrop-filter: blur(6px);
  z-index: 201;
}

.lightbox-btn:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .lightbox-prev { left: .5rem; }
  .lightbox-next { right: .5rem; }
}

@media (max-width: 380px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Research project cards — stack on small screens */
@media (max-width: 680px) {
  .rp-card {
    grid-template-columns: 1fr;
  }

  .rp-image {
    height: 200px;
  }
}

/* Pub summary — stack on very small screens */
@media (max-width: 420px) {
  .pub-summary {
    flex-direction: column;
  }

  .pub-summary-stat {
    border-right: none;
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem;
  }

  .pub-summary-stat:last-child { border-bottom: none; }
}


/* ============================================================
   SOFTWARE TOOL CARD
   ============================================================ */
.software-card {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 2.2fr);
  gap: 1.5rem;
  align-items: stretch;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow: hidden;
}

.software-content {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-content: center;
}

.software-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.software-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
}

@media (max-width: 820px) {
  .software-card {
    grid-template-columns: 1fr;
  }

  .software-image {
    order: 2;
  }
}
