/* Britt Lab — site styles
   Paper + fluorescence: warm off-white page, ink type, hairline rules,
   accents from GFP green and DAPI blue. Type: Geist / Geist Mono. */

:root {
  --paper: #F5F4EF;
  --paper-2: #EDECE5;
  --card: #FBFAF6;
  --ink: #121315;
  --ink-2: #474A50;
  --ink-3: #66696F;
  --rule: rgba(18, 19, 21, 0.13);
  --rule-2: rgba(18, 19, 21, 0.22);
  --ui-border: rgba(18, 19, 21, 0.52);
  --line: rgba(18, 19, 21, 0.86);

  --gfp: #34D27C;
  --gfp-ink: #11743F;
  --gfp-wash: #E3F5E9;
  --dapi: #4262FF;
  --dapi-ink: #2B45CF;
  --tomato: #FF5B4D;

  --scope: #07090C;
  --scope-2: #10141A;
  --scope-ink: #E9ECEF;
  --scope-dim: rgba(233, 236, 239, 0.55);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1280px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Section flow: hairlines that fade out instead of running edge to edge,
     and the spacing rhythm shared by every section. */
  --fade-rule: linear-gradient(90deg, var(--line), var(--rule-2) 35%, transparent);
  --fade-rule-soft: linear-gradient(90deg, var(--rule-2), var(--rule) 50%, transparent);
  --flow-y: clamp(56px, 7vw, 104px);
  --wash-fade: clamp(48px, 7vw, 120px);
  --overlap: clamp(40px, 5vw, 72px);  /* how far the home banner card hangs into the page */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--gfp-ink); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
ul { margin: 0; padding: 0; }
address { font-style: normal; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--dapi); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--gfp); color: var(--ink); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }
main:focus { outline: none; }

/* ---------- Type helpers ---------- */

.label {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.label::before { content: ""; width: 6px; height: 6px; background: currentColor; flex: none; }
.label--plain::before { display: none; }

.display {
  font-size: clamp(2.5rem, 5.2vw, 4.6rem);
  font-weight: 250; letter-spacing: -0.035em; line-height: 1.02;
}
.h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); font-weight: 250; letter-spacing: -0.03em; line-height: 1.06; }
.h3 { font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: 350; letter-spacing: -0.015em; line-height: 1.2; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--ink-2); font-weight: 350; max-width: 46ch; }
.prose { max-width: 66ch; color: var(--ink-2); }
.prose p { margin-bottom: 1.1em; }
.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.muted { color: var(--ink-3); }

/* ---------- Buttons (Isomorphic-style label + arrow boxes) ---------- */

.cta { display: inline-flex; align-items: stretch; gap: 4px; text-decoration: none; color: var(--ink); position: relative; }
.cta-label, .cta-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.cta-label {
  padding: 0 16px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; position: relative;
}
.cta-arrow { width: 40px; flex: none; overflow: hidden; }
.cta-arrow svg { width: 14px; height: 14px; transition: transform 0.35s var(--ease); }
.cta:hover, .cta:focus-visible { color: var(--paper); }
.cta:hover .cta-label, .cta:hover .cta-arrow,
.cta:focus-visible .cta-label, .cta:focus-visible .cta-arrow { background: var(--ink); border-color: var(--ink); }
.cta:hover .cta-arrow svg, .cta:focus-visible .cta-arrow svg { transform: translateX(3px); }
.cta:focus-visible { outline: none; }
.cta:focus-visible .cta-label { outline: 2px solid var(--dapi); outline-offset: 3px; }
.cta--light { color: var(--scope-ink); }
.cta--light .cta-label, .cta--light .cta-arrow { border-color: rgba(233, 236, 239, 0.7); }
.cta--light:hover, .cta--light:focus-visible { color: var(--scope); }
.cta--light:hover .cta-label, .cta--light:hover .cta-arrow { background: var(--scope-ink); border-color: var(--scope-ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px 18px; }

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
}
.text-link svg { width: 12px; height: 12px; transition: transform 0.3s var(--ease); }
.text-link:hover svg { transform: translateX(3px); }

/* ---------- Pixel mouse that peeks over CTAs ---------- */

.peek {
  position: absolute; bottom: calc(100% - 1px); right: 6px;
  width: 78px; height: 50px; pointer-events: none; z-index: 2;   /* 16px headroom for the bounce */
}
.peek-clip { position: absolute; inset: 0; overflow: hidden; }
.peek-head {
  position: absolute; left: 0; bottom: -3px; width: 78px; height: 42px;   /* 2 spare pixel rows above the ears */
  transform: translateY(105%);
  transition: transform 0.22s cubic-bezier(0.5, 0, 0.8, 0.4);
}
.peek-paws {
  position: absolute; left: 0; bottom: -7px; width: 78px; height: 9px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.12s linear, transform 0.12s linear;
}
.peek svg { width: 100%; height: 100%; image-rendering: pixelated; shape-rendering: crispEdges; }
.cta:hover .peek-head, .cta:focus-visible .peek-head {
  transform: translateY(0);
  transition: transform 0.42s cubic-bezier(0.25, 1.6, 0.45, 1) 0.05s;
}
.cta:hover .peek-paws, .cta:focus-visible .peek-paws {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.1s linear 0.3s, transform 0.25s cubic-bezier(0.25, 1.6, 0.45, 1) 0.3s;
}
.peek .whisk-b, .peek .blink { visibility: hidden; }
.cta:hover .peek .whisk-a { animation: whisk-a 0.36s steps(1) 0.5s infinite; }
.cta:hover .peek .whisk-b { animation: whisk-b 0.36s steps(1) 0.5s infinite; }
.cta:hover .peek .blink { animation: blink 3.4s steps(1) 1.4s infinite; }
.cta:hover .peek .ears { animation: ear-twitch 2.6s steps(1) 0.9s infinite; }
@keyframes whisk-a { 0%, 49% { visibility: visible; } 50%, 100% { visibility: hidden; } }
@keyframes whisk-b { 0%, 49% { visibility: hidden; } 50%, 100% { visibility: visible; } }
@keyframes blink { 0%, 93% { visibility: hidden; } 94%, 100% { visibility: visible; } }
@keyframes ear-twitch { 0%, 88% { transform: none; } 89%, 94% { transform: translateY(-1px); } 95%, 100% { transform: none; } }
.peek--left { right: auto; left: 6px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 244, 239, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow 0.3s;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(18, 19, 21, 0.04), 0 10px 24px -22px rgba(18, 19, 21, 0.4); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-name { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav ul { list-style: none; display: flex; gap: 2px; }
.site-nav a {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-2);
}
.site-nav a:hover { color: var(--ink); background: rgba(18, 19, 21, 0.05); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.lang-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 10px; border: 1px solid var(--ui-border); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-decoration: none; color: var(--ink-3);
}
.lang-switch .is-on { color: var(--ink); }
.lang-switch:hover { border-color: var(--line); color: var(--ink-3); }
.lang-sep { opacity: 0.5; }
.lang-switch--plain { border: 0; padding: 0; color: inherit; }
.menu-toggle {
  display: none; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.menu-toggle-icon { display: grid; gap: 4px; width: 14px; }
.menu-toggle-icon i { display: block; height: 1px; background: currentColor; transition: transform 0.25s var(--ease); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon i:first-child { transform: translateY(2.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon i:last-child { transform: translateY(-2.5px) rotate(-45deg); }

/* ---------- Sections ---------- */

.section { padding: var(--flow-y) 0; }
.section--tight { padding: clamp(40px, 5vw, 72px) 0; }
/* Bottom-of-page spacer before the footer: one gap, not two */
.section--tight:empty { padding: 0 0 clamp(40px, 5vw, 72px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); flex-wrap: wrap; }
.section-head .h2 { max-width: 22ch; }

/* Wash: a full-bleed band of --paper-2 that fades in and out, so sections
   change tone without a hard edge. border-image paints the full width of the
   viewport without extra markup (body already hides horizontal overflow). */
.wash {
  position: relative;
  border-image: linear-gradient(180deg, rgba(237, 236, 229, 0), var(--paper-2) var(--wash-fade), var(--paper-2) calc(100% - var(--wash-fade)), rgba(237, 236, 229, 0)) fill 0 / / 0 100vmax;
}
.wash--end { border-image: linear-gradient(180deg, rgba(237, 236, 229, 0), var(--paper-2) var(--wash-fade)) fill 0 / / 0 100vmax; }
.wash .card { background: var(--card); }

/* Hairline that fades to the right, for the top of lists */
.fade-top { border-top: 0 !important; background: var(--fade-rule) top left / 100% 1px no-repeat; }

.page-hero { position: relative; isolation: isolate; padding: clamp(48px, 8vw, 112px) 0 clamp(32px, 5vw, 56px); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46% 90% at 94% 0%, rgba(52, 210, 124, 0.13), transparent 70%),
    radial-gradient(34% 80% at 4% 0%, rgba(66, 98, 255, 0.06), transparent 70%);
}
.page-hero .display { max-width: 18ch; }
.page-hero .lede { margin-top: 24px; }

/* ---------- Home banner ---------- */

/* The banner sits a layer above the page (z-index 3) so the part of the card
   that hangs into the welcome section (.ed--intro, z-index 2) stays clickable.
   The card hangs below the image by --overlap, so the banner runs into the
   page instead of ending at a hard edge. */
.banner { position: relative; z-index: 3; min-height: clamp(560px, 78vh, 820px); display: flex; align-items: flex-end; background: var(--scope); }
.banner-media { position: absolute; inset: 0; overflow: hidden; }
.banner-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.banner-fx { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.banner-fx.is-on { opacity: 1; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 9, 12, 0.22), rgba(7, 9, 12, 0) 55%), linear-gradient(0deg, rgba(7, 9, 12, 0.22), rgba(7, 9, 12, 0) 35%); pointer-events: none; }
.banner-inner { position: relative; z-index: 2; padding-top: 64px; padding-bottom: 0; margin-bottom: calc(-1 * var(--overlap)); }
.banner-card {
  max-width: 620px; padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--radius);
  background: rgba(250, 249, 245, 0.8);
  -webkit-backdrop-filter: blur(6px) saturate(1.05); backdrop-filter: blur(6px) saturate(1.05);
  box-shadow: 0 0 0 1px rgba(18, 19, 21, 0.08), 0 28px 56px -30px rgba(0, 0, 0, 0.42);
}
.banner-card .display { font-size: clamp(2.2rem, 4.1vw, 3.8rem); }
.banner-card .lede { margin: 20px 0 0; }
.banner-card .cta-row { padding-top: 30px; }
.banner-credit {
  position: absolute; right: var(--gutter); bottom: 18px; z-index: 1; margin: 0;
  padding: 4px 8px; border-radius: 4px; background: rgba(7, 9, 12, 0.6); color: var(--scope-ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- Welcome quote ---------- */

.welcome { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.welcome blockquote { margin: 0; }
.welcome blockquote p {
  font-size: clamp(1.45rem, 2.5vw, 2.15rem); font-weight: 280; letter-spacing: -0.02em; line-height: 1.28; color: var(--ink);
}
.signature { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.signature img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; filter: grayscale(0.15); }
.signature span { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-2); }



/* ---------- Question cards ---------- */

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 22px 22px 20px; min-height: 300px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(18, 19, 21, 0.35); }
.card-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.card h3 { font-size: 1.32rem; font-weight: 350; letter-spacing: -0.015em; line-height: 1.22; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card-refs { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.card-glyph { width: 100%; height: 56px; color: var(--ink); }

/* ---------- Approach ---------- */

.approach { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.methods { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 32px; border-top: 1px solid var(--rule); }
.methods li { padding: 18px 18px 18px 0; border-bottom: 1px solid var(--rule); }
.methods li:nth-child(odd) { border-right: 1px solid var(--rule); }
.methods li:nth-child(even) { padding-left: 18px; }
.methods h3 { font-size: 1rem; font-weight: 500; letter-spacing: -0.005em; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.methods h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gfp); box-shadow: 0 0 0 3px var(--gfp-wash); flex: none; }
.methods li:nth-child(2) h3::before { background: var(--dapi); box-shadow: 0 0 0 3px #E4E9FF; }
.methods li:nth-child(4) h3::before { background: var(--tomato); box-shadow: 0 0 0 3px #FFE6E3; }
.methods p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

.figure { margin: 0; }
.figure-frame { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--rule); }
.figure-frame--dark { background: var(--scope); border-color: var(--scope); }
.figure figcaption { margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-3); line-height: 1.5; }

/* ---------- Publication rows ---------- */

.pub-list { list-style: none; background: var(--fade-rule) top left / 100% 1px no-repeat; }
.pub-row { border-bottom: 1px solid transparent; border-image: var(--fade-rule-soft) 1; border-width: 0 0 1px; }
.pub-row > a, .pub-row > div {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 240px) 24px; gap: 20px; align-items: baseline;
  padding: 20px 0; text-decoration: none; color: var(--ink);
}
.pub-row > a:hover .pub-title { color: var(--gfp-ink); }
.pub-year { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.pub-title { font-size: 1.12rem; font-weight: 400; letter-spacing: -0.01em; line-height: 1.32; transition: color 0.2s; }
.pub-authors { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.pub-authors b { color: var(--ink); font-weight: 500; }
.pub-authors b.is-current { color: var(--gfp-ink); }
.pub-venue { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.02em; }
.pub-arrow { width: 14px; height: 14px; color: var(--ink-3); align-self: center; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.pub-meta a { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.pub-meta a:hover { color: var(--gfp-ink); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 8px; vertical-align: 2px;
  border: 1px solid var(--rule-2); border-radius: 4px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); font-weight: 400;
}
.tag--gfp { border-color: rgba(17, 116, 63, 0.45); color: var(--gfp-ink); background: var(--gfp-wash); }
.tag--dapi { border-color: rgba(43, 69, 207, 0.4); color: var(--dapi-ink); background: #EBEEFF; }

/* ---------- Image strip (home gallery teaser) ---------- */

.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.strip a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--scope); aspect-ratio: 4 / 5; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease), filter 0.6s; filter: saturate(1.05); }
.strip a:hover img { transform: scale(1.04); filter: saturate(1.25); }
.strip span {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 4px;
  background: rgba(7, 9, 12, 0.66); color: var(--scope-ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- News list ---------- */

.news-list { list-style: none; background: var(--fade-rule) top left / 100% 1px no-repeat; }
.news-list li { border-bottom: 1px solid transparent; border-image: var(--fade-rule-soft) 1; border-width: 0 0 1px; }
.news-list a { display: grid; grid-template-columns: 140px minmax(0, 1fr) 24px; gap: 20px; padding: 22px 0; text-decoration: none; align-items: baseline; }
.news-list time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.news-list h2, .news-list h3 { font-size: 1.2rem; font-weight: 400; letter-spacing: -0.01em; }
.news-list p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.news-list a:hover h2, .news-list a:hover h3 { color: var(--gfp-ink); }
.news-list svg { width: 14px; height: 14px; color: var(--ink-3); }

/* ---------- Join band ---------- */

.band {
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 32px; align-items: end;
  padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    radial-gradient(60% 120% at 100% 100%, rgba(52, 210, 124, 0.16), transparent 70%),
    radial-gradient(50% 100% at 0% 0%, rgba(66, 98, 255, 0.08), transparent 70%),
    var(--card);
}
.band p { margin: 14px 0 0; color: var(--ink-2); max-width: 52ch; }

/* ---------- Funders marquee ---------- */

.funders { padding: clamp(32px, 4vw, 48px) 0 clamp(56px, 7vw, 88px); }
.marquee { position: relative; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: clamp(48px, 6vw, 88px); padding-right: clamp(48px, 6vw, 88px); }
.funder { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); flex: none; }
.funder img {
  width: auto; max-width: 220px; object-fit: contain;
  filter: grayscale(1) contrast(1.15) brightness(0.55);
  opacity: 0.78; mix-blend-mode: multiply;
  transition: filter 0.35s, opacity 0.35s;
}
.funder:hover img, .funder:focus-visible img { filter: none; opacity: 1; }
.funder small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: rgba(245, 244, 239, 0.72); padding: clamp(56px, 6vw, 72px) 0 28px; font-size: 14.5px;
  /* Rounded top that overlaps the end of the page by its own radius, so the
     corners show whatever the last section ends on (paper or wash). */
  --footer-r: clamp(16px, 2.4vw, 28px);
  position: relative; border-radius: var(--footer-r) var(--footer-r) 0 0; margin-top: calc(-1 * var(--footer-r));
}
.site-footer a { color: rgba(245, 244, 239, 0.86); text-decoration: none; }
.site-footer a:hover { color: var(--gfp); }
.site-footer .label { color: rgba(245, 244, 239, 0.5); margin-bottom: 14px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-lockup { display: flex; gap: 14px; align-items: center; }
.footer-crest { width: 34px; height: auto; flex: none; }
.footer-lab { margin: 0; color: var(--paper); font-size: 15px; max-width: 34ch; line-height: 1.35; }
.footer-dept { margin: 4px 0 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: rgba(245, 244, 239, 0.55); }
.footer-tagline { margin-top: 22px; max-width: 32ch; }
.footer-nav { list-style: none; display: grid; gap: 6px; }
.footer-base { display: flex; gap: 24px; justify-content: space-between; margin-top: 56px; padding-top: 20px; border-top: 1px solid rgba(245, 244, 239, 0.14); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; }
.footer-base .lang-switch--plain { margin-left: auto; }

/* ---------- Research page ---------- */

.banner-strip { border-radius: var(--radius); overflow: hidden; background: var(--scope); }
.banner-strip img { width: 100%; height: clamp(120px, 16vw, 220px); object-fit: cover; }
.aims { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.theme { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); padding: clamp(40px, 6vw, 80px) 0; align-items: start; background: var(--fade-rule-soft) top left / 100% 1px no-repeat; }
.theme:nth-of-type(even) .theme-figure { order: -1; }
.theme-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-bottom: 14px; display: block; }
.theme h2 { margin-bottom: 20px; }
.theme .prose { font-size: 16.5px; }
.paper-links { list-style: none; margin-top: 24px; border-top: 1px solid var(--rule); }
.paper-links li { border-bottom: 1px solid var(--rule); }
.paper-links a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; text-decoration: none; font-size: 14.5px; }
.paper-links span { color: var(--ink-3); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.collab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.collab-grid .card { min-height: 220px; }

/* ---------- People ---------- */


.alumni-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
.alum { font-size: 13.5px; line-height: 1.4; }
.alum-photo { aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: #fff; border: 1px solid var(--rule); margin-bottom: 10px; }
.alum-photo img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.05); opacity: 0.92; transition: filter 0.45s, opacity 0.45s, transform 0.6s var(--ease); }
.alum:hover .alum-photo img { filter: none; opacity: 1; transform: scale(1.03); }
.alum-name { font-weight: 500; color: var(--ink); }
.alum-role { color: var(--ink-3); margin-top: 2px; }
.alum-now { margin-top: 6px; color: var(--ink-2); }
.alum-now::before { content: "→ "; color: var(--gfp-ink); }
.pet-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 14px; margin-top: 24px; }
.pet { font-size: 13.5px; line-height: 1.4; }
.pet-photo { aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: #fff; border: 1px solid var(--rule); margin-bottom: 10px; }
.pet-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.pet:hover .pet-photo img { transform: scale(1.03) rotate(-1deg); }
.pet-name { font-weight: 500; color: var(--ink); font-size: 1.04rem; }
.pet-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.pet-owner { margin-top: 6px; color: var(--ink-2); }
.pet-owner::before { content: "♥ "; color: var(--gfp-ink); }
.pet-about { margin-top: 6px; color: var(--ink-2); }
.pet-empty { margin-top: 24px; padding: clamp(28px, 5vw, 48px) 20px; border: 1px dashed var(--rule-2); border-radius: var(--radius); text-align: center; color: var(--ink-3); }
.pet-empty-paws { display: block; font-size: 1.4rem; letter-spacing: 0.4em; margin-bottom: 10px; opacity: 0.7; }
.pet-empty p { margin: 0; }
.subhead { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); margin: 34px 0 16px; }

/* ---------- PI page ---------- */

.pi-hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.pi-portrait { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #ddd; }
.pi-portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.pi-titles { list-style: none; margin-top: 24px; border-top: 1px solid var(--rule); }
.pi-titles li { padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); display: flex; gap: 12px; }
.pi-titles li::before { content: ""; width: 6px; height: 6px; margin-top: 9px; background: var(--ink); flex: none; }
.pi-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(28px, 5vw, 72px); }
.pi-body .prose { font-size: 17px; }
.pi-body .prose p:first-child { color: var(--ink); font-size: 1.22rem; font-weight: 350; line-height: 1.5; }
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: var(--rule-2); }
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }
.timeline li:last-child::before { background: var(--gfp); border-color: var(--gfp-ink); box-shadow: 0 0 0 4px var(--gfp-wash); }
.timeline strong { display: block; font-weight: 500; }
.timeline span { color: var(--ink-2); font-size: 15px; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--card); }
.contact-card dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; font-size: 15px; }
.contact-card dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.contact-card dd { margin: 0; }
.link-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.link-list a { display: inline-block; padding: 6px 10px; border: 1px solid var(--ui-border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
.link-list a:hover { border-color: var(--line); }

/* ---------- Publications page ---------- */

.pub-tools { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button {
  border: 0; background: transparent; padding: 9px 14px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.segmented button + button { border-left: 1px solid var(--rule-2); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--ui-border); border-radius: var(--radius-sm); background: var(--card);
  font: inherit; font-size: 15px; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--line); box-shadow: 0 0 0 3px rgba(66, 98, 255, 0.15); }
.search svg { position: absolute; left: 13px; top: 13px; width: 14px; height: 14px; color: var(--ink-3); }
.pub-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.year-group { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; padding: 18px 0 8px; background: var(--fade-rule) top left / 100% 1px no-repeat; }
.year-group > h2 { font-family: var(--font-mono); font-size: 13px; font-weight: 400; letter-spacing: 0.04em; color: var(--ink-2); padding-top: 4px; position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
.year-group .pub-list { border-top: 0; }
.year-group .pub-row:last-child { border-bottom: 0; }
.year-group .pub-row > div { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); padding: 4px 0 22px; }
.year-group .pub-row + .pub-row > div { padding-top: 22px; }
[hidden] { display: none !important; }

/* ---------- Gallery ---------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--ui-border); background: transparent; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.masonry { columns: 3 300px; column-gap: 14px; }
.tile { break-inside: avoid; margin: 0 0 14px; }
.tile button {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: var(--scope);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.tile--figure button { background: #fff; border: 1px solid var(--rule); }
.tile img { width: 100%; transition: transform 0.7s var(--ease); }
.tile button:hover img { transform: scale(1.03); }
.tile figcaption { padding: 10px 2px 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.tile figcaption b { display: block; color: var(--ink); font-weight: 500; }

.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: 1fr auto; background: rgba(7, 9, 12, 0.97); color: var(--scope-ink); padding: 56px var(--gutter) 20px; }
.lightbox[hidden] { display: none; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; min-height: 0; }
.lightbox-stage img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox-meta { display: flex; justify-content: space-between; gap: 24px; padding-top: 16px; max-width: var(--max); margin: 0 auto; width: 100%; font-size: 14px; }
.lightbox-meta p { margin: 0; max-width: 80ch; color: var(--scope-dim); }
.lightbox-meta b { color: var(--scope-ink); font-weight: 500; display: block; margin-bottom: 4px; }
.lightbox-btns { display: flex; gap: 6px; flex: none; }
.lightbox button.lb-btn {
  height: 38px; min-width: 38px; padding: 0 12px; background: transparent; color: var(--scope-ink); cursor: pointer;
  border: 1px solid rgba(233, 236, 239, 0.4); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.lightbox button.lb-btn:hover { background: var(--scope-ink); color: var(--scope); }
.lightbox .lb-close { position: absolute; top: 12px; right: var(--gutter); }

.viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.viz {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.viz--wide { grid-column: 1 / -1; }
.viz--dark { background: var(--scope); color: var(--scope-ink); border-color: var(--scope); }
.viz--dark .viz-text, .viz--dark .viz-source { color: var(--scope-dim); }
.viz-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.viz h3 { font-size: 1.3rem; font-weight: 350; letter-spacing: -0.015em; }
.viz-text { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.viz-source { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-3); line-height: 1.5; }
.viz-source a { color: inherit; }
.viz-canvas { position: relative; min-height: 280px; }
.viz-canvas svg { width: 100%; height: auto; overflow: visible; }
.viz-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-family: var(--font-mono); font-size: 12px; }
.viz-controls label { display: inline-flex; gap: 10px; align-items: center; letter-spacing: 0.04em; }
.viz-controls input[type="range"] { accent-color: var(--gfp); width: 180px; }
.viz--dark .viz-controls input[type="range"] { accent-color: var(--gfp); }
.viz-btn {
  height: 32px; padding: 0 12px; border: 1px solid currentColor; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: inherit;
}
.viz-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.viz--dark .viz-btn[aria-pressed="true"] { background: var(--scope-ink); color: var(--scope); border-color: var(--scope-ink); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; flex: none;
  border-radius: 999px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--data { color: var(--gfp-ink); background: var(--gfp-wash); }
.viz--dark .badge--data { color: var(--gfp); background: rgba(52, 210, 124, 0.12); }
.viz--dark .viz-tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.45; letter-spacing: 0.02em;
  transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity 0.12s;
  white-space: nowrap;
}
.viz-tooltip.is-on { opacity: 1; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.viz--dark .viz-legend { color: var(--scope-dim); }
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.stim { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stim canvas { width: 100%; aspect-ratio: 1 / 1; image-rendering: pixelated; border-radius: 6px; background: #000; border: 1px solid rgba(233, 236, 239, 0.15); }
.stim-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--scope-dim); margin-bottom: 6px; }

/* ---------- Join ---------- */

.join-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.join-list { list-style: none; background: var(--fade-rule) top left / 100% 1px no-repeat; }
.join-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.join-list .card-num { padding-top: 6px; }
.join-list h2 { font-size: 1.5rem; font-weight: 350; margin-bottom: 10px; }
.join-list p { margin: 0; color: var(--ink-2); }
.join-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.join-aside .contact-card { margin-top: 0; }
.join-aside h2 { font-size: 1.5rem; font-weight: 350; margin-bottom: 10px; }
.join-aside p { color: var(--ink-2); }
.mcgill-lockup { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.mcgill-lockup img { width: 30px; height: auto; }

/* ---------- Post ---------- */

.post { max-width: 760px; }
.post-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; margin-bottom: 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.post h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); font-weight: 260; letter-spacing: -0.03em; line-height: 1.06; margin-bottom: 26px; }
.post-body { font-size: 18px; color: var(--ink-2); line-height: 1.65; }
.post-body a { color: var(--ink); }
.post-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- 404 ---------- */

.notfound { min-height: 60vh; display: grid; align-content: center; gap: 24px; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .site-nav ul { gap: 0; }
  .site-nav a { padding: 7px 7px; letter-spacing: 0.05em; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 0; }
}

@media (max-width: 1020px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 18px;
    padding: 18px var(--gutter) 28px; background: var(--paper); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s linear 0.25s;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; transition: opacity 0.2s, transform 0.25s var(--ease); }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--rule); }
  .site-nav a { padding: 14px 0; font-size: 14px; border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; color: var(--gfp-ink); }
  .site-nav .lang-switch { align-self: flex-start; }
  .approach, .aims, .theme, .pi-hero, .pi-body, .join-grid { grid-template-columns: 1fr; }
  .theme:nth-of-type(even) .theme-figure { order: 0; }
  .join-aside { position: static; }
  .welcome { grid-template-columns: 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-id { grid-column: 1 / -1; }
  .collab-grid { grid-template-columns: 1fr; }
  .viz-grid { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
  .band { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; --overlap: 0px; }
  body { font-size: 15.5px; }
  .banner { display: block; min-height: 0; background: var(--paper); }
  .banner-media { position: relative; height: 300px; }
  .banner::after { display: none; }
  .banner-inner { padding-top: 0; padding-bottom: 8px; margin-top: -72px; }
  .banner-card { background: rgba(250, 249, 245, 0.88); box-shadow: 0 0 0 1px rgba(18, 19, 21, 0.08), 0 18px 36px -26px rgba(0, 0, 0, 0.35); }
  .banner-card .display { font-size: clamp(2rem, 9vw, 2.6rem); }
  .banner-credit { top: 12px; bottom: auto; right: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .methods { grid-template-columns: 1fr; }
  .methods li:nth-child(odd) { border-right: 0; }
  .methods li:nth-child(even) { padding-left: 0; }
  .pub-row > a, .pub-row > div { grid-template-columns: 1fr; gap: 6px; }
  .pub-arrow { display: none; }
  .year-group { grid-template-columns: 1fr; gap: 6px; }
  .year-group > h2 { position: static; }
  .year-group .pub-row > div { grid-template-columns: 1fr; }
  .news-list a { grid-template-columns: 1fr; gap: 6px; }
  .news-list svg { display: none; }
  .alumni-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-base { flex-wrap: wrap; }
  .footer-base .lang-switch--plain { margin-left: 0; }
  .masonry { columns: 2 140px; column-gap: 10px; }
  .tile { margin-bottom: 10px; }
  .viz { padding: 16px; }
  .viz-head { flex-direction: column; gap: 8px; }
  .lightbox-meta { flex-direction: column; }
  .join-list li { grid-template-columns: 1fr; gap: 6px; }
  .cta-label { padding: 0 12px; }
}

/* ---------- Pause / play control for moving content ---------- */

.motion-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--ui-border); border-radius: var(--radius-sm); background: transparent; color: var(--ink-2);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase;
}
.motion-btn:hover { border-color: var(--line); color: var(--ink); }
.motion-btn i { display: inline-block; width: 8px; height: 9px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.motion-btn[aria-pressed="true"] i { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.marquee.is-paused .marquee-track { animation-play-state: paused; }
.funders-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.funders-head .label { margin: 0; }
.funders-head + .marquee { margin-top: 22px; }

/* Larger targets on touch screens */
@media (pointer: coarse) {
  .cta-label, .cta-arrow { height: 44px; }
  .cta-arrow { width: 44px; }
  .chip, .segmented button, .viz-btn, .motion-btn, .lang-switch, .lb-btn { min-height: 44px; }
  .motion-btn { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: 100%; }
  .marquee-group[aria-hidden="true"] { display: none; }
  .marquee-group { flex-wrap: wrap; justify-content: center; row-gap: 32px; padding-right: 0; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Data table toggles under charts ---------- */

.viz-table { margin-top: 12px; font-size: 13px; }
.viz-table summary {
  cursor: pointer; width: max-content;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.viz-table-wrap { overflow-x: auto; margin-top: 10px; }
.viz-table table { border-collapse: collapse; min-width: 100%; font-variant-numeric: tabular-nums; }
.viz-table th, .viz-table td { padding: 6px 10px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.viz-table th { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.viz-canvas canvas { max-width: 100%; }

/* ==========================================================================
   Editorial layout (home and People)
   Sections are told apart by composition, type and tone instead of rules:
   - .ed-grid      12-column grid; text and images alternate sides
   - .field        a warm tonal field covering part of the width only,
                   anchored to one edge with a rounded inner corner
   - .bleed-right  images that run off the right edge and cross into the
                   next section, so one area leads into the next
   - --rhythm      one vertical spacing unit for every section
   ========================================================================== */

:root {
  --rhythm: clamp(72px, 9vw, 136px);
  --col-gap: clamp(16px, 2.4vw, 32px);
  --soft-r: clamp(16px, 2.2vw, 28px);
}

.ed { position: relative; isolation: isolate; padding-block: calc(var(--rhythm) / 2); }
.banner + .ed-flow > .ed:first-child { padding-top: calc(var(--rhythm) / 2 + var(--overlap)); }
.ed-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }

/* Distance from the viewport edge to the content edge */
.ed, .ed-flow { --edge: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }

.field { padding-block: calc(var(--rhythm) * 0.62); margin-block: calc(var(--rhythm) * 0.08); }
.field::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; background: var(--paper-2); pointer-events: none; }
.field--left::before { left: 0; right: calc(var(--edge) * 0.5); border-radius: 0 var(--soft-r) var(--soft-r) 0; }
.field--right::before { right: 0; left: calc(var(--edge) + (100% - 2 * var(--edge) + var(--col-gap)) / 4 - var(--col-gap) / 2); border-radius: var(--soft-r) 0 0 var(--soft-r); }

.bleed-right { margin-right: calc(-1 * max(var(--gutter), (100vw - var(--max)) / 2 + var(--gutter))); }

/* Section labels: the existing mono label, with a little more air */
.ed-idx { margin-bottom: 22px; }
.ed-head { max-width: 40rem; }
.ed-head .h2 { max-width: 20ch; }
.ed-head-cta { margin-top: 28px; }
.ed-side .h2 { font-size: clamp(1.8rem, 2.8vw, 2.5rem); }

/* ---------- Home: welcome ---------- */

/* Above the next section, so the image can hang over its field */
.ed--intro { z-index: 2; }
.ed-intro-text { grid-column: 1 / 8; }
.ed-quote { margin: 0; }
.ed-quote p { font-size: clamp(1.45rem, 2.4vw, 2.1rem); font-weight: 280; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); }
.ed-intro-img {
  grid-column: 9 / 13; margin-top: 0; margin-left: 0; position: relative; z-index: 2; align-self: start;
  /* drops into the questions field below */
  margin-bottom: calc(-1 * var(--rhythm) * 1.9);
}
.ed-intro-img img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--soft-r) 0 0 var(--soft-r); background: var(--scope); }
.ed-intro-img figcaption, .ed-join-credit {
  margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- Home: questions ---------- */

.ed--questions .ed-head { max-width: calc((100% - 11 * var(--col-gap)) / 12 * 7 + 6 * var(--col-gap)); }
.ed-questions { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px var(--col-gap); align-items: start; margin-top: clamp(48px, 6vw, 88px); }
.ed-questions li:nth-child(even) { margin-top: clamp(28px, 4vw, 64px); }
.ed-num { display: block; margin-bottom: 18px; font-size: clamp(2.6rem, 4.2vw, 3.8rem); font-weight: 200; letter-spacing: -0.045em; line-height: 0.9; color: var(--gfp-ink); font-variant-numeric: tabular-nums; }
.ed-questions h3 { font-size: clamp(1.12rem, 1.4vw, 1.3rem); font-weight: 400; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 12px; }
.ed-questions p { color: var(--ink-2); font-size: 15px; margin: 0; }
.ed-questions .ed-refs { margin-top: 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-3); line-height: 1.5; }

/* ---------- Home: approach (figure left, text right) ---------- */

.ed-approach-fig { grid-column: 1 / 7; margin-top: clamp(0px, 5vw, 80px); }
.ed-approach-text { grid-column: 8 / 13; }
.ed-approach-text .prose { margin-top: 24px; }
.ed-methods { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 26px var(--col-gap); margin-top: 36px; }
.ed-methods h3 { font-size: 1rem; font-weight: 500; letter-spacing: -0.005em; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.ed-methods h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gfp); box-shadow: 0 0 0 3px var(--gfp-wash); flex: none; }
.ed-methods li:nth-child(2) h3::before { background: var(--dapi); box-shadow: 0 0 0 3px #E4E9FF; }
.ed-methods li:nth-child(4) h3::before { background: var(--tomato); box-shadow: 0 0 0 3px #FFE6E3; }
.ed-methods p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* ---------- Home: papers (heading column + list, no rules) ---------- */

.ed-side { grid-column: 1 / 5; align-self: start; position: sticky; top: calc(var(--header-h) + 32px); }
.ed-papers { grid-column: 6 / 13; list-style: none; }
.ed-papers .pub-row { border: 0; }
.ed-papers .pub-row + .pub-row { margin-top: clamp(26px, 3vw, 40px); }
.ed-papers .pub-row > a {
  grid-template-columns: 52px minmax(0, 1fr) 16px; grid-template-areas: "year main arrow" "year venue arrow";
  gap: 6px 20px; padding: 0;
}
.ed-papers .pub-year { grid-area: year; padding-top: 3px; }
.ed-papers .pub-row > a > span:nth-child(2) { grid-area: main; }
.ed-papers .pub-venue { grid-area: venue; color: var(--ink-3); font-size: 11.5px; }
.ed-papers .pub-arrow { grid-area: arrow; align-self: start; margin-top: 6px; }
.ed-papers .pub-title { font-size: clamp(1.1rem, 1.5vw, 1.3rem); font-weight: 350; letter-spacing: -0.015em; }

/* ---------- Home: gallery mosaic ---------- */

.ed-head--split { max-width: none; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
.ed-head--split > :first-child { grid-column: 1 / 7; }
.ed-head--split > :last-child { grid-column: 8 / 13; }
.ed-head--split .lede { margin: 0; }
.mosaic {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 16vw, 240px); gap: 12px;
  margin-top: clamp(36px, 4.5vw, 64px);
}
.mosaic a { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--scope); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease), filter 0.6s; }
.mosaic a:hover img { transform: scale(1.035); filter: saturate(1.2); }
.mosaic span {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 4px;
  background: rgba(7, 9, 12, 0.66); color: var(--scope-ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
}
.mosaic-1 { grid-column: 1 / 6; grid-row: 1 / 3; }
.mosaic-2 { grid-column: 6 / 9; grid-row: 1; }
.mosaic-4 { grid-column: 6 / 9; grid-row: 2; }
.mosaic-3 { grid-column: 9 / 13; grid-row: 1 / 3; border-radius: var(--radius) 0 0 var(--radius); }

/* ---------- Home: news on a right-anchored field ---------- */

.ed--news .ed-side { grid-column: 1 / 4; position: static; }
.ed-side .text-link { display: flex; width: max-content; margin-top: 4px; }
.ed-news { grid-column: 4 / 13; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px var(--col-gap); padding-left: var(--col-gap); }
.ed-news a { display: block; text-decoration: none; }
.ed-news time { display: block; margin-bottom: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.ed-news h3 { font-size: 1.16rem; font-weight: 400; letter-spacing: -0.01em; line-height: 1.3; transition: color 0.2s; }
.ed-news p { margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; }
.ed-news a:hover h3 { color: var(--gfp-ink); }

/* ---------- Home: funders and the closing image ---------- */

.ed--funders { padding: calc(var(--rhythm) / 2) 0; border: 0; }

/* A dark lab photograph, inset from the left edge, that runs into the footer */
.ed-join {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: clamp(440px, 50vw, 640px);
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  margin-left: calc(var(--edge) + (100vw - 2 * var(--edge) + var(--col-gap)) / 12 - var(--col-gap));
  background: var(--ink); color: var(--scope-ink); border-radius: var(--soft-r) 0 0 0;
}
.ed-join-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
.ed-join::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 19, 21, 0.9), rgba(18, 19, 21, 0.45) 50%, rgba(18, 19, 21, 0.05) 80%),
    linear-gradient(0deg, var(--ink), rgba(18, 19, 21, 0) 40%);
}
.ed-join-inner { position: relative; width: 100%; padding-block: var(--rhythm); }
.ed-join-text { max-width: 34rem; }
.ed-join-text .h2 { color: var(--scope-ink); }
.ed-join-text p { margin: 18px 0 32px; color: var(--scope-dim); max-width: 46ch; }
.ed-join-credit { position: absolute; right: var(--gutter); bottom: 20px; margin: 0; color: var(--scope-dim); }
.page-home .site-footer { margin-top: 0; border-radius: var(--soft-r) 0 0 0; }

/* ---------- People: hero with the PI feature ---------- */

.ed-hero { padding: clamp(48px, 7vw, 104px) 0 calc(var(--rhythm) / 2); }
.ed-hero .ed-grid { align-items: start; }
.ed-hero-text { grid-column: 1 / 7; grid-row: 1; }
.ed-hero-text .lede { margin-top: 24px; }
.ed-pi { display: contents; }
.ed-pi img {
  grid-column: 8 / 13; grid-row: 1 / 3; width: calc(100% + max(var(--gutter), (100vw - var(--max)) / 2 + var(--gutter)));
  aspect-ratio: 5 / 6; object-fit: cover; object-position: 50% 30%; border-radius: var(--soft-r) 0 0 var(--soft-r);
}
.ed-pi-text { grid-column: 1 / 7; grid-row: 2; align-self: end; padding-top: clamp(40px, 6vw, 96px); max-width: 30rem; }
.ed-pi-text h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 300; margin-bottom: 10px; }
.ed-pi-text p:not(.label) { color: var(--ink-2); margin-bottom: 26px; }

/* ---------- People: rosters ---------- */

.roster-head { grid-column: 1 / 4; align-self: start; position: sticky; top: calc(var(--header-h) + 32px); padding-right: var(--col-gap); }
.roster-head h2 { font-size: clamp(1.4rem, 2vw, 1.85rem); font-weight: 300; letter-spacing: -0.02em; }
.roster-head p { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; max-width: 28ch; }
.roster-count { display: block; margin-bottom: 14px; font-size: clamp(2.6rem, 4.4vw, 4rem); font-weight: 200; letter-spacing: -0.045em; line-height: 0.9; color: var(--gfp-ink); font-variant-numeric: tabular-nums; }
.roster-count--paw { font-size: clamp(2rem, 3vw, 2.6rem); letter-spacing: 0; }
.roster-grid, .roster-body { grid-column: 4 / 13; }
.roster-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px var(--col-gap); align-items: start; }
.roster-grid > li:nth-child(3n+2) { margin-top: clamp(32px, 4vw, 64px); }
.roster + .roster:not(.field) { padding-top: calc(var(--rhythm) * 0.35); }
.ed-flow--people > .roster:first-child { padding-top: calc(var(--rhythm) * 0.35); }

.person-photo { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--card); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; transition: transform 0.6s var(--ease); }
.person-photo img.is-placeholder { object-fit: contain; padding: 14% 12% 8%; mix-blend-mode: multiply; }
.person:hover .person-photo img.is-placeholder { transform: translateY(-3px) rotate(-2deg); }
.person-name { display: block; margin-top: 14px; font-size: 1.06rem; font-weight: 450; letter-spacing: -0.01em; line-height: 1.25; }
.person-role { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
/* Every profile: Research interests, optional Background (folded), Fun fact */
.person-field { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.person-field em { display: block; margin-bottom: 4px; font-style: normal; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.person-field .stub { color: var(--ink-3); }
.person-fact { color: var(--ink); }
.person-bio { margin-top: 14px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.person-bio summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gfp-ink);
}
.person-bio summary::-webkit-details-marker { display: none; }
.person-bio summary::after { content: "+"; font-size: 13px; line-height: 1; }
.person-bio[open] summary::after { content: "\2212"; }
.person-bio p { margin: 8px 0 0; }
.person-links { display: flex; gap: 12px; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }

/* Confocal strip: starts at the roster column and bleeds right, half over the alumni field */
.ed-strip { position: relative; z-index: 2; margin: calc(var(--rhythm) * 0.4) 0 calc(-1 * clamp(48px, 6vw, 88px)); margin-left: calc((100% - 11 * var(--col-gap)) / 12 * 3 + 3 * var(--col-gap)); }
.ed-strip.bleed-right { margin-right: calc(-1 * max(var(--gutter), (100vw - var(--max)) / 2 + var(--gutter))); }
.ed-strip img { width: 100%; height: clamp(110px, 13vw, 190px); object-fit: cover; object-position: 50% 60%; border-radius: var(--soft-r) 0 0 var(--soft-r); }
.roster--alumni { padding-top: calc(var(--rhythm) * 0.62 + clamp(48px, 6vw, 88px)); }
.roster--alumni .subhead:first-child { margin-top: 0; }
.roster--alumni .alum-photo { background: var(--card); border: 0; }
.roster-body .alumni-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.roster--pets { padding-bottom: var(--rhythm); }
.roster-body .pet-grid { margin-top: 0; }
.roster-body .pet-photo { border: 0; background: var(--card); }
.pet-empty { margin: 0; padding: 0; border: 0; text-align: left; font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 300; letter-spacing: -0.01em; line-height: 1.4; color: var(--ink-2); max-width: 36ch; }

/* ---------- Editorial layout: tablet ---------- */

@media (max-width: 1020px) {
  .ed-intro-text, .ed-intro-img, .ed-approach-fig, .ed-approach-text, .ed-side, .ed-papers,
  .ed--news .ed-side, .ed-news, .roster-head, .roster-grid, .roster-body, .ed-hero-text, .ed-pi-text { grid-column: 1 / -1; }
  .ed-intro-img { margin: 40px 0 0; margin-right: calc(-1 * var(--gutter)); }
  .ed-intro-img img { aspect-ratio: 16 / 10; }
  .field--left::before { right: calc(var(--gutter) * 0.5); }
  .field--right::before { left: calc(var(--gutter) * 0.5); }
  .ed--questions .ed-head { max-width: none; }
  .ed-questions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-questions li:nth-child(even) { margin-top: 32px; }
  .ed-approach-fig { margin-top: 0; }
  .ed-approach-text { margin-top: 40px; }
  .ed-side, .roster-head { position: static; margin-bottom: 32px; }
  .ed-head--split > :first-child, .ed-head--split > :last-child { grid-column: 1 / -1; }
  .ed-head--split > :last-child { margin-top: 18px; }
  .ed-news { padding-left: 0; }
  .ed-join { margin-left: calc(var(--gutter) * 0.5); }
  .ed-pi img { grid-column: 1 / -1; grid-row: 2; width: calc(100% + var(--gutter)); margin-top: 40px; aspect-ratio: 16 / 11; }
  .ed-pi-text { grid-row: 3; padding-top: 28px; }
  .roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roster-grid > li:nth-child(3n+2) { margin-top: clamp(20px, 3vw, 36px); }
  .ed-strip { margin-left: 20%; }
}

/* ---------- Editorial layout: phone ---------- */

@media (max-width: 640px) {
  .ed-questions, .ed-news { grid-template-columns: 1fr; }
  .ed-questions li:nth-child(even) { margin-top: 0; }
  .ed-methods { grid-template-columns: 1fr; }
  .mosaic { grid-auto-rows: 34vw; gap: 8px; }
  .mosaic-1 { grid-column: 1 / 8; grid-row: 1 / 3; }
  .mosaic-2 { grid-column: 8 / 13; grid-row: 1; }
  .mosaic-4 { grid-column: 8 / 13; grid-row: 2; }
  .mosaic-3 { grid-column: 1 / 13; grid-row: 3 / 5; }
  .mosaic span { left: 6px; bottom: 6px; font-size: 9.5px; }
  .ed-papers .pub-row > a { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "year main" "year venue"; }
  .ed-join { margin-left: 0; border-radius: var(--soft-r) var(--soft-r) 0 0; min-height: 420px; }
  .ed-join::after { background: linear-gradient(0deg, var(--ink) 10%, rgba(18, 19, 21, 0.55) 60%, rgba(18, 19, 21, 0.35)); }
  .page-home .site-footer { border-radius: 0; }
  .ed-pi img { aspect-ratio: 1 / 1; }
  .roster-grid { grid-template-columns: 1fr; gap: 40px; }
  .roster-grid > li:nth-child(3n+2) { margin-top: 0; }
  .person-photo { aspect-ratio: 16 / 10; }
  .roster-body .alumni-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-strip { margin-left: 12%; }
}
