/* Team Triton wiki: styles. Implements STYLE_GUIDE.md (reference page:
   Website_refrence_DO_NOT_ALTER/Wet Lab Overview D.dc.html).
   Fonts and icons are self-hosted: static/fonts/fonts.css, static/phosphor/. */

:root {
  --page-max: 1520px;  /* overall content width (layout, hero, footer) */
  --text-max: 100ch;    /* max line length of body text */
  color-scheme: light;

  /* Base */
  --ink: #1f2a37;
  --ink-muted: #4d5b6a;
  --ink-soft: #33404d;
  --navy: #1B5E80;
  --navy-dark: #123F57;
  --page-bg: #DCEFFA;
  --hero-bg: #C3E3F6;
  --wave-1: #9DCDEB;
  --wave-2: #B9DEF3;
  --surface: #FFFFFF;
  --hover-tint: #F1F7FB;
  --toc-active: #E6F2FA;
  --focus: #F5B82E;
  --gold: #FFD54A;

  /* Module colours: accent / band tint / note / deep text */
  --sensing: #F2786A;     --sensing-band: #FDEBE7;     --sensing-note: #FFCFC6;     --sensing-deep: #B23A2B;
  --capturing: #FFD54A;   --capturing-band: #FFF6D9;   --capturing-note: #FFE58A;   --capturing-deep: #8A6400;
  --degradation: #6FB3DD; --degradation-band: #E7F3FB; --degradation-note: #C6E3F5; --degradation-deep: #1B5E80;
  --biosafety: #7DCB72;   --biosafety-band: #EEF8EA;   --biosafety-note: #D4EDCE;   --biosafety-deep: #2F7A33;
  --protocols: #9DCDEB;   --protocols-band: #E4F1FA;
  --tfa: #7442A8;         --tfa-light: #B98BDB;        --tfa-band: #EEE3F8;         --tfa-deep: #6B3A92;

  /* Shapes */
  --r-card: 36px 30px 38px 28px / 30px 38px 28px 36px;
  --r-panel: 34px 28px 36px 26px / 28px 36px 26px 34px;
  --r-box: 30px 24px 32px 22px / 24px 32px 22px 30px;
  --r-figure: 28px 22px 30px 20px / 22px 30px 20px 28px;
  --r-blob: 58% 42% 55% 45% / 47% 58% 42% 53%;
  --r-hero: 46% 54% 42% 58% / 52% 44% 56% 48%;
  --r-note: 6px 6px 22px 6px;

  /* Page accent (overridden per topic below) */
  --accent: var(--focus);
  --accent-band: var(--capturing-band);   /* default page: warm yellow tint, matching the yellow accent */
  --accent-note: #D6ECF8;
  --accent-deep: var(--navy);

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-hand: 'Patrick Hand', 'Fredoka', sans-serif;
}

body[data-module="sensing"]     { --accent: var(--sensing);     --accent-band: var(--sensing-band);     --accent-note: var(--sensing-note);     --accent-deep: var(--sensing-deep); }
body[data-module="capturing"]   { --accent: var(--capturing);   --accent-band: var(--capturing-band);   --accent-note: var(--capturing-note);   --accent-deep: var(--capturing-deep); }
body[data-module="degradation"] { --accent: var(--degradation); --accent-band: var(--degradation-band); --accent-note: var(--degradation-note); --accent-deep: var(--degradation-deep); }
body[data-module="biosafety"]   { --accent: var(--biosafety);   --accent-band: var(--biosafety-band);   --accent-note: var(--biosafety-note);   --accent-deep: var(--biosafety-deep); }
body[data-module="protocols"]   { --accent: var(--protocols);   --accent-band: var(--protocols-band);   --accent-note: #D6ECF8;                  --accent-deep: var(--navy); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page-bg); scroll-padding-top: 96px; }
html:not(.motion-off) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font: 400 17px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.site { position: relative; isolation: isolate; min-height: 100vh; overflow-x: clip; }

/* ---------- Header and dropdown ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); }
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: var(--ink); border-radius: 3px;
}
.site-header__bar {
  max-width: 1280px; margin: 0 auto; padding: 6px 24px; min-height: 72px;
  display: flex; align-items: center; gap: 16px;
}
.site-header__logo { display: flex; align-items: center; flex: 0 0 auto; }
.site-header__logo svg, .site-footer__logo svg { display: block; height: 58px; width: auto; }
/* the picture of Triton and the letters are clipped to the logo (svg default), so he swims in from its left edge */
.triton-logo__letter { transform-box: fill-box; transform-origin: 50% 100%; }
.logo-intro [data-triton-logo] [data-triton], .logo-intro [data-triton-logo] [data-letter] { visibility: hidden; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.nav__btn {
  display: flex; align-items: center; gap: 5px; min-height: 44px;
  padding: 9px clamp(8px, 1.1vw, 16px);
  border: 2px solid transparent; border-radius: 999px; background: transparent;
  font: 500 clamp(15px, 1.4vw, 17px)/1.2 var(--font-display); color: var(--ink);
  cursor: pointer; transition: background .2s, transform .2s;
}
.nav__btn:hover { transform: translateY(-1px); }
.nav__btn[aria-expanded="true"] { background: var(--tint); border-color: var(--ink); }
.nav__btn i { font-size: 13px; }

.nav-panel-wrap {
  position: absolute; top: 100%; left: 0; right: 0; padding: 14px 24px 0;
  display: flex; justify-content: center;
}
.nav-panel {
  position: relative; width: min(1000px, 100%); padding: 26px 30px 24px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-panel);
  box-shadow: 6px 7px 0 var(--ink);
}
.nav-panel__head { display: flex; align-items: center; gap: 18px; }
.nav-panel__label { font: 600 15px/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--menu); }
.nav-panel__rule { flex: 1; height: 2.5px; background: var(--ink); opacity: .18; border-radius: 2px; }
.nav-panel__tag { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.nav-panel__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 20px; color: var(--ink); }
.nav-item:hover { background: var(--hover-tint); color: var(--ink); }
.nav-item__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.nav-item__title { font: 600 17px/1.3 var(--font-display); }
.nav-item__sub { font-size: 14px; color: var(--ink-muted); line-height: 1.35; }
.nav-item > .ph-bold { font-size: 14px; color: var(--ink-muted); }

/* Icon blob (also used for the footer socials and the TFA counter) */
.blob { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 52px; width: 52px; height: 52px; }
.blob::before {
  content: ''; position: absolute; inset: 0;
  background: var(--blob-bg, var(--tint)); border: 2px solid var(--ink); border-radius: var(--r-blob);
}
.blob > i { position: relative; font-size: 24px; color: var(--menu, var(--ink)); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); }
.hero__waves { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; pointer-events: none; }
.hero__inner {
  position: relative; max-width: var(--page-max); margin: 0 auto; padding: 56px 32px 200px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center;
}
.hero__text { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.breadcrumb i { font-size: 12px; }
.hero h1 {
  margin: 0; font: 600 clamp(44px, 6vw, 68px)/1.02 var(--font-display); color: var(--navy); overflow-wrap: anywhere;
}
.hero__lead { margin: 0; max-width: 520px; font-size: 19px; line-height: 1.6; text-wrap: pretty; }
.hero__lead:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  background: var(--accent-band); border: 2.5px solid var(--ink); border-radius: 999px;
  font: 500 17px/1.2 var(--font-display); color: var(--ink); transition: transform .2s;
}
.chip i { font-size: 18px; color: var(--accent-deep); }
.chip:hover { color: var(--ink); transform: translate(-1px, -2px); }
.chip:active { transform: translate(2px, 2px); }

.hero__art {
  position: relative; height: 320px; background: var(--surface);
  border: 2.5px solid var(--ink); border-radius: var(--r-hero); box-shadow: 6px 7px 0 var(--ink);
}
.hero__art-inner {
  position: absolute; inset: 14px; border-radius: 140px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.hero__art-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* \label{hero}: the picture alone, no frame. With \label{hero_background} the hero gets that picture as
   its background (a tint keeps the text readable) and the hero picture sits in a bubble that hugs it. */
.hero__picture { justify-self: center; max-width: 100%; }
.hero__picture img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; margin: 0 auto; }
.hero--bg { background-size: cover; background-position: center; }
.hero--bg::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--hero-bg) 88%, transparent), color-mix(in srgb, var(--hero-bg) 35%, transparent));
}
.hero__picture--bubble {
  padding: 18px; background: var(--surface);
  border: 2.5px solid var(--ink); border-radius: var(--r-hero); box-shadow: 6px 7px 0 var(--ink);
}
.hero__picture--bubble img { max-height: 320px; border-radius: 20px; }
/* more room around a drawing that is cut out: its corners must not reach the rounded edge of the bubble */
.hero__picture--fit { padding: 20px 30px; }
/* The drawing alone, cut out of its picture (wiki/page.html): the bubble hugs the drawing. The box is as wide as the drawing
   allows (up to 300px high and 440px wide); --ar is the width / height of the part that is shown. */
.hero__crop { position: relative; overflow: hidden; width: min(calc(290px * var(--ar) * var(--k, 1)), calc(420px * var(--k, 1))); max-width: 100%; aspect-ratio: var(--ar); border-radius: 20px; }
.hero__picture .hero__crop img { position: absolute; max-width: none; max-height: none; height: auto; margin: 0; border-radius: 0; }

/* Waves (hero + footer): 200% wide, loop on translateX(-50%) */
.wave { position: absolute; left: 0; top: 0; width: 200%; height: 100%; animation: waveX var(--dur) linear infinite; }
.wave--rev { animation-direction: reverse; }
.wave svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wave__fill--1 { fill: var(--wave-1); }
.wave__fill--2 { fill: var(--wave-2); }
.wave__fill--3 { fill: var(--page-bg); }
.wave__fill--navy { fill: var(--navy); }
.wave__crest { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@keyframes waveX { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Placeholder tag (STYLE_GUIDE 5.11): remove once the real text is in */
.placeholder-tag {
  display: inline-block; margin-right: 8px; padding: 1px 10px; vertical-align: 2px;
  border: 1.5px dashed var(--ink); border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.7;
}

/* ---------- Page layout: sidebar + main card ---------- */
.layout {
  max-width: var(--page-max); margin: 0 auto; padding: 24px 32px 96px;
  display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start;
}
.card {
  flex: 1 1 600px; min-width: 0; position: relative;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-card);
  box-shadow: 6px 7px 0 var(--ink); overflow: hidden; overflow: clip;   /* clip: same look, but no scroll container, so position: sticky works inside (Project design page) */
}

/* The page behind (the floating TFA, static/wiki.js) must stay clickable between and under the boxes: the layout lets clicks
   through, only the card and the sidebar box catch them. */
.layout { pointer-events: none; }
.layout > .card, .toc__box { pointer-events: auto; }

/* Sidebar "On this page": as narrow as 230px, widens up to 290px when labels need it (never so much that
   the card wraps below it), and keeps within the screen height (the box scrolls inside). */
.toc { flex: 0 0 auto; width: fit-content; min-width: 230px; max-width: clamp(230px, calc(100% - 650px), 290px); position: sticky; top: 100px; }
.toc__box {
  position: relative; padding: 20px 16px 18px 12px; max-height: calc(100vh - 116px);
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-box);
  display: flex; flex-direction: column; gap: 6px;
}
.toc__label { padding: 0 10px; font: 600 13px/1.4 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); }
.toc__row { display: flex; gap: 6px; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.toc__list { position: relative; flex: 1; min-width: 0; margin: 0; padding: 28px 0 0; list-style: none; display: flex; flex-direction: column; }
.toc__item { position: relative; }
/* a row is at least 44px and grows with its text (the filter tube follows, see wiki.js) */
.toc__link {
  min-height: 44px; display: flex; align-items: center; padding: 6px 10px; border-radius: 14px;
  font: 600 15px/1.25 var(--font-body); color: var(--ink); overflow-wrap: anywhere; hyphens: auto;
}
.has-subs > .toc__link { padding-right: 34px; }
.toc__link:hover { background: #EEF6FB; color: var(--ink); }
.toc__link.is-active { background: var(--toc-active); font-weight: 700; }
.toc__toggle {
  position: absolute; top: 7px; right: 4px; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-muted); font-size: 14px; cursor: pointer;
}
.toc__toggle:hover { background: #DCEBF5; color: var(--ink); }
.toc__toggle i { transition: transform .25s; }
.toc__item.is-expanded .toc__toggle i { transform: rotate(180deg); }
/* dropdown with the subsections: opens on hover/focus, stays open for the section being read or when pinned */
.toc__subs { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease .12s; }
.toc__sublist { min-height: 0; overflow: hidden; margin: 0; padding: 0 0 0 14px; list-style: none; }
.toc__item.is-expanded > .toc__subs { grid-template-rows: 1fr; transition-delay: 0s; }
.toc__item.is-expanded .toc__sublist { padding-bottom: 4px; }
@media (hover: hover) {
  .toc__item.has-subs:hover > .toc__subs { grid-template-rows: 1fr; transition-delay: 0s; }
  .toc__item.has-subs:hover .toc__sublist { padding-bottom: 4px; }
  .toc__item.has-subs:hover .toc__toggle i { transform: rotate(180deg); }
}
.toc__item:focus-within > .toc__subs { grid-template-rows: 1fr; transition-delay: 0s; }
.toc__sublink {
  display: block; padding: 5px 10px; border-left: 2px solid rgba(31, 42, 55, .2); border-radius: 0 10px 10px 0;
  font: 500 14px/1.3 var(--font-body); color: var(--ink-muted); overflow-wrap: anywhere; hyphens: auto;
}
.toc__sublink:hover { background: #EEF6FB; color: var(--ink); }
.toc__sublink.is-active { border-left-color: var(--ink); background: var(--toc-active); color: var(--ink); font-weight: 700; }

/* Filter tube: 22px top offset, a section is at least 44px; wiki.js measures the real rows */
.pipe { --R: 44px; --T: 22px; --H: calc(var(--n) * var(--R)); position: relative; flex: 0 0 56px; width: 56px; height: calc(var(--T) + var(--H) + 24px); }
.pipe > * { position: absolute; box-sizing: border-box; }
.pipe__body { left: 10px; top: var(--T); width: 36px; height: var(--H); background: #E6F3FA; border: 2.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.pipe__fill {
  left: 12.5px; top: var(--T); width: 31px; height: var(--fill, calc((var(--ai, 0) + 1) * var(--R) - 6px));
  background: radial-gradient(circle, #FFC15E 2.2px, transparent 2.8px) 0 0 / 8px 8px; opacity: .7; transition: height .9s ease;
}
.pipe__mark { left: 14px; width: 28px; top: var(--b, calc(var(--T) + var(--i) * var(--R) + var(--R) - 6px)); border-top: 2px dashed var(--ink); opacity: .3; }
.pipe__bead {
  left: 18px; width: 20px; height: 20px; top: -24px; opacity: 0; border-radius: 50%;
  background: #FFC15E; border: 2px solid var(--ink); cursor: pointer;
  transition: top .6s cubic-bezier(.5, 0, .55, 1.3), opacity .15s, box-shadow .3s;
}
.pipe__bead.is-on { top: calc(var(--b, calc(var(--T) + var(--i) * var(--R) + var(--R) - 6px)) - 20px); opacity: 1; }
.pipe__bead.is-current { box-shadow: 0 0 0 6px rgba(255, 213, 74, .5); }
.pipe__tfa { width: 8px; height: 8px; border-radius: 50%; background: var(--tfa-light); border: 1.5px solid var(--ink); }
.pipe__cap, .pipe__neck { background: #9AA7B1; border: 2.5px solid var(--ink); }
.pipe__neck--top { left: 21px; top: 0; width: 14px; height: 12px; border-radius: 3px; }
.pipe__cap--top { left: 4px; top: 8px; width: 48px; height: 16px; border-radius: 7px; }
.pipe__cap--bottom { left: 4px; top: calc(var(--T) + var(--H) - 4px); width: 48px; height: 16px; border-radius: 7px; }
.pipe__neck--bottom { left: 21px; top: calc(var(--T) + var(--H) + 10px); width: 14px; height: 12px; border-radius: 3px; }

.tfa-counter {
  margin: 10px 4px 0; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  background: var(--tfa-band); border: 2px solid var(--ink); border-radius: 16px 12px 18px 10px;
}
.tfa-counter__num {
  position: relative; flex: 0 0 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font: 700 16px/1 var(--font-display); color: var(--ink);
}
.tfa-counter__num::before { content: ''; position: absolute; inset: 0; background: var(--tfa-light); border: 2px solid var(--ink); border-radius: var(--r-blob); }
.tfa-counter__num > span { position: relative; }
.tfa-counter__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tfa-counter__title { font: 600 14px/1.2 var(--font-display); color: var(--tfa-deep); }
.tfa-counter__hint { font: 400 15px/1.2 var(--font-hand); color: var(--ink-muted); }
/* Easter egg: a button in the box sends the caught TFA to the bioreactor in the header */
.tfa-counter__send {
  flex: 0 0 auto; margin-left: auto; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 17px; cursor: pointer;
  transition: transform .15s ease;
}
.tfa-counter__send:hover:not(:disabled), .tfa-counter__send:focus-visible { transform: translateY(-2px) rotate(-8deg); }
.tfa-counter__send:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tfa-counter__send:disabled { background: var(--surface); color: var(--ink-muted); opacity: .55; cursor: default; }
.motion-off .tfa-counter__send { transition: none; }

/* The visitor's plug flow reactor (header, between the logo and the menu): a long tube the liquid flows through in plugs,
   from the inlet (left) to the outlet (right). It fills with TFA from the left; --bio (0 to 1) and --stress (0 to 1, when it is
   overfull) are set by static/wiki.js. */
.bioreactor { flex: 1 1 140px; max-width: 420px; min-width: 0; margin: 0 8px; display: flex; align-items: center; gap: 10px; }
.bioreactor[hidden] { display: none; }
.bioreactor svg { display: block; flex: 1 1 auto; min-width: 0; width: 100%; height: auto; max-height: 42px; overflow: visible; --bio: 0; --stress: 0; }
.bioreactor__pipes rect, .bioreactor__flanges rect { fill: #98A3AE; stroke: var(--ink); stroke-width: 2; }
.bioreactor__vessel { fill: #EAF5FB; stroke: var(--ink); stroke-width: 2.5; }
.bioreactor__liquid, .bioreactor__clip { width: calc(var(--bio) * 311px); transition: width .9s ease; }
.bioreactor__liquid { fill: var(--tfa-light); }
.bioreactor.is-full .bioreactor__liquid { fill: var(--tfa); fill: color-mix(in srgb, var(--tfa), #F2786A calc(var(--stress) * 70%)); }
.bioreactor__plugs rect { fill: rgba(255, 255, 255, .3); }
.bioreactor__dot { fill: rgba(255, 255, 255, .85); }
.bioreactor__arrow { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bioreactor__glass { stroke: rgba(255, 255, 255, .75); stroke-width: 2.5; stroke-linecap: round; fill: none; pointer-events: none; }
.bioreactor__crack { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; opacity: 0; transition: stroke-dashoffset .5s ease-out, opacity .1s; }
.bioreactor__drips circle { fill: var(--tfa); stroke: var(--ink); stroke-width: 1.5; opacity: 0; }
/* the liquid moves on: plugs of liquid and TFA particles travel from left to right */
html:not(.motion-off) .bioreactor__plugs { animation: bioPlug 2.4s linear infinite; }
html:not(.motion-off) .bioreactor__dot { animation: bioDot 3s linear infinite; }
html:not(.motion-off) .bioreactor__arrow { animation: bioArrow 1.2s ease-in-out infinite; }
html:not(.motion-off) .bioreactor.is-full .bioreactor__plugs { animation-duration: 1.4s; }
html:not(.motion-off) .bioreactor.is-full .bioreactor__dot { animation-duration: 1.8s; }
@keyframes bioPlug { to { transform: translateX(40px); } }
@keyframes bioDot { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(34px); opacity: 0; } }
@keyframes bioArrow { 0%, 100% { transform: translateX(-2px); opacity: .45; } 50% { transform: translateX(2px); opacity: 1; } }
/* just filled: a short pulse; overfull: the whole thing trembles a little; too much: it breaks */
html:not(.motion-off) .bioreactor.is-celebrating svg { animation: bioPulse .55s ease-in-out 4; }
@keyframes bioPulse { 50% { transform: scale(1.06); filter: drop-shadow(0 0 7px #B651DB); } }
html:not(.motion-off) .bioreactor.is-stressed svg { animation: bioShake .16s linear infinite; }
@keyframes bioShake { 25% { transform: translate(1px, -.6px); } 75% { transform: translate(-1px, .6px); } }
.bioreactor.is-broken svg { --bio: 0 !important; }
.bioreactor.is-broken .bioreactor__liquid, .bioreactor.is-broken .bioreactor__clip { transition: width 2.6s ease-in; }
.bioreactor.is-broken .bioreactor__vessel { stroke: var(--sensing-deep); fill: #F3E3E0; }
.bioreactor.is-broken .bioreactor__crack { stroke-dashoffset: 0; opacity: 1; }
html:not(.motion-off) .bioreactor.is-broken .bioreactor__pipes { animation: bioShake .12s linear 12; }
html:not(.motion-off) .bioreactor.is-broken .bioreactor__drips circle { animation: bioDrip 1.1s ease-in infinite; }
html:not(.motion-off) .bioreactor.is-broken .bioreactor__drips circle:nth-child(2) { animation-delay: .35s; }
html:not(.motion-off) .bioreactor.is-broken .bioreactor__drips circle:nth-child(3) { animation-delay: .7s; }
@keyframes bioDrip { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
.motion-off .bioreactor__liquid, .motion-off .bioreactor__clip { transition: none; }
/* the total score, next to the reactor: a button that opens an e-mail with it */
.bioreactor__score {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 11px 3px 9px;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; color: var(--ink);
  font: 600 15px/1 var(--font-display); text-decoration: none; transition: transform .15s ease;
}
.bioreactor__score i { font-size: 15px; }
.bioreactor__score:hover, .bioreactor__score:focus-visible { color: var(--ink); transform: translateY(-2px) rotate(-3deg); }
.bioreactor__score:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.motion-off .bioreactor__score { transition: none; }
.bioreactor { position: relative; }
.bioreactor__score { cursor: pointer; }
.bio-share {
  position: absolute; z-index: 60; top: calc(100% + 10px); right: 0; width: min(250px, 86vw); padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: 18px 14px 20px 12px; box-shadow: 4px 5px 0 var(--ink);
}
.bio-share[hidden] { display: none; }
.bio-share__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 7px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); font: 500 16px/1.2 var(--font-display); text-align: left; text-decoration: none; cursor: pointer;
}
.bio-share__item i { font-size: 18px; color: var(--tfa-deep); }
.bio-share__item:hover, .bio-share__item:focus-visible { background: var(--tfa-band); color: var(--ink); }
.bio-share__item:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.bio-share__hint { margin: 4px 8px 2px; font: 400 16px/1.3 var(--font-hand); color: var(--ink-muted); }
.bio-pop { position: fixed; z-index: 300; pointer-events: none; margin: 0; border-radius: 50%; background: rgba(182, 81, 219, .75); border: 2px solid var(--ink); }

/* Floating TFA molecules: page margins only, behind the content */
.tfa-layer { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.tfa { position: absolute; opacity: .6; transition: opacity .8s; pointer-events: auto; cursor: pointer; transform: rotate(var(--r0)); animation: tfaFloat var(--dur) ease-in-out var(--delay) infinite; }
.tfa svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tfa.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes tfaFloat {
  0% { transform: translate(0, 0) rotate(var(--r0)); }
  25% { transform: translate(14px, -18px) rotate(calc(var(--r0) + 12deg)); }
  50% { transform: translate(-6px, -30px) rotate(calc(var(--r0) - 6deg)); }
  75% { transform: translate(-16px, -10px) rotate(calc(var(--r0) + 8deg)); }
  100% { transform: translate(0, 0) rotate(var(--r0)); }
}

/* ---------- Content (output of pandoc/wiki.lua) ---------- */
.sec { padding: 48px 44px 52px; }
.sec > * { margin-top: 0; margin-bottom: 0; }
.sec > * + * { margin-top: 18px; }
.sec p, .sec ul, .sec ol, .sec blockquote { max-width: var(--text-max); text-wrap: pretty; }
.sec ul, .sec ol { padding-left: 1.4em; }
.sec li + li { margin-top: .35em; }
.sec li::marker { color: var(--accent-deep); }
.sec p a, .sec li a, .info a, .note__body a, .term-pop a { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
/* Running text is justified WITHOUT hyphenation: a word that does not fit moves to the next line and the
   spaces on the line grow instead, so no word is ever split. :where() keeps the specificity at zero, so anything with its own alignment (centred figure titles,
   table cells, the DBTL ring, ...) keeps it. Headings, captions, buttons and the protocol sheets are left
   as they are; so is the hand-written start page, which has its own layout. */
:where(.sec, .hp-sh) :where(p, li:not(.protos > li)),
:where(.hero__lead, .term-pop__text, .member-card__text) {
  text-align: justify; text-justify: inter-word; -webkit-hyphens: none; hyphens: none;
}
.sec code { padding: 1px 6px; background: var(--hover-tint); border-radius: 6px; font-size: .92em; overflow-wrap: anywhere; }
.sec blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--ink-soft); }

.sec--small { padding: 44px 44px 48px; }
.sec--small .sec__head h2 { font-size: 28px; }
.sec__head { position: relative; display: inline-block; margin-bottom: 6px; max-width: 100%; }
.sec__head h2 { margin: 0; font: 600 36px/1.15 var(--font-display); color: var(--navy); }
.sec__head svg { position: absolute; left: -4px; bottom: -9px; width: calc(100% + 12px); height: 12px; overflow: visible; }
.sec__head path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sec h3 { margin-top: 30px; font: 600 26px/1.2 var(--font-display); color: var(--navy); }
.sec h4 { margin-top: 24px; font: 600 20px/1.3 var(--font-display); color: var(--navy); }
.sec h5, .sec h6 { margin-top: 20px; font: 600 17px/1.3 var(--font-display); color: var(--ink-soft); }

/* Information cards: \begin{TFAInformation} etc. Very subtle tint, soft round corners. */
.info { padding: 20px 26px; border-radius: var(--r-figure); background: var(--info-bg); max-width: none; }
.info > * { margin: 0; max-width: var(--text-max); }
.info > * + * { margin-top: 12px; }
.info--tfa { --info-bg: var(--tfa-band); }
.info--sensing { --info-bg: var(--sensing-band); }
.info--degradation { --info-bg: var(--degradation-band); }
.info--application { --info-bg: var(--capturing-band); }
/* \begin{InformationColour}{colour}: the wiki colours use the topic tints above plus these two; any other
   colour (style="--info-tint:...") is mixed into white just as lightly, so the text stays readable */
.info--green { --info-bg: var(--biosafety-band); }
.info--orange { --info-bg: #FFEBD6; }
.info--custom { --info-bg: color-mix(in srgb, var(--info-tint) 22%, #FFFFFF); }
.info--neutral { --info-bg: #EEF2F6; }
/* Information environment around a whole \section: that section is tinted edge to edge */
.sec--tfa { background: var(--tfa-band); }
.sec--sensing { background: var(--sensing-band); }
.sec--degradation { background: var(--degradation-band); }
.sec--application { background: var(--capturing-band); }
.sec--green { background: var(--biosafety-band); }
.sec--orange { background: #FFEBD6; }
.sec--custom { background: color-mix(in srgb, var(--info-tint) 22%, #FFFFFF); }
.sec--neutral { background: #EEF2F6; }
.sec--tfa .info, .sec--sensing .info, .sec--degradation .info, .sec--application .info,
.sec--green .info, .sec--orange .info, .sec--custom .info, .sec--neutral .info { background: rgba(255, 255, 255, .6); }

/* Highlighted text: \texthighlight[colour]{text} (<mark class="hl">). A marker stroke in a wiki colour:
   see-through, a bit stronger where the pen starts, with wobbly ends like the hand-drawn shapes elsewhere.
   It continues over line breaks (box-decoration-break). The text keeps its own colour. */
.hl {
  --hl: var(--gold);
  margin: 0 -.15em; padding: .02em .25em .06em; color: inherit;
  border-radius: .8em .3em .9em .25em / .5em .8em .45em .9em;
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--hl) 30%, transparent),
    color-mix(in srgb, var(--hl) 62%, transparent) .6em,
    color-mix(in srgb, var(--hl) 48%, transparent) calc(100% - .6em),
    color-mix(in srgb, var(--hl) 22%, transparent));
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hl--yellow { --hl: var(--gold); }
.hl--red    { --hl: var(--sensing); }
.hl--blue   { --hl: var(--degradation); }
.hl--green  { --hl: var(--biosafety); }
.hl--purple { --hl: var(--tfa-light); }
.hl--orange { --hl: #F9A84A; }

/* Stakeholder quotes: \begin{quote}{Name} (Name = a \section of latex_texts/Engagement/stakeholders.tex).
   Same look as the quotes on the start page (.tj-voice in wiki/pages/home.html): the person's round photo
   (or their drawn face from the river story) with a white rim, and a white speech bubble with an ink outline
   whose tail points at the photo. The photo (gold info badge) opens the person's card: the same .hp-sh
   popover as on the river story ("River story" below). */
.quote {
  max-width: var(--text-max); margin: 30px 0 0;
  display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "photo text";
  column-gap: 18px; align-items: start;
}
.quote__photo {
  grid-area: photo; position: relative; display: block; width: 96px; height: 96px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: inherit; font: inherit;
}
button.quote__photo { cursor: pointer; transition: transform .15s ease; }
button.quote__photo:hover { transform: translateY(-3px) rotate(-4deg); }
button.quote__photo:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.quote__face {
  position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--tfa-band); border: 3px solid #FFFFFF; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(31, 42, 55, .12);
}
.quote__face i { font-size: 42px; color: var(--ink-muted); }
.quote__face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.quote__face--drawn { background: var(--degradation-band); }
.quote__doodle { display: block; width: 78%; height: 78%; margin-top: 6%; overflow: visible; stroke: var(--ink); stroke-linejoin: round; }
.quote__badge {
  position: absolute; right: -4px; bottom: -2px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: var(--gold); border: 2.5px solid var(--ink); border-radius: 50%; font-size: 15px; color: var(--ink);
}
.sec .quote__text {
  grid-area: text; position: relative; max-width: none; margin: 12px 0 0; padding: 12px 18px 14px;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: 6px 22px 22px 22px; box-shadow: 3px 4px 0 var(--ink);
  font: italic 400 19px/1.45 var(--font-body); color: var(--ink-soft); text-wrap: pretty;
}
.quote__text > * { margin: 0; max-width: none; }
.quote__text > * + * { margin-top: 10px; }
.quote__text > p:first-child::before { content: '\201C'; }
.quote__text > p:last-child::after { content: '\201D'; }
/* the bubble's tail, pointing at the photo: an ink triangle with a white one inside it */
.quote__text::before, .quote__text::after { content: ''; position: absolute; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.quote__text::before { left: -14px; top: 10px; width: 14px; height: 18px; background: var(--ink); }
.quote__text::after { left: -9px; top: 13.5px; width: 10px; height: 11px; background: var(--surface); }
@media (max-width: 560px) {
  .quote { grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; }
  .quote__photo { width: 64px; height: 64px; }
  .quote__face i { font-size: 30px; }
  .quote__badge { width: 26px; height: 26px; font-size: 13px; }
  .sec .quote__text { margin-top: 6px; font-size: 17px; }
}
.motion-off button.quote__photo { transition: none; }
/* the cards of quoted people on a page without a river (wiki.lua puts them at the end) */
.sec > .hp-cards { position: absolute; width: 0; height: 0; }

/* Figures */
.fig { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.fig__title { margin: 0; align-self: center; max-width: 100%; text-align: center; font: 600 18px/1.3 var(--font-display); color: var(--ink); }
.fig__frame {
  position: relative; align-self: center; width: fit-content; max-width: 100%; min-width: min(100%, 260px);
  padding: 18px; background: color-mix(in srgb, var(--accent-band) 75%, #fff);
  border: 2.5px solid var(--ink); border-radius: var(--r-figure); box-shadow: 5px 6px 0 var(--ink);
}
/* The mat is a white rounded rectangle just larger than the image, so the corners can be round
   without cutting into the image, which keeps square corners. */
.fig__mat { padding: 12px; background: #fff; border-radius: 20px; }
.fig__frame img { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; margin: 0 auto; border-radius: 0; }
.fig__frame[style] img { width: 100%; max-height: none; }
/* Plain images (\includegraphics outside a figure): no frame, no number, rounded corners */
.img-plain { width: fit-content; max-width: 100%; margin: 26px auto 0; }
.img-plain img { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; margin: 0 auto; border-radius: 20px; }
.img-plain[style] img { width: 100%; max-height: none; }
.fig__placeholder {
  min-height: 220px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed rgba(31, 42, 55, .35); border-radius: 20px; text-align: center; color: var(--ink-muted); font-size: 15px;
}
/* \figuredata{Label}{url}: download buttons for the data behind a figure */
.fig__data { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 0; }
.fig__dl {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; min-height: 36px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 999px;
  font: 600 14px/1.2 var(--font-display); color: var(--ink); text-decoration: none;
  box-shadow: 2px 3px 0 rgba(31, 42, 55, .18);
}
.fig__dl:hover, .fig__dl:focus-visible { background: var(--accent-band); transform: translate(-1px, -1px); box-shadow: 3px 4px 0 rgba(31, 42, 55, .22); }
.fig__dl i { font-size: 16px; color: var(--accent-deep); }

/* \begin{subfigure}: the panels stacked one above the other in the single frame, each
   with its own (A) / (B) caption. The images keep the normal figure treatment (centred,
   capped at 560px tall), so a panel is never stretched or cropped to match its neighbour. */
.fig__frame--subs { width: 100%; }
.fig__subs { display: flex; flex-direction: column; gap: 18px; }
.fig__sub { min-width: 0; }
.fig__sub-cap { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.fig__sub-cap strong { color: var(--ink); }

.fig figcaption { display: flex; align-items: flex-start; justify-content: center; gap: 10px; margin-top: 6px; text-align: center; font-size: 16px; line-height: 1.55; color: var(--ink-muted); }
.fig figcaption svg { flex: 0 0 auto; width: 27px; height: 41px; margin-top: -14px; overflow: visible; transform: rotate(-45deg); }
.fig figcaption strong { color: var(--ink); }

/* Videos (\video): the frame of a figure around a responsive 16:9 player */
.fig--video .fig__frame { width: 100%; max-width: 760px; }
.video-embed { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Tables */
.table-wrap { margin-top: 26px; max-width: 100%; overflow-x: auto; border: 2.5px solid var(--ink); border-radius: var(--r-figure); background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.table-wrap th { padding: 12px 16px; text-align: left; font: 600 15px/1.3 var(--font-display); background: var(--accent-band); border-bottom: 2.5px solid var(--ink); }
.table-wrap td { padding: 10px 16px; border-top: 1.5px solid rgba(31, 42, 55, .18); }
.table-wrap tbody tr:first-child td { border-top: 0; }
.table-wrap caption { caption-side: bottom; padding: 10px 16px 12px; text-align: left; font-size: 14px; line-height: 1.5; color: var(--ink-muted); border-top: 1.5px solid rgba(31, 42, 55, .18); }
.table-wrap caption strong { color: var(--ink); }

/* \captiontop in the \caption{..}: caption above the table instead of below it */
.table-wrap--captop caption { caption-side: top; border-top: 0; border-bottom: 1.5px solid rgba(31, 42, 55, .18); }

/* \begin{tablenotes}: the footnotes of a table, inside its frame under the rows */
.table-wrap__notes { padding: 10px 16px 12px; font-size: 13px; line-height: 1.5; color: var(--ink-muted); border-top: 1.5px solid rgba(31, 42, 55, .18); }
.table-wrap__notes > * { margin: 0; }
.table-wrap__notes > * + * { margin-top: 6px; }

/* \foldtable in the \caption{..}: collapsible table, the caption is the button.
   The frame lives on .table-fold, the inner .table-wrap only scrolls a wide table. */
.table-fold { margin-top: 26px; max-width: 100%; overflow: hidden; border: 2.5px solid var(--ink); border-radius: var(--r-figure); background: var(--surface); }
.table-fold > summary {
  list-style: none; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; cursor: pointer;
  background: var(--accent-band); font-size: 14px; line-height: 1.5; color: var(--ink-muted);
}
.table-fold > summary::-webkit-details-marker { display: none; }
.table-fold > summary > span { flex: 1; }
.table-fold > summary strong { color: var(--ink); }
.table-fold > summary i { flex: 0 0 auto; margin-top: 3px; font-size: 18px; color: var(--accent-deep); }
.table-fold[open] > summary { border-bottom: 2.5px solid var(--ink); }
.table-fold__minus { display: none; }
.table-fold[open] .table-fold__minus { display: inline-block; }
.table-fold[open] .table-fold__plus { display: none; }
.table-fold .table-wrap { margin-top: 0; border: 0; border-radius: 0; background: transparent; }
.table-fold .table-wrap th { border-top: 0; }

/* Equations */
.equation { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 4px; overflow-x: auto; }
.equation math { margin: 0 auto; font-size: 1.15em; }
.equation__num { flex: 0 0 auto; font: 500 16px/1 var(--font-display); color: var(--ink-muted); }
math { font-size: 1.05em; }

/* Terms (\term{word}{definition}): dotted word + definition bubble (static/wiki.js moves .term-pop next to the word) */
.term__def { display: none; }
@media (scripting: none) {   /* without JavaScript the definition is written out after the word */
  .term__def { display: inline; color: var(--ink-muted); }
  .term__def::before { content: ' ('; }
  .term__def::after { content: ')'; }
}
.term__word {
  cursor: pointer; border-radius: 4px; transition: background .2s;
  text-decoration: underline dotted var(--accent-deep); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.term__word:hover, .term__word[aria-expanded="true"] { background: var(--accent-band); }
.term-pop {
  position: absolute; z-index: 100; width: min(360px, calc(100vw - 16px)); padding: 14px 52px 16px 18px;
  background: var(--accent-note); border: 2px solid var(--ink); border-radius: var(--r-note);
  box-shadow: 4px 5px 0 rgba(31, 42, 55, .18); font-size: 16px; line-height: 1.6; color: var(--ink);
}
.term-pop__arrow {
  position: absolute; top: -9px; left: var(--arrow-x, 50%); width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg);
  background: var(--accent-note); border: 2px solid var(--ink); border-right: 0; border-bottom: 0;
}
.term-pop--above .term-pop__arrow { top: auto; bottom: -9px; transform: rotate(225deg); }
.term-pop__title { font: 400 22px/1.2 var(--font-hand); color: var(--accent-deep); margin-bottom: 4px; }
.term-pop__close {
  position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer; font-size: 18px;
}
.term-pop__close:hover { background: rgba(255, 255, 255, .6); }
html:not(.motion-off) .term-pop:not([hidden]) { animation: termPop .18s ease-out; }
@keyframes termPop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* "Want to know more?" sticky note (\begin{details}) and References */
.note {
  position: relative; margin-top: 26px; transform: rotate(var(--rot, -.8deg));
  background: var(--accent-note); border: 2px solid var(--ink); border-radius: var(--r-note);
  box-shadow: 4px 5px 0 rgba(31, 42, 55, .18);
}
.note--r1 { --rot: -.8deg; } .note--r2 { --rot: .6deg; } .note--r3 { --rot: -.5deg; } .note--r4 { --rot: .4deg; }
.note--refs { --rot: 0deg; background: #D6ECF8; box-shadow: none; }
.note::before, .member-card__quote::before {
  content: ''; position: absolute; top: -12px; left: 50%; width: 84px; height: 22px; margin-left: -42px; transform: rotate(-3deg);
  background: rgba(255, 255, 255, .65); border: 1.5px solid rgba(31, 42, 55, .35); border-radius: 3px; pointer-events: none;
}
.note summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 14px 20px; cursor: pointer;
  font: 400 23px/1.25 var(--font-hand); color: var(--ink);
}
.note summary::-webkit-details-marker { display: none; }
.note summary > span { flex: 1; }
.note summary i { font-size: 18px; }
.note summary > i:first-child { font-size: 20px; color: var(--accent-deep); }
.note--refs summary > i:first-child { color: var(--navy); }
.note__minus { display: none; }
.note[open] .note__minus { display: inline-block; }
.note[open] .note__plus { display: none; }
.note__body { padding: 0 20px 18px 52px; font-size: 16px; line-height: 1.65; }
.note__body > * { margin: 0; max-width: var(--text-max); }
.note__body > * + * { margin-top: 12px; }
.note__body ul, .note__body ol { padding-left: 1.3em; }
.note__body .references, .note__body .csl-bib-body { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.note__body .csl-entry { margin: 0 0 8px; }
.note__body .csl-entry:last-child { margin-bottom: 0; }
.note--refs .note__body { padding-left: 72px; }

/* \begin{formaldetails}: the same collapsible note, more formal. Straight (no tilt) and square to the text
   column, no tape, a darker background (the note colour with some of the darker module colour mixed in), round corners and a
   title in Fredoka instead of the hand-written font. The lamp and the + / - stay. */
.note--formal {
  --rot: 0deg; transform: none; box-shadow: none; border-radius: 18px;
  background: var(--accent-note); background: color-mix(in srgb, var(--accent-note) 60%, var(--accent-deep));
}
.note--formal::before { display: none; }
.note--formal li::marker { color: var(--ink); }
.note--formal summary { font: 500 20px/1.3 var(--font-display); border-radius: 16px; }
.note--formal summary > i:first-child { font-size: 22px; }
.note--formal .note__body { padding: 0 24px 20px 52px; }

/* Button link (\begin{hyperlink}) */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 12px 22px;
  background: var(--accent); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 3px 4px 0 var(--ink);
  font: 600 17px/1.2 var(--font-display); color: var(--ink); transition: transform .2s;
}
.cta:hover { color: var(--ink); transform: translate(-1px, -2px); }
.cta:active { transform: translate(2px, 2px); }
.cta-row + .cta-row { margin-top: 12px; }
.cta.is-broken { background: #fff; border-style: dashed; box-shadow: none; }

/* Protocol sheets (\begin{protocols}): tilted paper sheets side by side; on hover a sheet straightens,
   lifts, and its checkboxes are ticked one after another. Colours cycle proto--c1..6 (pandoc/wiki.lua). */
.sec .protos { display: flex; flex-wrap: wrap; gap: 30px 26px; max-width: none; margin-top: 26px; padding: 4px 0 8px; list-style: none; }
.sec .protos li { margin: 0; display: flex; }
.sec .proto, .sec .proto * { text-decoration: none; }
.proto {
  --p: var(--protocols); --p-band: var(--protocols-band); --p-deep: var(--navy);
  display: flex; width: 168px; min-height: 200px; color: var(--ink); text-decoration: none;
  transform: rotate(var(--tilt, -1deg)); transition: transform .3s ease;
}
.protos li:nth-child(5n+2) .proto { --tilt: 1.2deg; }
.protos li:nth-child(5n+3) .proto { --tilt: -.5deg; }
.protos li:nth-child(5n+4) .proto { --tilt: 1.6deg; }
.protos li:nth-child(5n+5) .proto { --tilt: -1.5deg; }
.proto--c1 { --p: var(--sensing);     --p-band: var(--sensing-band);     --p-deep: var(--sensing-deep); }
.proto--c2 { --p: var(--capturing);   --p-band: var(--capturing-band);   --p-deep: var(--capturing-deep); }
.proto--c3 { --p: var(--degradation); --p-band: var(--degradation-band); --p-deep: var(--degradation-deep); }
.proto--c4 { --p: var(--biosafety);   --p-band: var(--biosafety-band);   --p-deep: var(--biosafety-deep); }
.proto--c5 { --p: var(--tfa-light);   --p-band: var(--tfa-band);         --p-deep: var(--tfa-deep); }
.proto--c6 { --p: #F9A84A;            --p-band: #FFEBD6;                 --p-deep: #8F4A12; }
.proto__sheet {
  position: relative; flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 14px 12px 0; overflow: hidden;
  background: var(--p-band); border: 2.5px solid var(--ink); border-radius: 6px 24px 6px 6px; box-shadow: 5px 6px 0 var(--ink);
  transition: box-shadow .3s ease;
}
.proto__sheet::before {   /* dog-ear */
  content: ''; position: absolute; top: -2.5px; right: -2.5px; width: 26px; height: 26px;
  background: var(--p); border: 2.5px solid var(--ink); border-radius: 0 22px 0 9px;
}
.proto__title { font: 600 16px/1.2 var(--font-display); color: var(--p-deep); overflow-wrap: break-word; hyphens: auto; }
.proto__title::before { content: ''; float: right; width: 16px; height: 16px; }   /* keeps the first line clear of the dog-ear */
.proto__row { display: flex; align-items: center; gap: 9px; }
.proto__icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 34px; font-size: 20px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 9px 6px 10px 7px;
}
.proto__lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.proto__lines i { height: 2px; background: var(--ink); border-radius: 2px; opacity: .7; }
.proto__lines i:last-child { width: 65%; }
.proto__checks { display: flex; flex-direction: column; gap: 7px; }
.proto__check { display: flex; align-items: center; gap: 7px; }
.proto__box { position: relative; flex: none; width: 13px; height: 13px; background: var(--p); border: 2px solid var(--ink); border-radius: 3px; }
.proto__tick { position: absolute; left: 0; bottom: 1px; width: 20px; height: 16px; overflow: visible; }
.proto__tick path {
  fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .25s ease;
}
.proto__pen { flex: 1; height: 6px; overflow: visible; }
.proto__check:last-child .proto__pen { flex: 0 1 68%; }
.proto__pen path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.proto__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: auto -12px 0; padding: 7px 12px;
  background: var(--surface); border-top: 2.5px solid var(--ink); font: 600 15px/1.2 var(--font-display); color: var(--ink);
  transition: background .3s ease;
}
.proto__btn i { flex: none; transition: transform .3s ease; }
a.proto:hover, a.proto:focus-visible { transform: translate(-2px, -4px) rotate(0deg); }
a.proto:active { transform: translate(2px, 2px) rotate(0deg); }
a.proto:hover .proto__sheet, a.proto:focus-visible .proto__sheet { box-shadow: 7px 9px 0 var(--ink); }
a.proto:active .proto__sheet { box-shadow: 3px 4px 0 var(--ink); }
a.proto:hover .proto__btn, a.proto:focus-visible .proto__btn { background: var(--p); }
a.proto:hover .proto__btn i, a.proto:focus-visible .proto__btn i { transform: translateX(3px); }
a.proto:hover .proto__tick path, a.proto:focus-visible .proto__tick path { stroke-dashoffset: 0; transition-delay: var(--tick-delay, .1s); }
.proto__check:nth-child(2) { --tick-delay: .4s; }
.proto__check:nth-child(3) { --tick-delay: .7s; }
a.proto:focus-visible { outline: none; }
a.proto:focus-visible .proto__sheet { outline: 3px solid var(--focus); outline-offset: 4px; }
.proto.is-broken .proto__sheet { border-style: dashed; box-shadow: none; }

/* Footnotes (pandoc) */
.footnotes { padding: 0 44px 40px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.footnotes hr { display: none; }
.footnotes ol { margin: 0; padding-left: 1.3em; }
.footnote-ref { font-size: .8em; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: -20px; }
.site-footer__waves { position: relative; height: 90px; overflow-x: clip; }
.site-footer__main { background: var(--navy); color: #EAF4FB; }
.site-footer__cols {
  max-width: var(--page-max); margin: 0 auto; padding: 24px 32px 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; align-items: start;
}
.site-footer__col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.site-footer__logo { padding: 12px 18px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-box); }
.site-footer__logo svg { height: 64px; }
.site-footer__year { font: 500 17px/1.3 var(--font-display); }
.site-footer__label { font: 600 14px/1.3 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.site-footer a { color: #EAF4FB; }
.site-footer a:hover { color: var(--gold); }
.site-footer__link { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.5; }
.site-footer__link i { font-size: 18px; flex: 0 0 auto; }
.site-footer__socials { display: flex; gap: 10px; }
.site-footer .site-footer__btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 20px;
  background: var(--gold); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 3px 4px 0 var(--ink);
  font: 600 16px/1.2 var(--font-display); color: var(--ink); transition: transform .2s;
}
.site-footer .site-footer__btn:hover { color: var(--ink); transform: translate(-1px, -2px); }
.site-footer .site-footer__btn:active { transform: translate(2px, 2px); }
.site-footer__btn i { font-size: 18px; }
.social { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink) !important; transition: transform .2s; }
.social:hover { transform: translate(-1px, -2px); }
.social::before { content: ''; position: absolute; inset: 0; background: var(--gold); border: 2.5px solid var(--ink); border-radius: var(--r-blob); }
.social i { position: relative; font-size: 20px; }
.site-footer__legal {
  max-width: var(--page-max); margin: 0 auto; padding: 16px 32px 28px; font-size: 14px; color: #C9E0EE;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; border-top: 1.5px solid rgba(234, 244, 251, .2);
}
.site-footer__legal a { color: var(--gold); text-decoration: underline; }
.site-footer__legal p, .site-footer p { margin: 0; }
/* "Pause animations" / "Play animations" (wiki.js), at the end of the license row */
.motion-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  background: none; border: 1.5px solid rgba(234, 244, 251, .5); border-radius: 999px;
  font: 600 14px/1.2 var(--font-body); color: #EAF4FB; cursor: pointer;
}
.motion-toggle:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.motion-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.motion-toggle[hidden] { display: none; }

/* Sponsor box (start page, footer column next to Source): a fixed-size white box the logos slide
   through. static/wiki.js moves it and loops it; it can also be dragged, swiped or scrolled. */
.sponsors { align-items: stretch; min-width: 0; }
/* With the sponsor box the footer gets fixed column widths, so the Source button never runs into it:
   below 1300px the box gets its own row, from 1300px it sits next to Source. */
@media (min-width: 900px) {
  .site-footer__cols--sponsors { grid-template-columns: 200px 220px minmax(340px, 1fr); }
  .site-footer__cols--sponsors .sponsors { grid-column: 1 / -1; }
}
@media (min-width: 1300px) {
  .site-footer__cols--sponsors { grid-template-columns: 200px 220px 340px minmax(0, 1fr); }
  .site-footer__cols--sponsors .sponsors { grid-column: auto; }
}
.sponsors__box {
  width: 100%; max-width: 520px; height: 104px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; user-select: none; -webkit-user-select: none;
  background: var(--page-bg); border: 2.5px solid var(--ink); border-radius: var(--r-box); box-shadow: 6px 7px 0 var(--ink);
}
.sponsors__box::-webkit-scrollbar { display: none; }
.sponsors__box.is-dragging, .sponsors__box.is-dragging a { cursor: grabbing; }
.sponsors__track { display: flex; align-items: center; height: 100%; width: max-content; margin: 0; padding: 0; list-style: none; }
/* padding instead of flex gap, so the three copies are exactly equal and the loop has no jump */
.sponsors__item { flex: 0 0 auto; padding: 0 22px; }
.sponsors__item a { display: block; transition: transform .2s; }
.sponsors__item a:hover { transform: scale(1.08); }
.sponsors__item img { display: block; height: 60px; max-width: 200px; width: auto; object-fit: contain; -webkit-user-drag: none; }
.motion-off .sponsors__item a { transition: none; }

/* ---------- Home page placeholder ---------- */
.home-card { max-width: var(--page-max); margin: 24px auto 96px; padding: 0 32px; }
.home-card__inner {
  padding: 44px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-card); box-shadow: 6px 7px 0 var(--ink);
}
.home-card h2 { margin: 0 0 28px; font: 600 32px/1.15 var(--font-display); color: var(--navy); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 24px; }
.tile { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 22px; color: var(--ink); }
.tile:hover { background: var(--hover-tint); color: var(--ink); }
.tile .blob { flex-basis: 56px; width: 56px; height: 56px; }
.tile__title { display: block; font: 600 20px/1.2 var(--font-display); }
.tile__sub { display: block; font-size: 14px; color: var(--ink-muted); line-height: 1.4; }

/* ---------- Members page (wiki/members.html, static/team.js) ---------- */
body[data-layout="members"] .tfa-layer { display: none; }   /* this page has its own TFA, inside the columns */

.hero__title { position: relative; max-width: 100%; }
.hero__title + .hero__lead { margin-top: 8px; max-width: 560px; }
.hero__title svg { position: absolute; left: -4px; bottom: -10px; width: calc(100% + 12px); height: 14px; overflow: visible; }
.hero__title path, .filter__head path, .member-card__name path { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hero__title path { stroke-width: 5; }

.team {
  --px: -40px;   /* centre line of the pipe that runs down the left gutter */
  position: relative; max-width: 1340px; margin: -40px auto 0; padding: 0 64px 120px;
  display: flex; flex-direction: column; gap: 96px;   /* the pipe between two columns is drawn for exactly this gap */
}
.filter__top, .filter__bottom { position: relative; }
.filter__top { padding-top: 40px; }
.filter__head { position: relative; width: fit-content; max-width: 100%; margin-bottom: 96px; }
.filter__head h2 { margin: 0; font: 600 36px/1.15 var(--font-display); color: var(--navy); }
.filter__head svg { position: absolute; left: -4px; bottom: -9px; width: calc(100% + 12px); height: 12px; overflow: visible; }

/* Pipes: in from the left edge, down through each column, around the left gutter into the next one, out to the left */
.plumb, .plumb__elbow { position: absolute; }
.plumb { background: #9AA7B1; }
.plumb--h { left: calc(var(--px) + 22px); right: calc(50% + 22px); height: 27px; border-top: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); }
.plumb--edge { left: -100vw; }
.plumb--v { left: calc(var(--px) - 13.5px); top: -41px; bottom: 85px; width: 27px; border-left: 2.5px solid var(--ink); border-right: 2.5px solid var(--ink); }
.plumb__elbow { width: 80px; height: 80px; overflow: visible; }
.plumb__elbow--mid { left: calc(50% - 40px); }
.plumb__elbow--side { left: calc(var(--px) - 40px); }
.plumb__ink, .plumb__fill { fill: none; }
.plumb__ink { stroke: var(--ink); stroke-width: 27; }
.plumb__fill { stroke: #9AA7B1; stroke-width: 22; }
.filter__top .plumb--h { bottom: 49.5px; }
.filter__top .plumb__elbow { bottom: 23px; }
.filter__bottom .plumb--h { top: 43.5px; }
.filter__bottom .plumb__elbow { top: 17px; }

/* Filter column: two caps and the glass body. team.js sets the height and places the faces (.is-ready). */
.filter__cap { position: relative; z-index: 2; height: 30px; margin: 0 -10px; background: #9AA7B1; border: 2.5px solid var(--ink); border-radius: 14px; }
.filter__body {
  position: relative; margin-top: -6px; min-height: 320px; padding: 72px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-around; gap: 48px 32px;
  background: #E6F3FA; border-left: 2.5px solid var(--ink); border-right: 2.5px solid var(--ink); box-shadow: 6px 7px 0 var(--ink);
}
.filter__body.is-ready { display: block; padding: 0; }
.filter__bottom { margin-top: -6px; }
.filter__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.filter__canvas--fx, .filter__shine { pointer-events: none; }
.filter__shine { position: absolute; top: 0; bottom: 0; left: 3%; width: 31px; }
.filter__shine::before, .filter__shine::after { content: ''; position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .45); }
.filter__shine::before { left: 0; width: 18px; border-radius: 9px; }
.filter__shine::after { left: 26px; width: 5px; border-radius: 3px; }

/* A person: face + name. The rim is grey until a TFA molecule reaches it (then .is-lit); a real photo is always in colour */
.member { --d: 150px; position: relative; z-index: 5; width: var(--d); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.filter__body.is-ready > .member { position: absolute; }
.member.is-open { z-index: 25; }
.member__face { position: relative; width: var(--d); height: var(--d); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.member__face::before { content: ''; position: absolute; inset: 0; transform: translate(4px, 5px); background: var(--ink); border-radius: 50%; }
.member__face::after {
  content: ''; position: absolute; inset: 0; background: #D8C79F; border: 2.5px solid var(--ink); border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 241, 168, 0), 0 0 0 0 rgba(255, 241, 168, 0); transition: background 1s, box-shadow 1.2s;
}
.member__photo { position: absolute; inset: 11%; z-index: 1; overflow: hidden; background: #E9E4D6; border: 2px solid var(--ink); border-radius: 50%; transition: background 1s; }
.member__photo svg { display: block; width: 100%; height: 100%; opacity: .3; transition: opacity 1s; }
.member__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.member.is-lit .member__face::after { background: #FFC15E; box-shadow: 0 0 0 6px rgba(255, 241, 168, .9), 0 0 44px 14px rgba(255, 241, 168, .85); }
.member.is-lit .member__photo { background: #FFF1A8; }
.member.is-lit .member__photo svg { opacity: .95; }
.member__name { padding: 5px 14px; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; font: 600 16px/1.25 var(--font-display); white-space: nowrap; }

/* The card that opens next to a face */
.member-card {
  position: absolute; z-index: 30; width: 380px; padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-box); box-shadow: 6px 7px 0 var(--ink);
  font-size: 16px; line-height: 1.65;
}
.member-card__close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.member-card__close::before { content: ''; position: absolute; inset: 4px; background: var(--capturing-band); border: 2px solid var(--ink); border-radius: var(--r-blob); }
.member-card__close i { position: relative; font-size: 16px; }
.member-card__kicker { padding-right: 44px; font: 600 13px/1.4 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--capturing-deep); }
.member-card__name { position: relative; align-self: flex-start; margin-top: -8px; padding-right: 44px; }
.member-card__name h3 { margin: 0; font: 600 30px/1.1 var(--font-display); color: var(--navy); overflow-wrap: anywhere; }
.member-card__name svg { position: absolute; left: -4px; bottom: -9px; width: calc(100% - 32px); height: 12px; overflow: visible; }
.member-card__meta { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.member-card__occupation { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink-muted); }
.member-card__occupation i { font-size: 18px; color: var(--capturing-deep); }
.member-card__roles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.member-card__role { padding: 4px 12px; background: var(--capturing-band); border: 2px solid var(--ink); border-radius: 999px; font: 500 14px/1.4 var(--font-display); }
.member-card__linkedin { position: relative; width: 44px; height: 44px; margin: -4px -4px -4px auto; display: flex; align-items: center; justify-content: center; color: var(--ink); transition: transform .2s; }
.member-card__linkedin::before { content: ''; position: absolute; inset: 4px; background: var(--degradation); border: 2px solid var(--ink); border-radius: var(--r-blob); }
.member-card__linkedin i { position: relative; font-size: 18px; }
.member-card__linkedin:hover { color: var(--ink); transform: translate(-1px, -2px); }
.member-card__text { margin-top: 2px; }
.member-card__text > * { margin: 0; text-wrap: pretty; }
.member-card__text > * + * { margin-top: 10px; }
.member-card__text a { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.member-card__quote {
  position: relative; margin: 10px 0 0; padding: 18px 20px 18px 16px; display: flex; gap: 12px; transform: rotate(-.8deg);
  background: var(--capturing-note); border: 2px solid var(--ink); border-radius: var(--r-note); box-shadow: 4px 5px 0 rgba(31, 42, 55, .18);
  font: 400 21px/1.35 var(--font-hand); text-wrap: pretty;
}
.member-card__quote i { flex: 0 0 auto; margin-top: 2px; font-size: 22px; color: var(--capturing-deep); }
.member-card__fact { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--tfa-band); border: 2px solid var(--ink); border-radius: 16px 12px 18px 10px; }
.member-card__fact-icon { position: relative; flex: 0 0 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.member-card__fact-icon::before { content: ''; position: absolute; inset: 0; background: var(--tfa-light); border: 2px solid var(--ink); border-radius: var(--r-blob); }
.member-card__fact-icon i { position: relative; font-size: 18px; }
.member-card__fact-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.member-card__fact-title { font: 600 14px/1.4 var(--font-display); color: var(--tfa-deep); }

/* ---------- DBTL cycles: \begin{DBTL_cycle} (pandoc/wiki.lua, behaviour in wiki.js) ----------
   Without JavaScript the iterations are stacked and every text is open. wiki.js adds
   .dbtl--js: the ring in the middle, four cards around it, "Read more" opens an overlay. */
.dbtl { container-type: inline-size; margin-top: 26px; }
.dbtl__grid { display: grid; }
.dbtl__grid > * { grid-area: 1 / 1; min-width: 0; }
.dbtl__stage { display: flex; flex-direction: column; gap: 34px; }
.dbtl-iter { display: flex; flex-direction: column; gap: 18px; }
.dbtl-iter[hidden], .dbtl__overlay[hidden] { display: none; }
.dbtl .dbtl-iter__title { grid-area: title; margin: 0; font: 600 24px/1.25 var(--font-display); color: var(--navy); }
.dbtl-iter__n { margin-right: 12px; font: 600 14px/1.2 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); }
.dbtl__center { display: none; grid-area: c; }

/* phase colours (arrow = ring, tint = card, deep = text, blob = icon) */
.dbtl-p--design { --p: #EE6E62; --p-tint: #FBE0DC; --p-deep: #B23A2B; --p-blob: #EE6E62; }
.dbtl-p--build  { --p: #F9A84A; --p-tint: #FDE8CF; --p-deep: #94500A; --p-blob: #F9A84A; }
.dbtl-p--test   { --p: #46C5B0; --p-tint: #D3F1EC; --p-deep: #1D7365; --p-blob: #46C5B0; }
.dbtl-p--learn  { --p: #64187A; --p-tint: #E9DCEE; --p-deep: #64187A; --p-blob: #B98BDB; }
.dbtl-phase--design { grid-area: d; } .dbtl-phase--build { grid-area: b; }
.dbtl-phase--test { grid-area: t; }   .dbtl-phase--learn { grid-area: l; }

.dbtl-phase {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 210px;
  padding: 20px 20px 18px; background: var(--p-tint); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: var(--r-figure); box-shadow: 5px 6px 0 var(--ink); transition: transform .2s;
}
.dbtl-phase__top { display: flex; align-items: center; gap: 12px; }
.dbtl-phase__blob { position: relative; flex: 0 0 44px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.dbtl-phase__blob::before { content: ''; position: absolute; inset: 0; background: var(--p-blob); border: 2.5px solid var(--ink); border-radius: var(--r-blob); }
.dbtl-phase__blob i { position: relative; font-size: 22px; color: var(--ink); }
.dbtl-phase__name { font: 600 14px/1.2 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--p-deep); }
.dbtl .dbtl-phase__title { margin: 0; font: 600 19px/1.2 var(--font-display); color: var(--navy); }
.dbtl .dbtl-phase__abs { flex: 1; margin: 0; max-width: none; font-size: 15px; line-height: 1.5; }
.dbtl-phase__more {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 7px 14px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; color: var(--ink);
  font: 600 15px/1.2 var(--font-display);
}
.dbtl-phase__body { width: 100%; margin-top: 8px; padding-top: 14px; border-top: 1.5px dashed rgba(31, 42, 55, .35); font-size: 17px; line-height: 1.7; }
.dbtl-phase__body > * { margin-top: 0; margin-bottom: 0; }
.dbtl-phase__body > * + * { margin-top: 14px; }
.dbtl-phase__body p, .dbtl-phase__body ul, .dbtl-phase__body ol { max-width: var(--text-max); text-wrap: pretty; }
.dbtl-phase__body ul, .dbtl-phase__body ol { padding-left: 1.4em; }
.dbtl-phase__body a { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.dbtl-phase__body .fig, .dbtl-phase__body .table-wrap, .dbtl-phase__body .note { margin-top: 22px; }

/* with JavaScript: ring + four cards */
.dbtl--js .dbtl__stage {
  display: grid; gap: 22px; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px) minmax(0, 1fr);
  grid-template-areas: "title title title" "d c b" "l c t";
}
.dbtl--js .dbtl-iter { display: contents; }
.dbtl--js .dbtl-iter[hidden] { display: none; }
.dbtl--js .dbtl__center { display: block; align-self: center; justify-self: center; position: relative; width: min(320px, 100%); aspect-ratio: 1; }
.dbtl--js .dbtl-phase { cursor: pointer; }
.dbtl--js .dbtl-phase:hover { transform: translate(-1px, -2px); }
.dbtl--js .dbtl-phase:active { transform: translate(2px, 2px); }
.dbtl--js .dbtl-phase__more { display: inline-flex; }
.dbtl--js .dbtl-phase__body { display: none; }
@container (max-width: 700px) {
  .dbtl--js .dbtl__stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "c" "d" "b" "t" "l"; }
}

.dbtl__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dbtl__ring-dash { fill: var(--surface); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; opacity: .35; }
.dbtl__arrow { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.dbtl__arrow--design { fill: #EE6E62; } .dbtl__arrow--build { fill: #F9A84A; }
.dbtl__arrow--test { fill: #46C5B0; }   .dbtl__arrow--learn { fill: #64187A; }
.dbtl__center-body { position: absolute; inset: 18%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.dbtl__label { font: 600 13px/1.2 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); }
.dbtl__num { font: 600 48px/1 var(--font-display); color: var(--navy); }
.dbtl__nav { display: flex; gap: 12px; margin-top: 6px; }
.dbtl__btn {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 3px 0 var(--ink); color: var(--ink);
  transition: transform .2s;
}
.dbtl__btn--next { background: var(--gold); }
.dbtl__btn i { font-size: 18px; }
.dbtl__btn:hover:not(:disabled) { transform: translate(-1px, -2px); }
.dbtl__btn:active:not(:disabled) { transform: translate(2px, 2px); }
.dbtl__btn:disabled { opacity: .35; cursor: default; }
.dbtl__dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.dbtl__dot { display: flex; padding: 8px 4px; border: 0; background: none; cursor: pointer; }
.dbtl__dot span { display: block; box-sizing: border-box; width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); transition: width .3s, background .3s; }
.dbtl__dot.is-current span { width: 26px; background: var(--ink); }

/* opened card: same footprint as the ring area, grows when the text is longer.
   The ink shadow is a drop-shadow filter on the wrapper so that it follows the clip-path animation. */
.dbtl__overlay { z-index: 2; align-self: stretch; filter: drop-shadow(6px 7px 0 var(--ink)); }
.dbtl__overlay-in {
  box-sizing: border-box; min-height: 100%; padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 16px;
  background: var(--p-tint); border: 2.5px solid var(--ink); border-radius: var(--r-card);
}
.dbtl__overlay-head { display: flex; align-items: center; gap: 14px; }
.dbtl__overlay-head .dbtl-phase__blob { flex-basis: 52px; width: 52px; height: 52px; }
.dbtl__overlay-head .dbtl-phase__blob i { font-size: 24px; }
.dbtl__overlay-heads { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dbtl .dbtl__overlay-title { margin: 0; font: 600 28px/1.15 var(--font-display); color: var(--navy); }
.dbtl__close { flex: 0 0 44px; }
.dbtl__overlay-body .dbtl-phase__body { display: block; margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  /* header: logo on top, menu buttons wrap underneath; not sticky, to keep the screen free */
  html { scroll-padding-top: 16px; }
  .site-header { position: relative; }
  .site-header__bar { flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding-bottom: 10px; }
  .nav { margin-left: 0; width: 100%; justify-content: center; }
  .bioreactor { flex: 1 1 100%; max-width: none; margin: 0 6px; }
}
@media (max-width: 960px) {
  .toc { flex-basis: 100%; width: auto; max-width: none; position: static; }
  .toc__box { max-width: 420px; max-height: none; }
  .toc__row { overflow: visible; }
  .layout { gap: 28px; padding: 16px 20px 72px; }
  .sec { padding: 36px 22px 40px; }
  .footnotes { padding: 0 22px 32px; }
  .sec__head h2 { font-size: 30px; }
  .hero__inner { padding: 36px 20px 190px; gap: 32px; }
  .hero__art { height: 260px; }
  .home-card { padding: 0 20px; }
  .home-card__inner { padding: 28px 22px; }
}
@media (max-width: 640px) {
  .site-header__bar { padding: 6px 12px; }
  .nav-panel-wrap { padding: 10px 12px 0; }
  .nav-panel { padding: 20px 16px 16px; }
  .nav-panel__tag { display: none; }
  .note summary { font-size: 20px; padding: 12px 16px; }
  .note--formal summary { font-size: 18px; }
  .note--formal .note__body { padding: 0 16px 16px 20px; }
  .dbtl__overlay-in { padding: 22px 18px 24px; }
  .dbtl .dbtl__overlay-title { font-size: 23px; }
  .note__body { padding: 0 16px 16px 20px; }
  .team { --px: -30px; padding: 0 16px 96px 50px; }
  .filter__head h2 { font-size: 30px; }
  .member-card { padding: 22px 18px 20px; }
  .sec .protos { gap: 24px 16px; }
  .sec .protos li { flex: 0 1 calc(50% - 8px); }
  .proto { width: 100%; min-height: 190px; }
  .proto__title { font-size: 15px; }
}

/* ---------- Lists with labels (\item[+] / \item[-] / \item[label], see pandoc/prepare.py) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sec .labels { list-style: none; padding-left: 0; }
.labels li { display: flex; align-items: baseline; gap: 10px; }
.labels li > div { min-width: 0; }
.labels li > i { flex: 0 0 auto; position: relative; top: 2px; font-size: 18px; }
.labels__pro > i { color: var(--biosafety-deep); }
.labels__con > i { color: var(--sensing-deep); }
.labels__label { flex: 0 0 auto; padding: 0 8px; border: 1.5px solid var(--ink); border-radius: 999px; font: 700 13px/1.6 var(--font-body); }
.labels__dot { flex: 0 0 7px; height: 7px; margin: 0 5px; border-radius: 50%; background: var(--accent-deep); position: relative; top: -2px; }

/* ---------- River story (\begin{river}, Human Practices "Our story") ----------
   Markup from pandoc/wiki.lua ("River story"); static/wiki.js draws the water, the side arms and
   the pipes into .hp-flow from the positions of the stations (.hp-in / .hp-out mark where a pipe
   enters and leaves). The river runs down a gutter on the left at every width: --gut is the
   gutter, --sx the centre line of the river and the pipes. */
.sec--river { --sec-px: 44px; background: var(--degradation-band); }
.hp-river {
  --gut: 128px; --sx: 58px; --rw: 46px; --pw: 30px; --aw: 22px; --iw: 64px;
  --w: #9DCDEB; --w2: #B9DEF3; --pipe: #9AA7B1;
  position: relative; isolation: isolate; margin-top: 40px; padding-bottom: 8px;
}
.hp-river > * { position: relative; z-index: 1; }
.hp-river > .hp-flow { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hp-river > .hp-cards { position: absolute; width: 0; height: 0; }
.sec--river .citation, .hp-river a { overflow-wrap: anywhere; }
.hp-in, .hp-out, .hp-spring__out { position: absolute; left: var(--sx); width: 0; height: 0; pointer-events: none; }
.hp-in { top: 0; }
.hp-out { bottom: 0; }
/* without JavaScript: a plain band of water in the gutter */
.hp-river:not(.is-drawn)::before {
  content: ''; position: absolute; z-index: 0; top: 160px; bottom: 0; left: calc(var(--sx) - var(--rw) / 2); width: var(--rw);
  background: var(--w); border-left: 2.5px solid var(--ink); border-right: 2.5px solid var(--ink);
}

/* what JS draws (.hp-flow) */
.hp-flow .ink { fill: none; stroke: var(--ink); stroke-width: 5px; stroke-linejoin: round; }
.hp-flow .water { fill: var(--w); }
.hp-flow .pipe-ink { fill: none; stroke: var(--ink); }
.hp-flow .pipe-fill { fill: none; stroke: var(--pipe); }
.hp-flow .pour { fill: none; stroke: var(--w); stroke-linecap: round; }
.hp-flow .ripple { fill: none; stroke: #DCEFFA; stroke-width: 2.5px; stroke-linecap: round; }
.hp-flow .chevron { fill: none; stroke: var(--navy); stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.hp-flow .speck { fill: var(--tfa); stroke: var(--ink); stroke-width: 1.5px; }
.hp-flow .reed { fill: none; stroke: var(--ink); stroke-width: 2px; stroke-linecap: round; }
.hp-flow .cattail { fill: #B5651D; stroke: var(--ink); stroke-width: 1.5px; }
.hp-flow .pebble { fill: #C9CED4; stroke: var(--ink); stroke-width: 1.8px; }
.hp-flow .plank { fill: #E3B57E; stroke: var(--ink); stroke-width: 2px; stroke-linejoin: round; }
.hp-flow .plank-line { fill: none; stroke: var(--ink); stroke-width: 1.2px; opacity: .55; }
.hp-flow .wheel { fill: var(--sensing); stroke: var(--ink); stroke-width: 2.2px; }
.hp-flow .wheel-spoke { fill: none; stroke: var(--ink); stroke-width: 2px; stroke-linecap: round; }
html:not(.motion-off) .hp-flow .ripple, html:not(.motion-off) .hp-flow .speck { transform-box: fill-box; transform-origin: center; }
html:not(.motion-off) .hp-flow .ripple { animation: hpRip 5s ease-in-out infinite; }
html:not(.motion-off) .hp-flow .speck { animation: hpDrift 9s ease-in-out infinite; }
html:not(.motion-off) .hp-dot, html:not(.motion-off) .hp-fl { animation: hpDrift 9s ease-in-out infinite; }
html:not(.motion-off) .hp-bub { animation: hpRise 8s ease-in-out infinite; }
html:not(.motion-off) .hp-sh:popover-open { animation: hpPop .18s ease-out; }
@keyframes hpDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, 7px); } }
@keyframes hpRise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes hpRip { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4px, 3px); } }
@keyframes hpPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* little things in the water */
.hp-specks { position: absolute; inset: 0; pointer-events: none; }
.hp-dot, .hp-fl, .hp-bub, .hp-bead { position: absolute; border-radius: 50%; border: 1.5px solid var(--ink); }
.hp-dot { background: var(--tfa); }
.hp-fl { background: var(--degradation); }
.hp-bub { background: #fff; }
.hp-bead { width: 26px; height: 26px; background: #FFC15E; }

/* the lake where the story starts */
.hp-spring { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 10px 36px; align-items: center; }
.hp-lake { position: relative; aspect-ratio: 360 / 380; }
.hp-lake > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hp-lake .hp-dot { margin: -6px 0 0 -6px; }
.hp-lakewater { fill: var(--w); stroke: none; }
.hp-lakebank { fill: none; }
.hp-spring__out { left: 33.333%; top: 100%; }
.hp-spring__text > * { margin: 0; }
.hp-spring__text > * + * { margin-top: 16px; }
.sec .hp-spring__text h3 { font: 400 26px/1.25 var(--font-hand); color: var(--navy); }
.hp-spring__text > p { font-size: 19px; line-height: 1.6; max-width: 42ch; }
.hp-spring .fig { max-width: 400px; transform: rotate(-1.5deg); }

/* cards beside the river */
.hp-stop, .hp-panel, .hp-valve__card {
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-card);
}
.hp-stop { margin: 56px 0 0 var(--gut); padding: 30px 34px 32px; box-shadow: 6px 7px 0 var(--ink); }
.hp-panel { position: relative; z-index: 1; border-radius: var(--r-figure); padding: 28px 30px 30px; }
.hp-stop > *, .hp-panel > *, .hp-valve__card > *, .hp-split__sign > * { margin-top: 0; margin-bottom: 0; }
.hp-stop > * + *, .hp-panel > * + *, .hp-valve__card > * + *, .hp-split__sign > * + * { margin-top: 14px; }
.sec .hp-river h3 { margin-top: 14px; font: 600 26px/1.2 var(--font-display); color: var(--navy); }
.sec .hp-river h4 { margin-top: 12px; font: 600 24px/1.2 var(--font-display); color: var(--navy); }
.hp-river .info { background: var(--sensing-band); }
.hp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hp-num, .hp-icon {
  position: relative; flex: 0 0 52px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  font: 600 22px/1 var(--font-display); color: var(--ink);
}
.hp-num::before, .hp-icon::before { content: ''; position: absolute; inset: 0; background: var(--nb); border: 2.5px solid var(--ink); border-radius: var(--r-blob); }
.hp-num > span, .hp-icon > i { position: relative; }
.hp-icon > i { font-size: 25px; }
.hp-faces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.hp-face { display: block; width: 46px; height: 46px; overflow: visible; stroke: var(--ink); stroke-linejoin: round; }
.hp-face-btn { display: block; padding: 0; border: 0; background: none; border-radius: 50%; line-height: 0; cursor: pointer; transition: transform .15s ease; }
.hp-face-btn:hover, .hp-face-btn:focus-visible { transform: translateY(-3px) rotate(-4deg); }
.hp-face-btn.is-unknown { cursor: default; opacity: .6; }
/* A photo face: the button is the round frame and the photo is clipped inside it, so a photo of any shape fills
   the circle (a bare <img> with border-radius is painted as a square by some browsers) and is never squeezed.
   Used by the river story (46px) and the stakeholder map (sized there). */
.hp-face-btn--photo { --face: 46px; box-sizing: border-box; width: var(--face); height: var(--face); overflow: hidden; border: 2.5px solid var(--ink); background: var(--surface); }
.hp-face-btn--photo .hp-face { width: 100%; height: 100%; max-width: none; }
.hp-face--photo { display: block; border: 0; border-radius: 0; object-fit: cover; object-position: 50% 28%; }

/* Stakeholder map: \begin{stakeholdermap}. One figure cut into four fields (Academia, Water remediation,
   Policy, Start-up and business), each scattered with the faces of its stakeholders (they open the same .hp-sh
   cards as the river story). Always a rectangle: 2 x 2 square fields (so the grid of faces in each is a square too), and 1 x 4 (on top
   of each other) when the figure is narrower than 560px, measured on the figure itself (container query, with the
   window width as fallback). The ink background shows through the 2.5px gaps as the lines between the fields.
   The faces lie on a grid of about as many columns as rows (4 faces make 2 x 2) over the whole field, placed by
   wiki.lua with left/top percentages, each moved off its cell centre; they stand straight; each also gets a fixed size
   (--s), so they lie scattered, not in rows. */
.hp-map-wrap { container-type: inline-size; max-width: 860px; margin: 28px auto; }
.hp-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5px; background: var(--ink); border: 2.5px solid var(--ink); border-radius: var(--r-figure); box-shadow: 5px 6px 0 var(--ink); overflow: hidden; }
.hp-map__box { position: relative; container-type: inline-size; min-width: 0; aspect-ratio: 1; background: var(--box-bg); }
.hp-map__box--academia { --box-bg: var(--tfa-band); }
.hp-map__box--water { --box-bg: var(--degradation-band); }
.hp-map__box--policy { --box-bg: var(--capturing-band); }
.hp-map__box--business { --box-bg: var(--biosafety-band); }
.hp-map .hp-map__title { position: absolute; z-index: 1; left: 22px; top: 18px; right: 12px; margin: 0; font: 700 clamp(17px, 5.2cqw, 22px)/1.2 var(--font-hand); color: var(--ink); }
.hp-map__people { --d: min(72px, 100cqw / (var(--cols, 3) + 1.2)); position: absolute; inset: calc(50px + var(--d) * 0.6) calc(var(--d) * 0.4) calc(var(--d) * 0.4); margin: 0; padding: 0; list-style: none; }
.hp-map__people > li { position: absolute; margin: 0; padding: 0; transform: translate(-50%, -50%); }
.hp-map .hp-face-btn { --face: calc(var(--d) * var(--s, 1)); width: var(--face); height: var(--face); }
.hp-map .hp-face { width: 100%; height: 100%; max-width: none; }
.hp-map .hp-todo { position: absolute; left: 22px; top: 60px; margin: 0; }
@container (max-width: 560px) {
  .hp-map { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hp-map { grid-template-columns: minmax(0, 1fr); }
}

/* side arms: the options we let flow away (the notes; wiki.js draws an arm to each one) */
.hp-arms { margin: 40px 0 0 calc(var(--gut) + 64px); }
.hp-arms > .note { max-width: 520px; margin-top: 22px; }
.hp-arms > .note:nth-of-type(even) { margin-left: 52px; }
.sec .hp-arms > .hp-hint { margin: 0; font: 400 22px/1.3 var(--font-hand); color: var(--ink); }

/* the drinking water treatment plant: the river flows into its intake */
.hp-plant { margin-top: 80px; padding-top: 70px; }
.hp-intake {
  position: absolute; z-index: 3; left: calc(var(--sx) - var(--iw) / 2); width: var(--iw); top: -2px; height: 107px;
  background: var(--w); border: 2.5px solid var(--ink); border-top: 0; border-radius: 0 0 14px 14px;
}
.hp-grate { position: absolute; left: 6px; right: 6px; top: 77px; border-top: 2.5px solid var(--ink); }
.hp-grate--2 { top: 87px; }
.hp-roof { position: absolute; left: calc(var(--sx) + var(--iw) / 2 + 18px); right: 3%; top: 0; height: 72px; width: auto; display: block; }
.hp-roof path { fill: #D3E8F4; stroke: var(--ink); stroke-width: 2.5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hp-plant__body { position: relative; background: #F6F8FA; border: 2.5px solid var(--ink); border-radius: var(--r-box); box-shadow: 6px 7px 0 var(--ink); padding: 30px 30px 36px var(--gut); }

/* the tank with the concentrate */
.hp-tank { margin-top: 96px; padding-top: 18px; }
.hp-tank__cap { position: absolute; z-index: 2; left: -10px; right: -10px; top: 0; height: 36px; background: var(--pipe); border: 2.5px solid var(--ink); border-radius: 18px; }
.hp-tank__boss { position: absolute; z-index: 2; left: calc(var(--sx) - 34px); top: -14px; width: 68px; height: 18px; background: var(--pipe); border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; }
.hp-tank__body {
  position: relative; overflow: hidden; padding: 54px 6% 60px var(--gut);
  background: var(--degradation-note); border: 2.5px solid var(--ink); border-top: 0; border-radius: 0 0 48px 48px / 0 0 40px 40px; box-shadow: 6px 7px 0 var(--ink);
}

/* a note on a side branch of the pipe (regulations) */
.hp-valve { margin: 56px 0 0 calc(var(--gut) + 40px); }
.hp-valve__card { padding: 24px 28px 26px; border-radius: var(--r-figure); max-width: 720px; }
.hp-valve__card > .note { margin-top: 22px; }

/* the pipe splits: degradation and capture */
.hp-split { margin-top: 48px; }
.hp-split__sign { margin-left: var(--gut); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sec .hp-split__sign h3 { margin: 0; }
.hp-pipes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; margin-top: 150px; }
.hp-pipes--1 { grid-template-columns: minmax(0, 1fr); }
.hp-pipes--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-pipe { position: relative; display: flex; flex-direction: column; min-width: 0; }
.hp-pipes .hp-in, .hp-pipes .hp-out { left: 50%; }
.hp-tube { position: relative; flex: 1; border: 2.5px solid var(--ink); padding: 34px 16px 38px; }
.hp-pipe--degradation .hp-tube { background: var(--degradation-note); border-radius: 46px 40px 48px 38px / 40px 48px 38px 46px; }
.hp-pipe--capture .hp-tube { background: var(--capturing-band); border-radius: 40px 46px 38px 48px / 48px 38px 46px 40px; }
.hp-tube__cap { position: absolute; z-index: 2; left: 22%; right: 22%; height: 24px; background: var(--pipe); border: 2.5px solid var(--ink); border-radius: 12px; }
.hp-tube__cap--top { top: -13px; }
.hp-tube__cap--bottom { bottom: -13px; }
.hp-window { position: relative; height: 70px; margin: 0 8px 12px; }
.hp-window__arrow { position: absolute; left: calc(50% - 14px); top: 20px; font-size: 28px; color: var(--ink); }
.hp-window__label { position: absolute; right: 0; bottom: -6px; font: 400 16px/1 var(--font-hand); color: var(--navy); }
.hp-pipe--capture .hp-window__label { color: var(--capturing-deep); }
.hp-panel--tube { padding: 22px 22px 24px; font-size: 16px; line-height: 1.65; }

/* the bioreactor with the biosensor compartment */
.hp-reactor { margin-top: 150px; }
.hp-reactor .hp-in { left: calc(var(--gut) + (100% - var(--gut)) / 2); }
.hp-reactor .hp-out { left: var(--gut); top: 72%; bottom: auto; }
.hp-reactor__body {
  position: relative; overflow: hidden; margin-left: var(--gut); padding: 44px 8% 180px;
  background: var(--degradation-note); border: 2.5px solid var(--ink); border-radius: 40px 34px 50% 50% / 34px 40px 150px 150px; box-shadow: 6px 7px 0 var(--ink);
}
.hp-sensor {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 196px; height: 94px; max-width: 62%;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px 6px;
  background: var(--sensing-band); border: 2.5px solid var(--ink); border-top-style: dashed; border-radius: 10px 10px 26px 22px / 10px 10px 22px 26px;
}
.hp-sensor-art { display: block; width: 100%; height: 100%; }
.hp-sensor-art__waves { fill: none; stroke: #FF1E14; stroke-width: 11; stroke-linecap: round; }
.hp-sensor-art__hairs { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.hp-sensor-art__cell { fill: #5FC67E; }
.hp-sensor-art__shade { fill: #3C9A5A; }
.hp-sensor-art__edge { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }

/* back into the landscape */
.hp-river > .hp-sea { z-index: -1; height: 210px; margin: 110px calc(-1 * var(--sec-px)) -60px; }
.hp-sea > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hp-sea .hp-in { left: calc(var(--sx) + var(--sec-px)); top: 64px; }
.hp-sea__grass, .hp-sea__water, .hp-sea__deep { stroke: var(--ink); stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
.hp-sea__grass { fill: #DDF2D6; }
.hp-sea__water { fill: var(--w); }
.hp-sea__deep { fill: var(--w2); }

/* stakeholder cards: a face opens its card (HTML popover, works without JavaScript) */
.hp-sh {
  width: min(680px, calc(100vw - 32px)); max-height: min(86vh, 920px); overflow: auto; margin: auto; padding: 34px 36px 36px;
  background: var(--surface); color: var(--ink); border: 2.5px solid var(--ink); border-radius: var(--r-card); box-shadow: 8px 9px 0 var(--ink);
  font: 400 17px/1.65 var(--font-body); text-align: left;
}
.hp-sh::backdrop { background: rgba(31, 42, 55, .45); }
.hp-sh__close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 18px; cursor: pointer;
}
.hp-sh__top { display: flex; align-items: flex-start; gap: 26px; padding-right: 40px; }
.hp-sh__photo { flex: 0 0 150px; }
.hp-sh__photo img, .hp-sh__frame {
  display: block; width: 150px; height: 170px; object-fit: cover; box-sizing: border-box;
  border: 2.5px solid var(--ink); border-radius: var(--r-figure); box-shadow: 5px 6px 0 var(--ink); transform: rotate(-1.5deg);
}
.hp-sh__frame { padding: 22px 16px; background: var(--degradation-band); }
.hp-sh__doodle { display: block; width: 100%; height: 100%; overflow: visible; stroke: var(--ink); stroke-linejoin: round; }
.hp-sh__intro { min-width: 0; }
.hp-sh p { margin: 0; max-width: none; }
.hp-sh .hp-sh__name { margin-top: 2px; font: 600 30px/1.15 var(--font-display); color: var(--navy); }
.hp-sh .hp-sh__role { margin-top: 6px; font: 700 15px/1.45 var(--font-body); }
.hp-sh .hp-sh__quote {
  margin: 16px 0 0; max-width: none; padding: 14px 16px 12px; color: var(--ink);
  background: var(--capturing-band); border: 2px solid var(--ink); border-radius: var(--r-note);
  font: 400 20px/1.35 var(--font-hand); transform: rotate(-.6deg);
}
.hp-sh__quote p:first-child::before { content: '\201C'; }
.hp-sh__quote p:last-child::after { content: '\201D'; }
.hp-sh__more { margin-top: 28px; padding-top: 22px; border-top: 2px dashed rgba(31, 42, 55, .3); }
.hp-sh__more > * + * { margin-top: 10px; }
.hp-sh .hp-sh__h { margin-top: 20px; font: 600 19px/1.25 var(--font-display); color: var(--navy); }
.hp-sh .hp-sh__h:first-child { margin-top: 0; }
.hp-sh__more ol, .hp-sh__more ul { padding-left: 22px; }
.hp-todo { color: var(--ink-muted); }

/* ---------- phones: narrower gutter, thinner river ---------- */
@media (max-width: 960px) { .sec--river { --sec-px: 22px; } }
@media (max-width: 760px) {
  .hp-river { --gut: 48px; --sx: 20px; --rw: 20px; --pw: 18px; --aw: 12px; --iw: 28px; margin-top: 28px; }
  .hp-spring { grid-template-columns: 1fr; }
  .hp-lake { width: 126px; margin-left: calc(var(--sx) - 42px); }   /* outlet (1/3 of the lake) right above the river */
  .hp-spring__text { padding-left: var(--gut); }
  .hp-spring__text > p { font-size: 17px; }
  .hp-stop { margin-top: 40px; padding: 20px 18px 22px; }
  .hp-arms { margin-left: calc(var(--gut) + 26px); }
  .hp-arms > .note:nth-of-type(even) { margin-left: 0; }
  .hp-plant__body, .hp-tank__body { padding: 28px 14px 30px var(--gut); }
  .hp-roof { left: calc(var(--sx) + var(--iw) / 2 + 10px); }
  .hp-grate { left: 3px; right: 3px; }
  .hp-panel, .hp-valve__card { padding: 20px 16px 22px; }
  .hp-valve { margin-left: calc(var(--gut) + 14px); }
  .hp-face { width: 38px; height: 38px; }
  .hp-face-btn--photo { --face: 38px; }
  .hp-faces { gap: 5px; }
  .hp-pipes, .hp-pipes--3 { grid-template-columns: minmax(0, 1fr); gap: 80px; margin-top: 90px; }
  .hp-pipes .hp-tube__cap { left: 12%; right: 12%; }
  .hp-reactor { margin-top: 80px; }
  .hp-reactor__body { padding: 30px 12px 150px; border-radius: 30px 26px 50% 50% / 26px 30px 100px 100px; }
  .hp-sensor { max-width: 84%; }
  .hp-sh { padding: 26px 20px 26px; }
  .hp-sh__top { flex-direction: column; gap: 18px; padding-right: 0; }
  .hp-sh__photo img, .hp-sh__frame { width: 120px; height: 136px; }
}

/* ---------- Reduced motion: turn all decorative motion off ---------- */
.motion-off .toc__subs, .motion-off .toc__toggle i { transition: none; }
.motion-off .wave, .motion-off .tfa { animation: none; }
.motion-off .pipe__fill, .motion-off .pipe__bead, .motion-off .chip, .motion-off .cta, .motion-off .nav__btn, .motion-off .social { transition: none; }
.motion-off .dbtl-phase, .motion-off .dbtl__btn, .motion-off .dbtl__dot span { transition: none; }
.motion-off .member__face::after, .motion-off .member__photo, .motion-off .member__photo svg, .motion-off .member-card__linkedin { transition: none; }
.motion-off .proto, .motion-off .proto__sheet, .motion-off .proto__btn, .motion-off .proto__btn i, .motion-off .proto__tick path { transition: none; }

/* ---------- Effects created by wiki.js ---------- */
.bubble { position: fixed; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 50%; background: rgba(255, 255, 255, .75); pointer-events: none; z-index: 200; opacity: 0; }
.tfa-fly { position: fixed; margin: 0; z-index: 300; pointer-events: none; opacity: .9; }
.tfa-fly svg { display: block; width: 100%; height: 100%; overflow: visible; }
