/* ============================================================
   Wu Lab @ Columbia — modern redesign
   Clean minimal light theme + dark mode, Columbia-blue accent
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-soft: #55627a;
  --text-faint: #8a94a8;
  --accent: #0279ee;
  --accent-deep: #0256ab;
  --accent-soft: #e7f2fe;
  --border: #e5eaf1;
  --shadow: 0 1px 2px rgba(16, 34, 64, .05), 0 8px 24px rgba(16, 34, 64, .06);
  --shadow-lift: 0 2px 4px rgba(16, 34, 64, .06), 0 16px 40px rgba(16, 34, 64, .12);
  --radius: 16px;
  --font-sans: "Inter", "Liberation Sans", "Arimo", -apple-system, "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --nav-h: 64px;
}

html[data-theme="dark"] {
  --bg: #0e1420;
  --bg-alt: #131b2b;
  --bg-card: #172033;
  --text: #e8edf5;
  --text-soft: #a7b2c7;
  --text-faint: #6d7a92;
  --accent: #4aa3ff;
  --accent-deep: #7cbcff;
  --accent-soft: #16283f;
  --border: #24304a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

.anchor-alias { position: absolute; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(16, 34, 64, .06);
}
.nav-wrap { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-name { font-size: 1.05rem; letter-spacing: -.01em; }
.brand-sub { color: var(--text-faint); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-soft); font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.nav-cta {
  color: #fff !important; background: var(--accent); margin-left: 6px;
}
.nav-cta:hover { background: var(--accent-deep); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card);
  color: var(--text-soft); cursor: pointer; transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 72px) 0 88px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(500px 350px at 5% 90%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12; letter-spacing: -.02em; font-weight: 700;
  margin-bottom: 22px;
}
.hero-title .accent { color: var(--accent); }
.hero-mission { font-size: 1.08rem; color: var(--text-soft); max-width: 56ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-stats { display: flex; gap: 40px; }
.stat { display: flex; flex-direction: column; }
.stat-line { display: flex; align-items: baseline; }
.stat-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.stat-plus { font-size: 1.3rem; font-weight: 700; color: var(--accent); margin-left: 2px; }
.stat-label { font-size: .82rem; color: var(--text-faint); margin-top: 2px; }

.hero-photo {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift);
  background: var(--bg-card); border: 1px solid var(--border);
  transform: rotate(1.2deg);
  transition: transform .35s ease;
}
.hero-photo:hover { transform: rotate(0deg) scale(1.01); }
.hero-photo img { width: 100%; height: auto; cursor: zoom-in; }
.hero-photo figcaption {
  font-size: .8rem; color: var(--text-faint); padding: 10px 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 44px; max-width: 720px; }
.eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -.01em; line-height: 1.15;
}
.section-sub { margin-top: 12px; font-weight: 500; }
.section-sub a { font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.research-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.research-card h3 { font-size: 1.15rem; margin: 16px 0 8px; letter-spacing: -.01em; }
.research-card > p { color: var(--text-soft); font-size: .95rem; }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.card-list { margin-top: 16px; padding-left: 0; list-style: none; border-top: 1px solid var(--border); }
.card-list li {
  font-size: .88rem; color: var(--text-soft); padding: 10px 0 10px 22px; position: relative;
  border-bottom: 1px solid var(--border);
}
.card-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.card-list li::before {
  content: ""; position: absolute; left: 4px; top: 17px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .55;
}

/* ---------- Publications ---------- */
.pub-legend { margin-top: 10px; font-size: .85rem; color: var(--text-faint); }
.pub-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 32px; }
.pub-search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; color: var(--text-faint);
  transition: border-color .2s, box-shadow .2s;
}
.pub-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pub-search input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: .95rem;
}
.pub-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-soft);
  font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  cursor: pointer; transition: all .18s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-active:hover { color: #fff; }

.pub-year { margin: 40px 0 8px; }
.pub-year:first-child { margin-top: 0; }
.pub-year h3 {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: var(--accent);
  padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft);
}
.pub-item {
  padding: 18px 4px 18px 0; border-bottom: 1px solid var(--border);
  font-size: .93rem; color: var(--text-soft);
}
.pub-item a { font-weight: 600; color: #4aa3ff; }
.pub-item a:hover { color: var(--accent-deep); }
html[data-theme="dark"] .pub-item a { color: #7cbcff; }
html[data-theme="dark"] .pub-item a:hover { color: #a5d3ff; }
.pub-item em { font-style: italic; }
.pub-item u { text-underline-offset: 3px; }
.pub-item strong { color: var(--text); font-weight: 600; }
.pub-empty { text-align: center; color: var(--text-faint); padding: 40px 0; }

/* ---------- People ---------- */
.pi-card {
  display: flex; gap: 28px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 32px;
}
.pi-photo img { width: 300px; border-radius: 14px; }
.pi-info h3 { font-size: 1.3rem; letter-spacing: -.01em; }
.pi-role { color: var(--accent); font-weight: 600; font-size: .9rem; margin: 4px 0 12px; }
.pi-info p { color: var(--text-soft); font-size: .95rem; margin-bottom: 14px; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.person-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.person-photo { aspect-ratio: 1 / 1.05; overflow: hidden; background: var(--bg-alt); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.person-card:hover .person-photo img { transform: scale(1.04); }
.person-body { padding: 16px 18px 18px; }
.person-body h4 { font-size: 1rem; letter-spacing: -.01em; }
.person-role { font-size: .84rem; color: var(--text-soft); margin-top: 6px; }

.alumni { margin-top: 48px; }
.alumni h3 { font-size: 1.2rem; margin-bottom: 18px; }
.alumni-list { columns: 2; column-gap: 40px; list-style: none; }
.alumni-list li {
  font-size: .9rem; color: var(--text-soft); padding: 8px 0;
  break-inside: avoid; border-bottom: 1px dashed var(--border);
}
.alumni-list strong { color: var(--text); }

/* ---------- Software ---------- */
.software-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.software-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--accent); }
.software-card p { font-size: .9rem; color: var(--text-soft); margin-bottom: 10px; }
.soft-img { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 14px; background: #fff; }
.soft-img img { width: 100%; height: 150px; object-fit: cover; cursor: zoom-in; }
.soft-links { font-weight: 600; font-size: .88rem !important; }
.soft-cite { font-size: .8rem !important; color: var(--text-faint) !important; font-style: italic; }

/* ---------- Protocols ---------- */
.protocol-card {
  display: flex; gap: 20px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; box-shadow: var(--shadow); max-width: 640px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.protocol-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.protocol-card h3 a { color: var(--text); font-size: 1.05rem; }
.protocol-card h3 a:hover { color: var(--accent); }
.protocol-card p { color: var(--text-soft); font-size: .9rem; margin-top: 4px; }

/* ---------- News timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.timeline li { position: relative; padding: 0 0 22px 12px; font-size: .93rem; color: var(--text-soft); }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline li.hidden-item { display: none; }
.timeline li.visible-item { display: block; animation: fadeUp .4s ease both; }
.news-date { font-weight: 700; color: var(--text); margin-right: 8px; white-space: nowrap; }
.news-more { text-align: center; margin-top: 28px; }

/* ---------- Join ---------- */
.join-section { padding-bottom: 110px; }
.join-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 48px; box-shadow: var(--shadow-lift); position: relative; overflow: hidden;
}
.join-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #9b6bff));
}
.join-card h2 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 14px; }
.join-lead { font-size: 1.05rem; color: var(--text-soft); max-width: 62ch; margin-bottom: 28px; }
.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 30px; }
.join-item h3 { font-size: 1.02rem; margin-bottom: 10px; }
.join-item p { font-size: .92rem; color: var(--text-soft); margin-bottom: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-bottom: 28px; }
.footer-brand { font-weight: 800; font-size: 1.1rem; }
.footer-tag { color: var(--text-faint); font-size: .88rem; margin-top: 4px; }
.footer-head { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; color: var(--text); }
.site-footer p { font-size: .9rem; color: var(--text-soft); margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; }
.footer-bottom p { font-size: .82rem; color: var(--text-faint); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(8, 12, 20, .88); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1000px, 92vw); max-height: 88vh; border-radius: 12px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: 0;
  color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; opacity: .8;
}
.lightbox-close:hover { opacity: 1; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-media { max-width: 520px; }
  .research-grid { grid-template-columns: 1fr; }
  .software-grid { grid-template-columns: 1fr; }
  .join-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .alumni-list { columns: 1; }

  .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px; box-shadow: var(--shadow-lift);
    display: none;
  }
  .nav.open { display: flex; }
  .nav-link { padding: 12px 10px; font-size: 1rem; }
  .nav-cta { margin: 8px 0 0; text-align: center; justify-content: center; }
  .hamburger { display: flex; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: calc(var(--nav-h) + 48px) 0 64px; }
  .hero-stats { gap: 24px; }
  .pi-card { flex-direction: column; }
  .pi-photo img { width: 260px; }
  .join-card { padding: 32px 24px; }
  .brand-sub { display: none; }
}
