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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, Arial, Helvetica, sans-serif;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout helpers ── */
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-page { padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 640px) { .px-page { padding-left: 2rem; padding-right: 2rem; } }

/* ── Navbar ── */
header.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: #8B2635;
  border-bottom: 1px solid #6e1e2b;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
}
@media (min-width: 640px) { .navbar-inner { padding: 1.25rem 2rem; flex-wrap: nowrap; } }
.navbar-brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
.navbar-brand span { font-weight: 500; color: rgba(255,255,255,0.6); }

/* Hamburger button (visible only on mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

nav.links { display: flex; gap: 1.5rem; align-items: center; }
@media (min-width: 640px) { nav.links { gap: 2.5rem; } }
nav.links a {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: color 0.15s;
}
nav.links a:hover { color: #fff; }

/* Mobile nav collapse */
@media (max-width: 639px) {
  .nav-toggle { display: flex; }
  nav.links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 0 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    order: 3;
  }
  nav.links.open { display: flex; }
  nav.links a {
    font-size: 0.9375rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}

/* ── Footer ── */
footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.5rem 1.25rem;
  margin-top: auto;
}
@media (min-width: 640px) { footer { padding: 1.5rem 2rem; } }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #64748b;
}
@media (min-width: 640px) { .footer-inner { flex-direction: row; } }
.footer-brand { font-weight: 600; color: #334155; }
.footer-brand span { font-weight: 500; color: #94a3b8; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 0.875rem; color: #94a3b8; transition: color 0.15s; }
.footer-links a:hover { color: #881337; }

/* ── Main ── */
main { flex: 1; }
.page-wrap { min-height: 100vh; background: #fff; }
.content-area { padding: 4rem 1.25rem; }
@media (min-width: 640px) { .content-area { padding: 4rem 2rem; } }

/* ── Typography ── */
h1.page-title { font-size: 2.25rem; font-weight: 700; color: #0f172a; margin-bottom: 1rem; line-height: 1.2; }
h2.section-title { font-size: 1.25rem; font-weight: 600; color: #0f172a; margin-bottom: 1.5rem; }
h2.section-heading { font-size: 1.125rem; font-weight: 700; color: #0f172a; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-base { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-slate-800 { color: #1e293b; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-rose-900  { color: #881337; }
.leading-8 { line-height: 2rem; }
.leading-7 { line-height: 1.75rem; }
.underline { text-decoration: underline; }
.underline:hover { color: #881337; }

/* ── Sections spacing ── */
.sections { display: flex; flex-direction: column; gap: 3.5rem; }
.section { }

/* ── Hero ── */
.hero-sub { font-size: 1.125rem; color: #64748b; margin-bottom: 1rem; }
.hero-title { font-size: 2.25rem; font-weight: 700; color: #0f172a; margin-bottom: 1.25rem; }
.hero-body { max-width: 48rem; display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.hero-body p { font-size: 1.25rem; line-height: 2rem; color: #1e293b; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.hero-links a { font-size: 1.25rem; color: #1e293b; text-decoration: underline; }
.hero-links a:hover { color: #881337; }

/* ── News ── */
.news-list { display: flex; flex-direction: column; gap: 1.25rem; }
.news-item { }
.news-item-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-bottom: 0.25rem; }
.news-item-title { font-size: 1rem; font-weight: 500; color: #1e293b; }
.news-item-date { font-size: 0.875rem; color: #94a3b8; }
.news-item-body { font-size: 0.875rem; color: #64748b; line-height: 1.625; }
.news-item-link { font-size: 0.875rem; color: #881337; text-decoration: underline; }

/* ── Category / type badges ── */
.badge {
  display: inline-block;
  border-radius: 9999px;
  border-width: 1px;
  border-style: solid;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-conference { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-journal    { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-workshop   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-preprint   { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge-award        { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-paper        { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-event        { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-announcement { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-other        { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

/* ── Publications list ── */
.pub-year-group { margin-bottom: 2.5rem; }
.pub-year-label { font-size: 0.875rem; font-weight: 600; color: #64748b; margin-bottom: 1rem; }
.pub-list { display: flex; flex-direction: column; gap: 1.25rem; list-style: none; }
.pub-item { display: flex; gap: 1rem; }
.pub-num { flex-shrink: 0; font-size: 1rem; color: #94a3b8; width: 1.5rem; text-align: right; margin-top: 0.125rem; }
.pub-title { font-size: 1.125rem; color: #1e293b; line-height: 2rem; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: #881337; transition: color 0.15s; }
.pub-meta { font-size: 1.125rem; color: #64748b; line-height: 2rem; }
.pub-meta a { color: inherit; }
.pub-meta a:hover { color: #334155; }

/* ── Members grid ── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (min-width: 640px)  { .members-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .members-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .members-grid { grid-template-columns: repeat(5, 1fr); } }

.member-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.member-card:hover { opacity: 0.8; }
.member-photo-wrap { width: 100%; aspect-ratio: 3/4; background: #f1f5f9; overflow: hidden; }
.member-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.member-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #94a3b8;
}
.member-info { padding-top: 0.75rem; }
.member-name { font-size: 1rem; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-title { font-size: 1rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-period { font-size: 1rem; color: #64748b; }

/* ── Member profile ── */
.profile-header { display: flex; flex-direction: column; gap: 2rem; align-items: flex-start; margin-bottom: 3rem; }
@media (min-width: 640px) { .profile-header { flex-direction: row; } }
.profile-photo { width: 12rem; flex-shrink: 0; }
.profile-photo img {
  width: 100%; aspect-ratio: 3/4;
  border-radius: 1rem; object-fit: cover;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}
.profile-initials-wrap {
  width: 100%; aspect-ratio: 3/4;
  border-radius: 1rem;
  background: #ffe4e6;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; font-weight: 700; color: #881337;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.profile-info { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-name { font-size: 1.875rem; font-weight: 700; color: #0f172a; }
.profile-title { font-size: 1rem; font-weight: 500; color: #881337; }
.profile-dept, .profile-inst { font-size: 0.875rem; color: #64748b; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.profile-link {
  display: inline-flex; align-items: center; gap: 0.375rem;
  border-radius: 9999px; border: 1px solid #e2e8f0; background: #fff;
  padding: 0.375rem 0.875rem; font-size: 0.875rem; color: #475569;
  transition: border-color 0.15s, color 0.15s;
}
.profile-link:hover { border-color: #fca5a5; color: #881337; }
.profile-link svg { width: 1rem; height: 1rem; }

.profile-sections { display: flex; flex-direction: column; gap: 3rem; }

/* Research / platform cards */
.card-grid { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 640px) { .card-grid { flex-direction: row; flex-wrap: wrap; } }
.card {
  flex: 1; min-width: 16rem;
  border: 1px solid #e2e8f0; border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
}
.card-title { font-size: 1rem; font-weight: 600; color: #0f172a; margin-bottom: 0.5rem; }
.card-title a:hover { color: #881337; text-decoration: underline; }
.card-desc { font-size: 0.875rem; color: #64748b; line-height: 1.625; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
.card-tag {
  font-size: 0.75rem; color: #64748b; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 9999px;
  padding: 0.1rem 0.5rem;
}

/* ── Openings ── */
.opening-body { max-width: 48rem; font-size: 1.125rem; line-height: 2rem; color: #1e293b; }
.opening-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.opening-list li::before { content: "· "; }
.opening-list li { font-size: 1.125rem; color: #1e293b; }
.cta-link { font-size: 1.25rem; color: #1e293b; text-decoration: underline; }
.cta-link:hover { color: #881337; }

/* ── Animations (from globals.css) ── */
@keyframes float-slow   { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-20px) scale(1.03); } }
@keyframes float-slower { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(16px) scale(0.97); } }
@keyframes fade-up      { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.animate-float-slow   { animation: float-slow   9s ease-in-out infinite; }
.animate-float-slower { animation: float-slower 12s ease-in-out infinite; }
.animate-fade-up   { animation: fade-up 0.65s ease both; }
.animate-fade-up-2 { animation: fade-up 0.65s 0.12s ease both; }
.animate-fade-up-3 { animation: fade-up 0.65s 0.24s ease both; }

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  border-top: 1px solid #e2e8f0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(4px);
}
.cookie-inner {
  max-width: 80rem; margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  align-items: flex-start;
}
@media (min-width: 640px) { .cookie-inner { flex-direction: row; align-items: center; padding: 1rem 2rem; } }
.cookie-text { font-size: 0.75rem; line-height: 1.25rem; color: #64748b; flex: 1; }
.cookie-text strong { font-weight: 600; color: #334155; }
.cookie-text a { text-decoration: underline; }
.cookie-text a:hover { color: #881337; }
.cookie-btn {
  flex-shrink: 0; border-radius: 9999px; background: #881337;
  padding: 0.375rem 1rem; font-size: 0.75rem; font-weight: 600;
  color: #fff; border: none; cursor: pointer; transition: background 0.15s;
}
.cookie-btn:hover { background: #9f1239; }

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.flex-baseline-between { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }

/* ── Mobile overrides ── */
@media (max-width: 639px) {
  /* Content area */
  .content-area { padding: 2rem 1rem; }

  /* Typography scale-down */
  h1.page-title { font-size: 1.75rem; }
  .hero-body p { font-size: 1rem; line-height: 1.75rem; }
  .hero-links a { font-size: 1rem; }
  .opening-body { font-size: 1rem; line-height: 1.75rem; }
  .opening-list li { font-size: 1rem; }

  /* People cards: 2-column grid on mobile */
  .people-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .people-card { width: 100% !important; }

  /* Profile page: photo full width on narrow screens */
  .profile-photo-box { width: 100%; max-width: 10rem; }

  /* Publications: smaller title */
  h1.pub-page-title { font-size: 1.375rem; }

  /* Research sections */
  .research-section h2 { font-size: 1.25rem; }
}
