/* =========================================================
   Gevaert Lab — Clean Minimal Theme
   ========================================================= */

:root {
  --red:        #8C1515;
  --red-light:  #f5eded;
  --dark:       #111111;
  --body:       #333333;
  --muted:      #777777;
  --light:      #f7f7f5;
  --border:     #e8e8e4;
  --border-mid: #d0d0cc;
  --white:      #ffffff;
  --font:       'Inter', 'Helvetica Neue', Arial, sans-serif;
  --max:        1080px;
  --nav-h:      60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--dark);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout -------------------------------------------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.75rem;
}
section { padding: 4rem 0; }

/* --- Nav ----------------------------------------------- */
nav#main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  height: 100%;
}
.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand .red { color: var(--red); }
.nav-links {
  display: flex;
  list-style: none;
  margin: 0 0 0 auto;
  gap: 0;
}
.nav-links a {
  display: block;
  padding: 0 1rem;
  line-height: var(--nav-h);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--dark); }
.nav-links a.active {
  box-shadow: inset 0 -2px 0 var(--red);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--dark);
  border-radius: 2px;
}

/* --- Buttons ------------------------------------------- */
.btn {
  display: inline-block;
  padding: .65rem 1.35rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s, color .15s, border-color .15s;
  border: 1.5px solid transparent;
}
.btn-dark {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.btn-dark:hover { background: #333; border-color: #333; }

.btn-outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--border-mid);
}
.btn-outline:hover { border-color: var(--dark); }

.btn-red {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-red:hover { background: #6f1111; border-color: #6f1111; }

.btn-link {
  background: none;
  border: none;
  color: var(--red);
  font-size: .875rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* --- Hero ---------------------------------------------- */
.hero {
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
}
.hero h1 { font-size: 3rem; max-width: 680px; margin-bottom: 1.25rem; }
.hero .lead {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 2rem;
}
.btn-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* --- Stats strip --------------------------------------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 1.75rem 1.5rem;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--dark);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-num span { color: var(--red); }
.stat-label {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* --- Section heading ----------------------------------- */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Cards (publications, projects) -------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.card-venue {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  margin-bottom: .6rem;
}
.card h3 {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.4;
  color: var(--dark);
  margin-bottom: .6rem;
  flex: 1;
}
.card p { font-size: .875rem; color: var(--muted); line-height: 1.55; }
.card-link {
  margin-top: 1rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-link:hover { text-decoration: underline; }

/* --- Research list ------------------------------------- */
.research-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}
.research-item:last-child { border-bottom: none; }
.research-item.flip { direction: rtl; }
.research-item.flip > * { direction: ltr; }
.research-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
  background: var(--red-light);
  padding: .25rem .65rem;
  border-radius: 4px;
  margin-bottom: .85rem;
}
.research-item h2 {
  font-size: 1.35rem;
  margin-bottom: .75rem;
}
.research-item p { color: var(--muted); font-size: .93rem; }
.research-visual {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.research-visual svg { opacity: .25; }
.research-visual img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 1rem;
  display: block;
}

/* --- People -------------------------------------------- */
.pi-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}
.pi-section img {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.pi-name { font-size: 1.5rem; margin-bottom: .2rem; }
.pi-title { font-size: .9rem; color: var(--red); font-weight: 600; margin-bottom: 1rem; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.person-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--white);
  transition: border-color .15s;
}
.person-card:hover { border-color: var(--border-mid); }
.person-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: .75rem;
  background: var(--light);
}
.person-initials {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--light);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--muted);
  margin-bottom: .75rem;
}
.person-name { font-size: .95rem; font-weight: 700; color: var(--dark); margin-bottom: .15rem; }
.person-role { font-size: .78rem; font-weight: 600; color: var(--red); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .04em; }
.person-bio { font-size: .82rem; color: var(--muted); line-height: 1.5; }

.group-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2.5rem 0 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.group-heading:first-of-type { border-top: none; padding-top: 0; }

/* --- Publications -------------------------------------- */
.pub-highlighted {
  border-left: 2px solid var(--red);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  border-radius: 0 6px 6px 0;
  background: var(--light);
}
.pub-title { font-size: .95rem; font-weight: 600; color: var(--dark); margin-bottom: .25rem; line-height: 1.4; }
.pub-title a { color: var(--dark); }
.pub-title a:hover { color: var(--red); text-decoration: none; }
.pub-authors { font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.pub-authors strong { color: var(--dark); }
.pub-meta { font-size: .8rem; color: var(--muted); }
.pub-journal { font-style: italic; }

.pub-list { list-style: none; padding: 0; }
.pub-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: none; }
.pub-source-links { margin-top: .4rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.pub-source-links a {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .15rem .5rem;
  border-radius: 4px;
  text-decoration: none;
}
.pub-source-links a:hover { color: var(--red); border-color: var(--red); }
.pub-year-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1.5rem 0 .6rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}

.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.filter-bar input,
.filter-bar select {
  padding: .5rem .85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--border-mid); }
.filter-bar input { min-width: 240px; }
#pub-count { font-size: .8rem; color: var(--muted); margin-left: auto; }

#pub-loading { text-align: center; padding: 4rem; color: var(--muted); }
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Page header --------------------------------------- */
.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; margin-bottom: .3rem; }
.page-header p { color: var(--muted); font-size: .9rem; }

/* --- Highlight box ------------------------------------- */
.infobox {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.infobox h3 { font-size: 1rem; margin-bottom: .75rem; }
.infobox ul { list-style: none; padding: 0; }
.infobox ul li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--body); }
.infobox ul li:last-child { border-bottom: none; }

/* --- CTA strip ----------------------------------------- */
.cta-strip {
  background: var(--dark);
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
}
.cta-strip h2 { color: var(--white); margin-bottom: .75rem; }
.cta-strip p { color: rgba(255,255,255,.6); max-width: 500px; margin: 0 auto 1.75rem; }
.btn-white {
  background: var(--white);
  color: var(--dark);
  border: 1.5px solid var(--white);
}
.btn-white:hover { background: transparent; color: var(--white); }

/* --- External links row -------------------------------- */
.link-row { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.link-row a { font-size: .875rem; font-weight: 600; color: var(--red); }
.link-row a:hover { text-decoration: underline; }

/* --- Footer -------------------------------------------- */
footer {
  background: var(--dark);
  color: rgba(255,255,255,.5);
  padding: 3.5rem 0 1.5rem;
  font-size: .85rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-brand { font-size: 1rem; font-weight: 700; color: var(--white); letter-spacing: -.02em; margin-bottom: .4rem; }
.footer-brand .red { color: var(--red); }
footer p { color: rgba(255,255,255,.4); font-size: .8rem; line-height: 1.6; }
footer h4 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); margin-bottom: .85rem; }
footer ul { list-style: none; padding: 0; }
footer ul li { margin-bottom: .4rem; }
footer ul a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .85rem; }
footer ul a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .75rem;
  color: rgba(255,255,255,.3);
}
.footer-bottom a { color: rgba(255,255,255,.3); }
.footer-bottom a:hover { color: var(--white); }

/* --- Utility ------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.alt-bg { background: var(--light); }

/* === Responsive ======================================== */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(3) { border-top: 1px solid var(--border); }
  .research-item,
  .research-item.flip { grid-template-columns: 1fr; direction: ltr; gap: 1.5rem; }
  .pi-section { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 3.5rem 0 3rem; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: .5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { line-height: 1; padding: .85rem 1.75rem; box-shadow: none; }
  .nav-links a.active { color: var(--red); box-shadow: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .people-grid { grid-template-columns: 1fr 1fr; }
}
