/* main.css — "Clinical Clean" v2.
   A modern, flowing, responsive layout. The legacy 753px pixel grid is retired:
   content reads top-to-bottom in DOM order (already reading order) and is laid
   out with flex/grid + the 8px spacing scale. Light, airy, token-driven. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--c-bg-outer);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }
img { border: 0; max-width: 100%; height: auto; }
strong { font-weight: 700; }

/* --------------------------------------------------------------- Frame ---- */
/* Reserve the scrollbar's width on BOTH sides so the centered frame stays truly
   centered — otherwise the vertical scrollbar eats width only on the right and
   the page looks shifted left (a left-right centering that's "not nice"). */
html { scrollbar-gutter: stable both-edges; }

.frame {
  max-width: var(--wrap);
  margin: 0 auto;
  background: var(--c-bg-panel);
  min-height: 100vh;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- Header --- */
/* The cone-mosaic header image is the brand. It fills the full width of the
   frame so the header is exactly as wide as the page below it. (The source is a
   753px raster; at the 860px frame it scales up ~14%. Swap in a 2× asset to keep
   it razor-sharp — see Header_cones.) A charcoal band backs it as a fallback. */
.site-head {
  position: relative;
  background: var(--c-head-band);
}
.brand { display: block; line-height: 0; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.nav__tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-left: var(--s-2); }
.lang-toggle, .theme-toggle {
  width: 32px; height: 32px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: transparent;
  color: var(--c-nav-text);
  border: 1px solid var(--c-line);
  cursor: pointer; line-height: 1;
  transition: color .15s, border-color .15s, transform .15s;
}
.theme-toggle { font-size: 16px; }
.theme-toggle svg { display: block; }
.lang-toggle { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-decoration: none; }
.lang-toggle:hover, .theme-toggle:hover { color: var(--c-heading); border-color: var(--c-nav-text); transform: scale(1.06); text-decoration: none; }

/* --------------------------------------------------------------- Nav ------ */
/* A clean bar under the header band: uppercase labels, amber underline for the
   current page (echoing the legacy amber "active" button). */
.nav {
  margin: 0;
  background: var(--c-bg-panel);
  border-bottom: 1px solid var(--c-line);
}
.nav__inner {
  display: flex; align-items: stretch; margin: 0 auto; max-width: var(--wrap);
  padding: 0 max(var(--s-2), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s-2), env(safe-area-inset-right, 0px));
}
/* On a mouse/desktop the links wrap to rows so nothing is ever hidden (a mouse
   can't swipe). On touch devices they become a single swipeable row instead —
   see the (pointer: coarse) block below. Tools stay pinned to the right. */
.nav__list {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0;
  list-style: none; margin: 0; padding: 0;
  flex: 1 1 auto; min-width: 0;
}
.nav__link {
  display: block;
  padding: 14px 15px;
  font-family: var(--font-nav);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-nav-text);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.nav__link:hover { color: var(--c-heading); text-decoration: none; }
.nav__link.is-active { color: var(--c-nav-active); border-bottom-color: var(--c-accent); }
.nav__link.is-active:hover { color: var(--c-nav-active); }

/* Project sub-navigation */
.subnav { border-bottom: 1px solid var(--c-line); }
.subnav__list {
  display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0 auto;
  max-width: var(--wrap);
  padding: 10px max(var(--s-3), env(safe-area-inset-left, 0px));
}
.subnav__link {
  display: block; padding: 5px 11px; border-radius: 999px;
  font-family: var(--font-nav); font-weight: 600; font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--c-nav-text); white-space: nowrap;
}
.subnav__link:hover { color: var(--c-heading); background: var(--c-surface); text-decoration: none; }
.subnav__link.is-active { color: var(--c-accent); background: var(--c-surface); }

/* Touch devices (which can swipe) get a single scrollable row with a soft
   edge-fade; mouse/desktop keeps the wrapping rows above so nothing is hidden. */
@media (pointer: coarse) {
  .nav__list, .subnav__list {
    flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent);
            mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent);
  }
  .nav__list::-webkit-scrollbar, .subnav__list::-webkit-scrollbar { display: none; }
}

/* --------------------------------------------------------------- Content -- */
.content {
  display: block;
  /* One container width for EVERY page (was --wrap-text on some, --wrap on
     others, so Contact/Impressum/study/project pages looked narrower). Running
     text is still capped at --wrap-text below for a comfortable measure. */
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--s-5) max(var(--s-3), env(safe-area-inset-left, 0px)) var(--s-6);
}
.content img { height: auto; }
/* First element sits tight under the content padding on every page — overrides
   the default top margin of a leading heading (e.g. .content h2) so the gap
   below the menu ribbon is uniform. */
.content > *:first-child { margin-top: 0; }

.content h1 {
  margin: 0 0 var(--s-2);
  color: var(--c-heading);
  font-size: var(--fs-5);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}
.content h2 {
  margin: var(--s-6) 0 var(--s-2);
  color: var(--c-heading);
  font-size: var(--fs-4);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
  text-wrap: balance;
}
.content p { margin: 0 0 var(--s-2); }
.content > p, .content li { max-width: var(--wrap-text); }

/* --------------------------------------------------------- Home (modern) -- */
/* Hero */
.c-welcome { margin-bottom: var(--s-3) !important; }
.c-intro { font-size: var(--fs-3); color: var(--c-text); line-height: 1.55; }
.c-intro p { margin: 0 0 var(--s-2); }
/* Intro row: the welcome text and the lab visual sit side by side, stacking
   only when there is no room. The float approach put the image after the text
   in source, so it never wrapped beside it — a flex row fixes that at any width. */
.c-introrow { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-start; margin: 0 0 var(--s-3); }
.c-introrow .c-intro { flex: 1 1 300px; min-width: 0; margin: 0; }
/* Right column of the intro row: the lab figure with the study call-to-action
   beneath it. On desktop the column is height-matched to the intro text and the
   figure flexes to fit, so figure + CTA never exceed the text height and nothing
   below (the box itself or the next section) is pushed down. */
.c-introrow__side { display: flex; flex-direction: column; gap: var(--s-3); align-items: center; min-width: 0; }
.c-introrow__side .c-studies { margin: 0; width: 100%; }
/* "Take part in a study" call-to-action → Contact page */
.c-studies {
  display: flex; align-items: center; gap: var(--s-2);
  border: 1px solid var(--c-line); border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-s); background: var(--c-surface);
  padding: var(--s-2) var(--s-3); margin: 0; color: var(--c-text);
}
.c-studies:hover { text-decoration: none; border-color: var(--c-accent); background: var(--c-bg-panel); }
.c-studies__txt { min-width: 0; font-size: 14.5px; }
.c-studies__txt strong { color: var(--c-heading); }
.c-studies__go { margin-left: auto; color: var(--c-accent); font-size: 20px; flex: 0 0 auto; }
.c-hero {
  flex: 0 0 auto; width: 240px; max-width: 100%;
  /* auto side margins centre it when the row wraps and it sits alone on a line;
     on wide screens the intro text grows and absorbs the space, so no effect. */
  margin: 0 auto;
}
/* Theme-matched home figure: the white-matte art blends into the white panel in
   light mode, the grey-matte version into the charcoal panel in dark mode. No
   card frame, so each reads as floating directly on the page. */
.c-hero--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-hero--light { display: none; }
  :root:not([data-theme="light"]) .c-hero--dark { display: block; }
}
:root[data-theme="dark"] .c-hero--light { display: none; }
:root[data-theme="dark"] .c-hero--dark { display: block; }

/* ---- Inline download marker: small PDF icon + label. Replaces the old red
   PNG logos. The icon is an SVG (not an emoji) so it stays crisp and neutral. */
.dl {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px; letter-spacing: .03em;
  color: var(--c-link); white-space: nowrap;
}
/* The icon, shared by the explicit .dl link and by ANY in-text link to a PDF
   anywhere in the content — except image links (book covers etc.), which wrap an
   <img> rather than text. */
/* Keep the icon glued to its link text (no line break between them). */
.content a[href$=".pdf" i]:not(.dl):not(:has(img)) { white-space: nowrap; }
.dl::before,
.content a[href$=".pdf" i]:not(.dl):not(:has(img))::before {
  content: ""; display: inline-block; flex: 0 0 auto;
  width: 12px; height: 14px; margin-right: 4px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M4 1h11l7 7v17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2z' fill='%23cf3a2c'/%3E%3Cpath d='M15 1l7 7h-6a1 1 0 0 1-1-1z' fill='%23932015'/%3E%3Crect x='6' y='14' width='10' height='1.8' rx='.9' fill='%23fff'/%3E%3Crect x='6' y='18' width='12' height='1.8' rx='.9' fill='%23fff'/%3E%3Crect x='6' y='22' width='8' height='1.8' rx='.9' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}
.dl { gap: 0; }
.dl::before { margin-right: 6px; }
.dl:hover { text-decoration: none; color: var(--c-link-hover); }
.dl:hover span { text-decoration: underline; }
/* XLS variant — green spreadsheet glyph */
.dl--xls::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M4 1h11l7 7v17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2z' fill='%231d7a44'/%3E%3Cpath d='M15 1l7 7h-6a1 1 0 0 1-1-1z' fill='%2311512d'/%3E%3Cpath d='M6.5 13h11v10h-11z' fill='none' stroke='%23fff' stroke-width='1.3'/%3E%3Cpath d='M10 13v10M14 13v10M6.5 16.5h11M6.5 20h11' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Introduction section */
.c-motion {
  display: block; margin: 0 0 var(--s-2);
  border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.c-motion-txt { margin: 0 0 var(--s-3); }
.c-witten {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-s); padding: var(--s-2) var(--s-3);
  font-size: 14.5px; color: var(--c-muted); line-height: 1.55;
  margin: var(--s-2) 0 var(--s-3) !important;
}
.c-witten strong { color: var(--c-text); }
.c-witten-pdf { display: none; } /* citation already links out; icon is redundant in the card */
.c-books-intro { margin-top: var(--s-2); }
/* Gif + explanatory text: a balanced row on desktop, stacked on mobile. The key
   reference card and the covers follow full-width below. */
.c-motion-row { display: flex; flex-direction: column; gap: var(--s-3); margin: 0 0 var(--s-3); }
.c-motion-row .c-hero-motion { margin: 0; }
.c-motion-text { min-width: 0; }
.c-motion-text .c-motion-txt { margin: 0 0 var(--s-2); }
.c-motion-text .c-books-intro { margin: 0; }
/* The first methods heading sits closer to the intro block (its default 64px top
   margin left too large a gap under the welcome/intro row). */
.content--home .c-intro-h { margin-top: var(--s-4); }

/* Book covers + review PDFs */
.book-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin: var(--s-2) 0 var(--s-3); }
.book-row img { max-height: 190px; width: auto; border-radius: 6px; box-shadow: var(--shadow); }
.book-row a { line-height: 0; }
/* Home: each book cover sits above its article link, centred, in an even row.
   Covers are shown at their native height (120px) so they stay crisp. */
.book-reviews { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4); margin: var(--s-3) 0; }
.book-review { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; width: 150px; text-align: center; }
/* Target size = the first cover's native 150x200. The other three are low-res
   (84x120) source files and will look soft here until higher-res ones replace them. */
.book-review img { height: 190px; width: auto; max-width: 100%; border-radius: 6px; box-shadow: var(--shadow); display: block; }
.book-review > a:first-child { line-height: 0; }
/* Caption under each cover. Rendered as a centred text block (not an inline-flex
   row) so a two-line label stays centred with the PDF icon glued to the first
   word — the inline-flex version left an odd gap beside the shorter line. */
.book-review .dl { display: block; width: 100%; text-align: center; white-space: normal; font-size: 12.5px; line-height: 1.4; }
.pdf-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: var(--s-1) 0 var(--s-3); }

/* Cover zoom: the first cover opens its full artwork in an on-page lightbox
   (progressive — without JS the link still opens the image in a new tab). */
.cover-zoom { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 4vw, 48px); background: rgba(0,0,0,.82); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 8px; box-shadow: 0 16px 50px rgba(0,0,0,.6); cursor: default; }
.lightbox__close { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: 16px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox__close:hover { background: rgba(255,255,255,.26); }

.c-impressum { font-size: var(--fs-1); color: var(--c-muted); margin: var(--s-5) 0 0; }
.c-copyright { display: none; } /* legacy dark watermark; replaced by the footer */

/* ----------------------------------------------- Generic subpage scaffold - */
/* Subpages were pixel-pinned; now they flow in the readable column. These
   defaults keep every page clean in the new language pending per-page polish. */
.content--sub, .content--pubs, .content--project, .content--study,
.content--contact, .content--impressum, .content--people,
.content--research, .content--resources { height: auto !important; }

/* Pinned children now flow as normal blocks. */
.pin { position: static !important; top: auto; left: auto; }

.pg-hero { margin: 0 0 var(--s-3); }
.pg-hero img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.pg-hero figcaption, .rh-cap, .rs-cap { text-align: right; font-size: var(--fs-1); color: var(--c-muted); padding: 4px 2px 0; }
.pg-body { padding: 0; }
.sec-h, .rh-h { font-size: var(--fs-4); color: var(--c-heading); font-weight: 700; margin: var(--s-5) 0 var(--s-2); letter-spacing: -.015em; }
.pg-copyright, .rh-copyright, .pe-copyright, .rs-copyright, .pub-copyright, .ct-copyright, .im-copyright { display: none; }

/* Headings / captions / intros */
.ct-h, .im-h, .pe-h, .rs-h {
  font-size: var(--fs-4); color: var(--c-heading); font-weight: 700;
  margin: var(--s-5) 0 var(--s-2); letter-spacing: -.015em;
}
/* First heading sits tight under the content padding; `.content h2` (0,1,1)
   would otherwise force a full --s-6 top margin, leaving a big gap. */
.content .pe-h--members, .content .im-h:first-child { margin-top: 0; }
.im-en-note { font-size: var(--fs-1); color: var(--c-muted); margin: 0 0 var(--s-3); }
#theses { scroll-margin-top: var(--s-4); }   /* breathing room when jumped to via #theses */
.rh-intro, .rs-txt, .ct-intro { color: var(--c-text); margin: 0 0 var(--s-2); }
.content .rh-intro { margin-bottom: var(--s-5); }

/* Research — project tiles (cards like People); the whole tile is clickable. */
.proj-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
.proj {
  display: flex; gap: var(--s-2); align-items: flex-start; position: relative;
  border: 1px solid var(--c-line); border-radius: var(--radius-s);
  background: var(--c-surface); padding: var(--s-2) var(--s-3);
  transition: border-color .15s, background .15s;
}
.proj:hover { border-color: var(--c-accent); background: var(--c-bg-panel); }
.proj__icon { flex: 0 0 84px; line-height: 0; }
.proj__icon img { width: 84px; height: 84px; border-radius: 10px; }
.proj__icon--svg { width: 84px; height: 84px; }
.proj__text { min-width: 0; }
.content .proj__title { font-size: 17px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; }
.proj__title a { color: var(--c-link); text-decoration: none; }
/* Stretch the title link over the entire tile so a click anywhere navigates. */
.proj__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.proj:hover .proj__title a { text-decoration: underline; }
.proj__desc, .proj__text p { color: var(--c-muted); margin: 0; font-size: 14.5px; line-height: 1.5; }

/* People — photo + text cards */
.person { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0 0 var(--s-3); }
.person__photo { flex: 0 0 92px; width: 92px; height: 92px; border-radius: 10px; object-fit: cover; }
.person__text { min-width: 0; font-size: 14.5px; color: var(--c-text); line-height: 1.5; }
.person__name { color: var(--c-heading); font-weight: 700; }
.pe-links { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s-3); flex-wrap: wrap; }
.pe-links img { display: block; }
.pe-logo { display: inline-block; line-height: 0; margin: 0 var(--s-2) var(--s-2) 0; }
.pe-voronoi { display: none; }

/* Resources */
.rs-txt a { overflow-wrap: anywhere; }
.rs-txt p { margin: .5em 0 0; }
.rs-logo { display: inline-block; line-height: 0; margin: 0 var(--s-2) var(--s-2) 0; vertical-align: middle; }
/* Funders: centred and loosely spaced, the way the legacy row looked. */
.rs-funders { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-4) var(--s-5); margin: var(--s-3) auto var(--s-3); }
.rs-funders .rs-logo { margin: 0; }
/* Gertrud Kusen Stiftung has no real logo — a tidy theme-aware text badge. */
.rs-kusen {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 9px 16px; line-height: 1.05; text-align: center;
  border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-surface);
}
.rs-kusen strong { font-size: 15px; font-weight: 700; color: var(--c-heading); letter-spacing: .005em; }
.rs-kusen > span { font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--c-accent); }

/* Publications */
.content--pubs a { overflow-wrap: anywhere; }
.pub-profiles { float: right; display: flex; gap: 8px; margin: 0 0 6px 12px; }
.pub-profiles img { display: block; }
.pub-note { text-align: right; clear: right; color: var(--c-muted); font-size: 14px; }
.pub-rule { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-2) 0; }
.pub-dl { float: right; display: flex; gap: 12px; margin: 0 0 6px 14px; }
.pub-dl img { display: block; }
.content--pubs .pub-year { font-size: 18px; color: var(--c-heading); font-weight: 700; margin: var(--s-4) 0 var(--s-2); letter-spacing: -.01em; }
.pub { display: flex; gap: var(--s-2); align-items: baseline; margin: 0 0 var(--s-2); }
.pub__num {
  flex: 0 0 auto; min-width: 2.5ch; text-align: right;
  color: var(--c-muted); font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.content--pubs .pub__cite { margin: 0; line-height: 1.5; font-size: 14.5px; min-width: 0; }
/* keep inline PDF links from breaking across the icon, and keep a DOI intact
   (never wrap in the middle of a doi) */
.pub__cite a[href$=".pdf" i],
.person__text a[href$=".pdf" i],
.rs-txt a[href$=".pdf" i],
.pub__cite a[href*="doi.org" i],
.pb-ref a[href*="doi.org" i] { white-space: nowrap; }

/* Reference typography — the start-page citation treatment (.c-witten): the
   authors/venue sit in muted text and the title stands out brighter and bold.
   Applied to every reference as PLAIN text (no card box): publications, theses,
   project references. */
.content--pubs .pub__cite,
.pb-ref { color: var(--c-muted); }
.content--pubs .pub__cite strong,
.pb-ref strong { color: var(--c-text); font-weight: 700; }

/* Project / study detail blocks */
.pb-img { display: block; margin: 0 auto var(--s-2); border-radius: var(--radius-s); max-width: 100%; }
.study-dl { margin: var(--s-3) 0; }
.pb-txt { color: var(--c-text); line-height: 1.6; margin: 0 0 var(--s-2); }
.pb-txt a { overflow-wrap: anywhere; }
.pb-h { font-size: 18px; font-style: normal; color: var(--c-heading); font-weight: 700; margin: var(--s-4) 0 var(--s-2); }
.pb-photo { display: inline-block; line-height: 0; margin: 0 var(--s-2) var(--s-2) 0; }
.pb-photo img { display: block; }
.pb-ref { margin: 0 0 var(--s-2); }
.pb-txt ul { margin: .5em 0; padding-left: 22px; }
.pb-txt ul li { margin: 0 0 .3em; }
.pb-center { text-align: center; }
.pb-sub { text-align: center; color: var(--c-muted); font-size: var(--fs-2); line-height: 1.5; margin: 0 auto var(--s-4); max-width: var(--wrap-text); }

address { font-style: normal; }
.ct-tel { display: inline-block; margin-top: 1em; }

/* --------------------------------------------------------------- Footer --- */
.footer {
  border-top: 1px solid var(--c-line);
  background: var(--c-surface);
}
.footer__list {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--s-4); list-style: none; margin: 0 auto; max-width: var(--wrap);
  padding: var(--s-4) max(var(--s-3), env(safe-area-inset-left, 0px)) var(--s-2);
}
.footer__item { opacity: .78; transition: opacity .15s; }
.footer__item:hover { opacity: 1; }
.flogo { display: inline-block; line-height: 0; }
.flogo .is-color { display: none; }
.flogo:hover .is-grey  { display: none; }
.flogo:hover .is-color { display: inline; }
/* Lock each footer logo to its exact box so the grey->colour hover swap can't
   shift the row. (The global `img { height:auto }` otherwise lets the colour PNG
   render at its 1px-off natural height, growing the footer by a pixel on hover.) */
.footer__item--uni  .flogo img { width: 116px; height: 45px; }
.footer__item--ukb  .flogo img { width: 202px; height: 46px; }
.footer__item--bak  .flogo img { width: 75px;  height: 45px; }
.footer__item--bigs .flogo img { width: 238px; height: 52px; }

/* =========================================================== DESKTOP ====== */
@media (min-width: 760px) {
  .content { padding-top: var(--s-5); }

  /* Home hero: intro text beside the imaging visual. */
  .content--home { max-width: var(--wrap); }
  .content--home .c-welcome { max-width: 16ch; }
  .content--home .c-hero { width: 300px; }
  .content--home .c-intro-h { clear: both; }

  /* Height-match the figure/CTA column to the intro text so nothing is pushed:
     the column stretches to the text height, the CTA keeps its natural size at
     the bottom, and the figure flexes into whatever space is left (scaling down
     via object-fit, never up past its 300px width). */
  .content--home .c-introrow { align-items: stretch; }
  /* Column stretches to the intro-text height; the figure+CTA group keeps a
     fixed, sub-text height and is centred vertically, so there is even breathing
     room above and below and nothing is ever pushed down. */
  .content--home .c-introrow__side { flex: 0 0 300px; align-items: stretch; justify-content: flex-start; gap: var(--s-1); padding-top: 6px; }
  .content--home .c-introrow__side .c-hero {
    width: 100%; flex: 0 1 auto; min-height: 0; height: 166px;
    object-fit: contain; object-position: center top; margin: 0;
  }
  .content--home .c-introrow__side .c-studies { flex: 0 0 auto; padding: var(--s-1) var(--s-2); }
  .content--home .c-introrow__side .c-studies__txt { font-size: 13px; line-height: 1.35; }

  /* Introduction: the fixation gif and the explanatory text sit in a balanced
     row (heights tuned to be roughly flush); the key reference card and the book
     covers follow full-width below. */
  .content--home .c-motion-row { flex-direction: row; align-items: center; gap: var(--s-4); }
  .content--home .c-hero-motion { flex: 0 0 auto; width: 442px; max-width: 50%; margin: 0; }
  .content--home .c-motion-text { flex: 1 1 0; }

  /* Research: two-column card grid. */
  .content--research { max-width: var(--wrap); }
  .content--research .proj-grid { grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-3); }

  /* People: responsive roster grid. */
  .content--people { max-width: var(--wrap); }

  /* Resources & publications get a touch more room. */
  .content--resources, .content--pubs { max-width: 860px; }
}

@media (min-width: 980px) {
  .content--research .proj-grid { gap: var(--s-5) var(--s-4); }
}

/* =============================================== v2.1 consolidation ======== */
/* Footer meta line (imprint + photo credit), site-wide. */
.footer__meta {
  text-align: center; font-size: var(--fs-1); color: var(--c-muted);
  margin: 0; padding: 0 max(var(--s-3), env(safe-area-inset-left, 0px)) var(--s-4);
}
.footer__meta a { color: var(--c-muted); }
.footer__meta a:hover { color: var(--c-link); }
.footer__sep { margin: 0 .5em; opacity: .6; }

/* Home — leading motion figure (gif first, then the welcome text). */
.c-hero-motion { margin: 0 0 var(--s-4); }
.c-hero-motion img {
  display: block; width: 100%; max-width: 442px;  /* native size — never upscaled */
  border-radius: var(--radius-s); box-shadow: var(--shadow);
}
.c-hero-motion figcaption {
  font-size: var(--fs-1); color: var(--c-muted); line-height: 1.5;
  margin-top: 6px; max-width: 442px;
}

/* People — responsive roster of cards (2 columns on wide screens), with bios. */
.roster { display: grid; grid-template-columns: 1fr; gap: var(--s-2); margin: 0 0 var(--s-2); }
.content--people .person {
  display: flex; gap: var(--s-2); align-items: flex-start; margin: 0;
  border: 1px solid var(--c-line); border-radius: var(--radius-s);
  background: var(--c-surface); padding: var(--s-2) var(--s-3);
}
.content--people .person__photo {
  flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
}
.content--people .person__text { min-width: 0; font-size: 14px; color: var(--c-text); line-height: 1.5; }
.content--people .person__name { display: block; color: var(--c-heading); font-weight: 700; font-size: 15.5px; }
.person__role { color: var(--c-muted); font-size: 13px; margin: 1px 0 0; }
.person__role a { color: var(--c-link); }
.person__role a[href$=".pdf" i] { white-space: nowrap; }
.person__bio { margin: 6px 0 0 !important; color: var(--c-text); max-width: none; }
.person--lead { background: var(--c-bg-panel); border-color: var(--c-accent); }
.person--lead .pe-links { margin: 8px 0 0; }
.person--lead .pe-links img { max-height: 24px; width: auto; }
.pe-cv { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.pe-theses p, .pe-collab { font-size: 14px; }
/* Theses — a degree badge (PhD/MSc/BSc/Dipl.) anchors each citation row. */
.pe-theses { display: flex; flex-direction: column; gap: var(--s-2); }
.thesis { display: grid; grid-template-columns: 3.6em 1fr; gap: var(--s-2); align-items: baseline; }
.thesis__deg {
  display: inline-block; width: 100%; text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 0; border-radius: 999px;
  border: 1px solid var(--c-line); color: var(--c-muted); background: var(--c-surface);
}
.thesis__deg--phd { color: var(--c-accent); border-color: var(--c-accent); }
.thesis__cite { margin: 0; color: var(--c-muted); line-height: 1.5; }
.thesis__cite strong { color: var(--c-text); font-weight: 700; }
/* Collaborators — two-column directory: aligned names, institution + link beside. */
.pe-collab { display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--s-3); }
.collab__nm { color: var(--c-text); font-weight: 700; }
.collab__org { color: var(--c-muted); }

/* Contact — "take part in a study" cards + side-by-side postal addresses. */
.ct-h--first { margin-top: 0; }
.study-grid { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-2); }
.study-card a {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  border: 1px solid var(--c-line); border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-s); background: var(--c-surface);
  padding: var(--s-1) var(--s-2); color: var(--c-text);
}
.study-card a:hover { text-decoration: none; border-color: var(--c-accent); background: var(--c-bg-panel); }
.study-card strong { color: var(--c-heading); font-size: 13.5px; line-height: 1.25; }
.study-card__desc { color: var(--c-muted); font-size: 12px; line-height: 1.4; }
.study-card__when { color: var(--c-muted); font-size: 11px; margin-top: auto; }
.ct-map { display: block; width: 100%; max-width: 100%; border-radius: var(--radius-s); box-shadow: var(--shadow); margin: var(--s-1) 0 var(--s-3); }
/* Postal address: two copyable info cards (international / German), styled like
   the other tiles but not interactive — the text stays selectable. */
.ct-subh { font-size: 17px; color: var(--c-heading); font-weight: 700; margin: var(--s-4) 0 var(--s-2); letter-spacing: -.01em; }
.addr-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
.addr-card { border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); padding: var(--s-2) var(--s-3); }
.addr-card__h { margin: 0 0 var(--s-1); color: var(--c-accent); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.addr-card__body { font-style: normal; color: var(--c-text); font-size: 14.5px; line-height: 1.6; }

/* Direct contact: email + phone as prominent, tappable, copyable links. */
.contact-direct { display: flex; flex-direction: column; gap: var(--s-1); margin: 0 0 var(--s-2); }
.contact-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); margin: 0; }
.contact-row__k { flex: 0 0 64px; color: var(--c-accent); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.contact-row__v { font-size: var(--fs-3); color: var(--c-text); word-break: break-word; }

/* Research detail pages — flowing article with hero, lead and figures. */
.pb-hero { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 var(--s-3); }
.content .pb-title { color: var(--c-heading); font-size: var(--fs-5); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; margin: 0 0 var(--s-2); text-wrap: balance; }
.pb-lead { font-size: var(--fs-3); color: var(--c-text); line-height: 1.5; margin: 0 0 var(--s-4); max-width: var(--wrap-text); }
.content .pb-sub { font-size: 15.5px; color: var(--c-heading); font-weight: 700; margin: var(--s-3) 0 var(--s-1); letter-spacing: 0; }
.pb-fig { display: block; margin: var(--s-2) 0; border-radius: var(--radius-s); box-shadow: var(--shadow); }
.pb-fig--wide { width: 100%; max-width: 520px; }
.pb-cap { font-size: var(--fs-1); color: var(--c-muted); margin: 0 0 var(--s-3); max-width: var(--wrap-text); line-height: 1.5; }
.book-row--refs { gap: var(--s-3); align-items: flex-start; margin: var(--s-2) 0; flex-wrap: nowrap; }
.book-row--refs img { max-height: 120px; width: auto; flex: 0 0 auto; }
.book-row--refs .pb-ref { margin: 0; }

/* Research overview — tools pointer. */
.rh-tools { font-size: 14px; color: var(--c-muted); margin: var(--s-3) 0; }

/* Tools & Data — inline app logos. */
.rs-logo--inline { display: inline-block; vertical-align: middle; margin: 0 6px 0 0; max-height: 26px; width: auto; }
.rs-intro { margin-bottom: var(--s-3); }

@media (min-width: 760px) {
  .roster { grid-template-columns: 1fr 1fr; gap: var(--s-3); grid-auto-rows: 1fr; }
  .roster .person--lead { grid-column: 1 / -1; grid-row: 1; }
  /* Equal-height tiles: the members grid keeps the full-width lead tile (Wolf) on
     row 1 at its natural height, while every other member fills equal-height rows
     below; the alumni grid (no lead) makes all its rows equal. */
  .roster:has(.person--lead) { grid-template-rows: auto; }
  .study-grid { grid-template-columns: repeat(2, 1fr); }
  .addr-grid { grid-template-columns: 1fr 1fr; }
  .content--retina, .content--tools { max-width: var(--wrap); }
}
@media (max-width: 480px) {
  .book-row--refs { flex-wrap: wrap; }
}

/* Tools & Data — icon, page header, software cards. */
.icon-tools, .icon-code { display: block; width: 100%; height: 100%; }
/* Cone-mosaic tile icon: a centre crop of the ConeMapper Voronoi image. */
.icon-mosaic {
  display: block; width: 100%; height: 100%; border-radius: 10px;
  background-position: center; background-repeat: no-repeat; background-size: 200%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.tool-card__icon--svg { height: 40px; }

.tools-head { display: flex; align-items: flex-start; gap: var(--s-3); margin: 0 0 var(--s-4); }
.tools-head__icon { flex: 0 0 60px; width: 60px; height: 60px; }
.content .tools-head__title { margin: 4px 0 6px; }
.tools-head .rs-intro { margin: 0; }

.tool-grid { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-2); }
.tool-card {
  display: flex; gap: var(--s-2); align-items: flex-start;
  border: 1px solid var(--c-line); border-radius: var(--radius-s);
  background: var(--c-surface); padding: var(--s-2) var(--s-3);
}
.tool-card__icon { flex: 0 0 40px; width: 40px; height: auto; margin-top: 2px; }
.tool-card__body { min-width: 0; }
.tool-card__body strong { display: block; color: var(--c-heading); font-size: 15.5px; }
.tool-card__body p { margin: 4px 0 0; font-size: 13.5px; color: var(--c-text); line-height: 1.5; }
.tool-card__links { font-size: 13px; }
.tool-card__links a { white-space: nowrap; }

@media (min-width: 760px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
}

/* ------------------------------------------------------------ Print / PDF --- */
/* Used when the study flyers are exported to downloadable PDFs (Edge headless
   --print-to-pdf). Strips the site chrome and forces a clean light document. */
@media print {
  :root { color-scheme: light; }
  .site-head, .nav, .subnav, .footer, .no-print { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .content { padding-top: 0 !important; margin-top: 0 !important; max-width: 100% !important; }
  .content--study { font-size: 11.5pt; }
  .pb-h, .pb-txt, .pb-sub, .pb-cap, .content--study strong { color: #111 !important; }
  .pb-sub, .pb-cap { color: #555 !important; }
  .study-mail a, .content--study a { color: #111 !important; text-decoration: none; }
  a[href^="mailto:"], a[href^="tel:"] { color: #111 !important; }
  .pb-img { page-break-inside: avoid; }
  ul, li, p { page-break-inside: avoid; }
}

/* Fit the flyers on a single page when printed to PDF. */
@page { margin: 14mm 16mm; }
@media print {
  .content--study { font-size: 10.6pt; line-height: 1.4; }
  .content--study .pb-h { margin: 9pt 0 3pt; }
  .content--study .pb-txt, .content--study p { margin: 0 0 5pt; }
  .content--study ul { margin: 3pt 0; }
  .content--study li { margin: 0 0 2pt; }
  .content--study .pb-sub { margin: 0 auto 8pt; }
  .content--study .pb-cap:first-child { margin-bottom: 6pt; }
  .pb-img { max-width: 360px; margin-top: 2pt; margin-bottom: 6pt; }
}

/* ---- Study flyers: print-only letterhead + institutional logos ----------- */
/* Hidden on screen (the site has its own header/footer); shown only in the
   exported PDF, where the site chrome is stripped. */
.print-only { display: none; }
.study-pdf { margin-left: 8px; font-size: var(--fs-1); white-space: nowrap; }
.study-pdf a { color: var(--c-link); }

@media print {
  .print-only { display: block !important; }
  .study-letterhead { width: 360px; max-width: 72%; height: auto; margin: 0 auto 12pt; }
  .content--study .study-stand { text-align: right; color: #8a8a8a !important; margin: 0 0 4pt; }
  .content--study .pb-sub { margin: 0 auto 11pt; }
  .content--study .study-mail { text-align: center; margin: 11pt 0 7pt; line-height: 1.6; }
  .content--study .study-mail a { color: #111 !important; font-weight: 700; }
  .content--study .study-lead { text-align: center; color: #666 !important; font-size: 8.6pt; line-height: 1.45; margin: 7pt auto 0; max-width: 92%; }
  .study-foot { display: flex; justify-content: center; align-items: center; gap: 26px; margin: 12pt 0 0; padding-top: 11pt; border-top: 1px solid #e0e0e0; }
  .study-foot img { height: 34px; width: auto; }
}

/* Tighter still, so the longer German flyers stay on a single page. */
@media print {
  .content--study { font-size: 10.1pt; line-height: 1.36; }
  .content--study .study-letterhead { width: 320px; margin: 0 auto 8pt; }
  .content--study .pb-img { max-width: 296px; margin: 2pt auto 5pt; }
  .content--study .pb-txt, .content--study p { margin: 0 0 4pt; }
  .content--study .pb-h { margin: 7pt 0 2pt; }
  .content--study .pb-center { margin-bottom: 6pt; }
  .content--study ul { margin: 2pt 0; }
  .content--study li { margin: 0 0 1.5pt; }
  .content--study .study-mail { margin: 8pt 0 5pt; }
  .content--study .study-lead { margin-top: 5pt; }
  .content--study .study-foot { margin-top: 8pt; padding-top: 7pt; }
  .content--study .study-foot img { height: 30px; }
}
