/* ============================================================================
   CompNeuroSociety - "Warm Lab" redesign stylesheet
   Tokens first; components below; responsive rules at the bottom.
   ========================================================================== */
:root {
  --bg: #0d1117; --panel: #10151c; --panel2: #161b22;
  --line: #1f2833; --line-teal: #23444d;
  --text: #dfe7ee; --muted: #9fb1c1; --faint: #5d707f;
  --teal: #6db9c9; --pink: #D5718C; --purple: #b48ad6; --coral: #ff7e6b;
  --gold: #B6862C;
  /* Darker than --pink/--coral: those fail WCAG AA (~3.2:1, ~2.5:1) as white-text
     button backgrounds. These pass at ~4.8:1 while keeping the same hue, for
     backgrounds only — the lighter tokens stay as-is for text/accent use, where
     they already pass against --bg. */
  --pink-btn: #C2456B; --coral-btn: #CC4326;
  --grad: linear-gradient(90deg, #39a0d8, #6db9c9, #b48ad6);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Montserrat', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--coral); }
img { max-width: 100%; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }

/* --- Nav ------------------------------------------------------------------ */
.nav-bar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50; }
.nav-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.nav-brand img { width: 40px; height: 40px; border-radius: 50%; }
.nav-brand b { font-weight: 900; font-size: 16px; }
.nav-tag { font-family: var(--mono); font-size: 10.5px; color: var(--teal);
  border: 1px solid var(--line-teal); border-radius: 999px; padding: 3px 9px; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 700; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--teal); }
.btn-join { background: var(--pink-btn); color: #fff !important; font-weight: 800; padding: 11px 22px; border-radius: 999px; }
.btn-join:hover { background: var(--coral-btn); }
.hamburger { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; cursor: pointer; border: 0; background: none; border-radius: 8px; }
.hamburger span { width: 20px; height: 2px; background: var(--teal); }
.mobile-menu { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg);
  flex-direction: column; padding: 0; }
.mobile-menu.open { display: flex; }
.mobile-menu .mm-head { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 8px 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.mobile-menu .mm-close { width: 44px; height: 44px; border: 0; background: none; color: var(--teal);
  font-size: 20px; cursor: pointer; }
.mobile-menu .mm-list { flex: 1; padding: 18px 20px 0; display: flex; flex-direction: column; }
.mobile-menu .mm-list a { display: flex; align-items: center; min-height: 52px;
  font-family: var(--mono); font-size: 17px; color: var(--text); border-bottom: 1px solid var(--line); }
.mobile-menu .mm-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: #0a0e13; }
.mobile-menu .mm-foot .btn { display: flex; justify-content: center; min-height: 52px; align-items: center; width: 100%; }

/* --- Type + common blocks --------------------------------------------------- */
.crumb { font-family: var(--mono); font-size: 12px; color: var(--pink); margin: 0 0 14px; }
.display { font-size: 46px; font-weight: 900; line-height: 1.05; color: #fff;
  letter-spacing: -.02em; margin: 0; }
.display .grad, .grad-text { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.lede { font-size: 15.5px; line-height: 1.7; color: var(--muted); max-width: 62ch; margin: 16px 0 0; }
.section-crumb { font-family: var(--mono); font-size: 12px; margin: 0 0 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel2);
  border: 1px solid #263241; border-radius: 999px; padding: 6px 13px; }
.chan { font-family: var(--mono); font-size: 10.5px; color: var(--teal);
  border: 1px solid #263241; border-radius: 3px; padding: 3px 7px; }
.chan.pink { color: var(--pink); border-color: #3a2733; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--pink-btn); color: #fff !important; font-weight: 800; font-size: 14.5px;
  padding: 14px 28px; border-radius: 999px; }
.btn:hover { background: var(--coral-btn); }
.btn.teal { background: var(--teal); color: var(--bg) !important; }
.btn.teal:hover { background: var(--coral-btn); color: #fff !important; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--muted) !important;
  border: 1px solid #263241; border-radius: 999px; padding: 13px 20px; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal) !important; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.panel-glow { border-color: var(--line-teal);
  box-shadow: 0 0 0 1px rgba(109,185,201,.12), 0 0 28px rgba(109,185,201,.07); }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; border-radius: 999px; padding: 4px 10px; }
.tag.solid { color: var(--bg); background: var(--teal); font-weight: 600; }
.tag.teal { color: var(--teal); border: 1px solid var(--line-teal); }
.tag.dim { color: var(--faint); border: 1px solid #263241; }
.tag.purple { color: var(--purple); border: 1px solid #332a44; }
.tag.gold { color: var(--bg); background: var(--gold); font-weight: 600; }

/* --- Home hero --------------------------------------------------------------- */
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 44px;
  padding: 54px 0 50px; align-items: center; }
.hero-grid h1 { font-size: 56px; font-weight: 900; line-height: 1.04; color: #fff;
  letter-spacing: -.02em; margin: 0; }
.hero-grid .lede { max-width: 46ch; margin: 18px 0 24px; }
.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.stage-head, .stage-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; }
.stage-head { border-bottom: 1px solid var(--line); }
.stage-foot { border-top: 1px solid var(--line); }
.stage-head .mono, .stage-foot .mono { font-size: 11px; color: var(--faint); }
.stage-body { height: 400px; background: radial-gradient(circle at 50% 46%,
  rgba(109,185,201,.12), rgba(109,185,201,.03) 55%, transparent 72%); }
.stage-body iframe { width: 100%; height: 400px; border: 0; display: block; background: transparent; }

/* --- Ticker ------------------------------------------------------------------ */
.ticker { overflow: hidden; background: #0a0e13; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticker-inner { display: flex; white-space: nowrap; width: max-content;
  animation: marquee 22s linear infinite; padding: 9px 0; }
.ticker-inner span { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em;
  color: var(--teal); padding-right: 24px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-inner { animation: none; } }

/* --- Stats -------------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.stat { padding: 26px 32px 28px 0; border-right: 1px solid var(--line); }
.stat + .stat { padding-left: 32px; }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat b { display: block; font-family: var(--mono); font-size: 26px; font-weight: 600; }
.stat p { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin: 6px 0 0; }

/* --- Event cards ---------------------------------------------------------------- */
.events-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.events-head h2 { font-size: 22px; font-weight: 900; color: #fff; margin: 0; }
.events-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.event-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; }
.event-card .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.event-card .date { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--muted); }
.event-card .date.teal { color: var(--teal); }
.event-card h3 { font-size: 16px; font-weight: 800; color: #fff; line-height: 1.3; margin: 8px 0 4px; }
.event-card p { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 14px; }
.event-card.past { padding: 0; overflow: hidden; }
.event-card.past img { width: 100%; height: 118px; object-fit: cover; display: block;
  filter: grayscale(.6) brightness(.8); }
.event-card.past .pad { padding: 13px 18px 16px; }
.event-card.past h3 { color: var(--muted); font-size: 15px; }
.small-meta { font-size: 12px; color: var(--faint); margin: 0 0 8px; }

/* --- Events page ------------------------------------------------------------------ */
.spotlight { display: grid; grid-template-columns: 220px 1fr auto; gap: 24px; align-items: center;
  padding: 26px 30px; border-radius: 20px; }
.spotlight .date { font-family: var(--mono); font-size: 34px; font-weight: 600; color: var(--teal); margin-top: 12px; }
.spotlight h3 { font-size: 22px; font-weight: 900; color: #fff; line-height: 1.25; margin: 0; }
.spotlight p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; max-width: 60ch; }
.timeline-row { display: grid; grid-template-columns: 150px 96px 1fr auto; gap: 20px;
  align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.timeline-row .d { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.timeline-row .d small { display: block; font-size: 10.5px; color: var(--faint); font-weight: 400; margin-top: 3px; }
.timeline-row img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.timeline-row.past img { filter: grayscale(.6) brightness(.8); }
.timeline-row h3 { font-size: 15.5px; font-weight: 800; line-height: 1.3; margin: 0; color: #fff; }
.timeline-row.past h3 { color: var(--muted); }
.timeline-row p { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 4px 0 0; max-width: 72ch; }
.timeline-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.timeline-row .loc { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* --- People ------------------------------------------------------------------------ */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.people-grid.four { grid-template-columns: repeat(4, 1fr); }
.person-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.person-card img { width: 100%; height: 240px; object-fit: cover; display: block; }
.people-grid.four .person-card img { height: 190px; }
.person-card .pad { padding: 16px 18px 18px; }
.person-card h3 { font-size: 17px; font-weight: 800; color: #fff; margin: 0; }
.person-card .role { font-family: var(--mono); font-size: 11px; margin: 4px 0 10px; color: var(--teal); }
.person-card p { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 0; }
.person-card .links { display: flex; gap: 12px; margin-top: 12px; font-size: 12px; font-weight: 700; }
.jump-chips { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.jump-chips a { font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid #263241; border-radius: 999px; padding: 9px 16px; }
.jump-chips a:hover { color: var(--teal); border-color: var(--teal); }

/* --- Footer + bands ------------------------------------------------------------------ */
.band { display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 30px; border-radius: 20px; flex-wrap: wrap; }
.site-footer { background: #0a0e13; border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .inner { display: flex; align-items: center; justify-content: space-between;
  padding: 26px 32px; gap: 18px; flex-wrap: wrap; }
.site-footer .gbm { font-weight: 900; font-size: 22px; color: #fff; }
.site-footer .links { display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.site-footer .copy { font-family: var(--mono); font-size: 11.5px; color: var(--faint); font-weight: 400; }
.section { padding-top: 44px; scroll-margin-top: 84px; }

/* --- Responsive ------------------------------------------------------------------------ */
@media (max-width: 960px) {
  .container { padding: 0 20px; }
  .nav-bar { padding: 10px 12px 10px 16px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 34px 0 30px; }
  .hero-grid h1 { font-size: 38px; }
  .display { font-size: 34px; }
  .cta-row .btn, .cta-row .btn-ghost { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
  .stat { padding: 16px 8px 18px; text-align: center; }
  .stat + .stat { padding-left: 8px; }
  .stat b { font-size: 20px; }
  .events-grid, .people-grid, .people-grid.four { grid-template-columns: 1fr; }
  .spotlight { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 1fr; gap: 10px; }
  .timeline-row img { width: 100%; height: 140px; }
  .timeline-row .side { flex-direction: row; align-items: center; justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr !important; }
  .band { flex-direction: column; align-items: flex-start; }
}

/* --- Past project cards (clickable) + detail modal --- */
.project-card { display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; }
.project-card:hover, .project-card:focus-visible { border-color: var(--line-teal); }
.project-card img { width: 100%; height: 190px; object-fit: cover; display: block; filter: grayscale(.35); }
.project-card:hover img { filter: grayscale(0); }
.project-card .pad { padding: 18px 20px 20px; }
.project-card h3 { font-size: 15.5px; font-weight: 800; color: #fff; line-height: 1.3; margin: 10px 0 6px; }
.project-card p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.project-card .more { display: block; margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--teal); }

body.pm-open { overflow: hidden; }
.pm-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(6, 9, 13, .78);
  display: none; justify-content: center; overflow-y: auto; padding: 4vh 16px 48px; }
.pm-overlay.open { display: flex; }
.pm-sheet { background: var(--panel); border: 1px solid var(--line-teal); border-radius: 18px;
  width: 100%; max-width: 900px; height: fit-content; padding: 32px 38px 38px; }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pm-head h3 { font-size: 25px; font-weight: 900; color: #fff; line-height: 1.25; margin: 10px 0 2px; }
.pm-close { flex: none; width: 34px; height: 34px; background: none; border: 1px solid var(--line);
  border-radius: 8px; color: var(--muted); font-family: var(--mono); font-size: 13px; cursor: pointer; }
.pm-close:hover { border-color: var(--line-teal); color: var(--text); }
.pm-meta { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.pm-meta div { font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.pm-meta b { color: var(--text); font-weight: 700; }
.pm-sheet h4 { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--teal); margin: 26px 0 10px; }
.pm-sheet ul { margin: 0; padding-left: 19px; }
.pm-sheet li { font-size: 14.5px; line-height: 1.75; color: var(--muted); margin-bottom: 6px; }
.pm-sheet ul.pm-members { list-style: none; padding-left: 0; display: grid; gap: 5px; }
.pm-members b { color: var(--text); font-weight: 700; }
.pm-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-thumb { padding: 0; border: 0; background: none; line-height: 0; cursor: zoom-in; border-radius: 8px; }
.lb-thumb img { width: 154px; height: 106px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.lb-thumb:hover img, .lb-thumb:focus-visible img { border-color: var(--teal); }

/* Fullscreen photo viewer */
.lb-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(4, 6, 9, .93);
  display: none; align-items: center; justify-content: center; padding: 5vh 18px; }
.lb-overlay.open { display: flex; }
.lb-overlay img { max-width: min(1100px, 92vw); max-height: 86vh; object-fit: contain; border-radius: 10px; }
.lb-close, .lb-nav { position: absolute; background: rgba(16, 21, 28, .9); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; cursor: pointer; font-family: var(--mono); }
.lb-close { top: 18px; right: 18px; width: 36px; height: 36px; font-size: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 42px; height: 52px; font-size: 22px; line-height: 1; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close:hover, .lb-nav:hover { border-color: var(--teal); color: var(--teal); }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .pm-sheet { padding: 20px 18px 24px; }
  .lb-thumb img { width: 104px; height: 72px; }
  .lb-nav { width: 36px; height: 44px; font-size: 19px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}
