/* ==========================================================================
   UCLAIT — UCL Analytics & AI for Learning Team
   Design system: "Bold contemporary AI-lab"
   Single stylesheet shared across all pages.
   ========================================================================== */

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

/* ---------- Design tokens ---------- */
:root {
  /* Palette — dark (default) */
  --bg:            #060912;
  --bg-2:          #0a0f1d;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-2:     rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text:          #e9eef7;
  --text-muted:    #9aa7c0;
  --text-faint:    #6b7896;

  /* Brand / accents */
  --accent:        #6d6cf6;   /* indigo  */
  --accent-2:      #22d3ee;   /* cyan    */
  --accent-3:      #b15cff;   /* violet  */
  --accent-soft:   rgba(109, 108, 246, 0.14);
  --gradient:      linear-gradient(120deg, #6d6cf6 0%, #8a5cff 45%, #22d3ee 100%);
  --gradient-text: linear-gradient(120deg, #a9a8ff 0%, #c79bff 45%, #7ce7f7 100%);

  /* Effects */
  --glow:          0 0 0 1px var(--border), 0 18px 50px -18px rgba(109, 108, 246, 0.45);
  --shadow:        0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --radius:        18px;
  --radius-sm:     12px;
  --radius-lg:     28px;

  /* Layout */
  --maxw:          1180px;
  --nav-h:         72px;
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);

  --font-display:  'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg:            #f6f7fb;
  --bg-2:          #eef1f8;
  --surface:       rgba(16, 22, 40, 0.025);
  --surface-2:     rgba(16, 22, 40, 0.05);
  --border:        rgba(16, 22, 40, 0.10);
  --border-strong: rgba(16, 22, 40, 0.18);
  --text:          #131829;
  --text-muted:    #4a5670;
  --text-faint:    #76819b;
  --accent-soft:   rgba(109, 108, 246, 0.10);
  --glow:          0 0 0 1px var(--border), 0 18px 50px -22px rgba(109, 108, 246, 0.40);
  --shadow:        0 24px 60px -32px rgba(31, 41, 73, 0.30);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient background: layered radial glows + faint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 40rem at 12% -8%, rgba(109, 108, 246, 0.22), transparent 60%),
    radial-gradient(50rem 38rem at 92% 4%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(45rem 40rem at 70% 105%, rgba(177, 92, 255, 0.14), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
  opacity: 0.5;
  pointer-events: none;
}

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

::selection { background: rgba(109, 108, 246, 0.35); color: #fff; }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p  { color: var(--text-muted); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: linear-gradient(90deg, var(--accent-2), transparent);
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text-muted); max-width: 60ch; }

.section-head { max-width: 64ch; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head h2 { margin: 0.7rem 0 0.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 12px 34px -12px rgba(109, 108, 246, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -12px rgba(109, 108, 246, 0.85); }
.btn--ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }
[data-theme="light"] .btn--ghost:hover { color: var(--accent); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }

.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text small { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-mono); font-weight: 500; }
.brand__name { font-size: 1.06rem; }
.brand__name b { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav__links { display: flex; align-items: center; gap: 0.25rem; list-style: none; padding: 0; }
.nav__links a {
  display: inline-block; padding: 0.5rem 0.85rem;
  font-size: 0.92rem; font-weight: 500; color: var(--text-muted);
  border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a.active { color: var(--text); background: var(--accent-soft); }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

.nav__burger { display: none; }

/* Mobile nav panel */
@media (max-width: 920px) {
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    padding: 1rem 1.25rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.4s var(--ease);
    box-shadow: var(--shadow);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 0.85rem 1rem; font-size: 1rem; border-radius: 12px; }
  .nav__burger { display: grid; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(3.5rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 5rem); }
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.6rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(34,211,238,0.18); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.hero h1 { max-width: 18ch; margin-bottom: 1.3rem; }
.hero .lead { margin-bottom: 2rem; max-width: 64ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Floating stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin-top: clamp(3rem, 6vw, 4.5rem); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); }
.stat { background: var(--bg-2); padding: 1.6rem 1.4rem; }
.stat__num { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat__label { font-size: 0.86rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(40rem 18rem at var(--mx, 50%) -20%, rgba(109,108,246,0.16), transparent 60%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }

/* Research theme cards */
.theme-card { display: flex; flex-direction: column; gap: 0.9rem; min-height: 220px; }
.theme-card__index { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-2); letter-spacing: 0.2em; }
.theme-card h3 { text-transform: uppercase; letter-spacing: 0.04em; }
.theme-card h3 span { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.theme-card p { flex: 1; }
.theme-card .more { font-weight: 600; color: var(--text); font-family: var(--font-display); font-size: 0.92rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.theme-card .more .arrow { transition: transform 0.25s var(--ease); color: var(--accent-2); }
.theme-card:hover .more .arrow { transform: translateX(4px); }

/* Numbered icon chip */
.chip {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--border-strong);
  font-family: var(--font-display); font-weight: 700; color: var(--text);
}

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.3rem; }
.member { text-align: center; padding: 1.6rem 1.2rem; }
.member__photo {
  width: 116px; height: 116px; border-radius: 50%;
  margin: 0 auto 1rem; object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--bg-2);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.member:hover .member__photo { border-color: var(--accent); transform: scale(1.04); }
.member__name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.member__name a:hover { color: var(--accent-2); }
.member__role { font-size: 0.86rem; color: var(--text-muted); margin-top: 0.35rem; }
.member__tag { display: inline-block; margin-top: 0.7rem; font-size: 0.73rem; font-family: var(--font-mono); color: var(--accent-2); border: 1px solid var(--border); padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--surface); }
.role-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0 0.2rem; }
.role-divider span { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.role-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Publications / lists ---------- */
.pub-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.pub-tab { padding: 0.55rem 1.1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-weight: 600; font-size: 0.9rem; font-family: var(--font-display); cursor: pointer; transition: all 0.2s; }
.pub-tab:hover { color: var(--text); border-color: var(--border-strong); }
.pub-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.pub-list { list-style: none; padding: 0; counter-reset: pub; display: grid; gap: 0.9rem; }
.pub-list li {
  position: relative; padding: 1.15rem 1.3rem 1.15rem 3.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
  font-size: 0.96rem; line-height: 1.6;
}
.pub-list li::before {
  counter-increment: pub; content: counter(pub);
  position: absolute; left: 1rem; top: 1.1rem;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  color: var(--accent-2);
  width: 1.7rem; text-align: right;
}
.pub-list li:hover { border-color: var(--border-strong); transform: translateX(4px); background: var(--surface-2); }
.pub-list li a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.pub-list li a:hover { text-decoration-color: var(--accent-2); }
.pub-years .year-block { margin-bottom: 2.5rem; }
.pub-years .year-block:last-child { margin-bottom: 0; }
.pub-years .year-head { margin-bottom: 1rem; }
.pub-years .year-head h3 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.year-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.pub-panel { display: none; }
.pub-panel.active { display: block; animation: fade 0.4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.note { font-size: 0.9rem; color: var(--text-faint); font-style: italic; margin-top: 1.4rem; }

/* ---------- Reading club timeline ---------- */
.year-block { margin-bottom: 3rem; }
.year-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.year-head h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.year-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.rc-list { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.rc-item {
  display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: start;
  padding: 1rem 1.3rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: border-color 0.25s, background 0.25s;
}
.rc-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.rc-meta { display: flex; flex-direction: column; gap: 0.25rem; }
.rc-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-2); }
.rc-chair { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.rc-paper { color: var(--text-muted); font-size: 0.95rem; line-height: 1.55; }
.rc-paper a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.rc-paper a:hover { text-decoration-color: var(--accent-2); color: #fff; }
[data-theme="light"] .rc-paper a:hover { color: var(--accent); }
.rc-paper.tbd { color: var(--text-faint); font-style: italic; }
@media (max-width: 620px) { .rc-item { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---------- News ---------- */
.news-list { display: grid; gap: 1.1rem; }
.news-item { display: flex; gap: 1.1rem; padding: 1.4rem 1.5rem; align-items: flex-start; }
.news-item .chip { flex: none; }
.news-item p { color: var(--text-muted); }
.news-item a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.news-item a:hover { color: var(--text); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 2rem; }
.media-card { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); transition: transform 0.3s var(--ease), border-color 0.3s; }
.media-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.media-card img { width: 100%; height: 150px; object-fit: cover; }
.media-card span { display: block; padding: 0.8rem 1rem; font-size: 0.86rem; color: var(--text-muted); }

/* ---------- Social events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.event-card { padding: 0; overflow: hidden; }
.event-card__img { width: 100%; height: 200px; object-fit: cover; background: var(--bg-2); }
.event-card__body { padding: 1.3rem 1.5rem 1.6rem; }
.event-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.3rem; }
.event-card__meta { font-size: 0.85rem; color: var(--text-muted); }
.event-card__flag { font-size: 0.75rem; font-family: var(--font-mono); color: var(--accent-2); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- Callout / CTA band ---------- */
.cta {
  position: relative; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: clamp(2.4rem, 5vw, 4rem);
  background: linear-gradient(135deg, rgba(109,108,246,0.14), rgba(34,211,238,0.08));
  text-align: center;
}
.cta::after {
  content: ""; position: absolute; inset: -50% -10% auto;
  height: 120%; background: radial-gradient(40rem 20rem at 50% 0%, rgba(177,92,255,0.18), transparent 60%);
  pointer-events: none;
}
.cta h2 { position: relative; margin-bottom: 0.8rem; }
.cta p { position: relative; max-width: 56ch; margin: 0 auto 1.8rem; }
.cta__actions { position: relative; display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }
.mono-mail { font-family: var(--font-mono); }

/* ---------- Dates / info panel ---------- */
.info-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.8rem; }
.dates-list { list-style: none; padding: 0; display: grid; gap: 0.2rem; }
.dates-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px dashed var(--border); }
.dates-list li:last-child { border-bottom: 0; }
.dates-list .ev { font-weight: 600; color: var(--text); font-family: var(--font-display); }
.dates-list .dt { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-2); white-space: nowrap; text-align: right; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: clamp(2.5rem, 5vw, 4rem) 0 2.5rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.footer a { color: var(--text-muted); font-size: 0.93rem; }
.footer a:hover { color: var(--text); }
.footer__brand p { font-size: 0.93rem; max-width: 38ch; margin-top: 0.8rem; }
.footer__bottom { margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-faint); }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}

/* ---------- Page header (interior pages) ---------- */
.page-header { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-header h1 { margin: 0.8rem 0 0.7rem; }
.breadcrumb { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent-2); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.muted-link { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.muted-link:hover { color: var(--text); }
.center { text-align: center; }
.mt-2 { margin-top: 1.2rem; } .mt-4 { margin-top: 2.4rem; }

/* ==========================================================================
   Shared components: image carousel + full-screen lightbox
   Used by the Social "Life in the Lab" gallery and the News media.
   ========================================================================== */
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.carousel__viewport { overflow: hidden; }
.carousel__track { display: flex; transition: transform 0.45s var(--ease); }
.carousel__slide { position: relative; flex: 0 0 100%; margin: 0; }
.carousel__img { display: block; cursor: zoom-in; }
.carousel__slide img { width: 100%; height: 260px; object-fit: cover; display: block; }
.carousel__slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1rem 0.8rem; font-size: 0.9rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0)); }
.carousel__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); background: rgba(10,12,20,0.55); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background 0.2s ease; backdrop-filter: blur(2px); }
.carousel__nav:hover { background: rgba(10,12,20,0.85); }
.carousel__prev { left: 0.7rem; }
.carousel__next { right: 0.7rem; }
.carousel__counter { position: absolute; top: 0.8rem; right: 0.8rem; padding: 0.22rem 0.55rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; color: #fff; background: rgba(10,12,20,0.6); }

.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 3vh 3vw; background: rgba(6,8,16,0.9); backdrop-filter: blur(4px); }
.lightbox:not([hidden]) { display: flex; }
.lightbox__fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.lightbox__fig img { max-width: 100%; max-height: 82vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox__fig figcaption { color: #fff; font-size: 0.95rem; text-align: center; }
.lightbox__fig figcaption:empty { display: none; }
.lightbox__close { position: absolute; top: 1.1rem; right: 1.3rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; transition: background 0.2s ease; }
.lightbox__close:hover { background: rgba(255,255,255,0.2); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); color: #fff; font-size: 1.9rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background 0.2s ease; }
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__prev { left: 1.3rem; }
.lightbox__next { right: 1.3rem; }
