/* Palette sampled from the lab logo: green outline and navy wordmark.
   The site is light (white) by default; theme.js sets data-theme="dark" only
   when a visitor turns dark mode on with the header toggle. */
:root {
  --display: Montserrat, system-ui, sans-serif;
  --bg: #ffffff; --surface: #f6f7f8; --ink: #1b2127; --muted: #5a646e;
  --line: #e3e6ea; --accent: #3f604a; --accent-strong: #2f4a39; --accent-soft: #eef3ef; --on-accent: #ffffff;
  --brand: #284d70;
  /* drawn-mountain fallback banner */
  --sky-1: #a9cbe6; --sky-2: #f3dccb; --sun: #fff4e2; --stars: 0;
  --m-far: #b3c3d6; --m-mid: #7f97b0; --m-near: #4d6b80; --m-forest: #3f604a; --m-front: #2c4636;
  --snow: #ffffff; --snow-shade: #dfe7f1;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1114; --surface: #161a1f; --ink: #e9ecef; --muted: #9aa4ae;
  --line: #262c33; --accent: #8cc5a0; --accent-strong: #a7d6b7; --accent-soft: #1a2620; --on-accent: #0e1114;
  --brand: #ffffff;
  --sky-1: #03050a; --sky-2: #1a2236; --sun: #e9eef7; --stars: 1;
  --m-far: #2b3550; --m-mid: #222b40; --m-near: #192132; --m-forest: #121a1d; --m-front: #0b0f12;
  --snow: #c9d4e6; --snow-shade: #8d9bb4;
  color-scheme: dark;
}
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 Inter, system-ui, sans-serif;
       min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent);
         backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--brand); text-decoration: none;
         display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand:hover { color: var(--brand); }
.brand img { height: 42px; width: auto; }
nav { display: flex; align-items: center; gap: 8px; }
nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500; padding: 8px 12px; border-radius: 6px; }
nav a:hover { color: var(--ink); background: var(--surface); }
nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 7px; cursor: pointer; color: var(--muted);
            display: grid; place-items: center; }
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }

/* ---------- page banner ---------- */
/* Bottom edge curves downward in the middle, so the photo keeps its centre and only the corners are trimmed. */
.banner { height: 300px; background-size: cover; background-position: center; position: relative; overflow: hidden;
          background-color: var(--sky-2); border-radius: 0 0 50% 50% / 0 0 56px 56px; }
.banner.small { height: 200px; }
.banner.tall { height: 340px; } /* Join page: zoomed-out photo needs the extra height */
.banner.has-img { background-image: var(--img); }
:root[data-theme="dark"] .banner.has-img::after { content: ""; position: absolute; inset: 0; background: rgba(5, 7, 10, .28); }
.banner.fit { background-image: none; }
.banner.fit .fill { position: absolute; inset: -40px; background: var(--img) center / cover no-repeat; filter: blur(30px) saturate(1.15) brightness(.97); }
.banner.fit .photo { position: absolute; left: 50%; transform: translateX(-50%); width: auto; max-width: none;
                     -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
                     mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
@media (max-width: 820px) { .banner.fit .photo { -webkit-mask-image: none; mask-image: none; } }
.banner svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.banner .stars { opacity: var(--stars); }

.page-title { text-align: center; padding: 44px 0 8px; }
.page-title h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); margin: 0; color: var(--brand); font-weight: 700; }
.page-title .subtitle { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 14px auto 0; }

/* ---------- home ---------- */
.home-hero { text-align: center; padding: 40px 0 0; }
.home-hero img { height: clamp(150px, 22vw, 210px); width: auto; margin: 0 auto; }
.home-hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); color: var(--brand); font-weight: 700; margin: 18px 0 6px; }
.home-hero .affil { color: var(--muted); font-size: .98rem; margin: 0; }
.home-intro { padding: 36px 0 8px; text-align: center; }
.home-intro p { font-size: 1.06rem; color: var(--muted); }
.home-intro p.lead { font-size: 1.22rem; color: var(--ink); line-height: 1.6; }
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px 0 80px; }
.highlights .card h2 { font-size: 1.05rem; margin-bottom: 14px; }
.highlights ul { list-style: none; margin: 0 0 18px; padding: 0; }
.highlights li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.highlights li:first-child { border-top: 0; padding-top: 0; }
.highlights li a { color: var(--ink); text-decoration: none; font-weight: 500; }
.highlights li a:hover { color: var(--accent); }
.highlights li .meta { display: block; color: var(--muted); font-size: .82rem; }
.more { font-weight: 600; font-size: .9rem; text-decoration: none; }
.more::after { content: " →"; }

/* ---------- buttons ---------- */
.btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 28px 0 72px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 6px; text-decoration: none; font-weight: 600;
       font-size: .92rem; border: 1px solid var(--accent); transition: background .15s, color .15s; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.ghost { color: var(--accent); background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: 6px 14px; font-size: .84rem; }

/* ---------- cards ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 26px; }
.card h3 { font-size: 1.08rem; }
.card p { color: var(--muted); }

/* ---------- research ---------- */
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 40px 0 24px; }
.area-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
             transition: border-color .15s, box-shadow .15s; }
.area-card:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 6px 20px rgba(20, 30, 40, .06); }
.area-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.area-card .num { color: var(--accent); font-family: var(--display); font-weight: 700; font-size: .85rem; }
.area-card h3 { font-size: 1.02rem; margin: 0; }
.area-card .more { margin-top: auto; padding-top: 8px; color: var(--accent); font-size: .85rem; }
.overview { padding: 16px 0 40px; font-size: 1.06rem; color: var(--muted); margin-inline: auto; text-align: center; }
.area { padding: 56px 0; border-top: 1px solid var(--line); }
.area .goal { font-size: 1.15rem; color: var(--ink); font-weight: 500; margin: 0 0 1em; }
.area h2 { font-size: 1.7rem; color: var(--brand); }
.support { padding: 48px 0 80px; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 6px 12px; font-size: .88rem; }

/* ---------- publications ---------- */
.pub-year { font-size: 1.3rem; color: var(--brand); margin: 40px 0 4px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.pub { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pub .t { font-weight: 600; font-size: 1.02rem; line-height: 1.5; }
.pub .t a { color: var(--ink); text-decoration: none; }
.pub .t a:hover { color: var(--accent); text-decoration: underline; }
.pub .a { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.pub .a b { color: var(--ink); font-weight: 600; }
.pub .v { font-style: italic; font-size: .9rem; color: var(--muted); }

/* ---------- members ---------- */
.circle { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; background: var(--accent-soft);
          display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 2rem; color: var(--accent); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 28px; padding: 40px 0 48px; }
.member { text-align: center; display: flex; flex-direction: column; align-items: center; }
.member .circle { margin-bottom: 16px; }
.member h3 { font-size: 1.05rem; margin: 0 0 2px; }
.member .title { color: var(--accent); font-weight: 600; font-size: .9rem; }
.member .detail { color: var(--muted); font-size: .86rem; }
.member .bio { font-size: .9rem; color: var(--muted); margin: 10px 0 0; text-align: left; }
.member.pi { grid-column: 1 / -1; flex-direction: row; text-align: left; gap: 36px; align-items: center;
             background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.member.pi .circle { width: 180px; height: 180px; margin: 0; flex: none; }
.member.pi h3 { font-size: 1.3rem; }
.member.pi .bio { font-size: .98rem; }

/* ---------- news ---------- */
.news-cat { padding: 40px 0 8px; }
.news-cat h2 { font-size: 1.3rem; color: var(--brand); }
.news-item { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.news-item .d { color: var(--muted); font-weight: 600; font-size: .9rem; }
.news-item p { margin: 0 0 8px; }

/* ---------- join ---------- */
.join-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 32px 0 8px; }
.join-grid .card p { margin: 10px 0 0; }

/* ---------- contact ---------- */
.contact-card { text-align: center; padding: 28px 0 80px; font-size: 1.04rem; }
.contact-card .lab { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin-bottom: 10px; }
.contact-card p { margin: 0 0 18px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: var(--surface); padding: 52px 0 32px; font-size: .9rem; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
.foot h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 10px; }
.foot li a { color: var(--ink); text-decoration: none; }
.foot li a:hover { color: var(--accent); text-decoration: underline; }
.foot address { font-style: normal; color: var(--muted); line-height: 1.6; }
.foot address strong { color: var(--ink); font-family: var(--display); font-weight: 600; }
.copy { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

@media (max-width: 900px) {
  .highlights { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .menu-btn { display: grid; }
  nav ul { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
           background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 0; }
  nav ul.open { display: flex; }
  nav li a { display: block; padding: 12px 16px; border-radius: 0; }
  .banner { height: 200px; border-radius: 0 0 50% 50% / 0 0 32px 32px; } .banner.small { height: 150px; } .banner.tall { height: 220px; }
  .member.pi { flex-direction: column; text-align: center; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .foot { grid-template-columns: 1fr; }
  .home-intro p.lead { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---------- member groups ---------- */
.group-title { font-size: 1.15rem; color: var(--brand); margin: 24px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.member-grid.alumni { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px 24px; }
.member.small .circle { width: 112px; height: 112px; font-size: 1.4rem; }
.member.small h3 { font-size: .98rem; }

/* ---------- research page: painting as the page backdrop ---------- */
.research-hero { position: relative; overflow: hidden; min-height: 520px; display: grid; place-items: center;
                 border-radius: 0 0 50% 50% / 0 0 56px 56px; background: #2a3150; }
.research-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* navy wash from the logo's wordmark keeps the white type readable over the busy centre of the painting */
.research-hero::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(22, 36, 58, .62) 0%, rgba(22, 36, 58, .42) 55%, rgba(22, 36, 58, .25) 100%); }
.research-hero-text { position: relative; z-index: 1; text-align: center; color: #fff; padding: 56px 24px 72px; max-width: 760px; }
.research-hero-text h1 { color: #fff; font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; margin: 0 0 14px;
                         text-shadow: 0 2px 18px rgba(10, 18, 32, .45); }
.research-hero-text p { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.45rem); line-height: 1.45; text-wrap: balance;
                        text-shadow: 0 1px 12px rgba(10, 18, 32, .55); }
.research-hero-credit { position: absolute; z-index: 1; right: 56px; bottom: 56px; font-size: .75rem; color: rgba(255, 255, 255, .85);
                        text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
@media (max-width: 820px) {
  .research-hero { min-height: 380px; border-radius: 0 0 50% 50% / 0 0 32px 32px; }
  .research-hero-credit { right: 50%; transform: translateX(50%); bottom: 16px; white-space: nowrap; }
}

/* ---------- Lab Members: top join button and photo gallery ---------- */
.btns.top-join { margin: 0 0 16px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 28px 0 24px; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--surface); }
@media (max-width: 820px) { .gallery { grid-template-columns: 1fr; gap: 12px; } }
.news-item .eyebrow { margin-bottom: 4px; }
