@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-surface-2: #20232f;
  --color-border: #2a2d3a;
  --color-accent: #4f7cff;
  --color-accent-2: #7c5cff;
  --color-text: #e8eaf0;
  --color-muted: #8b8fa8;
  --color-white: #ffffff;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;

  --max-width: 1200px;
  --radius: 12px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; height: 100%; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Pushes the footer to the bottom of the viewport on short pages instead of
   letting it sit right under the last content block. */
main { flex: 1 0 auto; }

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

code, pre { font-family: 'JetBrains Mono', monospace; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 5rem 0; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

.section-label {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--color-muted);
  max-width: 640px;
  margin-bottom: 3rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: var(--color-white);
}

.btn-accent:hover { transform: translateY(-2px); }

.btn-outline {
  border-color: var(--color-border);
  color: var(--color-text);
  background: transparent;
}

.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.75);
  border-bottom: 1px solid var(--color-border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand { display: flex; flex-direction: column; min-width: 0; flex-shrink: 1; }
.brand-name {
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: 0.02em;
}
.brand-tagline {
  font-size: 0.7rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-right { flex-shrink: 0; }

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: var(--text-sm);
  font-weight: 500;
}

.nav-links a {
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--color-text); }

.navbar-right { display: flex; align-items: center; gap: 1.25rem; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle button.active {
  background: var(--color-accent);
  color: var(--color-white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem;
    gap: 1.25rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 7rem 0 5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(79, 124, 255, 0.19), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(124, 92, 255, 0.17), transparent 55%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20px;
  background-image: radial-gradient(rgba(139, 143, 168, 0.25) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  pointer-events: none;
  animation: hero-grid-drift 36s ease-in-out infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  width: 42rem;
  height: 42rem;
  top: -26rem;
  right: -18rem;
  border-radius: 50%;
  background: rgba(79, 124, 255, 0.08);
  filter: blur(48px);
  pointer-events: none;
  animation: hero-glow-drift 18s ease-in-out infinite alternate;
}

.hero .container { position: relative; z-index: 1; }

@keyframes hero-grid-drift {
  to { transform: translate(16px, 12px); }
}

@keyframes hero-glow-drift {
  to { transform: translate(-3rem, 4rem) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after { animation: none; }
}

.hero-title {
  font-size: var(--text-4xl);
  max-width: 820px;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 620px;
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover { border-color: var(--color-accent); transform: translateY(-3px); }

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .section-title { font-size: var(--text-2xl); }
}

/* ---------- About / stats ---------- */
.about-text { max-width: 760px; color: var(--color-muted); margin-bottom: 3rem; font-size: var(--text-lg); }

.stat-card { text-align: center; }
.stat-number {
  font-size: var(--text-3xl);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--color-muted); font-size: var(--text-sm); margin-top: 0.5rem; }

/* ---------- Research cards ---------- */
.research-card .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 124, 255, 0.12);
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.research-card h3 { font-size: var(--text-lg); margin-bottom: 0.5rem; }
.research-card p { color: var(--color-muted); font-size: var(--text-sm); }

/* ---------- Members ---------- */
.member-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.member-tab {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.member-tab:hover { color: var(--color-text); }
.member-tab.active {
  color: var(--color-white);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.member-group { margin-bottom: 3rem; }
.member-group-title {
  font-size: var(--text-lg);
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.member-card { text-align: center; }
.member-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 2px solid var(--color-border);
  background: var(--color-surface-2);
}

.member-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
}

.member-name { font-size: var(--text-base); font-weight: 500; margin-bottom: 0.25rem; }
.member-meta { font-size: var(--text-xs); color: var(--color-muted); }
.member-links { margin-top: 0.75rem; display: flex; justify-content: center; gap: 0.75rem; }

/* ---------- Members carousel (Alumni) ---------- */
.member-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0.25rem 1rem;
  flex: 1;
  min-width: 0;
  scrollbar-color: var(--color-border) transparent;
}
.member-carousel::-webkit-scrollbar { height: 6px; }
.member-carousel::-webkit-scrollbar-track { background: transparent; }
.member-carousel::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }

.member-carousel .member-card { flex: 0 0 180px; scroll-snap-align: start; }

.carousel-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.carousel-arrow:hover { border-color: var(--color-accent); color: var(--color-accent); }

.member-card-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border-style: dashed;
}
.member-card-more:hover { border-color: var(--color-accent); }

.member-more-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-accent);
  border: 2px dashed var(--color-border);
}

@media (max-width: 600px) {
  .member-carousel .member-card { flex-basis: 150px; }
  .carousel-arrow { width: 32px; height: 32px; font-size: 1.1rem; }
}
.member-links a { color: var(--color-muted); }
.member-links a:hover { color: var(--color-accent); }

.members-page .grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .members-page .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .members-page .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Publications ---------- */
.pub-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--color-surface);
  cursor: pointer;
}

.pub-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.pub-title { font-weight: 500; font-size: var(--text-base); margin-bottom: 0.35rem; }
.pub-meta { font-size: var(--text-sm); color: var(--color-muted); }
.pub-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.pub-tag {
  font-size: var(--text-xs);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.12);
  color: var(--color-accent);
}
.pub-type-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.pub-abstract {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.pub-item.expanded .pub-abstract { display: block; }

.pub-cta { margin-top: 2.5rem; text-align: center; }

/* ---------- Publications filters (publications.html) ---------- */
.pub-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2rem;
}

.pub-filters input[type="text"],
.pub-filters select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
}

.pub-filters input[type="text"] { flex: 1; min-width: 220px; }

/* ---------- Pagination (publications list) ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.btn-pagination { padding: 0.55rem 1.1rem; }
.btn-pagination:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

.pagination-info {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-family: 'JetBrains Mono', monospace;
}

.pub-count { color: var(--color-muted); font-size: var(--text-sm); margin-bottom: 1.5rem; }

/* ---------- Contact / footer ---------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 4rem 0 2rem;
  background: var(--color-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

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

.footer h4 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: 1rem; }
.footer address, .footer p { font-style: normal; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.8; }
.footer a { color: var(--color-muted); }
.footer a:hover { color: var(--color-accent); }
.footer-social { display: flex; gap: 1rem; margin-top: 0.5rem; }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

/* ---------- Page header (inner pages) ---------- */
.page-header { padding: 4rem 0 2rem; }
.page-header h1 { font-size: var(--text-3xl); margin-bottom: 0.75rem; }
.page-header p { color: var(--color-muted); max-width: 640px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Contact page ---------- */
.contact-card { display: flex; align-items: flex-start; gap: 1rem; }
.contact-card .icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79, 124, 255, 0.12); color: var(--color-accent);
  flex-shrink: 0;
}
