/* Liu Lab — design system.
   Committed single-theme dark: the subject is fluorescence microscopy, where signal
   is read off a dark field. A light variant would fight the imagery, so this is a
   deliberate choice rather than an omission. */

:root {
  /* Palette taken from the 17 Aug design source. Ground is a blue-biased navy
     (hue 260) rather than pure black; a single cyan carries every accent. */
  --bg:        oklch(0.135 0.028 260);
  --panel:     oklch(0.185 0.030 260);
  --panel-2:   oklch(0.220 0.030 260);
  --panel-3:   oklch(0.170 0.030 260);
  --footer-bg: oklch(0.115 0.028 260);

  /* Ink */
  --ink:   oklch(0.940 0.008 260);
  --muted: oklch(0.770 0.018 260);
  --dim:   oklch(0.660 0.020 260);

  /* One accent, used everywhere. The earlier draft also carried a magenta;
     the newer design drops it, and a single accent reads more disciplined. */
  --accent:      oklch(0.84 0.13 195);
  --accent-deep: oklch(0.74 0.14 195);

  --line:        oklch(0.275 0.025 260);
  --line-strong: oklch(0.360 0.030 260);

  /* Type */
  --display: 'Spectral', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, sans-serif;
  --mono: ui-monospace, 'IBM Plex Mono', Menlo, 'Cascadia Mono', Consolas, monospace;

  /* Rhythm */
  --gutter:    clamp(20px, 5vw, 72px);
  --section-y: clamp(76px, 9vw, 132px);
  --measure:   68ch;
  --maxw:      1180px;

  /* The single content column every full-bleed band aligns to. Sections centre
     their own .wrap; the header and hero have no wrap, so they use this as
     inline padding and land on exactly the same edge. */
  --edge: max(var(--gutter), (100% - var(--maxw)) / 2);
}

/* A 1180px column strands most of a large monitor. Widen the measure rather
   than leaving ~700px of dead margin each side. */
@media (min-width: 1560px) { :root { --maxw: 1320px; } }
@media (min-width: 1960px) { :root { --maxw: 1440px; } }

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, oklch(0.84 0.13 195 / 0.13), transparent 28rem),
    radial-gradient(circle at 14% 62%, oklch(0.84 0.13 195 / 0.08), transparent 24rem),
    var(--bg);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }

.h-hero {
  font-size: clamp(2.2rem, 4.6vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 21ch;
}
.h-page, .h-section {
  font-size: clamp(2.1rem, 4.2vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.016em;
  max-width: 26ch;      /* 20ch broke the longer page titles into four stub lines */
}
.h-card { font-size: 1.32rem; line-height: 1.25; letter-spacing: -0.008em; }

p { margin: 0; }
.lead  { color: var(--muted); font-size: 1.075rem; line-height: 1.72; max-width: var(--measure); }
.body  { color: var(--muted); line-height: 1.68; max-width: var(--measure); }
.dim   { color: var(--dim); }

/* Eyebrow: mono, because on this site small uppercase labels are instrument
   readouts — years, DOIs, counts — and they should all share one voice. */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 20px;
}
.eyebrow::before { content: ''; width: 34px; height: 1px; background: currentColor; flex: none; }

.meta { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */

.wrap    { max-width: var(--maxw); margin-inline: auto; }
.section { padding: var(--section-y) var(--gutter); }
.section--alt {
  background: linear-gradient(180deg, oklch(0.185 0.030 260 / 0.72), oklch(0.135 0.028 260 / 0.24));
  border-block: 1px solid var(--line);
}
.section__head { max-width: 880px; margin-bottom: clamp(34px, 4vw, 48px); }
.section__head > * + * { margin-top: 18px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px var(--edge);
  background: oklch(0.135 0.028 260 / 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; }
/* The new lockup carries the wordmark itself, so there is no text beside it,
   and its ink was pre-lightened for this ground, so no filter either. */
.brand img { height: 42px; width: auto; display: block; }

.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 20px; font-size: 0.875rem; color: var(--muted); }
.nav a { padding: 5px 0; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle { display: none; }

/* ---------- hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 76svh;
  display: grid; align-items: center;    /* centred: bottom-anchoring left a dead field up top */
  padding: clamp(64px, 8vw, 104px) var(--edge) clamp(56px, 7vw, 88px);
}
/* Two layers: a still gradient scrim, and the photograph moving underneath it
   like a stage being walked across at low magnification.

   The scale is held CONSTANT and only the translation animates. Animating
   scale as well made the browser resample the image at a slightly different
   size every frame, which on a detailed fluorescence image reads as a shimmer
   rather than as movement. A fixed-scale translation is a pure compositor
   transform: no resampling, no jitter. */
.hero::before {
  content: ''; position: absolute; z-index: -2;
  top: -8%; bottom: -8%; right: -8%;
  /* Capped, not stretched. The hero source is only 1536px wide, so letting it
     cover a 3440px viewport meant a 2.6x upscale and a visibly soft image.
     Capping the layer holds the upscale near 1.2x at any width; beyond the cap
     the ground simply continues, and the mask fades the image's own left edge
     in so there is no seam. */
  width: min(116%, 1900px);
  background: var(--hero-image, none) center right / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24%);
          mask-image: linear-gradient(90deg, transparent 0, #000 24%);
  animation: hero-pan 96s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, oklch(0.135 0.028 260 / 0.96) 0%, oklch(0.135 0.028 260 / 0.78) 38%, oklch(0.135 0.028 260 / 0.24) 72%),
    linear-gradient(0deg, var(--bg) 0%, transparent 34%);
}
/* A closed loop — the last frame equals the first, so it repeats without the
   snap-back an `alternate` cycle produces. Four waypoints on an irregular path
   read as someone traversing a specimen rather than as a mechanical sweep. */
/* No scale at all. The -8% inset already provides more travel room than the
   path uses, so scaling would only enlarge a 1536px source beyond its native
   width and soften it. Translation alone keeps the image at ~1:1. */
@keyframes hero-pan {
  0%   { transform: translate3d(  0%,    0%,   0); }
  27%  { transform: translate3d(-2.6%,  -1.1%, 0); }
  52%  { transform: translate3d(-3.4%,   1.3%, 0); }
  78%  { transform: translate3d(-1.1%,   2.0%, 0); }
  100% { transform: translate3d(  0%,    0%,   0); }
}
.hero__inner { max-width: 780px; }
.hero__inner > * + * { margin-top: 24px; }
.hero .lead { font-size: clamp(1.06rem, 1.7vw, 1.3rem); max-width: 58ch; }

.page-hero { padding: clamp(88px, 9vw, 128px) var(--gutter) clamp(54px, 7vw, 90px); }
/* The content sits inside .wrap, so a direct-child selector here matched
   nothing and every subpage title ran straight into its lead paragraph. */
.page-hero .wrap > * + * { margin-top: 20px; }

/* ---------- buttons ---------- */

.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 12px 20px;
  border: 1px solid rgb(255 255 255 / 0.14); border-radius: 6px;
  background: rgb(255 255 255 / 0.04);
  font-size: 0.94rem; font-weight: 500;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--line-strong); background: rgb(255 255 255 / 0.07); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  border-color: oklch(0.84 0.13 195 / 0.55);
  background: linear-gradient(135deg, oklch(0.84 0.13 195 / 0.22), oklch(0.74 0.14 195 / 0.12));
}
.btn--primary:hover { border-color: var(--accent); }

.logos { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.logos img { max-height: 40px; max-width: 168px; object-fit: contain; filter: brightness(1.12); }

/* ---------- hairline grid ----------
   Dividers are 1px GAPS over a filled container, not per-tile borders — that keeps
   every internal rule exactly 1px with no doubling where tiles meet. */

.grid {
  display: grid; gap: 1px;
  border: 1px solid var(--line); background: var(--line);
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
}
.tile {
  background: linear-gradient(180deg, oklch(0.200 0.030 260 / 0.96), oklch(0.160 0.028 260 / 0.98));
  padding: 30px; min-height: 226px;
  display: flex; flex-direction: column; gap: 14px;
}
.tile__icon { width: 52px; height: 52px; flex: none; color: var(--accent); }
.tile__icon svg { width: 100%; height: 100%; display: block; }
.tile p { color: var(--muted); line-height: 1.62; }

.tile--media { padding: 0; overflow: hidden; gap: 0; }
.tile--media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 1px solid var(--line); }
.tile--media .tile__body { padding: 26px 30px 30px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- publications ---------- */

.pub-summary { margin-bottom: 30px; }
.pub-list { max-width: 1080px; }

/* Grouped by year: with 21 entries a flat list is hard to scan, and the year
   printed on every row was repeating itself. It now heads the group instead. */
.pub-year { margin-bottom: clamp(30px, 4vw, 48px); }
.pub-year__label {
  font-family: var(--mono); font-size: 0.86rem; font-weight: 500;
  letter-spacing: 0.12em; color: var(--accent);
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.pub {
  display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 22px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.pub__n { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 4px; }
.pub__title { font-family: var(--display); font-size: 1.16rem; line-height: 1.36; margin-bottom: 7px; }
.pub__authors { color: var(--muted); font-size: 0.94rem; line-height: 1.6; }
.pub__journal { color: var(--dim); font-size: 0.94rem; font-style: italic; }
.pub__doi { display: inline-block; margin-top: 9px; font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.pub__doi:hover { text-decoration: underline; text-underline-offset: 3px; }
.pub[data-featured] .pub__title { color: var(--ink); }
.pub[data-featured] .pub__n::after {
  content: 'selected'; display: block; margin-top: 8px;
  font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}

/* ---------- people ---------- */

.pi {
  display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 76px); align-items: center; max-width: 1040px;
}
/* No forced ratio and no cover: the portrait is shown whole and simply scaled
   to the column, whatever proportions it happens to have. */
.pi img { width: 100%; height: auto; border: 1px solid var(--line); }
.pi__body > * + * { margin-top: 14px; }
.pi__zh { font-family: var(--mono); font-size: 1.02rem; color: var(--accent); }

.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.person {
  border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(180deg, oklch(0.200 0.030 260 / 0.96), oklch(0.160 0.028 260 / 0.98));
  display: grid; grid-template-rows: auto 1fr;
}
.person img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--line); }
.person__body { padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 9px; }
.person__name { font-family: var(--display); font-size: 1.5rem; line-height: 1.2; }
.person__en { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.03em; }
.person__role { font-size: 0.82rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.person p { color: var(--muted); font-size: 0.96rem; line-height: 1.68; }

.alumni { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); max-width: 960px; }
.alumnus { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px; background: var(--panel-3); }
.alumnus img { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); }
.alumnus b { font-family: var(--display); font-size: 1.05rem; font-weight: 400; display: block; }

/* ---------- news ---------- */

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.post { background: var(--panel-3); display: flex; flex-direction: column; }
.post img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post__body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post__title { font-family: var(--display); font-size: 1.2rem; line-height: 1.3; }
.post p { color: var(--muted); font-size: 0.94rem; line-height: 1.62; }
.post:hover .post__title { color: var(--accent); }

/* ---------- resources ---------- */

.res-group { display: flex; flex-direction: column; gap: 14px; }
.res { display: flex; flex-direction: column; gap: 2px; }
.res a { color: var(--accent); font-weight: 500; }
.res a:hover { text-decoration: underline; text-underline-offset: 3px; }
.res span { font-size: 0.86rem; color: var(--dim); }

/* ---------- join band ---------- */

.band {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 38px; align-items: center;
  padding: clamp(48px, 6vw, 84px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, oklch(0.84 0.13 195 / 0.16), oklch(0.74 0.14 195 / 0.05)), oklch(0.185 0.030 260 / 0.90);
}
.band > div > * + * { margin-top: 16px; }

/* ---------- footer ---------- */

.site-footer { padding: 44px var(--gutter); border-top: 1px solid var(--line); background: var(--footer-bg); color: var(--dim); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; }
.site-footer b { color: var(--muted); font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- scroll reveal ----------
   Applied by JS only, so the page is fully readable with scripting off; the
   class never lands and nothing is ever left invisible. Reduced-motion users
   get the end state immediately (see nav.js). */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
}
/* The section head leads, its content follows a beat later. */
.reveal.is-in { transition-delay: 0ms; }
.section__head.reveal.is-in { transition-delay: 0ms; }
.tools.reveal.is-in, .topics.reveal.is-in, .grid.reveal.is-in { transition-delay: 90ms; }

/* ---------- async states ---------- */

[data-loading] { position: relative; min-height: 120px; }
[data-loading]::after {
  content: 'Loading…'; font-family: var(--mono); font-size: 0.78rem; color: var(--dim);
  position: absolute; inset: 0; display: grid; place-items: center;
}
[data-failed]::after {
  content: 'This section could not load. Please refresh.';
  font-family: var(--mono); font-size: 0.78rem; color: var(--dim);
  display: block; padding: 26px 0;
}
[data-failed] > * { display: none; }

/* ---------- affiliation ----------
   The lab's institutional identity, given its own block rather than a 0.7rem
   label above the headline. Logos and wordmark read as one unit. */

.affil {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px;
  margin-top: 34px; padding-top: 26px;
  border-top: 1px solid var(--line);
}
.affil__mark {
  height: 54px; width: auto;
  max-width: min(320px, 72vw);
  object-fit: contain; flex: none;
}
/* The three marks carry very different aspect ratios, so matching them on
   height alone leaves the wordier ones looking cramped; a little extra room
   for the two university marks evens the row out optically. */
.affil__mark--invert { height: 50px; }
/* PKU and CFT ship as dark marks on transparency, so they vanish on this
   ground. Forcing them to white keeps the three lockups reading as a set;
   the NBIC mark is already a light variant and is left alone. */
.affil__mark--invert { filter: brightness(0) invert(1); opacity: .92; }

/* ---------- tools ----------
   Four cards, each tagged by what the tool does: see / steer / observe / design.
   The tag is the point — biosensors read state, optogenetics writes it. */

/* Separate cards with real gaps rather than a 1px hairline lattice — the
   lattice read as a table and left the copy feeling boxed in. The second
   column drops half a step so the four don't line up like a spreadsheet. */
.tools {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 30px);
  padding-bottom: 28px;   /* room for the staggered column below */
}
.tool {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, oklch(0.200 0.030 260 / 0.96), oklch(0.160 0.028 260 / 0.98));
  transition: border-color .35s ease, transform .35s ease;
}
.tool:nth-child(even) { transform: translateY(28px); }
.tool:hover { border-color: var(--line-strong); }

.toolfig {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2;
  background: oklch(0.115 0.028 260);
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  transition: transform .7s cubic-bezier(.2, .7, .3, 1);
}
img.toolfig { object-fit: cover; }
.tool:hover .toolfig { transform: scale(1.035); }

.tool__body { padding: 30px 34px 34px; display: flex; flex-direction: column; gap: 13px; }
.tool__tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.tool h3 { font-family: var(--display); font-size: 1.3rem; line-height: 1.24; }
.tool p { color: var(--muted); font-size: 0.96rem; line-height: 1.64; }

/* ---------- page patterns ---------- */

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  padding: 10px 16px; background: var(--panel-2); border: 1px solid var(--accent);
}
.skip:focus { left: 12px; }

/* Home: the four research questions as a plain index, not four heavy cards.
   Keeping the home page light is the point — the detail lives on /research/. */
.topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.topics a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  transition: padding-left .18s, border-color .18s;
}
.topics b { font-family: var(--display); font-size: 1.42rem; font-weight: 400; flex: 0 0 auto; }
.topics span { color: var(--dim); font-size: 0.95rem; }
.topics a:hover { padding-left: 12px; border-bottom-color: var(--accent); }
.topics a:hover b { color: var(--accent); }

.recent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }

/* Research page: alternating figure / prose blocks */
.story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 60px); align-items: center;
  padding: clamp(34px, 4vw, 54px) 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: 110px;
}
.story:first-of-type { border-top: 1px solid var(--line); }
.story img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line); }
.story:nth-of-type(even) img { order: 2; }
.story > div > * + * { margin-top: 14px; }
.h-story { font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.22; }

/* A full-bleed figure between sections. It reads as an image rather than as
   chrome, which is why it carries no text: this montage is far more saturated
   than the site's single-accent palette, and behind a headline it would both
   fight the type and lose the cell morphology that makes it worth showing. */
.band-figure { margin: 0; }
.band-figure img {
  width: 100%; height: clamp(240px, 30vw, 420px);
  object-fit: cover; display: block;
  border-block: 1px solid var(--line);
}
.band-figure figcaption { padding: 14px var(--edge) 0; }

/* Technologies: a genuine sequence, so numbering is meaningful here */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.flow li { position: relative; padding: 26px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.flow__n { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.1em; }
.flow b { font-family: var(--display); font-size: 1.16rem; font-weight: 400; }
.flow p { color: var(--muted); font-size: 0.94rem; line-height: 1.6; }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 20px; color: var(--muted); line-height: 1.62; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 7px; height: 1px; background: var(--accent); }

.pub__n { display: block; margin-top: 4px; color: var(--dim); font-size: 0.72rem; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .site-header { flex-direction: row; align-items: center; }
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
    border: 1px solid var(--line-strong); border-radius: 6px;
    background: transparent; color: var(--ink);
    font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer;
  }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 18px;
    background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a:last-child { border-bottom: 0; }
}

@media (max-width: 920px) {
  .recent, .two-col, .flow, .tools { grid-template-columns: 1fr; }
  .tools { padding-bottom: 0; }
  .tool:nth-child(even) { transform: none; }   /* stagger only makes sense in two columns */
  .story { grid-template-columns: 1fr; }
  .story:nth-of-type(even) img { order: 0; }
  .affil { flex-direction: column; align-items: flex-start; gap: 18px; }
  .grid { --cols: 1 !important; }
  .pi, .band, .alumni, .site-footer .wrap { grid-template-columns: 1fr; }
  .site-footer .wrap { align-items: start; }
  /* No .site-header rule here. It used to force flex-direction: column, and
     because this block sits after the 860px one it also won below 860px —
     which stacked the Menu button under the brand instead of beside it.
     Between 861 and 920px the header stays a row and the nav simply wraps. */
  .nav { justify-content: flex-start; }
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .pub__n { padding-top: 0; display: flex; gap: 12px; align-items: baseline; }
  .pub[data-featured] .pub__n::after { margin-top: 0; }
}

@media (max-width: 720px) {
  /* Three stacked marks at full height ate most of a phone screen. */
  .affil { gap: 14px; }
  .affil__mark { height: 40px; }
  .affil__mark--invert { height: 38px; }

  .people { grid-template-columns: 1fr; }
  .person img { aspect-ratio: 4 / 3; }
  .person__body { padding: 24px; }
}

