/* ============================================================
   LEXEND VARIABLE FONT
   ============================================================ */
@font-face {
  font-family: 'Lexend';
  src: url('https://static.igem.wiki/teams/6334/wiki/lexend-variablefont-wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* ============================================================
   MOSAIC VIS — DESIGN TOKENS & DARK SHELL
   ============================================================ */
:root {
  /* Core palette */
  --mosaic-pink: #e84d85;
  --mosaic-purple: #9b6ca8;
  --mosaic-lime: #c6da58;
  --mosaic-blue: #24b8ec;
  --mosaic-orange: #ee7954;

  /* Surfaces */
  --mosaic-bg: #000000;
  --mosaic-dark: #0a0a0a;
  --mosaic-card: #141416;
  --mosaic-border: #26262a;

  /* Text */
  --mosaic-text: #f3f4f6;
  --mosaic-muted: #9ca3af;
  --mosaic-gray: #d1d5db;

  /* Multi-color gradient stream (all 5 colors: pink -> purple -> blue -> lime -> orange) */
  --mosaic-gradient: linear-gradient(135deg, #e84d85 0%, #9b6ca8 25%, #24b8ec 50%, #c6da58 75%, #ee7954 100%);
  /* Horizontal variant (reading progress bar) */
  --mosaic-gradient-h: linear-gradient(90deg, var(--mosaic-pink), var(--mosaic-purple), var(--mosaic-blue), var(--mosaic-lime), var(--mosaic-orange));

  /* Soft tint backgrounds for hover/active states */
  --mosaic-pink-soft: rgba(232, 77, 133, 0.12);
  --mosaic-purple-soft: rgba(155, 108, 168, 0.16);
  --mosaic-lime-soft: rgba(198, 218, 88, 0.22);

  /* DBTL phase -> mosaic token mapping */
  --mosaic-phase-design: #24b8ec;
  /* blue  */
  --mosaic-phase-build: #c6da58;
  /* lime  */
  --mosaic-phase-test: #ee7954;
  /* orange */
  --mosaic-phase-learn: #e84d85;
  /* pink  */

  /* Remap Bootstrap 5.3 variables (no data-bs-theme) */
  --bs-body-bg: var(--mosaic-bg);
  --bs-body-color: var(--mosaic-text);
  --bs-emphasis-color: var(--mosaic-text);
  --bs-emphasis-color-rgb: 243, 244, 246;
  --bs-secondary-color: var(--mosaic-muted);
  --bs-secondary-bg: var(--mosaic-card);
  --bs-tertiary-color: rgba(243, 244, 246, 0.6);
  --bs-tertiary-bg: #1f1f23;
  --bs-heading-color: var(--mosaic-text);
  --bs-link-color: var(--mosaic-blue);
  --bs-link-hover-color: var(--mosaic-pink);
  --bs-border-color: var(--mosaic-border);
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
  --bs-dark-rgb: 10, 10, 10;
  --bs-light-rgb: 20, 20, 22;
  --bs-primary-rgb: 232, 77, 133;
}

/* Dark scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #050505;
}

::-webkit-scrollbar-thumb {
  background: #26262a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

::selection {
  background: rgba(36, 184, 236, 0.4);
  /* mosaic-blue */
  color: #fff;
}

body {
  padding-top: 56px;
  font-family: 'Lexend', sans-serif;
  background-color: var(--mosaic-bg);
  color: var(--mosaic-text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--mosaic-text);
}

a {
  color: var(--mosaic-blue);
}

a:hover {
  color: var(--mosaic-pink);
}

hr {
  border-color: var(--mosaic-border);
  opacity: 1;
}

/* Dark-theme safety overrides for Bootstrap light utilities */
.text-dark {
  color: var(--mosaic-text) !important;
}

.text-body {
  color: var(--mosaic-text) !important;
}

.bg-light {
  background-color: var(--mosaic-card) !important;
}

.table {
  color: var(--mosaic-text);
}

/* Reading progress bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--mosaic-gradient-h);
  z-index: 1100;
  transition: width 0.1s linear;
}

.bg-dark {
  background-color: #0a0a0a !important;
}

.bg-hero {
  background:
    radial-gradient(120% 120% at 85% 0%, rgba(155, 108, 168, 0.25) 0%, rgba(0, 0, 0, 0) 55%),
    linear-gradient(135deg, #0a0a0a 0%, #141416 100%);
  border-bottom: 1px solid var(--mosaic-border);
}

.bg-hero h1 {
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent !important;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .bg-hero h1 {
    color: #f3f4f6 !important;
  }
}

/* CALLOUT */
.bd-callout {
  padding: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--mosaic-border);
  border-left-width: .25rem;
  border-radius: .25rem
}

.bd-callout h4 {
  margin-bottom: 1.25rem
}

.bd-callout p:last-child {
  margin-bottom: 0
}

.bd-callout code {
  border-radius: .25rem
}

.bd-callout+.bd-callout {
  margin-top: -.25rem
}

.bd-callout-info {
  border-left-color: #5bc0de
}

.bd-callout-warning {
  border-left-color: #f0ad4e
}

.bd-callout-danger {
  border-left-color: #d9534f
}

/* footer */
footer a {
  color: white;
  font-weight: bold;
  text-decoration: none;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

/* ============================================================
   COMPONENT 1: NAVBAR SHELL (transparent bar, floating pill layout)
   ============================================================ */
.custom-navbar {
  background: transparent !important;
  /* not a solid gray bar */
  box-shadow: none;
  padding: 0.6rem 0;
  transition: transform 0.3s ease, padding 0.3s ease;
  z-index: 1030;
}

.navbar-scrolled {
  padding: 0.4rem 0;
}

.navbar-hide {
  transform: translateY(-100%);
}

/* Row: brand pill on the left, menu pill pushed right */
.nav-shell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The nav's own container spans full width (no centered gutter), so the
   shell can hug the right edge. */
.custom-navbar>.container {
  max-width: 100%;
  padding-inline: 0;
  /* kill Bootstrap's horizontal gutter */
  padding-right: 20px;
  /* nudge the whole navbar left of the right edge */
}

.custom-navbar>.container .nav-shell {
  width: 100%;
  margin: 0;
}

/* Left block — brand: logo placeholder + gradient team name.
   margin-right:auto pushes the menu pill to the right edge. */
.brand-pill {
  margin-right: auto;
  display: flex;
  align-items: center;
  padding: 6px 12px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.navbar-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  /* no border-radius / overflow — the logo must never be clipped */
  background: transparent;
  color: transparent;
  font-size: 0;
}

/* The 288px tile cloud is centred in its box by logo-anim.js (144,144);
   scale it to fit the chip and centre it there. */
.navbar-logo .mosaic-logo-anim {
  position: absolute;
  top: 0;
  left: 0;
  width: 288px;
  height: 288px;
  transform: translate(0.7px, 0.7px) scale(0.148);
  transform-origin: top left;
}

.navbar-team-name {
  font-weight: 700;
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.88);
  /* subtle — no rainbow gradient */
}

/* ============================================================
   COMPONENT 2: MENU PILL (glass capsule holding all nav items)
   ============================================================ */
/* Optical thick-glass refraction — 4-directional inset shadows carve out a
   physical cross-section; ultra-low blur keeps background text readable. */
.menu-pill {
  position: relative;
  isolation: isolate;
  /* keeps the glow layer inside its stacking scope */
  border-radius: 18px;
  /* thin bright outer line + the inner highlights fake the cut face */
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  /* near-clear base with a whisper of cool material light */
  background: rgba(255, 255, 255, 0.015);
  /* very low blur — background text stays legible with a slight lens feel */
  backdrop-filter: blur(4px) saturate(160%);
  -webkit-backdrop-filter: blur(4px) saturate(160%);
  /* layered light & shadow: outer float + inset highlights on every edge to
     fake the glass thickness / bevel refraction */
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.3),
    inset 0 2px 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px 0 rgba(0, 0, 0, 0.15),
    inset 2px 0 4px 0 rgba(255, 255, 255, 0.1),
    inset -2px 0 4px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Internal light-guide layer — diagonal sweep, inset 1px hugging the walls */
.menu-pill::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.0) 40%,
      rgba(255, 255, 255, 0.0) 60%,
      rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

/* Keep nav content (text + icons) above the glass layer */
.menu-pill>* {
  position: relative;
  z-index: 1;
}

/* Gradient refraction ring — MOSAIC 5-color edge hugs the pill's outline on
   hover, like the glass refraction band along its rim. Masked to 2px wide. */
.menu-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 2px;
  /* ring thickness */
  background: var(--mosaic-gradient);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.menu-pill:hover {
  border-color: rgba(155, 108, 168, 0.45);
  background: rgba(255, 255, 255, 0.03);
  box-shadow:
    0 14px 40px -5px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 5px 0 rgba(0, 0, 0, 0.2),
    inset 2px 0 6px 0 rgba(255, 255, 255, 0.2),
    inset -2px 0 6px 0 rgba(255, 255, 255, 0.2);
}

.menu-pill:hover::after {
  opacity: 1;
}

.menu-pill .navbar-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
  flex-wrap: nowrap;
  min-width: 0;
}

.menu-pill .navbar-nav .nav-item {
  position: relative;
  margin: 0;
}

/* Vertical divider between items (sits in the middle of the gap) */
.menu-pill .navbar-nav .nav-item+.nav-item::before {
  content: "";
  position: absolute;
  left: calc(clamp(14px, 1.8vw, 28px) / -2);
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.18);
}

/* Nav links — light text on the dark glass pill */
.menu-pill .nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 1.05rem;
  padding: 6px 2px;
  transition: color 0.25s ease;
}

.menu-pill .nav-link:hover {
  color: #fff !important;
}

/* Per-item MOSAIC colour — experiment: each navbar entry takes one brand hue */
.menu-pill .nav-link.nav-c-pink {
  color: var(--mosaic-pink) !important;
}

.menu-pill .nav-link.nav-c-purple {
  color: var(--mosaic-purple) !important;
}

.menu-pill .nav-link.nav-c-blue {
  color: var(--mosaic-blue) !important;
}

.menu-pill .nav-link.nav-c-lime {
  color: var(--mosaic-lime) !important;
}

.menu-pill .nav-link.nav-c-orange {
  color: var(--mosaic-orange) !important;
}

/* MOSAIC brand item — same proportions as the big wordmark (Lexend 600),
   scaled down to the navbar, letters tight, M keeps its notch */
.menu-pill .nav-link.nav-c-mosaic {
  font-weight: 600;
  /* match the big logo weight (was 800) */
  font-size: 1.25rem;
  line-height: 1;
  /* box = glyph height, so the M notch % lands like the big logo */
  letter-spacing: 0.01em;
  gap: 0;
}

.menu-pill .nav-c-mosaic .mosaic-m {
  color: #ffffff;
  display: inline-block;
  /* the M notch — same as the big wordmark */
  --m-depth: 33.5%;
  --m-notch-h: 8.5%;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%,
      0% calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% - var(--m-notch-h)),
      0% calc(70% - var(--m-notch-h)));
}

.menu-pill .nav-c-mosaic .mosaic-o {
  color: var(--mosaic-pink);
}

.menu-pill .nav-c-mosaic .mosaic-s {
  color: var(--mosaic-purple);
}

.menu-pill .nav-c-mosaic .mosaic-a {
  color: var(--mosaic-lime);
}

.menu-pill .nav-c-mosaic .mosaic-i {
  color: var(--mosaic-blue);
}

.menu-pill .nav-c-mosaic .mosaic-c {
  color: var(--mosaic-orange);
}

/* Remove Bootstrap's default dropdown caret */
.nav-link.dropdown-toggle::after {
  display: none;
}

/* Text wrapper — underline animates to exact text width */
.nav-link .u,
.dropdown-item .u {
  position: relative;
  display: inline-block;
}

.nav-link .u::after,
.dropdown-item .u::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.1em;
  width: 100%;
  height: 2px;
  background: var(--mosaic-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover .u::after,
.dropdown-item:hover .u::after {
  transform: scaleX(1);
}

/* Dropdown — fits under the pill, glass on dark.
   A ::before pseudo-element bridges the gap between the trigger and the menu,
   so moving the mouse down across the seam never leaves the parent (which
   would fire mouseleave and collapse the menu). */
.nav-item.dropdown>.dropdown-menu {
  position: absolute;
  top: 100%;
  /* flush under the trigger */
  left: 0;
  margin-top: 0;
  /* remove Bootstrap's spacer seam */
  z-index: 1300;
  /* above search panel (1200) and navbar content */
  min-width: 10rem;
  /* Bootstrap default; ensure a real size */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  background: #15151a;
  /* fully opaque — the pill's hover ring must not bleed through */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Invisible hover bridge: extends the menu's hit area up over the seam */
.nav-item.dropdown>.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  height: 10px;
}

/* And around the bottom/right, so the pointer can't slip out along the edges */
.nav-item.dropdown>.dropdown-menu::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: -10px;
  right: -10px;
  height: 10px;
}

.nav-item.dropdown:hover>.dropdown-menu,
.nav-item.dropdown.show>.dropdown-menu {
  display: block;
  /* override Bootstrap's display:none */
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  position: relative;
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.dropdown-item:hover {
  background: transparent;
  /* underline only — no bg fill */
  color: #fff !important;
}

/* Toggler — keep Bootstrap's default icon, just style the button */
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25);
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ============================================================
   COMPONENT 2.5: NAVBAR SEARCH (between brand and menu)
   ============================================================ */
.navbar-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 auto;
  /* centers in the gap created by brand-pill's auto margin */
}

.search-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--mosaic-text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.search-icon-button:hover {
  color: var(--mosaic-blue);
  border-color: rgba(36, 184, 236, 0.4);
  transform: translateY(-1px);
}

.search-icon-button.active {
  color: var(--mosaic-blue);
  border-color: rgba(36, 184, 236, 0.5);
  background: rgba(36, 184, 236, 0.08);
}

.search-icon-button svg {
  width: 20px;
  height: 20px;
}

.search-dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  /* anchor: center under the search icon */
  transform: translateX(-50%);
  /* expand equally both ways → input under icon */
  width: 500px;
  max-width: 90vw;
  background: rgba(20, 20, 22, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1200;
  /* above Bootstrap dropdowns (1000) within the navbar ctx */
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.search-dropdown-panel.open {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  /* keep the -50% horizontal centering */
  pointer-events: auto;
  animation: dropdownSlide 0.25s ease;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.search-dropdown-content {
  padding: 1.25rem;
}

.search-input-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.8rem 2.75rem 0.8rem 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  color: var(--mosaic-text);
  caret-color: var(--mosaic-blue);
  /* blue insertion caret when focused */
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: var(--mosaic-muted);
}

.search-input:focus {
  border-color: rgba(36, 184, 236, 0.5);
  box-shadow: 0 0 0 3px rgba(36, 184, 236, 0.12);
}

.search-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--mosaic-muted);
  pointer-events: none;
}

.clear-input-button {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--mosaic-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.clear-input-button:hover {
  color: var(--mosaic-text);
  background: rgba(255, 255, 255, 0.08);
}

.clear-input-button svg {
  width: 16px;
  height: 16px;
}

/* Keyboard-shortcut hint (⌘K / Ctrl K) — shows while the input is idle */
.search-kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mosaic-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Hide while typing or focused — the hint isn't needed then */
.search-input:focus~.search-kbd,
.search-input:not(:placeholder-shown)~.search-kbd {
  opacity: 0;
}

.search-hint,
.no-results {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--mosaic-muted);
}

.suggestions-container {
  max-height: 340px;
  overflow-y: auto;
}

.suggestions-container::-webkit-scrollbar {
  width: 6px;
}

.suggestions-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.2rem;
  border-radius: 8px;
  color: var(--mosaic-text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: transparent;
  /* no fill — arrow slide + padding only */
  padding-left: 1.4rem;
}

.suggestion-item:last-child {
  margin-bottom: 0;
}

.suggestion-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--mosaic-muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.active .suggestion-arrow {
  opacity: 1;
  transform: translateX(0);
}

.suggestion-title {
  flex: 1;
}

/* ============================================================
   COMPONENT 2.6: NAVBAR UI ANIMATIONS
   Icon shift + dropdown polish (navbar height expansion removed —
   it caused the whole page to jump on hover)
   ============================================================ */
/* Menu item icon + text shift.
   NOTE: do NOT translate the whole .nav-link on hover — the absolutely
   positioned dropdown is anchored to the nav-item, so moving the link would
   misalign the menu and the pointer could slip out (menu collapses). The
   hover motion lives on the icon only. */
.menu-pill .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.25s ease;
}

.menu-pill .nav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s ease, transform 0.2s ease;
}

.menu-pill .nav-link:hover .nav-icon {
  color: var(--mosaic-purple);
}

.nav-item.dropdown.show>.nav-link .nav-icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .search-dropdown-panel {
    animation: none;
    transition: none;
  }

  .suggestion-item,
  .suggestion-arrow,
  .menu-pill .nav-link,
  .menu-pill .nav-icon {
    transition: none;
  }
}

/* ============================================================
   COMPONENT 3: MOBILE — replaced by the bubble + overlay menu
   (the whole nav-shell is hidden; see COMPONENT 4 overlay rules)
   ============================================================ */

/* ============================================================
   COMPONENT 3.5: MOBILE OVERLAY MENU (right-edge bubble + fullscreen)
   ============================================================ */
/* Bubble button — hidden on desktop, fixed at top-right on mobile */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.menu-btn:active {
  transform: translateY(1px);
}

/* Fullscreen overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 100000;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-overlay .overlay-inner {
  position: relative;
  width: min(720px, 92vw);
  margin: 64px auto;
  background: rgba(20, 20, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  padding: 18px 16px;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.mobile-overlay .overlay-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}

.mobile-overlay .overlay-title {
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 2px 0 10px;
}

/* Overlay menu list */
.overlay-menu,
.overlay-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.overlay-menu>li {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-menu>li:first-child {
  border-top: none;
}

.overlay-menu>li>.overlay-section {
  display: block;
  padding: 12px 8px;
  font-weight: 700;
  color: #d1d5db;
  text-decoration: none;
}

.overlay-submenu {
  padding: 0 0 12px 10px;
}

.overlay-submenu a {
  display: block;
  padding: 8px 8px;
  color: #9ca3af;
  text-decoration: none;
  font-weight: 500;
}

.overlay-submenu a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Prevent background scroll while open */
body.no-scroll {
  overflow: hidden;
}

/* Mobile behavior: hide navbar contents, show the bubble */
@media (max-width: 992px) {
  .custom-navbar .nav-shell {
    display: none !important;
  }

  .menu-btn {
    display: flex;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100001;
  }

  /* small static default logo, top-left (links home) */
  .mobile-brand {
    display: flex;
    position: fixed;
    top: 13px;
    left: 14px;
    z-index: 100001;
    line-height: 0;
    transition: opacity 0.3s ease;
  }

  /* The mechanism screen opens in this corner. The mark gets out of its way
     while that screen holds the viewport. */
  html.mech-in-view .mobile-brand {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-brand-logo {
    height: 80px;
    width: auto;
  }
}

/* Desktop: the mobile logo must never show */
@media (min-width: 992px) {
  .mobile-brand {
    display: none !important;
  }
}

/* Desktop: the mobile overlay (and its inline search) must be fully gone —
   otherwise its absolutely-positioned panels can overlap/intercept the nav
   dropdowns at mid widths (~1000px). */
@media (min-width: 992px) {
  .mobile-overlay {
    display: none !important;
  }

  .menu-btn {
    display: none !important;
  }
}

/* Mobile search — inline inside the overlay menu.
   IMPORTANT: scoped to <992px so it never forces the panel visible on desktop
   (which would overlap and intercept the nav dropdowns). */
@media (max-width: 992px) {
  .mobile-search-item {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    display: block;
    /* overrides the desktop flex centering (higher specificity) */
    margin-left: 0;
    margin-right: 0;
  }

  .mobile-search-item .search-icon-button {
    display: none;
    /* no toggle needed — panel is always open */
  }

  .mobile-search-item .search-dropdown-panel {
    position: static;
    /* in-flow, full width inside the overlay — higher
                         specificity than the desktop .search-dropdown-panel,
                         so no !important needed */
    width: 100%;
    max-width: none;
    margin-top: 0.5rem;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    visibility: visible;
    opacity: 1;
    transform: none;
    animation: none;
    pointer-events: auto;
  }
}

/* Closed, the overlay has to be out of the pointer's way as well as out of
   sight. `visibility: hidden` on its own is not enough: the rule just above
   turns pointer-events back on for the inline search panel, and a descendant
   that re-enables it is still hit-tested underneath a hidden ancestor. That
   left a full-width invisible panel swallowing taps across the middle of every
   page below 992px — cards that would not open on a landscape phone, and the
   arrows on an opened card. Sits after that rule so it wins the tie on
   specificity; the `.open` state is untouched. */
.mobile-overlay:not(.open),
.mobile-overlay:not(.open) * {
  pointer-events: none;
}

/* ============================================================
   COMPONENT 4: ACCESSIBILITY PANEL
   ============================================================ */

/* Content area — uses CSS variable for adjustable font size.
   The matching root scale is set by accessibility.js, which is what carries
   the control to rem-sized text. */
.content {
  font-size: var(--base-font-size, 1.25em);
}

/* Body copy follows the panel's line-height setting. Most prose sections set
   their own leading, so this has to outrank them; headings are left out on
   purpose — their tight default is a design decision, not a reading setting. */
.content p,
.content li,
.content td,
.content th,
.content dd,
.content dt,
.content blockquote,
.content figcaption {
  line-height: var(--acc-line-height, 1.7) !important;
}

/* Except display type, where the line box is part of the drawing rather than a
   reading measure. The wordmark's M is clipped as a fraction of its own box, so
   leading it open moves the notch off the stroke — it cut the whole foot of the
   left stem away. Same idea as the mobile DBTL title below. */
.content .home-mosaic__mark {
  line-height: 1 !important;
}

/* And the statement screens: those are one line of display type each, set tight
   on purpose, and they hold the middle of a pinned screen — led open they read
   as a paragraph rather than as a line dropped on the page. */
.content .home-quote {
  line-height: 1.3 !important;
}

/* The card row's "Click to explore" is a one-line label in the row's foot, not
   prose; the reading line-height would push it into the arrows. */
.content .home-row-hint {
  line-height: 1 !important;
}

/* Toggle button */
#accessibility-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  width: 82px;
  height: 82px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease;
}

#accessibility-toggle:hover {
  transform: scale(1.1);
}

#accessibility-toggle img {
  display: block;
  width: 64px;
  height: 64px;
}

/* Panel */
#accessibility-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 1049;
  width: 200px;
  background: #141416;
  border: 1px solid var(--mosaic-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

#accessibility-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.acc-panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #f3f4f6;
}

.acc-section {
  margin-bottom: 12px;
}

.acc-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Option buttons */
.option-buttons {
  display: flex;
  gap: 4px;
}

.option-buttons button {
  flex: 1;
  padding: 4px 6px;
  font-size: 0.78rem;
  border: 1px solid #26262a;
  border-radius: 4px;
  background: #141416;
  color: #d1d5db;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.option-buttons button:hover {
  background: #1f1f23;
}

.option-buttons button.active {
  background: var(--mosaic-pink);
  color: #fff;
  border-color: var(--mosaic-pink);
}

/* Reset button */
.acc-reset-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  font-size: 0.78rem;
  border: 1px solid #26262a;
  border-radius: 4px;
  background: #141416;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.acc-reset-btn:hover {
  background: #1f1f23;
  color: var(--mosaic-orange);
}

/* ============================================================
   COMPONENT 5: TABLE OF CONTENTS (right-side line indicator)
   ============================================================ */

/* Content column — full width; the TOC floats fixed on the right edge. */
.content-row {
  position: relative;
}

.page-main {
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   COMPONENT 5: TABLE OF CONTENTS
   Floating lines on the right edge + a panel that slides in from
   the right on hover. No TOC badge. Unreached lines = light gray,
   reached/active = blue.
   ============================================================ */
#notion-toc-wrapper {
  position: fixed;
  top: 24%;
  right: 0;
  z-index: 999;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Hidden while the reader is still on the hero (before the first section) */
#notion-toc-wrapper.toc-gated {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#notion-toc-lines {
  position: fixed;
  top: 27%;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 99;
  cursor: pointer;
}

.toc-line {
  height: 5px;
  background-color: rgba(255, 255, 255, 0.2);
  /* unreached — light gray */
  transition: background-color 0.3s ease;
  border-radius: 3px;
}

.toc-line.toc-h1 {
  width: 36px;
}

.toc-line.toc-h2 {
  width: 30px;
}

.toc-line.toc-h3 {
  width: 22px;
}

.toc-line.toc-h4 {
  width: 14px;
}

.toc-line.toc-h5 {
  width: 8px;
}

.toc-line.active {
  background-color: var(--mosaic-blue);
  /* reached — blue */
}

#notion-toc-panel {
  position: fixed;
  top: 24%;
  right: 0;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: #141416;
  border: 1px solid var(--mosaic-border);
  border-radius: 12px 0 0 12px;
  padding: 14px 12px;
  box-sizing: border-box;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  z-index: 9995;
}

#notion-toc-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#notion-toc-panel::-webkit-scrollbar {
  width: 5px;
}

#notion-toc-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.notion-toc-link {
  display: block;
  padding: 5px 10px;
  font-size: 0.83rem;
  color: #d1d5db;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 4px;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  /* single line — no wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  /* too-long headings truncate with … */
  transition: color 0.15s ease, background 0.15s ease;
}

.notion-toc-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.notion-toc-link.active {
  color: var(--mosaic-text);
  background: rgba(36, 184, 236, 0.12);
  border-left-color: var(--mosaic-blue);
}

/* Hierarchical indentation by heading level */
.notion-toc-link.toc-h1 {
  padding-left: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.notion-toc-link.toc-h2 {
  padding-left: 20px;
  font-weight: 600;
}

.notion-toc-link.toc-h3 {
  padding-left: 34px;
  font-weight: 500;
  font-size: 0.8rem;
}

.notion-toc-link.toc-h4 {
  padding-left: 48px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.notion-toc-link.toc-h5 {
  padding-left: 58px;
  font-size: 0.75rem;
  color: #8a8d99;
}

/* Mobile — floating-lines TOC hidden (hover-only interaction, no touch) */
@media (max-width: 991.98px) {
  #notion-toc-wrapper {
    display: none !important;
  }
}

/* ============================================================
   COMPONENT 6: BACK TO TOP + PROGRESS RING
   Translucent glass + colourful glare
   ============================================================ */

/* Wrapper */
#backToTopWrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  width: 70px;
  height: 70px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.3s ease,
    left 0.3s ease, right 0.3s ease, bottom 0.3s ease;
  pointer-events: none;
}

#backToTopInner {
  position: relative;
  width: 70px;
  height: 70px;
}

/* Glass bubble button — contains SVG ring + text */
.main-bubble {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.45);
  /* semi-transparent — doesn't hide text below */
  backdrop-filter: blur(4px) saturate(150%);
  /* light blur — text stays readable */
  -webkit-backdrop-filter: blur(4px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.main-bubble:hover {
  background: rgba(20, 20, 22, 0.92);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(238, 121, 84, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.main-bubble:active {
  transform: scale(0.94);
}

/* SVG progress ring */
.main-bubble svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.main-bubble svg circle:first-of-type {
  /* track */
}

#gradientRing circle {
  transition: stroke-dashoffset 0.15s linear;
}

/* Back To Top text */
.back-to-top-text {
  position: relative;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.2s ease;
}

.main-bubble:hover .back-to-top-text {
  color: var(--mosaic-orange);
}

/* ============================================================
   PAGE TRANSITION OVERLAY (curtain)
   Full-screen overlay with spinner, slides in/out on navigation
   ============================================================ */

.loading-overlay {
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #000;
  z-index: 100000;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Small animated logo inside the navigation curtain (Component 14) */
.loading-overlay .mosaic-logo-anim {
  transform: scale(0.55);
}

/* While the curtain rises (navigating away), keep the logo hidden — the logo
   fades in fresh on the destination page instead of showing a stale
   pre-existing pattern during the rise. */
.loading-overlay.curtain-rise .mosaic-logo-anim {
  opacity: 0;
}

/* Hide the mobile Menu bubble while any loading overlay is covering the page
   (entry splash, or the transition curtain before it reveals). The menu-btn
   sits directly in <body> after the nav, so it is a later sibling of both
   overlays. */
.entry-loader:not(.done)~.menu-btn,
.loading-overlay:not(.loading_out):not(.loading_out_reverse)~.menu-btn {
  display: none !important;
}

/* DBTL floating widgets (the "CYCLE 1" badge + anchor nav) sit at z-index max,
   above the loading curtain — hide them while any overlay is covering. */
body:has(.loading-overlay:not(.loading_out):not(.loading_out_reverse)) .dbTL-cycle-badge,
body:has(.entry-loader:not(.done)) .dbTL-cycle-badge {
  display: none !important;
}

/* Spinning circle */
.loading-overlay svg {
  width: 5rem;
  margin-bottom: 2rem;
  overflow: visible;
  transition: opacity 0.3s ease;
}

.loading-overlay svg circle {
  fill: none;
  stroke: var(--mosaic-lime);
  stroke-width: 6;
  stroke-dasharray: 144.5;
  stroke-dashoffset: 144.5;
  transform-origin: center;
  animation: overlay-spin 3s ease-in infinite;
}

@keyframes overlay-spin {
  0% {
    transform: rotate(0deg);
    stroke-dashoffset: 144.5;
  }

  100% {
    transform: rotate(360deg);
    stroke-dashoffset: -144.5;
  }
}

/* Text */
.loading-overlay p {
  font-family: sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: opacity 0.3s ease;
}

/* Exit: slide down (forward) */
.loading-overlay.loading_out {
  transform: translateY(100%);
}

.loading-overlay.loading_out svg,
.loading-overlay.loading_out p {
  opacity: 0;
}

/* Exit: slide up (reverse) */
.loading-overlay.loading_out_reverse {
  transform: translateY(-100%);
}

.loading-overlay.loading_out_reverse svg,
.loading-overlay.loading_out_reverse p {
  opacity: 0;
}

/* ============================================================
   MAGNETIC CUSTOM CURSOR
   Corner-bracket reticle that follows cursor
   ============================================================ */

/* Hide default cursor when magnetic is active */
.has-magnetic-cursor,
.has-magnetic-cursor * {
  cursor: none !important;
}

/* Restore normal cursor in TOC area */
.has-magnetic-cursor #notion-toc-wrapper,
.has-magnetic-cursor #notion-toc-wrapper * {
  cursor: default !important;
}

.has-magnetic-cursor .toc-line,
.has-magnetic-cursor .notion-toc-link {
  cursor: pointer !important;
}

/* Hide pointer in TOC area */
.magnetic-pointer.magnetic-hidden {
  opacity: 0;
}

/* Container — follows cursor, size set via CSS vars */
.magnetic-pointer {
  --mw: 48px;
  --mh: 48px;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--mw);
  height: var(--mh);
  margin-left: calc(var(--mw) / -2);
  margin-top: calc(var(--mh) / -2);
  /* The cursor is the one thing that must never be covered: it has to stay
     above the lightbox and the "Read more" window (100000), above the navbar
     menu and the loading curtain (100001), and above the wiki-links preview
     layer, which rises over the "Read more" window (100002). This is the top
     of the page's stacking order — nothing goes above it. */
  z-index: 100100;
  pointer-events: none;
  opacity: 0;
  /* hidden unless the magnetic cursor is active (desktop) — touch devices
     would otherwise show a stray bracket at the top-left corner */
  transition: width 0.25s ease-out, height 0.25s ease-out,
    margin-left 0.25s ease-out, margin-top 0.25s ease-out,
    opacity 0.2s ease;
}

.has-magnetic-cursor .magnetic-pointer {
  opacity: 1;
}

/* Corner brackets */
.magnetic-pointer div {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #ffffff;
  transition: border-color 0.2s ease, width 0.25s ease-out, height 0.25s ease-out;
}

.magnetic-pointer div:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 3px solid;
  border-left: 3px solid;
}

.magnetic-pointer div:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 3px solid;
  border-right: 3px solid;
}

.magnetic-pointer div:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 3px solid;
  border-left: 3px solid;
}

.magnetic-pointer div:nth-child(4) {
  bottom: 0;
  right: 0;
  border-bottom: 3px solid;
  border-right: 3px solid;
}

/* Active state — glowing corners */
.magnetic-pointer.magnetic-active div {
  border-color: var(--mosaic-pink);
  width: 16px;
  height: 16px;
}

/* ============================================================
   COMPONENT 9: DBTL ENGINEERING PAGE
   Dark theme + split-layout scroll-driven DBTL cycle diagram
   ============================================================ */

/* ── 9.1 Engineering Page Overrides ────────────────────── */
.page-engineering {
  padding-top: 0;
}

.page-engineering .bg-hero {
  padding-top: calc(56px + 2rem) !important;
  padding-bottom: 2rem !important;
  margin-bottom: 0 !important;
}


/* Keep navbar full height on scroll */
.page-engineering .navbar-scrolled {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.page-engineering #reading-progress-bar {
  background: var(--mosaic-gradient-h);
}

/* The Engineering page reuses the Dry Lab hero but carries the purple of its
   navbar entry — title, cursor and the ambient glows behind it. */
.page-engineering .fancy-hero-dl {
  background:
    radial-gradient(1200px 600px at 70% 10%, rgba(155, 108, 168, 0.20), transparent 60%),
    radial-gradient(1000px 500px at 10% 20%, rgba(155, 108, 168, 0.12), transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #141416 100%);
}
.page-engineering .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-purple);
}
.page-engineering .typing-cursor {
  background: var(--mosaic-purple);
}

/* ── 9.2 DBTL Split Layout Container ──────────────────── */
/* Mobile title — hidden on desktop */
.dbTL-mobile-title {
  display: none;
}

.dbTL-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  /* compact cycle left, cards fill the rest */
  min-height: calc(100svh - 56px);
  margin: 0;
  padding: 0;
}

/* Body copy on the same light weight the Dry Lab pages use (`.dl-main` is 300);
   headings, badges, captions and bold runs keep their own weights. */
.page-engineering .eng-panel p,
.page-engineering .eng-panel ol,
.page-engineering .eng-panel ul,
.page-engineering .eng-panel li {
  font-weight: 300;
}

/* Full-width content column so the side-rail TOC sits flush to the page's left
   edge (like the team page), instead of inside the centred 1140px container. */
.page-engineering .container.content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Pages with a full-screen hero (fancy-page-hero) — full-bleed container,
   hide the default header, flush side-rail TOC. */
.full-bleed .bg-hero {
  display: none !important;
}

.full-bleed .container.content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Start under the fixed navbar so the hero fills the viewport edge-to-edge. */
.full-bleed {
  padding-top: 0;
  overflow-x: hidden;
  /* Bootstrap rows' negative margins must not overflow */
}

.full-bleed .fancy-page-hero {
  height: calc(100svh + 56px);
  margin-top: -56px;
  /* pull up under the fixed navbar */
}

.full-bleed .fancy-page-hero__pin {
  height: calc(100svh + 56px);
}

/* The Project Description body is plain Bootstrap grid, which expects the
   container's padding to absorb .row's negative margins. With that padding
   zeroed the prose ran flush against both viewport edges — on phones the list
   markers were clipped — and every .row pushed 12px past the right edge (more
   at the larger accessibility font tiers, since the gutter is rem-sized).
   Re-constrain the body blocks into a centred measure the way the team page
   does, which is exactly what a stock Bootstrap container would have given
   them; the hero above stays edge-to-edge. */
.page-description .page-main > .row,
.page-description .page-main > .lk-backlinks {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
}

/* The backlinks panel is not inside a column, so it has no gutter of its own —
   match the columns' half-gutter to keep its text on the same left edge. */
.page-description .page-main > .lk-backlinks {
  padding-left: 12px;
  padding-right: 12px;
}

.dbTL-left {
  position: sticky;
  top: 56px;
  height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* hug the left, compact */
  justify-content: center;
  padding: 1.5rem 0.5rem;
  z-index: 10;
}

.dbTL-right {
  /* The prose column keeps a gutter on both sides instead of running to the
     frame's edge; the left rail is already 300px, so this is what sets the
     measure the cards are read at. */
  padding: 2rem clamp(1.5rem, 5vw, 5rem) 4rem;
  min-height: 100svh;
  position: relative;
  z-index: 1;
}

/* ── 9.3 SVG Diagram ──────────────────────────────────── */
.dbTL-svg-wrap {
  width: 100%;
  max-width: 280px;
  position: relative;
}

.dbTL-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Node circles */
.dbTL-node-circle {
  transition: fill 0.35s ease, stroke 0.35s ease, filter 0.35s ease,
    r 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  pointer-events: visiblePainted;
}

/* Node default fills */
.dbTL-node-D {
  fill: #141416;
  stroke: #24b8ec;
  stroke-width: 2.5;
}

.dbTL-node-B {
  fill: #141416;
  stroke: #c6da58;
  stroke-width: 2.5;
}

.dbTL-node-T {
  fill: #141416;
  stroke: #ee7954;
  stroke-width: 2.5;
}

.dbTL-node-L {
  fill: #141416;
  stroke: #e84d85;
  stroke-width: 2.5;
}

/* Node text — white for the idle stages; the active (highlighted) stage takes
   its phase colour below. */
.dbTL-node-text {
  font-family: 'Lexend', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill 0.35s ease;
}

/* Node hover state */
.dbTL-node-group:hover .dbTL-node-circle {
  r: 31;
}

.dbTL-node-group:hover .dbTL-node-D {
  fill: #141416;
  stroke: #24b8ec;
  filter: drop-shadow(0 0 10px rgba(36, 184, 236, 0.5));
}

.dbTL-node-group:hover .dbTL-node-B {
  fill: #141416;
  stroke: #c6da58;
  filter: drop-shadow(0 0 10px rgba(198, 218, 88, 0.5));
}

.dbTL-node-group:hover .dbTL-node-T {
  fill: #141416;
  stroke: #ee7954;
  filter: drop-shadow(0 0 10px rgba(238, 121, 84, 0.5));
}

.dbTL-node-group:hover .dbTL-node-L {
  fill: #141416;
  stroke: #e84d85;
  filter: drop-shadow(0 0 10px rgba(232, 77, 133, 0.5));
}

.dbTL-node-group:hover .dbTL-node-text {
  fill: #fff;
}

/* Node active/highlight states — full saturation + glow */
.dbTL-node-group.highlight-D .dbTL-node-D {
  fill: #141416;
  stroke: #24b8ec;
  filter: drop-shadow(0 0 16px rgba(36, 184, 236, 0.6));
}

.dbTL-node-group.highlight-D .dbTL-node-text {
  fill: var(--mosaic-blue);
}

.dbTL-node-group.highlight-B .dbTL-node-B {
  fill: #141416;
  stroke: #c6da58;
  filter: drop-shadow(0 0 16px rgba(198, 218, 88, 0.6));
}

.dbTL-node-group.highlight-B .dbTL-node-text {
  fill: var(--mosaic-lime);
}

.dbTL-node-group.highlight-T .dbTL-node-T {
  fill: #141416;
  stroke: #ee7954;
  filter: drop-shadow(0 0 16px rgba(238, 121, 84, 0.6));
}

.dbTL-node-group.highlight-T .dbTL-node-text {
  fill: var(--mosaic-orange);
}

.dbTL-node-group.highlight-L .dbTL-node-L {
  fill: #141416;
  stroke: #e84d85;
  filter: drop-shadow(0 0 16px rgba(232, 77, 133, 0.6));
}

.dbTL-node-group.highlight-L .dbTL-node-text {
  fill: var(--mosaic-pink);
}

/* Ring-fill arc — SVG path, position & color driven by scroll */
#dbTL-ring-fill {
  transition: stroke 0.35s ease;
}

/* Center icon */
/* ── Nested sub-cycle, inside the big ring ──────────────────────────────
   A smaller D-B-T-L that runs while the outer ring is in Build or Test.
   The grey disc is the anchor: everything else is sized off its r=55, the
   small nodes sitting on its edge the way the big ones sit on the outer ring.
   Sizes live in the markup (user units) rather than here, so they scale with
   the ring; only the colours and the show/hide live in CSS. */
.dbTL-sub {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.dbTL-sub.is-on {
  opacity: 1;
}

.dbTL-sub-disc {
  fill: #1e1e1e;
}

.dbTL-sub-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 12;
}

.dbTL-sub-arc {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  /* One colour for the whole lap, deliberately not the outer arc's lerp: the
     outer ring changes colour because it is passing through the phases, and the
     inner one is a single iteration whose four parts are all in view at once —
     a colour that meant "t" at one scroll position and "d" at another would be
     saying something it does not mean. */
  stroke: var(--mosaic-purple);
}

.dbTL-sub-circle {
  fill: #24b8ec;
}

.dbTL-sub-circle--D { fill: #24b8ec; }   /* the same four phase colours as the */
.dbTL-sub-circle--B { fill: #c6da58; }   /* outer nodes, so a colour still means */
.dbTL-sub-circle--T { fill: #ee7954; }   /* one phase wherever it appears */
.dbTL-sub-circle--L { fill: #e84d85; }

/* Dark ink, not the white the big letters use: at r=14 these fills are light
   enough that white would be unreadable on the lime and the orange. */
.dbTL-sub-text {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  fill: #12161c;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

/* Pulse ring (rendered inside node groups but hidden by default) */
.dbTL-pulse-ring {
  fill: none;
  stroke-width: 2;
  opacity: 0;
}

.dbTL-node-group.highlight-D .dbTL-pulse-ring {
  stroke: var(--mosaic-blue);
  animation: dbTL-pulse 1.8s ease-out infinite;
}

.dbTL-node-group.highlight-B .dbTL-pulse-ring {
  stroke: var(--mosaic-lime);
  animation: dbTL-pulse 1.8s ease-out infinite;
}

.dbTL-node-group.highlight-T .dbTL-pulse-ring {
  stroke: var(--mosaic-orange);
  animation: dbTL-pulse 1.8s ease-out infinite;
}

.dbTL-node-group.highlight-L .dbTL-pulse-ring {
  stroke: var(--mosaic-pink);
  animation: dbTL-pulse 1.8s ease-out infinite;
}

@keyframes dbTL-pulse {
  0% {
    opacity: 0;
    r: 28;
  }

  40% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    r: 46;
  }
}

/* ── 9.4 Stage Indicator ──────────────────────────────── */
.dbTL-stage-indicator {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dbTL-stage-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #9ca3af;
  text-transform: uppercase;
}

.dbTL-stage-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: color 0.35s ease;
  color: #f3f4f6;
}

.dbTL-stage-value.stage-design {
  color: var(--mosaic-blue);
}

.dbTL-stage-value.stage-build {
  color: var(--mosaic-lime);
}

.dbTL-stage-value.stage-test {
  color: var(--mosaic-orange);
}

.dbTL-stage-value.stage-learn {
  color: var(--mosaic-pink);
}

.dbTL-cycle-badge {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(243, 244, 246, 0.4);
  margin-top: 2px;
}

.dbTL-anchor-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #141416;
  border: 1.5px solid #26262a;
  border-radius: 24px;
  color: #d1d5db;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  font-family: inherit;
  line-height: 1.4;
  margin: 0 0 0 auto;
  user-select: none;
}

.dbTL-anchor-toggle:hover {
  background: #1f1f23;
  color: #f3f4f6;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.dbTL-anchor-toggle:active {
  transform: scale(0.96);
}

.dbTL-anchor-toggle.active {
  background: #26262a;
  color: #f3f4f6;
}

.dbTL-anchor-menu {
  visibility: hidden;
  position: absolute;
  right: 0;
  top: 100%;
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0;
  background: #141416;
  border: 1px solid #26262a;
  border-radius: 10px;
  min-width: 240px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.dbTL-anchor-link {
  display: block;
  padding: 9px 16px;
  font-size: 0.82rem;
  color: #d1d5db;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.dbTL-anchor-link:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

/* ── 9.54 Inline code on the Project pages ─────────────
   Bootstrap paints <code> with its own pink (--bs-code-color), and this page is
   not inside .dl-main, so nothing overrode it. The Project section's colour is
   the purple the nav gives it. Scoped to code inside a paragraph or list item
   so the highlighting theme in a code block is untouched. */
.page-engineering p code,
.page-engineering li code,
.page-engineering td code,
.page-engineering th code {
  color: var(--mosaic-purple);
}

/* ── 9.55 Theme headings (Model track) ─────────────────
   Two levels, and they must not look alike: a theme opens a group of cycles,
   and the "Code Availability" note that closes it belongs underneath. Left to
   the bare h3/h4 defaults the two rendered as equal headings, so the note read
   as a second top-level section rather than the tail of the one above. */
.dbTL-theme {
  /* The theme sits one level above the cycle titles (themselves up to 2.4rem),
     so it stays larger than them without dwarfing the long titles. */
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--mosaic-text);
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dbTL-theme:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.dbTL-note-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
  margin: 2.25rem 0 0.6rem;
}

/* ── 9.6 Cycle Headers ────────────────────────────────── */
.dbTL-cycle-header {
  padding: 1.5rem 0 0.75rem 1.25rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--mosaic-blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dbTL-cycle-header:first-child {
  padding-top: 0;
}

/* per-cycle rail colour (matches the ring's starting node).
   Keyed on data-cycle, not on an id, because every track panel numbers its
   cycles from 1 — ids would collide across the four panels. */
.dbTL-cycle-header[data-cycle="1"] {
  border-left-color: var(--mosaic-blue);
}

.dbTL-cycle-header[data-cycle="2"] {
  border-left-color: var(--mosaic-orange);
}

.dbTL-cycle-header[data-cycle="3"] {
  border-left-color: var(--mosaic-lime);
}

/* The closing summary is not a cycle, so it carries its own rail colour. */
.dbTL-cycle-header--outlook {
  border-left-color: var(--mosaic-purple);
}

/* Closing summary: prose on the page background, no card. Indented to sit on
   the same line as the cycle headers' text. */
.dbTL-card-body .dbTL-summary,
.dbTL-summary {
  padding: 0 0 0 1.25rem;
  max-width: 92ch;
}
.dbTL-card-body .dbTL-summary p,
.dbTL-summary p {
  margin: 0 0 0.95rem;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--mosaic-text);
}

/* The first cycle of a track sits directly under the panel intro. */
.eng-panel-intro + .dbTL-cycle-header {
  padding-top: 0;
}

.dbTL-cycle-title-wrap {
  display: flex;
  /* The capsule sits on the title's centre line rather than on its baseline:
     with the badge's own padding the two baselines look a few pixels apart. */
  align-items: center;
  flex-wrap: wrap;      /* on a narrow frame the title drops below the badge */
  gap: 4px 12px;
}

.dbTL-cycle-num {
  /* A step larger than a caption, a clear step below the title it introduces
     — the badge names the cycle, the title says what the cycle was. */
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 0.14em;
  /* A long cycle title would otherwise squeeze this badge onto two lines. */
  flex: none;
  white-space: nowrap;
}

.dbTL-cycle-title {
  /* One clear step below the theme heading (2.5rem), and still well above the
     card's phase heading (1.5rem). At the old 2.4rem the two read as equals. */
  font-size: clamp(1.6rem, 2.7vw, 2.2rem);
  font-weight: 700;
  color: #f3f4f6;
  margin: 0;
}

.dbTL-cycle-desc {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(243, 244, 246, 0.7);
  line-height: 1.6;
}

/* ── 9.7 Content Cards (Glass) ────────────────────────── */
/* Dark glass card — GradientBlobCard style: translucent glass with a 2px
   gray-700 outline ring + neumorphic dual shadow + animated warm blob behind.
   Single transition (fixes the old double-declaration that dropped transform). */
.dbTL-card {
  position: relative;
  display: flex;
  margin-bottom: 2.5rem;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  outline: 2px solid rgba(55, 65, 81, 0.8);
  /* gray-700 ring (GradientBlobCard) */
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  /* subtle depth — no thick halo */
  overflow: hidden;
  /* JS adds .card-visible via IntersectionObserver */
  opacity: 0;
  transform: translateY(16px) scale(0.993);
  transition: opacity 0.45s ease,
    transform 0.6s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.3s ease;
  will-change: opacity, transform;
}

.dbTL-card.card-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dbTL-card:hover {
  outline-color: rgba(156, 163, 175, 0.9);
  /* brighten the ring on hover */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transform: translateY(-4px) scale(1.004);
}

/* Phase accent left rail — rounded glow pill */
.dbTL-card-accent {
  width: 5px;
  flex-shrink: 0;
  border-radius: 999px;
  margin: 1.6rem 0 1.6rem 1.6rem;
  position: relative;
  z-index: 1;
}

.accent-D {
  background: var(--mosaic-blue);
  box-shadow: 0 0 12px rgba(36, 184, 236, 0.55);
}

.accent-B {
  background: var(--mosaic-lime);
  box-shadow: 0 0 12px rgba(198, 218, 88, 0.55);
}

.accent-T {
  background: var(--mosaic-orange);
  box-shadow: 0 0 12px rgba(238, 121, 84, 0.55);
}

.accent-L {
  background: var(--mosaic-pink);
  box-shadow: 0 0 12px rgba(232, 77, 133, 0.55);
}

.dbTL-card-body {
  flex: 1;
  padding: 1.6rem 1.8rem;
}

.dbTL-card-body h4 {
  /* Matches the Dry Lab pages' phase-level heading (24px / 700). */
  font-weight: 700;
}

.dbTL-card-body h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f3f4f6;
  margin: 0.4rem 0 0.8rem;
}

.dbTL-card-body p {
  /* The site's body scale: 1.25rem / 300, the same size the Dry Lab pages
     give their prose. */
  font-size: 1.25rem;
  line-height: 1.7;
  color: rgba(243, 244, 246, 0.78);
  margin-bottom: 0.8rem;
}

.dbTL-card-body p strong {
  color: #f3f4f6;
  font-weight: 700;
}

.dbTL-card-body ol,
.dbTL-card-body ul {
  font-size: 1.25rem;
  line-height: 1.7;
  color: rgba(243, 244, 246, 0.78);
  padding-left: 1.25rem;
  margin-bottom: 0.8rem;
}

.dbTL-card-body ol li,
.dbTL-card-body ul li {
  margin-bottom: 0.35rem;
}

/* ── Inner cycle, named inside a Build or Test card ─────────────────────
   The nested D-B-T-L the ring draws on the left, written out: Build and Test
   are the phases that are themselves iterative, so each of those cards names
   the turns its loop took. Deliberately not a card of its own — a titled list
   under a hairline, with the sub-steps keyed in the same phase colours the ring
   and the outer nodes use, so the picture and the prose read as one thing.

   The list scrolls inside the card rather than growing it. Two reasons: the
   cards are what the ring's scroll mapping is measured against, so a card that
   changes height as its prose grows would move every cycle boundary under the
   reader; and the inner cycle is a detail *of* the phase, not a second card
   competing with it for the page.
   `overscroll-behavior: contain` is the important line — without it the list
   hands the wheel to the page the moment it reaches its end, so the reader
   scrolling the inner cycle finds the whole card sliding away underneath. */
.dbTL-inner-cycle {
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* The window the turns are read through: it folds the run away at a fixed
   height and scrolls inside itself, so a card stays a card however many turns
   the run has. The cap was 12.5rem, which cut a turn off mid-list — a reader
   saw a scrollbar where they expected a turn. It is a floor on how much of a
   turn is visible rather than a change of behaviour: the fold and the scroll
   are the component. */
.dbTL-card-body .dbTL-inner-cycle__steps {
  list-style: none;
  padding-left: 0;
  margin: 0;
  max-height: min(67.2vh, 26.4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}


.dbTL-card-body .dbTL-inner-cycle__steps::-webkit-scrollbar {
  width: 6px;
}

.dbTL-card-body .dbTL-inner-cycle__steps::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

/* One turn of the loop. The ring draws one lap per turn, so the count in here
   is not only editorial — it is what the drawing reads to decide how many laps
   the phase contains. */
.dbTL-card-body .dbTL-inner-cycle__turn {
  margin-bottom: 1.1rem;
}

.dbTL-card-body .dbTL-inner-cycle__turn:last-child {
  margin-bottom: 0;
}

.dbTL-inner-cycle__turn-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(243, 244, 246, 0.9);
  margin-bottom: 0.45rem;
}

.dbTL-card-body .dbTL-inner-cycle__list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 0.42rem;
  font-size: 1.25rem;
  line-height: 1.6;
}

.dbTL-card-body .dbTL-inner-cycle__list li {
  display: grid;
  grid-template-columns: 1.3rem 1fr;
  gap: 0.55rem;
  align-items: start;
  margin-bottom: 0;
}

/* Prose written inside a turn reads at the turn's own size. */
.dbTL-card-body .dbTL-inner-cycle__list p {
  font-size: inherit;
  margin-top: 0.6rem;
}

/* Dark ink on the key, for the same reason the small ring nodes use it: white
   on the lime and the orange is unreadable at this size. */
.dbTL-inner-cycle__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  color: #12161c;
}

.dbTL-inner-cycle__key--d { background: #24b8ec; }
.dbTL-inner-cycle__key--b { background: #c6da58; }
.dbTL-inner-cycle__key--t { background: #ee7954; }
.dbTL-inner-cycle__key--l { background: #e84d85; }

/* Phase badge — glass pill with a matching ring */
.dbTL-phase-badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-D {
  background: rgba(36, 184, 236, 0.14);
  color: var(--mosaic-blue);
  border-color: rgba(36, 184, 236, 0.35);
}

.badge-B {
  background: rgba(198, 218, 88, 0.14);
  color: var(--mosaic-lime);
  border-color: rgba(198, 218, 88, 0.35);
}

.badge-T {
  background: rgba(238, 121, 84, 0.14);
  color: var(--mosaic-orange);
  border-color: rgba(238, 121, 84, 0.35);
}

.badge-L {
  background: rgba(232, 77, 133, 0.14);
  color: var(--mosaic-pink);
  border-color: rgba(232, 77, 133, 0.35);
}

/* The stage name in the card heading carries the stage colour; the pill that
   used to sit above the heading is gone. */
.dbTL-phase-name--d { color: var(--mosaic-blue); }
.dbTL-phase-name--b { color: var(--mosaic-lime); }
.dbTL-phase-name--t { color: var(--mosaic-orange); }
.dbTL-phase-name--l { color: var(--mosaic-pink); }

/* ── 9.8 Data Highlights ──────────────────────────────── */
/* A row of measured numbers, centred and unboxed — as a card it read as
   decoration around three figures that are already in the prose above. */
.dbTL-data-highlight {
  display: flex;
  gap: 0.6rem 2.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.4rem 0 0.4rem;
}

.dbTL-data-item {
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;

  transition: transform 0.25s ease, border-color 0.25s ease;
}

.dbTL-data-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.20);
}

.dbTL-data-value {
  font-size: 1.22rem;
  font-weight: 800;
  color: #f3f4f6;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  /* numbers don't jitter while counting */
}

.dbTL-data-value.highlight-T {
  color: var(--mosaic-orange);
}

.dbTL-data-label {
  font-size: 0.62rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
  text-align: center;
}

/* ── 9.9 Code Blocks ──────────────────────────────────── */
.dbTL-code-block {
  margin: 1rem 0;
  background: linear-gradient(160deg, rgba(20, 20, 22, 0.9), rgba(10, 10, 12, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow-x: auto;
  /* scroll long code, don't clip it */
  max-width: 100%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.dbTL-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.dbTL-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dbTL-copy-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.20);
}

.dbTL-copy-btn.copied {
  background: rgba(198, 218, 88, 0.15);
  border-color: rgba(198, 218, 88, 0.3);
  color: #c6da58;
}

.dbTL-code-block pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
}

.dbTL-code-block code {
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(243, 244, 246, 0.85);
  white-space: pre;
}

/* ── 9.10 Details/Summary (folding) ───────────────────── */
.dbTL-details {
  margin-top: 0.85rem;
  background: linear-gradient(160deg, rgba(232, 77, 133, 0.06), rgba(10, 10, 12, 0.5));
  border: 1px solid rgba(232, 77, 133, 0.20);
  border-left: 4px solid var(--mosaic-pink);
  /* bd-callout style left rail */
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}

.dbTL-details summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d1d5db;
  transition: color 0.15s ease, background 0.15s ease;
  user-select: none;
  list-style: none;
}

.dbTL-details summary::-webkit-details-marker {
  display: none;
}

.dbTL-details summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.7rem;
  margin-right: 4px;
}

.dbTL-details[open] summary::before {
  transform: rotate(90deg);
}

.dbTL-details summary:hover {
  color: var(--mosaic-pink);
  background: rgba(232, 77, 133, 0.08);
}

.dbTL-details ul,
.dbTL-details ol,
.dbTL-details p {
  padding: 0 14px 10px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(243, 244, 246, 0.72);
}

/* Always-expanded variant (no <summary>, no disclosure affordance). These
   have to out-specify the base rule just above, which also targets a bare
   <p> and <ul> inside .dbTL-details. */
.dbTL-details .dbTL-details-title {
  margin: 0;
  padding: 14px 20px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d1d5db;
}
.dbTL-details > ul {
  padding: 10px 20px 16px 38px;
}

/* ── 9.11 Summary Table ───────────────────────────────── */
/* Marks a cell that improved on the previous round, and the best one so far.
   They ride on a data cell rather than a table of their own, so they are keyed
   to the cell rather than to any one table. */
.dl-table .highlight-improve {
  color: var(--mosaic-orange);
  font-weight: 600;
}

.dl-table .highlight-best {
  color: var(--mosaic-lime);
  font-weight: 700;
}

/* ── 9.12 Magnetic cursor on SVG nodes ────────────────── */
.dbTL-node-circle {
  pointer-events: auto;
}

/* ── 9.13 Responsive ──────────────────────────────────── */
@media (max-width: 992px) {
  .page-engineering {
    overflow-x: hidden;
  }

  .dbTL-container {
    display: block;
    min-height: auto;
  }

  /* keep cards inside the column; tables fit (cells wrap), code scrolls */
  .dbTL-card {
    max-width: 100%;
  }

  .dbTL-summary-table {
    table-layout: fixed;
  }

  .dbTL-card-body {
    overflow-x: auto;
    padding: 1.15rem 1.25rem;
  }

  .dbTL-card-accent {
    margin: 1.25rem 0 1.25rem 1rem;
  }

  /* Title inside DBTL fixed area */
  .dbTL-mobile-title {
    display: block;
    text-align: center;
    padding: 0.3rem 1rem 0;
  }

  .dbTL-mobile-title h1 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--mosaic-pink), var(--mosaic-purple), var(--mosaic-blue), var(--mosaic-lime));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* Display copy, not body copy — opts out of the accessibility line-height. */
  .dbTL-mobile-title p {
    font-size: 0.68rem;
    color: rgba(243, 244, 246, 0.7);
    margin: 0.2rem 0 0;
    line-height: 1.3 !important;
  }

  /* Hero header: normal flow, visible at top */
  .page-engineering .bg-hero {
    padding: 1rem 1.5rem !important;
    margin-bottom: 0 !important;
  }

  .page-engineering .bg-hero .display-4 {
    font-size: 1.4rem;
  }

  .page-engineering .bg-hero .lead {
    font-size: 0.7rem;
    margin-bottom: 0 !important;
  }

  /* Hide duplicate mobile title */
  .dbTL-mobile-title {
    display: none !important;
  }

  /* SVG panel: sticky at top (mobile navbar is replaced by the bubble button,
     so there is no 55px navbar to stick below) */
  .dbTL-left {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    min-height: 30svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem 0.8rem;
    overflow: visible;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  }

  .dbTL-svg-wrap {
    max-width: 200px;
  }

  .dbTL-stage-indicator {
    position: absolute;
    bottom: 10px;
    right: 20px;
  }

  /* Content: normal flow below SVG panel */
  .dbTL-right {
    margin-top: 0;
    padding: 1.5rem 1.5rem 3rem;
  }

  /* Scroll targets clear the one bar that is still pinned — the ring. The
     tab strip is no longer sticky, so it no longer needs room. Only on the
     Engineering page: as a bare `html` rule this pushed every #section on
     every other page a third of the screen down on a phone. */
  html:has(body.page-engineering) {
    scroll-padding-top: calc(var(--dbTL-rail-h, 30svh) + 1rem);
  }

  html {
    scroll-behavior: smooth;
  }

  .dbTL-anchor-toggle {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .dbTL-anchor-menu {
    min-width: 170px;
    font-size: 0.7rem;
  }

  .dbTL-data-highlight {
    gap: 0.6rem;
  }

  .dbTL-data-item {
    min-width: 74px;
    padding: 0.6rem 0.85rem;
  }

  .dbTL-data-value {
    font-size: 1.05rem;
  }
}

@media (max-width: 576px) {
  .page-engineering .bg-hero {
    padding: 0.8rem 1rem 1.5rem !important;
  }

  .page-engineering .bg-hero .display-4 {
    font-size: 1.2rem;
  }

  .page-engineering .bg-hero .lead {
    font-size: 0.6rem;
  }

  .dbTL-left {
    top: 0;
    min-height: 25svh;
  }

  .dbTL-svg-wrap {
    max-width: 150px;
  }

  .dbTL-stage-value {
    font-size: 1.2rem;
  }

  .dbTL-right {
    margin-top: 0;
    padding: 1rem 1rem 2.5rem;
  }

  .dbTL-card {
    border-radius: 14px;
  }

  .dbTL-card-accent {
    margin: 1rem 0 1rem 0.8rem;
  }

  .dbTL-card-body {
    padding: 0.9rem 1rem;
  }

  .dbTL-phase-badge {
    font-size: 0.58rem;
    padding: 4px 9px;
  }

  .dbTL-cycle-title {
    /* Still above the phase heading (1.35rem here), below the theme (1.9rem). */
    font-size: 1.6rem;
  }

  .dbTL-cycle-num {
    /* The same step as the desktop badge, so it does not outweigh the title. */
    font-size: 1.1rem;
  }

  .dbTL-card-body h3 {
    font-size: 0.95rem;
  }

  .dbTL-card-body p,
  .dbTL-card-body ol,
  .dbTL-card-body ul {
    font-size: 1.25rem;
  }

  .dbTL-anchor-menu {
    min-width: 170px;
  }

  .dbTL-anchor-link {
    font-size: 0.72rem;
  }
}

/* ── 9.13 Accessibility ───────────────────────────────── */
/* No-motion users: fade only, no rise/scale */
@media (prefers-reduced-motion: reduce) {

  .dbTL-card,
  .dbTL-card.card-visible,
  .dbTL-card:hover {
    transform: none;
    transition: opacity 0.01ms linear;
  }
}

/* Touch: drop the hover lift so it never sticks after a tap */
@media (hover: none) {
  .dbTL-card:hover {
    transform: none;
  }
}

/* ── 9.13 Track tabs (Wet Lab · Model · Software · Hardware) ── */
/* One track per tab. The strip is sticky so a reader can switch lines without
   scrolling back up; it stays flat on the page background rather than sitting
   in a box. The page carries its own navigation (ring + tabs), so the global
   side-rail TOC is switched off, as on the education and dry lab pages. */
.page-engineering #notion-toc-wrapper {
  display: none;
}

.eng-tabs {
  /* Pinned under the navbar: the tracks are long, and switching one should
     not mean scrolling all the way back to the top of the page. */
  position: sticky;
  top: 56px;
  z-index: 20;
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.75rem;
  padding: 0.4rem 1.25rem;
  background: var(--mosaic-bg);
  /* The strip sits under the navbar, so it can follow it: the bar hides on a
     downward scroll, and a strip held at 56px would then float with a gap of
     nothing above it. */
  transition: top 0.25s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

/* Bar hidden → the strip takes the top edge, where the bar was. */
body:has(.custom-navbar.navbar-hide) .eng-tabs {
  top: 0;
}

.eng-tabs::-webkit-scrollbar {
  display: none;
}

.eng-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.6rem 0.5rem 0.55rem;
  border: none;
  background: none;
  color: var(--mosaic-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  /* Underline lives on the accent bar so the active state reads as a rule,
     not as a filled pill. */
  border-bottom: 2px solid transparent;
  transition: color 0.22s ease, border-color 0.22s ease;
}

.eng-tab:hover {
  color: var(--mosaic-text);
}

.eng-tab:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: -2px;
}

.eng-tab.is-active {
  color: var(--mosaic-text);
  border-bottom-color: var(--mosaic-text);
}

/* First tab of each track sets the strip's accent. */
.eng-tab[data-track="wet-lab"].is-active {
  border-bottom-color: var(--mosaic-blue);
}

.eng-tab[data-track="model"].is-active {
  border-bottom-color: var(--mosaic-purple);
}

.eng-tab[data-track="software"].is-active {
  border-bottom-color: var(--mosaic-lime);
}

.eng-tab[data-track="hardware"].is-active {
  border-bottom-color: var(--mosaic-orange);
}

.eng-panel[hidden] {
  display: none;
}

.eng-panel-intro {
  margin: 0 0 2rem;
  padding-left: 1.25rem;
}

.eng-panel-title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 800;
  color: var(--mosaic-text);
  margin: 0 0 0.5rem;
}

.eng-panel-lead {
  font-size: 0.95rem;
  color: rgba(243, 244, 246, 0.72);
  max-width: 62ch;
  margin: 0 0 0.4rem;
}

.eng-panel-links {
  font-size: 0.8rem;
  color: var(--mosaic-muted);
  margin: 0;
}

/* Banner: makes it obvious to a reader — and to us — that this page is not
   finished content yet. */
.eng-fake-banner {
  text-align: center;
  color: var(--mosaic-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin: 1rem 1.25rem 0;
}

/* Mobile: the strip scrolls horizontally instead of squeezing four labels, and
   pins directly beneath the ring panel. That panel is sticky at top:0 and its
   height is content-driven, so engineering.js measures it into --dbTL-rail-h
   rather than guessing a viewport fraction here; the strip then sits under the
   ring in both flow and sticky state, so the two never swap places. */
@media (max-width: 992px) {
  .eng-tabs {
    /* The ring panel is sticky at the top and its height is measured into
       --dbTL-rail-h; the strip parks directly under it. */
    top: var(--dbTL-rail-h, 30svh);
    z-index: 101;
    padding: 0.35rem 0.75rem;
    gap: 0.15rem;
    background: var(--mosaic-bg);
  }

  /* Grow to share the width evenly when all four fit; never shrink below the
     label, so a narrow phone scrolls the strip instead of truncating it. */
  .eng-tab {
    flex: 1 0 auto;
    padding: 0.55rem 0.45rem 0.5rem;
    font-size: 0.69rem;
    letter-spacing: 0.04em;
  }

  .eng-panel-intro {
    padding-left: 0;
  }
}

/* ── 9.14 Print ───────────────────────────────────────── */
@media print {
  .page-engineering {
    background: #fff !important;
    color: #000 !important;
  }

  .page-engineering .dbTL-left {
    display: none;
  }

  .page-engineering .dbTL-right {
    padding: 0;
  }

  .page-engineering .dbTL-card {
    background: #fff;
    border: 1px solid #ddd;
    opacity: 1;
    transform: none;
    break-inside: avoid;
  }

  .page-engineering .dbTL-card-body p,
  .page-engineering .dbTL-card-body li {
    color: #333;
  }

  /* Print everything: a tab strip is meaningless on paper, and every track
     should reach the reader. */
  .page-engineering .eng-tabs {
    display: none;
  }

  .page-engineering .eng-panel[hidden] {
    display: block;
  }
}

/* ============================================================
   COMPONENT 10: MOSAIC BRAND INTRO (homepage)
   Left: logo placeholder (reserved for final mosaic SVG)
   Right: colored MOSAIC wordmark + tagline
   ============================================================ */
.mosaic-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0 2rem;
  /* transform/opacity are driven by home.js (damped spring entrance) */
}

/* Inner wrapper holds the breathing float — separate element, so it never
   conflicts with the spring transform on .mosaic-intro */
.mosaic-intro-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  animation: mosaic-intro-float 4s ease-in-out infinite;
}

/* note: named mosaic-intro-float, NOT mosaic-breathe — the tile colour
   breathing reuses "mosaic-breathe" and a later @keyframes with the same name
   would silently override this float.
   The 0.8 scale rides inside the keyframes because this element is the only
   place the brand lock-up's size is set: a transform here shrinks the logo and
   the wordmark together, and (unlike font-size or width) it leaves the row's
   layout box at its full width, so the breakpoint below still measures what it
   was written against. */
@keyframes mosaic-intro-float {

  0%,
  100% {
    transform: scale(0.8) translateY(0);
  }

  50% {
    transform: scale(0.8) translateY(-18px);
  }
}

/* Interactive-logo affordance — the logo hints it reassembles on click by
   briefly lifting a few tiles every few seconds (no text). The ripple is
   triggered by logo-anim.js (interactive logos only). */
/* !important so it beats the higher-specificity .has-flow mosaic-flow wave
   (which would otherwise override this shorthand and kill the lift). */
.mosaic-logo-anim .mosaic-tile.tile-hint {
  animation: tile-hint 1.8s ease-in-out !important;
}

@keyframes tile-hint {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
    filter: none;
  }

  25% {
    transform: translateY(-5px) scale(1.08);
    filter: brightness(1.45);
  }

  55% {
    transform: translateY(1px) scale(0.99);
    filter: brightness(1.2);
  }
}

.mosaic-intro-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: max-content;
  /* width = longest line (the subtitle) */
  /* The lock-up is scaled as one piece by the float keyframes; the text carries
     a counter-scale so it lands at 90% while the logo beside it stays at 80%.
     0.8 × 1.125 = 0.9. It is a transform rather than a font size so the row's
     layout box — which the breakpoints below measure — is untouched, and so the
     subtitle and the wordmark keep their relative sizes. */
  transform: scale(1.125);
}

/* Wordmark — one accent color per letter.
   Letters stretch via flex to exactly match the subtitle width below. */
.mosaic-intro-title {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  /* a bit thicker than 400 */
  font-size: 7.5rem;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

/* The six letters of the wordmark. Shared between the opening splash and the
   callback screen, so the palette lives in one place. */
/** A gap in the mark: the ground behind shows through, and no state change
 *  paints anything on it. The tiles carry a thin frame so each one reads as a
 *  tile; with no colour under it that frame is the whole tile, which turns a
 *  hole into an empty square. */
.mosaic-logo-anim .is-gap {
  background: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.mosaic-wordmark .mosaic-m {
  color: #ffffff;
  /* Trim the glyph's left side bearing so the M's ink, not its advance
     box, starts on the tagline's left edge. */
  margin-left: -0.075em;
  display: inline-block;
  /* a thin chop across the left vertical stroke, centred at 70% height —
     --m-depth cuts deep enough to sever the stroke, --m-notch-h is the
     half-height of the thin cut */
  --m-depth: 33.5%;
  --m-notch-h: 8.5%;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%,
      0% calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% - var(--m-notch-h)),
      0% calc(70% - var(--m-notch-h)));
}

.mosaic-wordmark .mosaic-o {
  color: #e84d85;
}

.mosaic-wordmark .mosaic-s {
  color: #9b6ca8;
}

.mosaic-wordmark .mosaic-a {
  color: #c6da58;
}

.mosaic-wordmark .mosaic-i {
  color: #24b8ec;
}

.mosaic-wordmark .mosaic-c {
  color: #ee7954;
  /* Same for the C's right side bearing. */
  margin-right: -0.02em;
}

.mosaic-intro-subtitle {
  /* One size at every width: the subtitle has to end on the M and C, and at
     0.85rem with 1px tracking its one line ran about 50px wider than the
     wordmark. 0.72rem with 0.2px tracking is the width the six letters
     themselves set. */
  font-size: clamp(0.72rem, 1.75vw, 0.9rem);
  letter-spacing: 0.2px;
  margin-top: 1rem;
  white-space: nowrap;
  text-align: center;
}

/* Desktop: the same one line set to the wordmark's width. At 0.72rem it was
   about 90px short, so its ends sat inside the M and C. */
@media (min-width: 769px) {
  .mosaic-intro-subtitle {
    /* Spread the words across the block instead of setting one long line:
       `space-between` pins the first and last word to the M and C edges
       whatever the font measures, so the line can never overhang the left
       edge. The size comes from the base clamp, so a 826px window (the
       compact row) does not get a smaller subtitle than a desktop. */
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
}

.mosaic-intro-team {
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  margin-top: 1.4rem;
  text-align: center;
}

/* The row is the logo, a gap and a nowrap tagline — about 868px once the
   tagline reaches its full size, plus the section's own padding. Between the
   phone layout and a wide window there is a band where it does not fit at all,
   and landscape phones sit in that band with too little height to stack. They
   get a tighter row instead.
   The logo keeps its 288px box — the tiles are positioned inside it in px — so
   it is scaled down and pulled back by the same amount in negative margin: it
   only costs the row what it actually shows. */
@media (min-width: 769px) and (max-width: 900px) {
  .mosaic-intro-inner {
    gap: 1.5rem;
  }

  .mosaic-intro-inner .mosaic-logo-anim {
    transform: scale(0.72);
    margin: 0 -40px;
  }

}

@media (max-width: 768px) {
  .mosaic-intro-inner {
    flex-direction: column;
    gap: 1.5rem;
    /* The logo box is a fixed 288px square — its tiles are placed inside it in
       px — and cannot be made narrower, only scaled, so the gutter is what has
       to give: 288 plus two 20px gutters is eight pixels wider than a 320px
       screen, which is enough to put a sideways scroll on the first screen. */
    padding: 0 clamp(0px, calc((100vw - 288px) / 2), 1.25rem);
  }

  /* constrain the text block so the long subtitle / letters never overflow */
  .mosaic-intro-text {
    width: 100%;
    max-width: 100%;
  }

  .mosaic-intro-title {
    justify-content: center;
    gap: 0.4rem;
    font-size: clamp(2.5rem, 11vw, 3.5rem);
  }

  .mosaic-intro-subtitle {
    white-space: normal;
    /* wrap the long tagline on phones */
    line-height: 1.7;
  }

  /* The wrapped tagline used to set wider than the wordmark, so its outer
     edges floated inside the M and C. Tighter tracking brings the two lines
     back to the wordmark's width. */
  .mosaic-intro-subtitle {
    /* two even lines rather than one long and one short, so the wrapped
       block keeps the wordmark's width on both sides */
    text-wrap: balance;
  }

  /* centred animated logo: cloud is already centred by logo-anim.js */
  .mosaic-intro-inner .mosaic-logo-anim {
    transform: scale(0.7);
  }
}

/* ============================================================
   COMPONENT 11: HOME STICKY STACK (pinned screens + damped inner reveal)
   ============================================================ */

/* Home: hide shared fixed widgets (TOC + accessibility + native hero +
   reading chrome — the narrative runs the scroll, so a progress bar and a
   back-to-top button would only sit on top of it) */
.page-home #notion-toc-wrapper,
.page-home #reading-progress-bar,
.page-home .bg-hero {
  display: none !important;
}

/* Stack — each screen is one viewport in normal flow; scrolling
   moves each screen up and out of view (no layering/covering). */
.home-stack {
  position: relative;
}

/* No scroll snapping. A snap rule used to sit on <body>, where it never reached
   the viewport scroller and so did nothing; moving it onto <html> to make it
   real was measured and rejected — with the crossing section taller than the
   viewport, the browser treats the whole section as a snap area and the scroller
   gets dragged back to a fixed point mid-crossing, which reads as a wall (a
   wheel notch could not advance past it). The acts are already separated by
   their own length and their frozen holds, so nothing here needs snapping. */

/* One screen = one viewport (below navbar); scrolls away naturally */
.home-screen {
  position: relative;
  /* anchors the absolute scroll-indicator */
  height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
  background: var(--mosaic-bg);
}

/* Screen 1 — brand hero content (JS scales/fades this wrapper on scroll) */
.splash-inner {
  will-change: transform, opacity;
  padding: 2rem 0 6rem;
  /* keep the logo+wordmark clear of the scroll indicator */
}

/* Animated MOSAIC logo — one gradient fills the whole logo area; the tile
   shapes are a mask cut out of it, so colours flow continuously tile to tile
   like a single gradient sheet. Tiles themselves are transparent and drive
   the reassembly animation. */
.mosaic-logo-anim {
  position: relative;
  /* the tile cloud is centred in this box (cloud center = 144,144) */
  width: 288px;
  height: 288px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
}

.mosaic-logo-anim .mosaic-tile {
  position: absolute;
  width: 31.33px;
  height: 31.33px;
  box-sizing: border-box;
  /* colour is set per-tile in JS from the _3 colour map */
  /* thin outline keeps every tile's frame readable */
  outline: 1px solid rgba(255, 255, 255, 0.14);
  outline-offset: -1px;
  will-change: left, top, opacity, transform;
  transform-origin: center center;
}

/* OKLCH colour-flow: each tile's background is color-mix(in oklch) between its
   brand colour (--c1/--c2) and a hue-shifted flow colour (--c1f/--c2f), with
   the mix weight animated by --flow. OKLCH keeps perceived brightness constant
   while the hue shifts, so the wave flows cleanly (no sRGB mud). Gated on
   .is-inview so it starts when the logo is first seen. */
@property --flow {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

@property --c1 {
  syntax: '<color>';
  initial-value: #ffffff;
  inherits: false;
}

@property --c2 {
  syntax: '<color>';
  initial-value: #ffffff;
  inherits: false;
}

@property --c1f {
  syntax: '<color>';
  initial-value: #ffffff;
  inherits: false;
}

@property --c2f {
  syntax: '<color>';
  initial-value: #ffffff;
  inherits: false;
}

.mosaic-logo-anim.is-ready.is-inview .mosaic-tile.has-flow {
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--c1f) var(--flow, 0%), var(--c1)),
      color-mix(in oklch, var(--c2f) var(--flow, 0%), var(--c2))) !important;
  animation: mosaic-flow 5s ease-in-out infinite;
  animation-delay: calc((var(--col, 0) + var(--row, 0)) * -0.4s);
  transition: --c1 0.8s ease, --c2 0.8s ease, --c1f 0.8s ease, --c2f 0.8s ease,
    --flow 0.8s ease;
  /* smooth morph colour change + flow fall-back */
}

@keyframes mosaic-flow {

  0%,
  25%,
  75%,
  100% {
    --flow: 0%;
  }

  50% {
    --flow: 100%;
  }
}

/* State-switch hold: while the logo reassembles, the wave is paused so every
   tile returns to its clean brand colour. --flow is eased (via the .has-flow
   transition) from its mid-wave value to 0 — no hard snap. */
.mosaic-logo-anim.is-flowhold .mosaic-tile {
  animation: none !important;
}

/* Release settle: still paused, but --flow is eased from brand up to each
   tile's staggered start value, so the wave BUILDS IN smoothly instead of the
   negative-delay stagger snapping in all at once. */
.mosaic-logo-anim.is-flowsettle .mosaic-tile.has-flow {
  transition: --c1 0.8s ease, --c2 0.8s ease, --c1f 0.8s ease, --c2f 0.8s ease,
    --flow 1.4s ease;
}

/* Loading/autoplay mode: tiles hold their state colours — no flow. */
.mosaic-logo-anim.is-loading.is-ready .mosaic-tile {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-logo-anim .mosaic-tile {
    transition: none;
  }

  .mosaic-logo-anim.is-ready.is-inview .mosaic-tile.has-flow {
    animation: none;
  }
}

/* ── Entry brand splash (Component 14) ────────────────────────────────
   Full-screen animated-logo loader, shown once per session. The logo
   reassembles (autoplay, no breathing); an ease-out percentage counts
   0→100%, then the splash fades out. Sits above the navigation curtain. */
.entry-loader {
  position: fixed;
  inset: 0;
  z-index: 100001;
  /* above .loading-overlay (100000) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--mosaic-bg);
}

.entry-loader .mosaic-logo-anim {
  width: 288px;
  height: 288px;
}

.entry-loader .loading-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transform: translateX(-18px);
  /* hug the logo's left, off-centre */
  opacity: 0;
  animation: entry-meta-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s forwards;
  /* fade in WITH the tiles */
}

@keyframes entry-meta-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.entry-loader .loading-pct {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.85);
  /* muted — the logo carries the colour */
}

.entry-loader .loading-text {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.entry-loader.done {
  opacity: 0;
  transition: opacity 0.45s ease;
}

@media (prefers-reduced-motion: reduce) {
  .entry-loader.done {
    transition: none;
  }

  .entry-loader .loading-meta {
    animation: none;
    opacity: 1;
  }
}

/* The cue that ends the act. Centred, and centred as a row: the arrow points up
   because it mirrors the finger rather than the page, and the word sits beside
   it rather than under it. */
.home-open-cue {
  position: fixed;
  left: 50%;
  top: 50%;
  /* above the cell layer, unlike the copy: the cue is an instruction and the
     cell's crown reaches this part of the frame */
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.7rem, 1.4vw, 1.15rem);
  margin: 0;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity;
}

.home-open-cue.is-hidden {
  visibility: hidden;
}

.home-open-cue:hover {
  transform: translate(-50%, -50%) translateY(-3px);
}

.home-open-cue:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 4px;
  border-radius: 12px;
}

.home-open-cue__arrow {
  display: block;
  width: clamp(2.6rem, 4.4vw, 4rem);
  height: clamp(2.6rem, 4.4vw, 4rem);
  animation: open-cue-rise 2.4s ease-in-out infinite;
}

.home-open-cue__arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.home-open-cue__label {
  font-size: clamp(1.15rem, 1.7vw, 1.6rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

/* The arrow drifts up into the direction it is asking for, then settles. */
@keyframes open-cue-rise {
  0%, 100% { transform: translateY(3px); opacity: 0.72; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-open-cue__arrow { animation: none; opacity: 1; }
  .home-open-cue { transition: none; }
}

/* The shared cell layer. Its CSS box stays at the planet size; the JS scales
   it down with a transform (no per-frame reflow) and moves its centre (top
   = the element's centre, then translate -50%/-50% + scale). */
.cell-stage {
  position: fixed;
  left: 50%;
  top: 0;
  z-index: 1;
  width: min(140vmin, 100vw);
  height: min(140vmin, 100vw);
  transform: translate(-50%, -50%);
  display: none;
  /* avoids intercepting scroll/clicks while it sits above the sections */
  pointer-events: none;
  will-change: transform;
}

.cell-stage__img {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-user-select: none;
  user-select: none;
}

/* The whole-cell float is driven from the JS rather than a CSS animation: the
   division canvas has to ride the exact same curve, or the two would ghost
   against each other while the stage hands the cell over. */
.cell-stage.is-full .cell-stage__img {
  will-change: transform;
}

/* Scroll indicator — bouncing mouse + dot */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  will-change: opacity;
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-indicator:hover {
  transform: translateX(-50%) translateY(-3px);
}

.scroll-indicator:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 4px;
  border-radius: 12px;
}

.scroll-mouse {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid var(--mosaic-muted);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Breathing — the circle gently shrinks and grows (pulse) */
.scroll-mouse {
  animation: scroll-breathe 2.4s ease-in-out infinite;
}

/* The home hero's cue is an arrow rather than the mouse outline the sub-page
   heroes use: the button is the one way off the opening screen, so it points
   the way out instead of describing a wheel. It travels down its own height
   and back, which reads as the direction without a dot inside it. */
.scroll-arrow {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--mosaic-muted);
  animation: scroll-arrow-drop 2.4s ease-in-out infinite;
}

.scroll-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes scroll-arrow-drop {

  0%,
  100% {
    transform: translateY(-3px);
    opacity: 0.72;
  }

  50% {
    transform: translateY(3px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-arrow {
    animation: none;
    opacity: 1;
  }
}

@keyframes scroll-breathe {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.82);
    opacity: 0.7;
  }
}

.scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mosaic-orange);
  animation: scroll-dot-move 1.5s ease-in-out infinite;
}

@keyframes scroll-dot-move {
  0% {
    transform: translateY(-6px);
    opacity: 1;
  }

  70% {
    transform: translateY(6px);
    opacity: 0;
  }

  100% {
    transform: translateY(-6px);
    opacity: 0;
  }
}

.scroll-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  /* offset trailing letter-spacing */
  color: var(--mosaic-muted);
  text-transform: uppercase;
}

/* Screen 4 — the 1 → 2 → 4 division. This section is only the scroll runway:
   one run through the clip, a fixed hold on the final frame, then one visible
   band of 1:1 travel so the opaque canvas can clear before the statement that
   follows it. */
.home-division {
  position: relative;
  /* All of this stretch is the scrub, so its length is the division's pace:
     the frames are read straight off the page position, and how long the cell
     takes to cleave is how much runway it is given. The band JS reserves for
     the hold on the last still and one screen for the canvas to clear the
     viewport come out of it, and what is left is the run. */
  height: calc(100svh - 56px + var(--div-run, 295svh));
  background: var(--mosaic-bg);
}

/* The frames themselves sit on a fixed layer of their own, like .cell-stage —
   the stage hands the cell over to it in place, so the sequence never appears
   to slide up from the bottom edge. The JS centres it and sets both the width
   and the opacity; the frame is 16:9 so height follows. */
.home-division__canvas {
  position: fixed;
  left: 50%;
  top: 0;
  /* under .cell-stage (z-index 1) on purpose: the stage dissolves out on top of
     this layer, so the two images never blend into a dip in brightness */
  z-index: 0;
  display: none;
  width: 100vw;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform, opacity;
}

/* The card rows. Each is one screen tall and is browsed sideways: the pin is
   its own horizontal scroller, so the trackpad, a shift-wheel, a touch drag,
   the keyboard and the scrollbar all move it without any of them having to be
   hand-rolled. Vertical scrolling goes straight past the row the way it does
   for every other screen in the stack. */
.home-hscroll {
  position: relative;
  height: calc(100svh - 56px);
  background: var(--mosaic-bg);
}

/* ---- the sentence that opens the application row ----
   Three parts, the way the statement acts are built: a lead-in at reading size,
   the phrase that carries the meaning at display size, then the rest of it.
   Against the left edge here, stacked over the row, rather than centred on a
   held screen of its own — the cards are what the sentence is about. */
.home-hscroll--library {
  display: flex;
  flex-direction: column;
  /* Where there is no room to share the frame the row keeps its own full height
     and the section grows to hold both, so nothing is clipped. */
  height: auto;
  min-height: calc(100svh - 56px);
}

.home-library {
  flex: 0 0 auto;
  /* The three parts are one thought and are read as one, so they sit close
     together; the room in this frame belongs to the cards. The top clearance
     never goes under the fixed navbar's 56px, or the lead line sits behind it
     when the reader scrolls back up to this screen. */
  padding: clamp(3.5rem, 7vh, 4.5rem) max(4vw, 1.6rem) clamp(0.8rem, 2.2vh, 1.6rem);
}

.home-library__lead {
  margin: 0 0 clamp(0.5rem, 1.2vh, 0.9rem);
  font-size: clamp(0.95rem, 1.6vw, 1.4rem);
  line-height: 1.45;
  color: var(--mosaic-text);
  max-width: 62rem;
}

/* Sized to hold the whole phrase on one line at a desktop width — the mark
   below belongs at the end of it, and a wrapped headline leaves the mark
   stranded at the right edge instead. */
.home-library__headline {
  margin: 0 0 clamp(0.5rem, 1.2vh, 0.9rem);
  /* One sentence with one emphasis, not a headline over body copy: keep the
     gradient phrase a step above the lead rather than a jump. */
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* The same five-colour gradient the statement acts give their accent phrases —
   this is the phrase that carries the sentence, and it is the last thing on the
   page still announcing the platform rather than using it. Painted through the
   text rather than set in one colour, so it stays coherent wherever the phrase
   wraps. */
.home-library__accent {
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* The square that closes the headline — the page's colour, at the size a full
   stop would be if the sentence had one. Inline, so it follows the phrase
   rather than the line box. */
.home-library__mark {
  display: inline-block;
  width: clamp(0.5rem, 0.95vw, 0.8rem);
  height: clamp(0.5rem, 0.95vw, 0.8rem);
  margin-left: clamp(0.7rem, 1.6vw, 1.3rem);
  background: var(--mosaic-pink);
  vertical-align: middle;
}

.home-library__body {
  margin: 0;
  font-size: clamp(1.05rem, 1.55vw, 1.4rem);
  line-height: 1.55;
  color: var(--mosaic-text);
  max-width: 74rem;
}

/* The name in the sentence, set the way it is set on the statement screen —
   and with the plain M, since the chop cut for the big wordmark takes the
   letter's foot off at reading size. */
.home-library__body .mosaic-wordmark {
  font-weight: 600;
  white-space: nowrap;
}

.home-library__body .mosaic-m {
  clip-path: none;
  margin-left: 0;
}

/* On a phone the lead-in and the headline already say this screen's one thing
   in the width available; the paragraph under them is the same statement a
   second time, and the room it takes is the cards' room. */
@media (max-width: 600px) {
  .home-library__body {
    display: none;
  }
}

/* The row keeps its own full height below this, because a frame that has to
   hold both cannot give either of them less than they need. */
.home-hscroll--library .home-hscroll__pin {
  flex: 0 0 auto;
  height: auto;
  padding: clamp(0.9rem, 2.4vh, 1.6rem) 0 clamp(3rem, 8vh, 4.5rem);
}

/* Enough room for both: the sentence takes what it needs, the row takes the
   rest, and the cards are sized by the row instead of by a share of the
   viewport. A card's cover is shrinkable and its title is not, so a shorter
   card costs the drawing height and keeps the words. */
@media (min-width: 993px) and (min-height: 640px) {
  /* One screen if the cards fit in one, taller than one if they do not: the
     card keeps the height the row gives it, and the section grows to hold the
     whole card rather than squeezing it. Squeezing was costing the drawings
     their width — a shorter card is a shorter cover, and the picture inside it
     is then sized by that. */
  .home-hscroll--library {
    min-height: calc(100svh - 56px);
  }

  .home-hscroll--library .home-hscroll__pin {
    flex: 0 0 auto;
    height: auto;
    /* Room for the foot of the screen: the progress squares and the row's two
       arrows both sit inside it. The card's bottom edge lands on this padding,
       so it has to clear the taller of the two — the arrows, which stand 52px
       off the section's bottom — or they are drawn over the card. */
    padding-top: clamp(0.4rem, 1.4vh, 0.9rem);
    padding-bottom: clamp(4.2rem, 9vh, 5.4rem);
  }

  .home-hscroll--library .hcard {
    height: min(57.6vh, 558px);
  }
}

.home-hscroll__pin {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  /* Dragging the row must not select the copy or start a native image drag —
     the figures are draggable by default, and that hands the gesture to the
     browser, which ends the drag after the first few pixels. */
  user-select: none;
  -webkit-user-select: none;
  /* the only horizontal scroller on the page: a swipe at either end of the row
     must not turn into a browser back-navigation */
  overscroll-behavior-x: contain;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-hscroll__pin::-webkit-scrollbar {
  display: none;
}

.home-hscroll.is-dragging .home-hscroll__pin {
  cursor: grabbing;
}

/* The row is a scroll region, so it is focusable: the arrow keys then scroll
   it, and a card that is off screen scrolls itself into view when tabbed to. */
.home-hscroll__pin:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: -6px;
  border-radius: 10px;
}

/* max-content so the trailing padding lands after the last card rather than
   being absorbed into a track that is only as wide as the viewport. */
.home-hscroll img {
  -webkit-user-drag: none;
}

.home-hscroll__track {
  flex: 0 0 auto;
  width: max-content;
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3vw, 3rem);
  padding-left: max(4vw, 1.6rem);
  /* --row-last-w is the last card's width; the row script writes it so the
     row's end position centres that card. Without it the fallback is 100%,
     which leaves the ordinary 4vw. */
  padding-right: max(4vw, calc((100% - var(--row-last-w, 100%)) / 2));
}

.hcard {
  position: relative;
  flex: 0 0 auto;
  width: min(84vw, 620px);
  height: min(57.6vh, 504px);
  border: 1px solid var(--mosaic-border);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.9);
  /* No overflow here: clipping would force transform-style back to flat and
     the turn-over would stop working. Each face does its own clipping. */
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  transition: transform 0.2s ease-out, border-color 0.25s ease;
}

/* A card is a thing you press, and until the pointer is on it there is nothing
   on the panel that says so — the cover is a drawing, not a control. The edge
   answering the pointer is the cheapest way to say it, and it reads without
   adding anything to the artwork. Not on the lifted copy: that one is already
   open, and there is nothing left for it to invite. */
.hcard:not(.hcard-lift):hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.hcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: inherit;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.hcard__face--back {
  transform: rotateY(180deg);
}

/* Opened: the figure on the left, the copy on the right. */
.hcard__back {
  flex: 1;
  min-width: 0;
  display: flex;
  background: linear-gradient(158deg, #17171a 0%, #0a0a0a 100%);
  /* The panel itself does not scroll: the figure is what the card is opened
     for, and it holds its place while the copy beside (or, on a phone, under)
     it does the moving. */
  overflow: hidden;
}

.hcard__back-figure {
  flex: 0 0 46%;
  min-width: 0;
  position: relative;
  margin: 0;
  background: var(--card-bg, #131313);
}

.hcard__back-figure img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 94%;
  height: 94%;
  object-fit: contain;
}

/* A figure that is a run of frames. The arrows sit on the drawing rather than
   beside it, so the column spends everything it has on the sheet: the drawing
   is a dense infographic and it was the only thing in the panel worth the
   room. The column is wider than the single-figure one for the same reason. */
.hcard__back-figure--seq {
  flex: 0 0 58%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
}

/* A layer over the drawing holding the two arrows at its edges. Only the
   buttons take the pointer — the rest of the layer must stay out of the way,
   or a press meant for the panel would land on nothing. */
.hcard__seq-nav {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem;
  pointer-events: none;
}

/* Gives the image a containing block of its own — the fit rules above are
   written against the figure, so the frame has to take that role over here —
   and the sheet's own ratio, so the drawing fills the column edge to edge
   instead of sitting in a box with dead space around it. */
.hcard__frame {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  aspect-ratio: 3508 / 2481;
  min-width: 0;
  min-height: 0;
  /* The frames travel sideways through here, so the box has to be what cuts
     them off. Nothing is clipped at rest: the drawing is 94% of the box and
     the box carries the sheet's own ratio. */
  overflow: hidden;
}

/* Stepping through a run. The two drawings are neighbours in a sequence, so
   the next one comes in from the side rather than appearing in place — and the
   outgoing one leaves by the side it came from, which is what makes the run
   read as a strip being moved rather than as a single picture being swapped.
   The travel is a touch over the drawing's own width, because the drawing is
   inset in the box and `translate` is measured against the drawing. */
.hcard__frame img {
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.hcard__frame img.is-from-next { transform: translate(-50%, -50%) translateX(107%); }
.hcard__frame img.is-from-prev { transform: translate(-50%, -50%) translateX(-107%); }
.hcard__frame img.is-to-prev { transform: translate(-50%, -50%) translateX(-107%); }
.hcard__frame img.is-to-next { transform: translate(-50%, -50%) translateX(107%); }

/* They sit on the drawing, which is dark and often busy underneath, so they
   carry their own glass and a drop shadow rather than relying on the panel
   behind them. */
.hcard__nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2rem, 2.6vw, 2.35rem);
  height: clamp(2rem, 2.6vw, 2.35rem);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.95);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hcard__nav svg {
  width: 52%;
  height: 52%;
}

/* Hovering an arrow says which way the run will move, so it is answered with
   the arrow itself: it picks up the row's colour and its stroke thickens. The
   stroke is set on the path as an attribute, which CSS outranks, so it can be
   changed from here without a second copy of the mark. */
.hcard__nav:hover {
  background: rgba(28, 28, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--mosaic-lime);
}

.hcard__nav:hover svg path {
  stroke-width: 2.5;
}

/* Page number under the opened card's figure: which drawing of the run is
   on show. White so it reads over the drawing, like the arrows. */
.hcard__frame-count {
  position: absolute;
  left: 50%;
  /* Kept well inside the figure: at 0.7rem the desktop card's number sat
     on the very bottom edge of the picture. */
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 6;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* The way out of the opened panel. It lives in the panel's own corner rather
   than on the dim behind it, so putting the card away is a press on the thing
   being put away — and a press that lands anywhere else is the reader reading,
   not a request to close. */
.hcard__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2rem, 2.6vw, 2.35rem);
  height: clamp(2rem, 2.6vw, 2.35rem);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.95);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hcard__close svg {
  width: 52%;
  height: 52%;
}

.hcard__close:hover {
  background: rgba(28, 28, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--mosaic-lime);
}

.hcard__close:hover svg path {
  stroke-width: 2.5;
}

.hcard__nav:focus-visible,
.hcard__preview:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 2px;
}

/* Full-size preview on the opened application cards. The button sits in the
   figure's corner and opens the same drawing over the page; it is part of the
   opened panel, not a way out of it. */
.hcard__preview {
  position: absolute;
  top: 0.7rem;
  /* Left corner: the close button owns the panel's top right, and the two
     were sitting on top of each other. */
  left: 0.7rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.1rem, 3vw, 2.6rem);
  height: clamp(2.1rem, 3vw, 2.6rem);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.95);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hcard__preview svg {
  width: 52%;
  height: 52%;
}

.hcard__preview:hover {
  background: rgba(28, 28, 32, 0.9);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--mosaic-blue);
}

.home-preview {
  position: fixed;
  inset: 0;
  /* Above the fixed Menu button (100001): on a phone the two share the top
     right corner, and the button was covering the preview's close. */
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3.5rem);
  background: rgba(0, 0, 0, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.home-preview[hidden] {
  display: none;
}

.home-preview__figure {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
}

.home-preview__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - clamp(2rem, 8vw, 7rem));
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

.home-preview__close {
  position: absolute;
  top: clamp(0.8rem, 2.4vw, 1.6rem);
  right: clamp(0.8rem, 2.4vw, 1.6rem);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.72);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.home-preview__close svg {
  width: 50%;
  height: 50%;
}

.home-preview__close:hover {
  background: rgba(28, 28, 32, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
}

.hcard__back-text {
  flex: 1;
  min-width: 0;
  padding: clamp(1.4rem, 3.2vw, 2.8rem);
  display: flex;
  flex-direction: column;
  /* `safe` so that once the copy is taller than the box it starts at the top
     and scrolls, instead of being centred with its first line above an edge
     that cannot be scrolled to. */
  justify-content: center;
  justify-content: safe center;
  gap: 0.7rem;
  /* The opened card is a frame of a fixed height, and the copy does not always
     fit one — a short phone loses the last of it. This is the panel's scroller,
     so the overflow is reachable while the figure stays where it is. */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* The panel is click-to-close, but this part of it is prose, and prose is
     meant to be selectable: an I-beam here says which of the two it is. */
  cursor: auto;
}

.hcard__back-num {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hcard__back-org {
  margin: 0;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  font-weight: 700;
  color: #fff;
}

.hcard__back-body {
  margin: 0;
  color: var(--mosaic-muted);
  font-size: clamp(0.88rem, 1.3vw, 1rem);
  line-height: 1.6;
}

/* The note a drawn figure carries: it is a concept, not a measurement. It rides
   both faces, because the drawing is on both — a reader who never turns the
   card over still meets the picture, and the picture is the thing that needs
   the note. Set a step down and held back, so it is read as a qualification of
   the drawing rather than as another line of the copy. */
.hcard__note {
  margin: 0;
  color: var(--mosaic-muted);
  font-size: clamp(0.68rem, 0.95vw, 0.78rem);
  line-height: 1.45;
  opacity: 0.72;
}

.hcard__face--front .hcard__note {
  flex: 0 0 auto;
  text-align: center;
  padding: 0 clamp(1.1rem, 3vw, 2rem) clamp(0.8rem, 2vh, 1.2rem);
}

.hcard__back-punch {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--mosaic-text);
}

/* The applications cards list what each scenario is for. The bullet carries the
   card's own accent, so a scenario keeps the colour it has in the row's
   progress squares. */
.hcard__back-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hcard__back-list li {
  position: relative;
  padding-left: 1.05rem;
  color: var(--mosaic-muted);
  font-size: clamp(0.82rem, 1.2vw, 0.95rem);
  line-height: 1.45;
}

.hcard__back-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--card-accent, var(--mosaic-purple));
}

/* ============================================================
   COMPONENT 19: HOME ENDING (the mosaic opens onto the wiki)
   ============================================================ */

/* Runway between the act that closes the cell story and the first row of
   cards. The cards are the page's first sideways thing and they arrive
   immediately after a screen of statement, so without this the reader meets
   them still moving and the row is under them before they have decided to look
   at it. This is the only row that needs it: the second one follows the
   applications act, which is itself a held screen. */
#home-hscroll {
  margin-top: 300px;
}

/* Room under the application row before the mechanism act. The rows are sized
   a screen minus the navbar, so the moment a row's top goes above the top of
   the window its foot is already inside the window — and the act that follows
   draws its headline at the very top of its own screen, so the reader gets the
   mechanism talking in the strip under the cards while they are still browsing
   them. The distance holds it out of frame until the row is done. It is space
   after the screen rather than inside it, so the row's own composition is
   untouched, and the row's progress squares stay where they are. */
#home-hscroll-apps {
  margin-bottom: 300px;
}

.home-ending {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Runway between the last card row and the mark. The ending is the last
     thing on the page, and a fling out of the cards arrives at it still
     travelling — there is nothing below to stop it, so the mark is on screen
     and gone in the same movement and the reader never reads it. The space is
     somewhere for that movement to be spent: the screen arrives with the
     scroll already used up rather than mid-throw. */
  margin-top: 300px;
  min-height: calc(100svh - 56px);
  padding: clamp(2.5rem, 7vh, 5rem) 1.5rem;
  background: var(--mosaic-bg);
  text-align: center;
}

.home-ending__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.6vh, 1.8rem);
  width: 100%;
  max-width: 74rem;
}

/* One box for the whole drawing. The tiles, the corner squares and the wires
   are all given in the same 1160 x 520 space, so an entry can be placed as a
   share of it and the text travels with the lines at every width. */
.home-ending__figure {
  position: relative;
  width: 100%;
  max-width: 72.5rem;
  aspect-ratio: 1160 / 520;
  container-type: inline-size;
}

.he-fig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Only the wide one is drawn here; the narrow layout swaps in the tight mark. */
.he-fig--tight { display: none; }

/* --- the tiles arrive one after another --- */
.he-tile,
.he-mark {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.home-ending.is-inview .he-tile {
  animation: he-pop 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 42ms);
}

/* --- each corner square steps out of the grid. It starts before the last of
       the tiles has landed: the two run into each other on purpose, so the
       drawing reads as one motion rather than as two waits. Only the wide
       figure carries them; the narrow one draws the mark alone. --- */
.home-ending.is-inview .he-mark {
  animation: he-pop 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  animation-delay: calc(1150ms + var(--i) * 80ms);
}

/* --- and each one pulls a wire out of its corner: the diagonal first, then
       the flat run, drawn by walking the dash offset down to nothing. White,
       because on this background a muted stroke is not a line anyone can see,
       and the draw-on is the whole point of it. Overlaps the squares the same
       way they overlap the tiles. --- */
.he-wire {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}

.home-ending.is-inview .he-wire {
  animation: he-draw 0.6s cubic-bezier(0.35, 0, 0.25, 1) forwards;
  animation-delay: calc(1400ms + var(--i) * 120ms);
}

@keyframes he-pop {
  from { opacity: 0; transform: scale(0.35); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes he-draw {
  to { stroke-dashoffset: 0; }
}

/* --- the entries sit on the flat runs --- */
.home-ending__link {
  position: absolute;
  left: var(--at);
  top: var(--run);
  /* the label rides above its own line */
  transform: translateY(calc(-100% - 0.55rem));
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--mosaic-muted);
  /* Sized off the figure box rather than the viewport, so the label keeps its
     proportion to the run it sits on however wide the drawing is drawn. */
  font-size: clamp(1rem, 1.85cqw, 1.35rem);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.45s ease, color 0.2s ease;
}

/* The icon and its label travel together: the narrow layout puts the arrow at
   the far end of the row, so they have to be one box to stay paired. */
.home-ending__lead {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.home-ending__icon {
  flex: 0 0 auto;
  /* Sized up: at the label's own size the glyph is about 18px and its hairline
     stroke thins out with it, so the entry reads as a line of text with a speck
     in front of it rather than as somewhere to go. */
  width: 1.3em;
  height: 1.3em;
  /* stroke is currentColor, so it follows the rule in the block below */
}

/* Each entry's glyph takes the colour of the corner of the mark it sits on. The
   squares the wires run out to are drawn in the site's five colours already, so
   the icon belongs to the drawing instead of being a bullet in front of a
   label. It is also the only colour on the row — the label stays muted until
   hover — which is what makes the eye land on the entry first. */
.home-ending__link[data-branch="tl"] .home-ending__icon { color: var(--mosaic-orange); }
.home-ending__link[data-branch="tr"] .home-ending__icon { color: var(--mosaic-blue); }
.home-ending__link[data-branch="br"] .home-ending__icon { color: var(--mosaic-purple); }
.home-ending__link[data-branch="bl"] .home-ending__icon { color: var(--mosaic-lime); }

.home-ending__link[data-side="right"] {
  transform: translate(-100%, calc(-100% - 0.55rem));
}

.home-ending.is-inview .home-ending__link {
  opacity: 1;
  /* Per property, not one value: a bare delay would land on the colour too,
     and the entry would sit there grey for two and a half seconds after the
     pointer was already on it. Only the arrival is staggered. */
  transition-delay: calc(2350ms + var(--i) * 100ms), 0s;
}

.home-ending__link:hover,
.home-ending__link:focus-visible {
  color: #fff;
}

.home-ending__arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.home-ending__link:hover .home-ending__arrow,
.home-ending__link:focus-visible .home-ending__arrow {
  transform: translateX(4px);
}

/* One sentence per line, and each one kept whole — the second is the line the
   screen is built around, so it is not left to break wherever the box ends.
   The nowrap is desktop-only: a phone is narrower than that sentence, and
   forcing it there would push the page sideways. */
.home-ending__tagline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  font-size: clamp(1.15rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--mosaic-text);
  opacity: 0;
}

/* The closing lines arrive after the drawing rather than with it. They are
   what the drawing is for — a figure assembling with its own caption already
   sitting under it reads as two things that happened to be on screen together
   — and they are the page's last word, so they are the last thing to land.
   The drawing is finished at 2.36s: 1.4s before the wires start, four turns
   of 120ms, and the 600ms each takes to draw. This opens just past that, and
   after the entries, which begin at 2.35s and are still settling. */
.home-ending.is-inview .home-ending__tagline {
  animation: he-text 0.7s ease forwards;
  animation-delay: 2500ms;
}

@keyframes he-text {
  to { opacity: 1; }
}

@media (min-width: 769px) {
  .home-ending__tagline span { white-space: nowrap; }
}

/* Narrow: the four branches cannot fit around the mark, so the wires go and
   the entries stack under it as an ordinary list. */
@media (max-width: 768px) {
  /* The row above is a whole screen of cards and this is the page's last
     screen: with nothing between them a flick at the end of the row carries
     straight past the closing mark. This is the run-up. */
  .home-ending {
    padding-top: clamp(4.5rem, 18svh, 11rem);
  }

  .home-ending__figure {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* No gap between the entries: each row already carries its own divider and
       its own padding, and a gap on top of that padding puts the copy hard
       against the line above it with a hole under it — the rows read as
       belonging to the line they hang from. Adjacent rows share a border
       instead, so the copy sits the same distance from the line either side.
       The logo keeps its own distance with a margin. */
    gap: 0;
  }

  .he-fig--wide { display: none; }

  .he-fig--tight {
    display: block;          /* the base rule hides it; the swap happens here */
    position: static;
    width: min(58vw, 13rem);
    height: auto;
    margin-bottom: 1.5rem;   /* what the figure's gap used to give the first row */
  }

  .home-ending__link {
    position: static;
    transform: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.9rem 0.2rem;
    border-top: 1px solid var(--mosaic-border);
    font-size: clamp(1.05rem, 4.4vw, 1.25rem);
    transition: opacity 0.45s ease, color 0.2s ease;
  }

  .home-ending__link:last-child {
    border-bottom: 1px solid var(--mosaic-border);
  }

  .home-ending__link[data-side="right"] { transform: none; }
}

/* The colour band that closes the home page, sitting directly above the shared
   footer. It is inserted next to the footer rather than inside the page
   container, so its inset can match the footer card's own — and so it can be
   full width without reaching for 100vw, which counts the scrollbar and would
   push the page sideways. */
.home-band {
  padding: 0 1.5rem;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}

.home-band span {
  display: block;
  position: relative;
  height: 4px;
  overflow: hidden;
}

/* Two full runs of the five colours, one of which is travelled per loop, so
   the seam is always off screen and the drift never jumps. */
.home-band span::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 200%;
  background: linear-gradient(90deg,
    var(--mosaic-pink) 0%, var(--mosaic-purple) 10%, var(--mosaic-blue) 20%,
    var(--mosaic-lime) 30%, var(--mosaic-orange) 40%,
    var(--mosaic-pink) 50%, var(--mosaic-purple) 60%, var(--mosaic-blue) 70%,
    var(--mosaic-lime) 80%, var(--mosaic-orange) 90%,
    var(--mosaic-pink) 100%);
  animation: home-band-slide 9s linear infinite;
}

@keyframes home-band-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .home-band span::before { animation: none; }

  /* The entrance animations hang off `.home-ending.is-inview …`, so switching
     them off here needs the same weight — a bare `.he-tile` loses on
     specificity and the drawing animates anyway. */
  .home-ending.is-inview .he-tile,
  .home-ending.is-inview .he-mark {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .home-ending.is-inview .he-wire {
    animation: none;
    stroke-dashoffset: 0;
  }

  .home-ending.is-inview .home-ending__tagline {
    animation: none;
    opacity: 1;
  }

  .home-ending__link {
    opacity: 1;
    transition: none;
  }
}

/* Opened card: the page behind is pushed out of focus while the panel itself
   stays sharp. The scrim carries the blur; the lifted card sits above it. The
   card is cloned onto this fixed stage rather than turned over in place — the
   row lives in the sliding track's stacking context and would be trapped
   behind the scrim. */
.hcard-scrim {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  /* inert while no card is open: an invisible full-screen layer that still
     hit-tests would swallow every click and hover on the cards underneath */
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.hcard-scrim.is-on {
  opacity: 1;
  pointer-events: auto;
}

.hcard-stage {
  position: fixed;
  inset: 0;
  z-index: 1401;
  pointer-events: none;
  perspective: 1800px;
}

.hcard.hcard-lift {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  /* Opened, the panel is broader and shallower than the card in the row. The
     figure is the reason to open one, and a wide, short frame is what gives it
     room; the row's own cards keep the size they were laid out at. The panel
     is created at the row's size and these are what it grows into. */
  width: min(92vw, 1060px);
  height: min(50vh, 430px);
  /* Opened, the panel gives up its frame. It is the drawing and the copy that
     should read, not the box holding them — a border and a deep shadow were
     putting a card around content that does not need one. */
  border-color: transparent;
  box-shadow: 0 30px 80px -55px rgba(0, 0, 0, 0.85);
  transform-origin: center center;
  /* the shift is written into the transform rather than left/top so the turn
     and the move to centre ride the compositor together */
  transform: translate3d(0, 0, 0) rotateY(0deg);
  /* ease-in-out so the turn reads as a turn: a front-loaded curve snaps the
     panel past 90° in the first third and the rest is a slow settle. The size
     rides the same curve: at the halfway mark the panel is edge-on, so the
     change of shape lands where nobody is looking at a face. */
  transition: transform 0.95s cubic-bezier(0.65, 0, 0.35, 1),
              width 0.95s cubic-bezier(0.65, 0, 0.35, 1),
              height 0.95s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
}

.hcard.hcard-lift.is-open {
  transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) rotateY(-180deg);
}

@media (prefers-reduced-motion: reduce) {
  .hcard.hcard-lift,
  .hcard-scrim {
    transition-duration: 0.01s;
  }
}

/* cursor-following spotlight on the card face */
.hcard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  /* the card no longer clips (see .hcard), so this rounds its own corners */
  border-radius: inherit;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%),
      rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 30%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hcard:hover::after {
  opacity: 1;
}

/* no spotlight on the lifted card: coplanar with both faces, it would only
   fight them for paint order */
.hcard.hcard-lift::after {
  display: none;
}

/* Cover = the figure and its title, nothing else. The figures are dense
   infographics, so they are fitted whole (contain), never cropped. Each card
   paints its plate in its own figure's background colour (--card-bg, sampled
   from the image corners) so the fit's letterboxing doesn't read as a
   lighter rectangle around the drawing. */
/* Cover over title, both full width, the pair centred. The face still defaults
   to a row from when it held a side-by-side media and body; a row lets the
   title take whatever width it wants and leaves the figure a thumbnail. The
   whole face wears the figure's own background colour so the plate and the
   card don't show as two slightly different darks. */
.hcard__face--front {
  flex-direction: column;
  justify-content: center;
  background: var(--card-bg, #131313);
}

/* Sized by the figures' own 3:2 rather than by what's left over: on a portrait
   card a full-height cover strands a landscape figure in the middle of a tall
   empty panel. Shrinkable, so a short card still wins the argument. */
.hcard__cover {
  /* Grows as well as shrinks: whatever height the card has beyond the title
     belongs to the drawing. Held at `0 1 auto` the box stopped growing at its
     3:2 and the rest of the card stood empty — a taller card then bought
     nothing. The ratio below is only the size it asks for when there is a
     choice. */
  flex: 1 1 auto;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 0;
  position: relative;
  margin: 0;
  background: var(--card-bg, #131313);
}

/* Out of flow on purpose. A percentage height never resolves against a flex
   item, so an in-flow image falls back to its intrinsic ratio and drags the
   panel taller than its flex-basis — which on a stacked card pushes the title
   out of the box. Pinned to the panel's middle instead, it just fits. */
.hcard__cover img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96%;
  height: 96%;
  object-fit: contain;
}

/* Scaffold cards — the ones whose figure does not exist yet. A ruled frame in
   the figure's place, so the row reads as unfinished rather than as a drawing
   that failed to load. */
.hcard__cover--empty {
  align-self: stretch;
  width: auto;
  margin: clamp(0.9rem, 2vw, 1.4rem) clamp(0.9rem, 2vw, 1.4rem) 0;
}

.hcard__cover--empty,
.hcard__back-figure--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--mosaic-border);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.015);
}

.hcard__ph {
  font-size: clamp(0.7rem, 1.05vw, 0.84rem);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
  text-align: center;
  padding: 0 0.8rem;
}

.hcard__title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.7rem clamp(1.1rem, 3vw, 2rem) clamp(0.9rem, 2.4vw, 1.5rem);
  font-size: clamp(1.05rem, 1.85vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-align: center;
  background: var(--card-bg, #131313);
}

/* Opened below this width, the panel stacks — figure on top, copy under it.
   An image beside its copy needs close to 900px before either is worth looking
   at, and under that the figure loses the argument badly: at a 601px viewport
   it was rendering 179px wide, the smallest drawing on the site. The panel is
   capped as well as stacked, or on a tablet the copy would run to a line
   length nobody wants to read.

   Not when the viewport is short as well as narrow: a landscape phone has
   width to spare and no height at all, so it keeps the side-by-side layout and
   spends the room it has on the figure (see the short-viewport block below).
   The second condition is for windows too small to qualify either way. */
@media (max-width: 992px) and (min-height: 521px), (max-width: 600px) {
  .hcard.hcard-lift {
    width: min(92vw, 620px);
    height: min(66svh, 520px);
  }

  .hcard__back {
    flex-direction: column;
  }

  .hcard__back-figure {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 2;
    /* without this a wide, short panel hands the figure the whole height and
       leaves the copy nothing */
    max-height: 55%;
    min-height: 0;
  }

  /* The sequence figure measures itself off the drawing's own ratio rather
     than the 3:2 the scaffold figures use, so the copy takes what is left
     instead of the drawing letterboxing inside a box it does not fill. The cap
     only stops it eating the copy whole on a wide panel. */
  .hcard__back-figure.hcard__back-figure--seq {
    aspect-ratio: auto;
    max-height: 62%;
  }

  .hcard__back-text {
    flex: 1;
  }
}

/* Landscape phones: the card is short, so the opened copy has to shrink to stay
   inside it rather than spill past the frame. */
@media (max-height: 520px) {
  /* There is width here and no height, so the opened panel stays side by side
     and takes its room from the width — as tall as the viewport allows without
     running under the navbar, and broader than the stacked panel is allowed to
     get. */
  .hcard.hcard-lift {
    width: min(94vw, 1060px);
    height: min(72svh, 500px);
  }

  .hcard__back-text {
    padding: 0.9rem 1.1rem;
    gap: 0.4rem;
  }

  .hcard__back-num {
    font-size: 1.4rem;
  }

  .hcard__back-org {
    font-size: 1.05rem;
  }

  .hcard__back-body {
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .hcard__back-punch {
    font-size: 0.85rem;
  }

  .hcard__title {
    font-size: 0.95rem;
    padding: 0.5rem 1rem 0.6rem;
  }
}

@media (max-width: 600px) {
  .hcard {
    width: 86vw;
    /* Sized off the card's own width, not the screen's height: 66svh left the
       cover box a good deal taller than any drawing in it, so the picture sat
       in a band of black. The height here is the cover's 1.4 plus the title's
       own height, which puts the cover at the drawings' ratio on any phone.
       The svh cap stays for short screens, and svh rather than vh because the
       row is pinned inside a 100svh frame. */
    height: min(calc(62vw + 4.4rem), 62svh);
  }

  .hcard__title {
    padding: 0.6rem 1.1rem 0.9rem;
    font-size: 1.05rem;
  }

  /* the opened side stacks too: figure on top, copy under it */
  .hcard__back {
    flex-direction: column;
  }

  .hcard__back-figure {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 2;
    /* the figure is fitted with 3% margin either side, so the box has to be
       tall enough to hold it once the width is fixed */
    min-height: 0;
  }

  .hcard__back-text {
    flex: 1;
    padding: 1rem 1.2rem 1.2rem;
    gap: 0.5rem;
    justify-content: center;
  }

  /* The arrows sit on the drawing, and on a phone the panel is only as wide as
     the screen, so they come down rather than up: at 44px they were the two
     largest things on the opened card. Capped in px as well, so the largest
     font tier cannot run the rem back up. */
  .hcard__nav {
    width: min(2.05rem, 33px);
    height: min(2.05rem, 33px);
  }

  .hcard__back-num {
    font-size: 1.5rem;
  }

  .hcard__back-org {
    font-size: 1.1rem;
  }

  .hcard__back-body {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .hcard__back-punch {
    font-size: 0.9rem;
  }

}

/* ---- The long-term vision: one screen, two acts ----
   No runway: both acts run on a clock rather than on the scroll, so there is no
   distance to scrub through and no page travel between them. The page is held
   from the moment the screen is reached until the second act is over, and the
   reader's push in between starts that act rather than moving them on — see the
   LT_* block in the page script. */
.home-longterm {
  position: relative;
  /* A full viewport, not the usual viewport-minus-navbar: the pin inside is a
     full viewport, and a sticky box taller than its container never sticks — it
     would sit permanently 56px low with its foot off the bottom of the screen.
     The two have to be the same height for the hold to land square. */
  height: 100svh;
  background: var(--mosaic-bg);
}

.home-longterm__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  box-sizing: border-box;
  overflow: hidden;
}

/* The heading, in the corner, set at the scale of the bench screen's kicker.
   The line is seventy-four characters, so it is allowed to wrap — and the
   break is balanced, because a ragged second line under a centred line reads
   as leftover rather than as a phrase. */
.home-longterm__intro {
  position: absolute;
  top: clamp(4.5rem, 9vh, 6.5rem);
  left: clamp(1.25rem, 4vw, 4rem);
  right: clamp(1.25rem, 4vw, 4rem);
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  color: #fff;
}

/* Both acts are staged in one band under the heading, so the second takes the
   first one's place rather than arriving somewhere else on the screen. */
.home-longterm__stage {
  position: absolute;
  left: 0;
  right: 0;
  /* High, and with most of the screen's height left under it: the band is here
     to place the two acts just under the heading, not to centre them on the
     screen. */
  top: clamp(8.5rem, 20vh, 13rem);
  bottom: clamp(0.75rem, 3vh, 2rem);
}

.home-longterm__hero,
.home-longterm__row {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  padding: 0 clamp(1rem, 2.4vw, 2.5rem);
  box-sizing: border-box;
  /* The script writes the whole transform, the -50% that centres this included,
     so nothing here may set one of its own. */
  transform: translateY(-50%);
}

.home-longterm__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 2.4rem);
}

/* The first pair is set at seven tenths of what the pair above it was: it is one
   entry in the sentence, not the sentence's headline, and at full size it read as
   the latter. */
.home-longterm__line {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: clamp(0.875rem, 2.1vw, 1.68rem);
  font-weight: 500;
  line-height: 1.25;
}

.home-longterm__fig {
  margin: 0;
  width: min(59vw, 39rem);
}

.home-longterm__fig img {
  display: block;
  width: 100%;
  height: auto;
}

/* Three columns rather than four: the first act has left the screen by the time
   these arrive, so the three of them take the width between them. */
.home-longterm__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* A tight gutter, so each third is as wide as the screen allows and the
     figures in it are as large as they can be at three across. */
  gap: clamp(0.6rem, 1.4vw, 1.6rem);
  align-items: start;
  padding: 0 clamp(0.5rem, 1vw, 1rem);
}

.lt-col {
  display: flex;
  flex-direction: column;
  /* A clear step between the phrase and its figure: they are two things, and set
     close together they read as one block. */
  gap: clamp(1.3rem, 3.6vh, 2.8rem);
  min-width: 0;
}

.lt-col__line {
  margin: 0;
  color: #fff;
  /* A step below the heading and no further: these three are read as the
     sentence's other half, so they carry the same weight, just smaller. */
  font-size: clamp(1.05rem, 1.6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
  /* Centred on its own figure, which is what the phrase belongs to — it is not
     a line of a column of text. */
  text-align: center;
  /* And two lines' worth whatever the phrase actually takes, so that a phrase
     which sets in one line and one which sets in two still put their figures on
     the same line across the screen. In `lh`, not `em`: the line-height here is
     the reader's, not the one set above — the accessibility panel re-leads every
     paragraph on the site with `!important`, so a min-height in `em` would be
     guessing at a number that is not in this rule's gift. */
  min-height: 2.7em;   /* fallback for a browser without `lh` */
  min-height: 2lh;
}

.lt-col__slot { position: relative; }

.lt-col__fig {
  display: block;
  width: 100%;
  height: auto;
}

/* Everything the clocks move starts out of sight, so the first paint does not
   show the finished screen for a frame before the script takes it apart. */
.home-longterm__intro,
.home-longterm__line,
.home-longterm__fig,
.home-longterm__row .lt-col {
  opacity: 0;
}

.home-longterm__intro,
.home-longterm__line,
.home-longterm__fig,
.home-longterm__hero,
.home-longterm__row,
.lt-col {
  will-change: opacity, transform;
}

/* The five phrases that carry the site's five colours. Colour alone does the
   work, as it does in the quote acts — nothing here is stepped up in weight. */
.lt-red    { color: var(--mosaic-pink); }
.lt-blue   { color: var(--mosaic-blue); }
.lt-lime   { color: var(--mosaic-lime); }
.lt-orange { color: var(--mosaic-orange); }
.lt-purple { color: var(--mosaic-purple); }

@media (max-width: 760px) {
  /* Side by side rather than stacked: three columns at a phone's width would put
     the figures fifty pixels across, and stacked they would not fit the screen.
     The phrase on the left of each pair, its figure on the right. */
  .home-longterm__intro {
    max-width: none;
    font-size: clamp(1.35rem, 6vw, 1.75rem);
  }

  /* "From ..." is the first half of the same sentence as the three column
     phrases, so on a phone it reads at their size rather than a step down. */
  .home-longterm__line {
    font-size: clamp(1.05rem, 1.6vw, 1.6rem);
  }

  .home-longterm__stage {
    top: clamp(11rem, 27vh, 16rem);
  }

  /* The stage starts below the intro line, so its middle sits at 62vh of the
     screen and the first act read low. Pulled back by that much, the phrase and
     its figure centre on the screen instead. A margin rather than a transform:
     the script writes the element's whole transform, -50% included. */
  .home-longterm__hero {
    margin-top: -12vh;
  }

  .home-longterm__row {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.8rem, 2.6vh, 1.4rem);
  }

  .lt-col {
    flex-direction: row;
    align-items: center;
    gap: clamp(0.7rem, 3vw, 1.2rem);
  }

  .lt-col__line { flex: 0 0 44%; }

  .lt-col__slot { flex: 1 1 auto; }
}

/* Bench sequence — the pipette turns through a revolution over the scroll.
   The pin holds one screen; the extra height is the runway the scrub reads. */
.home-pipette {
  position: relative;
  /* Three actions, a third of this runway apart, and one screen for each of the
     resting places to sit in. The entrance is read off the approach; the runway
     is what the turning is read off. */
  height: calc(100svh + var(--pp-run, 250svh));
  background: var(--mosaic-bg);
}

.home-pipette__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

/* The pipette on the left, its fork in the middle, and the three populations
   stacked on the right. The stack is centred in the frame; the text keeps its
   corners. --pp-stack-h is shared by the lines and the populations so the
   three arrows land on the three populations' centre lines. */
.home-pipette__bench {
  --pp-stack-h: clamp(320px, 48svh, 460px);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.2vw, 1.25rem);
  pointer-events: none;
}

/* The pipette stands upright on the left. Its tip sits below the middle of
   the stack, so the trunk leaves it downward before it turns right — see
   measurePipetteLines() in the page script. */
.pp-bench__figure {
  position: relative;
  /* A step further left than the row's own centre: the pipette is the object,
     not a column in a grid, and the fork needs room to leave it. */
  left: -3vw;
  height: min(46svh, 28vw, 400px);
  aspect-ratio: 288 / 576;
}

/* Two canvases hold the same figure: the live render, and the pre-rendered run
   kept as its fallback. They take the same box, and only one of them carries a
   picture — the live one is off until it has something to show, and takes over
   by adding `is-live` to itself. */
.pp-bench__sheet,
.pp-bench__gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.pp-bench__gl {
  display: none;
}

.pp-bench__gl.is-live {
  display: block;
}

/* The lines below the pipette: a trunk, a bar, and three drops with an arrow
   at the foot of each. The paths are drawn in by the page script, the way the
   description animation draws its own branching line. */
.pp-bench__lines {
  width: min(12vw, 170px);
  height: var(--pp-stack-h);
}

.pp-bench__lines svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;             /* the last arrowheads sit past the frame */
}

.pp-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  /* The frame is stretched to the stack's height, so the stroke keeps its
     weight instead of scaling with it. */
  vector-effect: non-scaling-stroke;
}

.pp-head {
  fill: #fff;
  opacity: 0;
}

/* The three populations the lines lead to, stacked so each arrow arrives on
   one: a fixed 8 x 3 matrix per population, the same cells at three different
   proportions. The three sit a clear gap apart — space-between with the rows
   at 26% of the stack puts their centres at 13/50/87%. */
.pp-bench__groups {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Square matrices: the width is the same 26% of the stack that each row
     gets in height, so a 6 x 6 grid stays 6 x 6 rather than stretching. The
     left margin holds them clear of the arrowheads rather than letting the
     arrow tips touch the first column. */
  width: calc(var(--pp-stack-h) * 0.26);
  height: var(--pp-stack-h);
  margin-left: clamp(1rem, 2.5vw, 2.5rem);
}

.pp-bench__cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: clamp(2px, 0.25vw, 3px);
  width: 100%;
  height: 26%;
  opacity: 0;                     /* the JS brings them in together */
  will-change: opacity;
}

.pp-bench__cells span {
  display: block;
  border-radius: 20%;
  background: var(--mosaic-orange);
}

.pp-bench__cells span.is-a {
  background: var(--mosaic-blue);
}

/* The corner column. The screen's own line and the line the first gesture adds
   are separate elements so each can arrive on its own beat, but they are laid
   out in flow here rather than positioned one under the other by hand. */
/* The corner the screen opens on. Sized off the viewport as well as in rem: the
   column has to clear the pipette standing in the middle of the frame, and that
   distance grows with the window — a rem-only measure runs into it. */
.home-pipette__col {
  position: absolute;
  top: clamp(2rem, 9vh, 5rem);
  left: clamp(1.4rem, 6vw, 5.5rem);
  /* Wide enough for the sentence that now sits here to set in a few lines rather
     than a column: it is a paragraph in the corner, not a headline over one. */
  max-width: min(40vw, 44rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3.2vh, 1.9rem);
  pointer-events: none;
}

.home-pipette__head {
  opacity: 0;                      /* the JS brings it in as the screen lands */
  will-change: opacity, transform;
}

/* The head is one paragraph now, so it carries the corner on its own — set above
   the aside, so the screen still opens on something with weight in it. */
.home-pipette__lede {
  margin: 0;
  line-height: 1.35;
  color: #fff;
}

/* The first gesture: the line standing at the right edge, opposite the column,
   centred on its own measure rather than ranged right. The name is the reverse
   of where it sits — the paragraph along the foot of the frame is `__aside`,
   below — so read the rule rather than the class. The resting offset lives in a
   variable, not in a translate of its own, because the JS writes a transform
   here every frame. */
.home-pipette__foot {
  position: absolute;
  --pp-foot-ty: -50%;
  right: clamp(1.4rem, 6vw, 5.5rem);
  top: 50%;
  margin: 0;
  max-width: min(24vw, 24rem);
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  opacity: 0;                      /* the JS brings it in on the first gesture */
  will-change: opacity, transform;
}

/* The second gesture: the paragraph across the foot of the frame, running the
   width under the pipette rather than standing to one side of it. Centred with
   the offset written into the transform rather than with a translate, because
   the JS writes a transform here every frame. */
.home-pipette__aside {
  position: absolute;
  /* the JS writes a transform here every frame, so the resting offset lives in
     a variable rather than in a translate of its own */
  --pp-aside-ty: 0%;
  left: clamp(1.4rem, 6vw, 5.5rem);
  right: clamp(1.4rem, 6vw, 5.5rem);
  bottom: clamp(2rem, 8vh, 4rem);
  margin: 0 auto;
  /* Wide: this is the longest sentence on the screen and has to hold to about
     three lines. */
  max-width: min(94vw, 62rem);
  text-align: center;
  line-height: 1.5;
  color: var(--mosaic-gray);
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
}

/* One size for all three passages. They arrive a gesture apart but are read as
   one voice — the line in the corner and its continuation on the right are two
   halves of a single sentence — so a step between them reads as an accident
   rather than as a hierarchy. Each keeps its own measure, weight and colour;
   only the type size is shared. */
.home-pipette__lede,
.home-pipette__foot,
.home-pipette__aside {
  font-size: clamp(1.15rem, 1.75vw, 1.55rem);
}

/* Below this the frame is too narrow to stand text either side of the pipette,
   so the columns give up their sides and the screen reads as a stack. */
@media (max-width: 992px) {
  .home-pipette__col,
  .home-pipette__foot {
    max-width: min(20vw, 20rem);
  }

  .home-pipette__bench {
    --pp-stack-h: clamp(300px, 44svh, 400px);
  }

  .pp-bench__figure {
    height: min(42svh, 24vw, 360px);
  }

  .pp-bench__lines {
    width: min(14vw, 150px);
  }
}

@media (max-width: 700px) {
  .home-pipette__col {
    left: 1.2rem;
    max-width: min(60vw, 18rem);
  }

  /* On a phone the two passages are set a step smaller and the drawing a
     step tighter: at the shared size the corner paragraph ran into the
     matrix stack and the foot paragraph into the drawing. */
  .home-pipette__lede,
  .home-pipette__aside {
    font-size: 0.9rem;
  }
  .home-pipette__lede { line-height: 1.3; }
  .home-pipette__aside { line-height: 1.4; }

  .home-pipette__bench {
    --pp-stack-h: 260px;
    top: 42%;
  }

  .pp-bench__figure {
    height: min(32svh, 44vw, 200px);
  }

  .pp-bench__lines {
    width: 12vw;
  }

  .home-pipette__foot {
    --pp-foot-ty: 0%;
    top: auto;
    bottom: 22%;
    left: 1.2rem;
    right: 1.2rem;
    max-width: none;
  }

  .home-pipette__aside {
    bottom: clamp(2rem, 8vh, 3.4rem);
    left: 1.2rem;
    right: 1.2rem;
    max-width: none;
  }
}

/* Narrow phones: the corner paragraph needs a little more measure so it sets
   in four lines, and the bench drops a touch to clear it. */
@media (max-width: 400px) {
  .home-pipette__col {
    max-width: min(72vw, 18rem);
  }
  .home-pipette__bench {
    top: 44%;
  }
}

/* Landscape phones and other short windows: the pipette is as tall as the
   drawing allows, which at this height leaves no room for the line at the
   foot of the screen. */
@media (max-height: 520px) {
  .home-pipette__bench {
    --pp-stack-h: 240px;
  }

  .pp-bench__figure {
    height: min(40svh, 52vw, 220px);
  }
}

/* Callback — the name and what it is, stacked and centred. The two arrive in
   turn; the line under the wordmark comes down into place. */
.home-mosaic-act {
  position: relative;
  height: calc(100svh + var(--mm-run, 200svh));
  background: var(--mosaic-bg);
}

.home-mosaic-act__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 1.8vh, 1.4rem);
  padding: 2rem;
  box-sizing: border-box;
  text-align: center;
}

.home-mosaic__mark {
  margin: 0 0 clamp(1.2rem, 4vh, 2.6rem);
  font-size: clamp(4rem, 14vw, 12rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.home-mosaic__tag {
  margin: 0;
  opacity: 0;                    /* the JS brings this one down into place */
  will-change: opacity, transform;
}

/* The design runs what is left of the stack to the same measure — about 62% of
   the frame — rather than stepping the text down under the wordmark. */
.home-mosaic__tag {
  font-size: clamp(1rem, 2.3vw, 1.95rem);
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  max-width: min(90vw, 56rem);
}

.home-mosaic__mark {
  opacity: 0;                    /* the first beat */
  will-change: opacity, transform;
}

/* Mechanism — three claims, one screen each, sliding left. The headline stays
   put and keeps a rule under whichever claim is in play; the track below it
   moves. The diagrams themselves are drawn by static/mechanism.js. */
/* The circuit's own screen. The statement holds the screen for a short stretch
   of scroll after it lands — real distance rather than a swallowed gesture —
   and then gives way to the drawing below it. The head shrink-wraps the
   sentence, so the rule under it can take 100% of that width and close on the
   same right edge the type does, whatever the two lines measure. */
.home-circuit {
  position: relative;
  background: var(--mosaic-bg);
  /* One screen held while the drawing under the sentence plays itself through
     its opening; the tail is what the reader scrolls to leave it. */
  min-height: calc(100svh + var(--hc-run, 70svh));
}

.home-circuit__pin {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(2.5rem, 5.5vh, 4rem) clamp(1rem, 4vw, 2.5rem) clamp(1rem, 2.5vh, 1.6rem);
  box-sizing: border-box;
}

.home-circuit__head {
  flex: none;
  align-self: flex-start;   /* the rule stops at the sentence, not the frame */
  max-width: 100%;
}

.home-circuit__text {
  margin: 0;
  font-size: clamp(0.95rem, 1.55vw, 1.45rem);
  font-weight: 300;
  line-height: 1.5;
  color: #fff;
}

/* The mark's M carries a chop across its left stem — a hole cut for the big
   wordmark, where it reads as part of the letter. At reading size the same cut
   takes the foot off, so the statement gets the plain letter. */
.home-circuit__text .mosaic-m {
  clip-path: none;
  margin-left: 0;
}

.home-circuit__line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.home-circuit__line + .home-circuit__line {
  transition-delay: 0.24s;
}

.home-circuit__text .mosaic-wordmark {
  font-weight: 600;
  white-space: nowrap;
}

/* Drawn rather than revealed: the scale is what reads as a line being pulled
   out. It waits for the second line, which is why its delay is longer than
   either line's. */
.home-circuit__rule {
  display: block;
  height: 4px;
  margin-top: clamp(1rem, 2.6vh, 1.7rem);
  background: linear-gradient(90deg,
    var(--mosaic-pink) 0%, var(--mosaic-purple) 25%, var(--mosaic-blue) 50%,
    var(--mosaic-lime) 75%, var(--mosaic-orange) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.95s;
}

.home-circuit.is-in .home-circuit__line {
  opacity: 1;
  transform: none;
}

.home-circuit.is-in .home-circuit__rule {
  transform: scaleX(1);
}

/* The fold under the statement, in the room the pin has left for it. */
.home-circuit__fold {
  margin-top: clamp(0.9rem, 2vh, 1.4rem);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease 1.45s,
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 1.45s;
}

.home-circuit.is-in .home-circuit__fold {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-circuit__line,
  .home-circuit__rule,
  .home-circuit__fold {
    transition: none;
  }
  .home-circuit__line,
  .home-circuit__fold {
    opacity: 1;
    transform: none;
  }
  .home-circuit__rule {
    transform: scaleX(1);
  }
}

/* The principle as an offer. The page has made its case by the time this
   arrives, so the drawing waits behind a single line and costs one press to
   meet rather than another screen of scrolling. */
.home-allprinciple__box {
  max-width: 1120px;
  margin: 0;
}

.home-allprinciple__summary {
  display: flex;
  align-items: baseline;
  justify-content: center;   /* the line is the whole row again once folded */
  gap: 1.1rem;
  width: 100%;
  padding: 2.4rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  list-style: none;
  cursor: pointer;
}

/* Set the way the card rows announce themselves: the same monospaced, tracked
   capitals, so the page uses one phrase for "this opens" rather than two. */
.home-allprinciple__label {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: clamp(0.88rem, 1.3vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-allprinciple__note {
  color: var(--mosaic-muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.4;
}

/* The colour follows the same element the cursor does. */
/* One word, one colour: the palette read across the line rather than as a
   single accent. */
.home-allprinciple__label .c-red { color: var(--mosaic-pink); }
.home-allprinciple__label .c-purple { color: var(--mosaic-purple); }
.home-allprinciple__label .c-lime { color: var(--mosaic-lime); }
.home-allprinciple__label .c-blue { color: var(--mosaic-blue); }
.home-allprinciple__label .c-orange { color: var(--mosaic-orange); }

.home-allprinciple__label:hover {
  color: var(--mosaic-blue);
}

/* The row ends on the mark rather than a sign: the fold is announced by the
   words on the left, and the page already has a mark it can close on. */
.home-allprinciple__mark {
  margin-left: auto;
  align-self: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.home-allprinciple__label {
  transition: transform 0.25s ease;
  animation: ap-label-breathe 3.6s ease-in-out infinite;
}

/* A slow breathe on the words themselves, so the line reads as alive from a
   distance without anything moving far enough to be a distraction. */
@keyframes ap-label-breathe {
  0%, 100% {
    opacity: 0.86;
    transform: translateY(3px);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    opacity: 1;
    transform: translateY(-7px);
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.5);
  }
}

.home-allprinciple__box.ap-done .home-allprinciple__label {
  animation: none;
}

.home-allprinciple__summary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.home-allprinciple__summary {
  border-radius: 10px;
  transition: background 0.25s ease;
}


@media (prefers-reduced-motion: reduce) {
  .home-allprinciple__label {
    animation: none;
  }
}

/* The line is only the way back: it appears once the Bxb1 half has been put
   away, and the button that puts it away appears only once the drawing has
   played itself out. */
.home-allprinciple__box:not(.is-collapsed) .home-allprinciple__summary {
  display: none;
}

.home-allprinciple__box .home-allprinciple__close {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, color 0.2s ease;
}

.home-allprinciple__box.ap-done .home-allprinciple__close {
  opacity: 1;
  pointer-events: auto;
}

.home-allprinciple__box.is-collapsed .home-allprinciple__close {
  opacity: 0;
  pointer-events: none;
}

/* The body is the part that folds: it is given a height while it opens and
   closes, and hands the height back to the content once it has landed. */
.home-allprinciple__body {
  will-change: height;
}

.home-allprinciple__box .home-allprinciple__scroll {
  padding-bottom: 0.5rem;
}

/* The way back out, under the drawing rather than in the row above it: once
   the circuit is open the row has scrolled away, and the reader who has
   finished with it should not have to hunt for the line that opened it. */
.home-allprinciple__foot {
  display: flex;
  justify-content: center;
  padding: 0 0 0.5rem;
}

.home-allprinciple__close {
  display: inline-flex;
  flex-direction: column;   /* the arrow sits under the word, not beside it */
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  background: none;
  color: var(--mosaic-gray);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease;
}

.home-allprinciple__close svg {
  width: 44px;
  height: 44px;
  color: #ffffff;
  transition: transform 0.25s ease;
}

.home-allprinciple__close:hover svg {
  transform: translateY(-3px);
}

.home-allprinciple__close:hover {
  color: var(--mosaic-blue);
}

.home-allprinciple__scroll #mosaic-allprinciple-animation {
  max-width: 1050px;
  margin: 0 auto;
}

/* The circuit is drawn to a 1120-wide reference and cannot be read at a
   phone's width, so the fold is not offered there at all. */
@media (max-width: 720px) {
  .home-circuit__fold {
    display: none;
  }
}



.home-mechanism {
  position: relative;
  /* On a phone there is no track to slide: each screen gets a runner instead —
     one viewport to hold it still, plus this much scrolling to play its cue
     over. See .mech-panel__run. */
  --mech-run: 60svh;
  /* One screen — the pin — and a short tail past it.
     It used to be four and a half screens: one held screen per claim plus the
     two leftward moves between them, sized when the three screens were
     scrubbed by the scroll and that runway *was* their pace. The screens are a
     deck now, moved by a sideways gesture and playing themselves once they are
     in front, so nothing reads that runway any more — the reader scrolled four
     and a half screens through a still drawing and reasonably concluded the
     page had stopped. What is left is the screen the deck sits on and the
     tail, which is distance rather than a brake. */
  /* The tail is the brake: scrolling through this screen has to carry some
     weight, or the drawing the reader just met is gone before it has played.
     600px rather than the old 300 — still short of the four-and-a-half-screen
     runway that used to read as a stuck page. */
  height: calc(100svh + 600px);
  background: var(--mosaic-bg);
}

.home-mechanism__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* The deck's two controls, and nothing around them. The panels are drawn edge
   to edge and a disc in the corner of one is a piece of furniture on top of
   the drawing; the arrow alone says the same thing and lets the drawing keep
   the frame. It is sized off the drawing rather than off a control: it has to
   be read across a full screen of infographic, not found in a toolbar.
   A drop shadow keeps it legible where the drawing underneath is bright.
   Hidden by opacity rather than `display`, so nothing shifts as they come and
   go. */
.home-mech__nav {
  position: absolute;
  top: var(--mech-nav-top, 50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.8rem, 4vw, 4rem);
  height: clamp(2.8rem, 4vw, 4rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.95));
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease, transform 0.2s ease;
}

.home-mech__nav--prev {
  left: clamp(0.9rem, 2.2vw, 1.7rem);
  transform: translateY(-50%);
}

.home-mech__nav--next {
  right: clamp(0.9rem, 2.2vw, 1.7rem);
  transform: translateY(-50%);
}

/* Shown only where there is another screen in that direction. The class is put
   on by the page, which is also what knows how many screens there are. */
.home-mech__nav.is-shown {
  opacity: 1;
  pointer-events: auto;
}

/* On a phone the drawing runs the panel's whole width, so an arrow at the base
   inset sat on the drawing (29px over it at either end). They move out to the
   screen's own edges and come down a size, which clears the ink both sides. */
@media (max-width: 768px) {
  .home-mech__nav {
    width: clamp(2.2rem, 9vw, 2.5rem);
    height: clamp(2.2rem, 9vw, 2.5rem);
  }

  /* Negative by the width of the theme's 12px container gutter: these are
     placed against the pin, which sits inside that gutter, and the drawing
     reaches back out through it. */
  .home-mech__nav--prev { left: -8px; }
  .home-mech__nav--next { right: -8px; }

  /* An arrow that has to sit half off the screen to clear the drawing is not
     an arrow the reader can find. The gesture is what actually moves the deck,
     so the phone says so in words above it instead. */
  .home-mech__nav {
    display: none;
  }

  .home-mechanism .home-mech__hint {
    display: block;
    margin: 0 0 8px;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
  }
}

.home-mech__nav svg {
  width: 100%;
  height: 100%;
}

/* Desktop has the arrows; the phone has this line instead. Hidden by default
   so it costs nothing where the arrows are there to be pressed. */
.home-mech__hint {
  display: none;
}

/* With no disc behind it the arrow is the only thing to answer, so hovering
   brightens it and leans it the way it would take the reader. */
.home-mech__nav:hover {
  color: #fff;
}

.home-mech__nav--prev:hover {
  transform: translateY(-50%) translateX(-6px);
}

.home-mech__nav--next:hover {
  transform: translateY(-50%) translateX(6px);
}

.home-mech__nav:focus-visible {
  outline: 2px solid var(--mosaic-lime);
  outline-offset: 3px;
}

/* The stacked layout has no track to slide, so the deck's controls have
   nothing to do there — each screen plays over its own runner instead. */
.home-mechanism.is-stacked .home-mech__nav {
  display: none;
}

/* --- the headline and its travelling rule --- */
.home-mech__head {
  position: relative;
  flex: 0 0 auto;
  /* The sentence that opens this screen sits directly above, so the headline
     only needs a short step below it rather than a screen-edge margin. */
  padding: 1.2rem clamp(1.4rem, 6vw, 5.5rem) 0;
}

/* On a phone the three claims are three lines of type standing between the
   reader and the drawing, and the drawing is the thing they came for: the deck
   starts on its first screen instead. */
@media (max-width: 768px) {
  .home-mech__head {
    display: none;
  }
}

.home-mech__phrases {
  margin: 0;
  /* A step under the sentence above it, not two: at 1.8rem the deck's own
     heading read as body copy and the two claims flattened into one block. */
  font-size: clamp(1.15rem, 2.4vw, 2.15rem);
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.home-mech__phrase {
  color: var(--mosaic-muted);
  transition: color 0.45s ease;
}

.home-mech__phrase.is-on {
  color: #fff;
}


/* Sits under the claim in play. JS moves the box to that claim and scales the
   fill: left-origin growth on the way in, right-origin retraction on the way
   out, so the line always travels the same direction as the screens. */
.home-mech__rule {
  position: absolute;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-mech__rule i {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

/* --- the sliding track --- */
.home-mech__track {
  flex: 1 1 auto;
  min-height: 0;
  width: 300%;
  display: flex;
  align-items: stretch;
  will-change: transform;
}

/* The runner is the block a screen is given on a phone: one viewport of it
   holds the screen, the rest is the stretch of scrolling the cue plays over.
   On the sliding layout it is not there at all — `display: contents` hands its
   panel straight to the track as the flex item it always was. */
.mech-panel__run { display: contents; }

.mech-panel {
  flex: 0 0 calc(100% / 3);
  min-width: 0;
  box-sizing: border-box;
  padding: clamp(1rem, 3vh, 2rem) clamp(1.4rem, 6vw, 5.5rem) clamp(1.6rem, 5vh, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2.4vh, 1.7rem);
}

.mech-panel__text {
  flex: 0 0 auto;
  max-width: min(94%, 56rem);
}

.mech-panel__num {
  display: none;
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}


.mech-panel__body {
  margin: clamp(0.35rem, 0.9vh, 0.55rem) 0 0;
  font-size: clamp(0.92rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  color: var(--mosaic-gray);
}


.mech-panel__stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mech-panel__stage svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: 'Lexend', sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

/* On a phone the library sentence sits above the deck and already keeps the
   brand mark clear, so the panel no longer needs a screen-top gutter. A small
   step after that text and the drawing can start straight away. */
@media (max-width: 768px) {
  .mech-panel {
    padding: 0.85rem 0 1rem;
  }
  .mech-panel__text {
    max-width: none;
    padding-inline: clamp(1.2rem, 5vw, 2rem);
  }
  /* The drawing is the reason for the screen: it takes the full width of
     the phone, reaching back through the container gutter on both sides. */
  .mech-panel__stage {
    margin-inline: -12px;
  }
  .mech-panel__body {
    font-size: 0.9rem;
  }

  /* The words above it give up a step so the drawing does not have to. */
  .home-mechanism .home-library {
    padding: clamp(2.8rem, 6vh, 3.6rem) max(4vw, 1.2rem) 0.4rem;
  }
  .home-library__lead {
    font-size: 0.9rem;
  }
  .home-library__headline {
    font-size: clamp(1.15rem, 5.2vw, 1.45rem);
  }
  /* At this size the headline wraps before the mark, leaving the square
     alone on a third line; it is decoration, so it goes. */
  .home-library__mark {
    display: none;
  }
}

/* Stacked layout (narrow screens) — set by mechanism.js. The track falls back
   into normal flow and each screen plays as its own block comes up. */
.home-mechanism.is-stacked {
  height: auto;
}

.home-mechanism.is-stacked .home-mechanism__pin {
  position: static;
  height: auto;
  overflow: visible;
  display: block;
}

.home-mechanism.is-stacked .home-mech__head {
  padding-top: clamp(3rem, 10vh, 5rem);
}

.home-mechanism.is-stacked .home-mech__rule {
  display: none;
}

.home-mechanism.is-stacked .home-mech__track {
  display: block;
  width: auto;
  transform: none !important;
}

/* Each screen holds still while it plays: the runner is a viewport plus a
   runway, and the panel sticks to the top of it for the length of the runway,
   so the drawing is in the same place on screen from the first beat to the
   last — it animates, it does not travel. */
.home-mechanism.is-stacked .mech-panel__run {
  display: block;
  min-height: calc(100svh + var(--mech-run, 60svh));
}

/* The drawing is the thing worth the width on a phone, so the panel gives it
   all of it: no side padding here, and the stage reaches back out through the
   page container's own inset. A row is a dozen parts wide; every pixel the
   padding takes is a pixel off the size of every part in it. The copy keeps
   its inset of its own, so only the drawings go edge to edge. */
.home-mechanism.is-stacked .mech-panel {
  position: sticky;
  top: 0;
  min-height: 100svh;
  padding: 3.5rem 0;
  box-sizing: border-box;
  /* the copy and the drawing travel as one block, centred on the screen */
  justify-content: center;
}

.home-mechanism.is-stacked .mech-panel__text {
  max-width: none;
  padding-inline: clamp(1.2rem, 5vw, 2rem);
}

.home-mechanism.is-stacked .mech-panel__stage {
  /* 12px is this theme's .container gutter — the drawing reaches back through
     it, and no further: anything wider than the gutter puts a scrollbar on the
     page, which is exactly what the phone screens cannot afford. */
  margin-inline: -12px;
}

/* Let the drawing set its own height here: the narrow screens are laid out tall
   (the library screen stacks), so a fixed stage height would letterbox them
   down to nothing. */
.home-mechanism.is-stacked .mech-panel__stage {
  min-height: 0;
  /* sized by the drawing, not by what is left over: the panel centres the pair
     instead, so the drawing does not drift away from its own caption */
  flex: 0 0 auto;
}

.home-mechanism.is-stacked .mech-panel__stage svg {
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .home-mech__phrase,
  .home-mech__rule {
    transition: none;
  }
}

/* End-of-row loop — no panel: the arrow and its caption sit straight on the
   background, closing the row rather than passing for another card. */
/* Just the arrow now. It used to be a column with a label under it, which is
   what set the width; with the label gone the button is the size of what is
   actually in it, rather than an arrow floating in a column of empty space. */
.hcard-loop {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  color: var(--mosaic-muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.25s ease;
}

.hcard-loop svg {
  width: clamp(2.4rem, 4.4vw, 3.4rem);
  height: clamp(2.4rem, 4.4vw, 3.4rem);
  transition: transform 0.3s ease;
}

.hcard-loop:hover,
.hcard-loop:focus-visible {
  color: #fff;
}

.hcard-loop:hover svg {
  transform: translateX(-5px);
}

/* Row arrows — one card per press, in the foot of the section. They stay out
   of the scroller so the cards pass beneath them rather than under them: an
   arrow drawn over a drawing is an arrow the reader cannot see. The pair
   shares the progress bar's baseline, one at either edge of the row. */
.home-row-nav {
  position: absolute;
  left: max(4vw, 1.6rem);
  right: max(4vw, 1.6rem);
  bottom: clamp(0.5rem, 1.6vh, 1.1rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.home-row-nav__btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: var(--mosaic-muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.home-row-nav__btn svg {
  width: clamp(2.4rem, 3.3vw, 2.9rem);
  height: clamp(2.4rem, 3.3vw, 2.9rem);
  transition: transform 0.3s ease;
}

.home-row-nav__btn:hover,
.home-row-nav__btn:focus-visible {
  color: #fff;
}

.home-row-nav__btn--prev:hover svg { transform: translateX(-5px); }
.home-row-nav__btn--next:hover svg { transform: translateX(5px); }

.home-row-nav__btn[disabled] {
  opacity: 0.22;
  cursor: default;
  pointer-events: none;
}

/* On a phone the two fixed controls sit in the foot corners, and the row's
   arrows were landing underneath them. The pair moves up out of their way
   rather than the controls moving: those two are on every page. */
@media (max-width: 720px) {
  .home-row-nav {
    bottom: calc(clamp(0.5rem, 1.6vh, 1.1rem) + 3rem);
  }
}


/* The one line under the row that says the cards open. It sits in the gap
   between the cards and the arrows, centred like the progress squares. */
.home-row-hint {
  position: absolute;
  left: 50%;
  /* top is written by placeRowHint(): above the cards */
  transform: translateX(-50%);
  margin: 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

/* On a phone the loop-back arrow after the last card leaves no room to centre
   that card; the row itself can be swiped back to the start instead. */
@media (max-width: 720px) {
  .home-hscroll .hcard-loop {
    display: none;
  }
}

/* Row progress — a segmented bar under the card row: one square per card, each
   filling left to right as the row is scrolled through that card's slice. */
.hscroll-progress {
  position: absolute;
  left: 50%;
  /* Sits in the foot of the section, clear of the cards: the card's bottom edge
     is the pin's own bottom padding above the section's, so the squares have to
     fit inside that padding to stay off the card. */
  bottom: clamp(0.5rem, 1.6vh, 1.1rem);
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
  pointer-events: none;
}

.hscroll-progress__seg {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

/* The filled part is given as its two edges rather than as one scale, because
   which end it hangs off depends on which way the reader is going. A square
   takes its fill on from the left edge and gives it up from the left edge too
   — so the square the row is leaving empties from its front, eaten away in the
   direction of travel, instead of retreating backwards out of the side the row
   has already passed. One scale can only be anchored at one end, and anchoring
   it at the left makes the emptying run the wrong way. */
.hscroll-progress__seg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--seg, #fff);
  clip-path: inset(0 calc((1 - var(--b, 0)) * 100%) 0 calc(var(--a, 0) * 100%));
}

.home-quote {
  margin: 0;
  max-width: min(90vw, 58rem);
  color: #fff;
  font-size: clamp(1.5rem, 4.6vw, 3rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

.home-quote__accent {
  font-weight: 700;
  white-space: nowrap;
}

.home-quote__accent {
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .home-quote {
    font-size: clamp(1.35rem, 6.6vw, 2rem);
  }

  .home-quote__accent {
    white-space: normal;
  }
}

/* Two-line quote on one screen — a sticky viewport over a 2-screen runway;
   JS reveals line 1 during the first viewport and line 2 during the second. */
.home-quote-act {
  position: relative;
  /* ~3.8 viewports: line1 reveal, line2 reveal, then a beat holding both
     lines on screen before the text content finally scrolls up */
  height: 380svh;
  background: var(--mosaic-bg);
}

/* The thesis act carries a single line too, so it gives back the same viewport
   for the same reason as the applications act above. Its line is longer than
   the others, so it is set a step down and on a wider measure — as a headline
   it is the longest sentence on the page and would otherwise run to four
   lines of display type. */
.home-quote-act--single {
  height: 280svh;
}

.home-quote-act--single .home-quote {
  max-width: min(94vw, 66rem);
  font-size: clamp(1.35rem, 3.1vw, 2.6rem);
  line-height: 1.35;
}

.home-quote-act__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 3.4vh, 2rem);
  padding: 2rem;
  box-sizing: border-box;
}

.home-quote-act .home-quote {
  opacity: 0;
  transform: translateY(26px);
  will-change: transform, opacity;
}

.home-quote--l2 {
  font-size: clamp(1rem, 1.9vw, 1.6rem);
  max-width: min(94vw, 56rem);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .home-quote--l2 {
    white-space: normal;
  }
}

/* Both lines of the act carry the same weight, so the second is not stepped
   down the way the sibling acts' closing line is. */
.home-quote-act--even .home-quote {
  font-size: clamp(1.5rem, 4.6vw, 3rem);
  max-width: min(90vw, 58rem);
  white-space: normal;
}

/* The question this act now asks is more than twice the length of the one the
   narrow measure was cut for, so it is given its own: a wider column and a step
   down in size, which is what keeps it inside three lines without the line
   breaking wherever the container happens to run out. */
#home-quote-act-intro .home-quote--l1 {
  max-width: min(94vw, 62rem);
  font-size: clamp(1.3rem, 2.9vw, 2.4rem);
}

/* Narrow measure, to land the line break where the design breaks it rather
   than wherever the container happens to run out. */
.home-quote-act--narrow .home-quote {
  max-width: 49rem;
}

/* ============================================================
   COMPONENT 12: TEAM PAGE
   Glass member cards with 5-color hover glow, grouped grid
   ============================================================ */

.team-page {
  max-width: 1100px;
  margin: 0 auto;
}

/* Section title (grouping: Students / Instructors / Advisors) */
.team-section {
  margin: 2.5rem 0 1.5rem;
}

.team-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.12em;
  /* scales with --base-font-size */
  font-weight: 700;
  color: var(--mosaic-text);
  margin-bottom: 1.25rem;
}

.team-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mosaic-border);
}

/* Mobile: tighter grid */
@media (max-width: 768px) {
}

/* Team content wrapper (after the parallax hero) */
.team-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

/* Welcome intro block — after the parallax hero, before the cards */
.team-welcome {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.team-welcome-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--mosaic-blue);
  margin-bottom: 1.25rem;
}

.team-welcome-text {
  font-size: 1em;
  /* scales with --base-font-size (accessibility panel) */
  font-weight: 300;
  line-height: inherit;
  /* follows the accessibility line-height panel */
  color: var(--mosaic-gray);
}

.team-welcome-text strong {
  color: var(--mosaic-text);
}

/* ============================================================
   COMPONENT 12b: TEAM PAGE (fullscreen hero)
   ============================================================ */
/* Hide the official hero header — the parallax hero replaces it */
.page-team .bg-hero {
  display: none !important;
}

/* The content container is fine; the hero itself is fullscreen */
.page-team .container.content {
  max-width: none;
  /* hero + content can span full width */
  padding-left: 0;
  padding-right: 0;
}

.page-team .team-content,
.page-team .team-welcome {
  max-width: 1100px;
  /* re-constrain the inner content */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Team welcome intro — centred on the full column; inner blocks re-constrain. */
.page-team .team-welcome-title,
.page-team .team-welcome-text {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Team hero should start at the very top (under the fixed navbar), not be
   pushed down by body padding — matches the fullscreen opening.
   height: 100vh + 56px compensates for the 56px pulled up under the navbar,
   so the hero's visible area fills the whole viewport with no gap at the bottom. */
.page-team {
  padding-top: 0;
}

.page-team .fancy-hero-m {
  height: calc(100vh + 56px);
  margin-top: -56px;
  /* pull up under the fixed navbar */
}

.page-team .fancy-hero__pin-m {
  height: calc(100vh + 56px);
}

/* ============================================================
   COMPONENT 12c: GALLERY (photo grid + lightbox modal)
   ============================================================ */
.gallery-container {
  width: 100%;
  padding: 1.5rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

.gallery-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background-color: var(--mosaic-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.gallery-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 70%);
  padding: 20px 16px 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.gallery-description {
  color: #fff;
  font-size: 0.76em;
  /* scales with --base-font-size */
  font-weight: 500;
  margin: 0;
  line-height: inherit;
  /* follows the accessibility line-height panel */
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.08) rotate(0.5deg);
}

.gallery-item:hover .gallery-tag {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Touch devices have no hover — keep the member name + description visible.
   Placed after the base rules so this wins on mobile. */
@media (max-width: 768px) {

  .gallery-tag,
  .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
  }

  .gallery-overlay {
    padding: 14px 12px 12px;
  }
}

@media (max-width: 480px) {
  .gallery-overlay {
    padding: 12px 10px 10px;
  }

  .gallery-description {
    font-size: 0.66em;
  }
}

/* Lightbox modal */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.gallery-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: galleryFade 0.3s ease-out;
}

@keyframes galleryFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
}

.gallery-modal-content {
  position: relative;
  background: var(--mosaic-card);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: gallerySlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

@keyframes gallerySlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.modal-image {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  flex: 1;
  cursor: pointer;
  /* click the photo to dismiss the lightbox */
}

.modal-info {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--mosaic-card);
  flex-shrink: 0;
}

.modal-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mosaic-text);
  margin: 0 0 8px 0;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--mosaic-muted);
  margin: 0;
  line-height: 1.6;
}

.modal-nav {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: var(--mosaic-card);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  justify-content: center;
  flex-shrink: 0;
}

.nav-btn {
  background: var(--mosaic-card);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--mosaic-text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-btn:hover {
  background: var(--mosaic-blue);
  color: #fff;
  border-color: var(--mosaic-blue);
}

.prev-btn {
  margin-right: auto;
}

.next-btn {
  margin-left: auto;
}

@media (max-width: 768px) {
  .gallery-modal-content {
    max-width: 95vw;
    max-height: 85vh;
    border-radius: 12px;
  }

  .modal-image {
    max-height: 50vh;
  }

  .modal-info {
    padding: 16px;
  }

  .modal-nav {
    padding: 12px 16px;
    gap: 8px;
  }

  .nav-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
}

/* FAMILY wordmark — letter colors mirror the MOSAIC brand intro order */
.family-f {
  color: #ffffff;
}

.family-a {
  color: #e84d85;
}

.family-m {
  color: #9b6ca8;
}

.family-i {
  color: #c6da58;
}

.family-l {
  color: #24b8ec;
}

.family-y {
  color: #ee7954;
}

/* ============================================================
   COMPONENT 12d: STACKED PHOTO FRAME
   Two photos in one frame; hover / keyboard focus / tap trades their
   places. Markup and the call signature: wiki/stacked_frame.html
   ============================================================ */

.sf-frame {
  position: relative;
  width: var(--sf-w, 300px);
  max-width: 100%;
  flex: 0 0 auto;
  user-select: none;
  /* Ratio box first: holds the frame's height on engines without
     aspect-ratio, where the @supports block below never applies. */
  height: 0;
  padding-top: var(--sf-arpc, 133.333%);
}

/* The card's own width is the measure the type scales against, so one call
   renders correctly both as a member card and as a much larger subgroup
   card. Everything sized in cqw below reads from this. */
@supports (aspect-ratio: 1 / 1) {
  .sf-frame {
    height: auto;
    padding-top: 0;
    aspect-ratio: var(--sf-ar, 300 / 400);
    container-type: inline-size;
  }
}

.sf-frame:focus-visible {
  outline: 2px solid var(--sf-accent, var(--mosaic-blue));
  outline-offset: 7px;
  border-radius: 18px;
}

/* Sweeping the pointer across a row: the card being left settles back first,
   and only then does the card being reached start to turn. Without the delay
   both move at once and the row reads as one blur.

   The delay sits on the hover state only, never on the resting one. A
   transition uses the transition values of the style it is moving *to*, so
   entering waits and leaving does not — which is what sequences the two.

   Deliberate, single-target actions — a tap, or Enter on a focused card — get
   no delay: the reader asked for that one card, and 300ms of nothing reads as
   a dropped input rather than as choreography. */
.sf-frame:hover .sf-photo,
.sf-frame:hover .sf-img,
.sf-frame:hover .sf-face {
  transition-delay: 0.3s;
}

/* ── The two faces ─────────────────────────────────────────── */

.sf-photo {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  /* z-index rides along with zero duration purely so the swap delay below
     reaches it too. Left out of the list it changes the instant the pointer
     arrives, so the face going back drops behind while it is still sitting
     still — a flash of the wrong face for the length of the delay. */
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
              z-index 0s;
}

.sf-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The caption rides on its photo and leaves with it. Without this the face
   that has just receded still shows its name, hanging that far below the
   frame and over whatever is underneath — the name is the last thing on the
   face, so it is the first thing to clear the frame's edge. Opacity only, so
   the text stays in the accessibility tree either way. */
.sf-face {
  transition: opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sf-photo--back .sf-face {
  opacity: 0;
}

/* The face waiting behind sits offset, so a sliver of it shows at rest —
   that sliver is the whole affordance that says there is a second photo. */
.sf-photo--front {
  z-index: 2;
}

.sf-photo--back {
  z-index: 1;
  transform: translate(var(--sf-offset-x, 5cqw), var(--sf-offset-y, 4cqw));
}

/* Dimmed while it is the face behind, so its exposed edge reads as a second
   sheet rather than competing with the photo in front. */
.sf-photo--back .sf-img {
  opacity: 0.5;
}

/* ── The swap ──────────────────────────────────────────────── */

.sf-frame:hover .sf-photo--front,
.sf-frame:focus-visible .sf-photo--front,
.sf-frame.is-flipped .sf-photo--front {
  z-index: 1;
  transform: translate(var(--sf-offset-x, 5cqw), var(--sf-offset-y, 4cqw));
}

.sf-frame:hover .sf-photo--back,
.sf-frame:focus-visible .sf-photo--back,
.sf-frame.is-flipped .sf-photo--back {
  z-index: 2;
  transform: none;
}

.sf-frame:hover .sf-photo--front .sf-img,
.sf-frame:focus-visible .sf-photo--front .sf-img,
.sf-frame.is-flipped .sf-photo--front .sf-img {
  opacity: 0.5;
}

.sf-frame:hover .sf-photo--back .sf-img,
.sf-frame:focus-visible .sf-photo--back .sf-img,
.sf-frame.is-flipped .sf-photo--back .sf-img {
  opacity: 1;
}

/* Captions follow their photo in and out of the frame. */
.sf-frame:hover .sf-photo--front .sf-face,
.sf-frame:focus-visible .sf-photo--front .sf-face,
.sf-frame.is-flipped .sf-photo--front .sf-face {
  opacity: 0;
}

.sf-frame:hover .sf-photo--back .sf-face,
.sf-frame:focus-visible .sf-photo--back .sf-face,
.sf-frame.is-flipped .sf-photo--back .sf-face {
  opacity: 1;
}

/* ── Type over the photo ───────────────────────────────────── */

/* Gradient at the foot of each face. Text sits on it rather than on whatever
   the photo happens to be doing there. Dark, not white: the site is dark, and
   a white wash would read as a smudge across the picture. */
.sf-photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sf-mask-height, 64%);
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, var(--sf-mask-a0, 0)) 0%,
      rgba(0, 0, 0, calc((var(--sf-mask-a0, 0) + var(--sf-mask-a1, 0.9)) / 2)) 50%,
      rgba(0, 0, 0, var(--sf-mask-a1, 0.9)) 100%);
  pointer-events: none;
  z-index: 1;
}

.sf-face {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.18em;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  /* Fallback sizes for engines without container queries. */
  font-size: 0.95rem;
  padding: 0.85rem 0.95rem 0.95rem;
}

@supports (container-type: inline-size) {
  .sf-face {
    font-size: clamp(0.82rem, 6.8cqw, 1.25rem);
    padding: clamp(0.6rem, 5cqw, 2rem);
    gap: clamp(0.1rem, 1cqw, 0.35rem);
  }
}

/* Name, role and note are strong/span rather than p or figcaption on purpose:
   the accessibility panel's line-height rule reaches those, and it would pull
   this block open past the gradient it is meant to sit on. Display type, not
   prose — nothing to exempt, because nothing here is body copy. */
.sf-name {
  display: block;
  font-size: 1.7em;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.12;
  color: #fff;
}

.sf-role {
  display: block;
  font-size: 1.05em;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sf-accent, var(--mosaic-blue));
}

.sf-note {
  display: block;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.4;
  color: var(--mosaic-gray);
}

/* ── Row of cards ──────────────────────────────────────────── */

/* The peek offset pushes each card's back face out past its box, so a row
   carries that much slack on its trailing edge — without it the last
   column's sliver is cut by whatever comes next. */
.sf-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  padding: 0.25rem 1.25rem 1.25rem 0;
}

/* Group heading — the italic display line that separates one group of
   members from the next. */
.sf-group-title {
  margin: 3rem 0 1.5rem;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-style: italic;
  font-weight: 700;
  color: var(--mosaic-text);
}

/* The one hint that the cards are pressable, above the first row only. */
.sf-explore {
  margin: -0.9rem 0 1.25rem;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
}

/* Subgroup cards are landscape and wide, so they go one to a row. */
.sf-row--wide {
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

/* ── Team page: the one photograph of everybody ────────────── */

.team-photo {
  margin: 0 auto;
  max-width: 900px;
}

.team-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--mosaic-border);
}

.team-photo figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85em;
  color: var(--mosaic-muted);
}

@media (prefers-reduced-motion: reduce) {
  .sf-photo,
  .sf-img {
    transition: none;
  }
}

/* ============================================================
   COMPONENT 13: MOSAIC FOOTER (card-style, two-column)
   ============================================================ */
.mosaic-footer {
  font-family: 'Lexend', sans-serif;
  position: relative;
  z-index: 2;
  background: var(--mosaic-dark);
  border: 1px solid var(--mosaic-border);
  border-radius: 16px;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  margin-top: 3rem;
  padding: 2rem 2rem 1.5rem;
  color: var(--mosaic-muted);
}

.mosaic-footer-main {
  padding-bottom: 1rem;
}

/* Left — brand block: team logo + MOSAIC wordmark */
.mosaic-footer-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  width: 100%;
}

.mosaic-footer-logo {
  width: auto;
  height: 6.5rem;
  /* static default_3 mosaic — keeps its SVG aspect */
  flex-shrink: 0;
  display: block;
}

.mosaic-footer-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.mosaic-footer-wordmark {
  font-weight: 600;
  /* a bit thicker than 400 */
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.mosaic-footer-wordmark .mosaic-m {
  color: #ffffff;
  display: inline-block;
  /* a thin chop across the left vertical stroke, centred at 70% height —
     --m-depth cuts deep enough to sever the stroke, --m-notch-h is the
     half-height of the thin cut */
  --m-depth: 33.5%;
  --m-notch-h: 8.5%;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%,
      0% calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% + var(--m-notch-h)),
      var(--m-depth) calc(70% - var(--m-notch-h)),
      0% calc(70% - var(--m-notch-h)));
}

.mosaic-footer-wordmark .mosaic-o {
  color: #e84d85;
}

.mosaic-footer-wordmark .mosaic-s {
  color: #9b6ca8;
}

.mosaic-footer-wordmark .mosaic-a {
  color: #c6da58;
}

.mosaic-footer-wordmark .mosaic-i {
  color: #24b8ec;
}

.mosaic-footer-wordmark .mosaic-c {
  color: #ee7954;
}

.mosaic-footer-brand-sub {
  font-size: 1.2rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.mosaic-footer-contact-info {
  text-align: center;
  /* contact sits in the exact middle of the footer */
}

.mosaic-footer-contact-info .mosaic-footer-socials {
  justify-content: center;
}

.mosaic-footer-contact-logo {
  flex-shrink: 0;
  height: 100%;
  /* fill the stretched column so the badge centres vertically */
  display: flex;
  align-items: center;
  justify-content: center;
}

.mosaic-footer-contact-logo img {
  max-width: 260px;
  height: auto;
  margin-left: -10px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.mosaic-footer-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mosaic-text);
  margin-bottom: 0.75rem;
}

.mosaic-footer-addr {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--mosaic-muted);
}

/* Email copy button (no mailto jump — click copies) */
.mosaic-footer-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--mosaic-blue);
  cursor: pointer;
  transition: color 0.2s ease;
}

.mosaic-footer-copy:hover {
  color: var(--mosaic-pink);
}

/* Socials */
.mosaic-footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0.75rem;
}

.mosaic-footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease, transform 0.2s ease;
}

.mosaic-footer-socials a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.mosaic-footer-socials img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Divider + bottom */
.mosaic-footer-hr {
  border-color: var(--mosaic-border);
  opacity: 1;
  margin: 1.25rem 0;
}

.mosaic-footer-bottom {
  text-align: center;
}

.mosaic-footer-bottom a {
  color: var(--mosaic-blue);
}

.mosaic-footer-bottom a:hover {
  color: var(--mosaic-pink);
}

@media (max-width: 992px) {
  .mosaic-footer {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* Mobile: logo + MOSAIC wordmark sit side by side (logo left, wordmark right),
   centred as one block; the sub-text is dropped so contact follows directly */
@media (max-width: 768px) {
  .mosaic-footer {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding: 1.5rem 1rem;
  }

  .mosaic-footer-brand {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .mosaic-footer-brand-sub {
    display: none;
  }

  .mosaic-footer-wordmark {
    font-size: 2rem;
  }

  /* contact is already text-align:center; school logo centres, nudged down */
  .mosaic-footer-contact-logo {
    margin-left: 0;
    margin-top: 1rem;
  }
}

/* Narrow phones: reduce logo box and wordmark further, keep sponsors compact */
@media (max-width: 480px) {
  .mosaic-footer {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
    padding: 1.25rem 0.75rem;
    border-radius: 12px;
  }

  .mosaic-footer-logo {
    width: auto;
    height: 5rem;
  }

  .mosaic-footer-wordmark {
    font-size: 1.7rem;
  }

  .mosaic-footer-brand-sub {
    font-size: 1rem;
  }

  .mosaic-footer-contact-logo img {
    max-width: 180px;
  }

  .mosaic-footer-socials {
    gap: 0.6rem;
  }
}

/* Sponsors — horizontal auto-scrolling logo strip (second row, dark) */
.mosaic-footer-sponsors {
  padding: 1rem 0;
}

.mosaic-footer-sponsors-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mosaic-text);
  margin-bottom: 1.25rem;
}

.mosaic-footer-slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 84px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mosaic-footer-slider {
  display: flex;
  align-items: center;
  gap: 0;
  /* no gap between the two copies — seamless loop */
  position: absolute;
  /* Each group repeats the partner set, so travel per loop is long; the
     duration is set to keep the scroll at roughly 29px/s. */
  animation: mosaic-footer-slide 52s linear infinite;
  padding: 0;
  width: max-content;
}

.mosaic-footer-sponsor-group {
  display: flex;
  align-items: center;
  gap: 24px;
  /* gap inside each group */
  flex-shrink: 0;
  padding-right: 24px;
  /* trailing gap so the loop join matches the internal gap */
}

@keyframes mosaic-footer-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.mosaic-footer-slider-container:hover .mosaic-footer-slider {
  animation-play-state: paused;
}

/* Partner marks sit straight on the strip — no card chrome, no plate. They are
   sized by height so they read as one row, with a max-width so the very wide
   marks (Sangon is 227x28) do not stretch far longer than the rest. */
.mosaic-footer-partner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mosaic-footer-partner img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.mosaic-footer-partner:hover img {
  opacity: 1;
}

@media (max-width: 768px) {
  .mosaic-footer-partner img {
    height: 24px;
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .mosaic-footer-partner img {
    height: 20px;
    max-width: 120px;
  }
}

/* ============================================================
   COMPONENT 15: EDUCATION PAGE (S·T·E·M journey)
   ============================================================ */

/* The Dry Lab skeleton (COMPONENT 16 — hero, sticky rail, main column),
   recoloured to the Engagement orange of the navbar, like Human Practices.
   Inside it the page runs one S·T·E·M journey: four stage banners, each
   followed by its activities, and inside most activities a smaller S·T·E·M
   run of its own. Stage colours are the Engineering page's DBTL order:
   S blue · T lime · E orange · M pink, carried as --c on each part.
   Markup: wiki/pages/education.html + wiki/edu_macros.html.
   Script: static/education.js. */

/* Hide the default header — the full-screen hero (hero_drylab.html) replaces it. */
.page-education .bg-hero {
  display: none !important;
}

/* Pull the hero up under the fixed navbar so it fills the viewport edge-to-edge. */
.page-education {
  padding-top: 0;
  overflow-x: hidden;
  /* prevent any element from pushing a horizontal scrollbar on mobile */
}

.page-education .fancy-hero-m {
  height: calc(100vh + 56px);
  margin-top: -56px;
}

.page-education .fancy-hero__pin-m {
  height: calc(100vh + 56px);
}

.page-education .container.content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* This page carries its own sticky rail — no global Notion TOC */
.page-education #notion-toc-wrapper {
  display: none;
}

/* ---- Engagement orange ---- */
.page-education .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-orange);
}

.page-education .typing-cursor {
  background: var(--mosaic-orange);
}

.page-education .dl-rail__nav a {
  --rail-accent: var(--mosaic-orange);
}

.page-education .dl-eyebrow {
  color: var(--mosaic-orange);
}

/* A longer rail than the Dry Lab ones: scroll the list rather than squash it. */
.page-education .dl-rail__nav > * {
  flex-shrink: 0;
}

/* ---- rail: one colour per stage, as on the Safety page ----
   The stage entries read as group labels but are links to the stage banners,
   so the scrollspy lights them while a banner is on screen. */
.page-education #dlRailNav a.edu-rail__stage {
  --rail-accent: var(--c);
  margin-top: 14px;
  padding: 9px 14px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
}

.page-education #dlRailNav a[href="#edu-rural"],
.page-education #dlRailNav a[href="#edu-desktiny"] { --rail-accent: var(--mosaic-blue); }

.page-education #dlRailNav a[href="#edu-simulator"],
.page-education #dlRailNav a[href="#edu-workshop"],
.page-education #dlRailNav a[href="#edu-game"] { --rail-accent: var(--mosaic-lime); }

.page-education #dlRailNav a[href="#edu-camp"],
.page-education #dlRailNav a[href="#edu-mun"] { --rail-accent: var(--mosaic-orange); }

.page-education #dlRailNav a[href="#edu-legacy"] { --rail-accent: var(--mosaic-pink); }

/* ---- the motto: "Grow like cells, pass on like life." ----
   The S·T·E·M colours run through the words. */
.edu-motto {
  width: fit-content;
  max-width: 100%;
  margin: 28px auto;
  text-align: center;
}

.dl-main .edu-motto p {
  margin: 0;
}

.edu-motto strong {
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--mosaic-blue), var(--mosaic-lime) 34%, var(--mosaic-orange) 67%, var(--mosaic-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .edu-motto strong {
    color: var(--mosaic-text);
    -webkit-text-fill-color: currentColor;
  }
}

.edu-motto--intro {
  margin-top: 0;
}

.edu-motto--intro strong {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
}

/* ---- the UDL note: a pixel strip on top, as the HP "why" boxes ---- */
.edu-note {
  margin: 20px 0 6px;
  padding: 16px 18px 14px;
  background:
    repeating-linear-gradient(90deg, var(--mosaic-orange) 0 8px, transparent 8px 11px) top / 100% 4px no-repeat,
    color-mix(in srgb, var(--mosaic-orange) 6%, transparent);
  border-radius: 0 0 8px 8px;
}

.dl-main .edu-note p {
  margin: 0;
  color: var(--mosaic-gray);
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 300;
}

/* ---- Tenet: the four stage cards (click to open) ---- */
/* Closed, the four cards are one size: education.js gives every card's head
   the height of the tallest one, so each "Click to expand" sits on the same
   line. Open, a card grows on its own and the others stay closed at the top
   of the row, leaving the room below them — so when one of them opens too,
   its paragraph starts exactly level with the first. In a 2 × 2 grid an open
   top card pushes the row below it down. */
.edu-tenet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  align-items: start;
}

.edu-tenet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

/* the pixel signature — three tiles in the corner */
.edu-tenet-card::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 22px;
  width: 6px;
  height: 6px;
  background: var(--c);
  box-shadow:
    8px 0 0 color-mix(in srgb, var(--c) 55%, transparent),
    8px 8px 0 color-mix(in srgb, var(--c) 25%, transparent);
}

.edu-tenet-card:hover {
  border-color: var(--c);
  transform: translateY(-3px);
}

.edu-tenet-card.is-open {
  border-color: var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 10px 30px color-mix(in srgb, var(--c) 10%, transparent);
}

.edu-tenet-card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 20px 20px 16px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.edu-tenet-card__head:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.edu-tenet-card .hp-glyph {
  margin-bottom: 10px;
}

.edu-tenet-card__word {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--c);
}

.edu-tenet-card__action {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--mosaic-text);
}

.edu-tenet-card__question {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--mosaic-muted);
}

.edu-tenet-card__hint {
  display: none;
  margin-top: 8px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--mosaic-muted);
  opacity: 0.75;
}

.edu-js .edu-tenet-card__hint {
  display: block;
  margin-top: auto;
  padding-top: 8px;
}

.edu-js .edu-tenet-card.is-open .edu-tenet-card__hint {
  display: none;
}

/* The paragraph folds away only when the script is there to open it. */
.edu-tenet-card__detail {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s ease;
}

.edu-js .edu-tenet-card:not(.is-open) .edu-tenet-card__detail {
  grid-template-rows: 0fr;
}

.edu-tenet-card__inner {
  overflow: hidden;
  min-height: 0;
}

.dl-main .edu-tenet-card__inner p {
  margin: 0 20px 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--mosaic-border);
  color: var(--mosaic-gray);
  font-size: 0.875rem;
  line-height: 1.65;
  font-weight: 300;
}

/* ---- Evaluation loop: the HP TRIP cycle as it is (COMPONENT 20) ---- */
.edu-loop .hp-trip-card__name {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  letter-spacing: 0.04em;
}

/* ---- Introduction: the four stages as pixel letters ---- */
.edu-journey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.dl-main a.edu-journey__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 18px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  color: var(--mosaic-text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.dl-main a.edu-journey__stage:hover,
.dl-main a.edu-journey__stage:focus-visible {
  border-color: var(--c);
  color: var(--mosaic-text);
  transform: translateY(-3px);
  outline: none;
}

.edu-journey__flow {
  flex: 1 1 24px;
  max-width: 64px;
}

/* ---- Stage banner (S · T · E · M) ----
   A pixel strip along the top in the stage colour, the big pixel letter on
   the left. The letter starts as grey tiles and takes the colour tile by tile
   when it scrolls in (education.js adds .is-armed, then .is-lit).
   Double class: .dl-section's padding comes later in the file. */
.dl-section.edu-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 36px;
  /* top-aligned: a long intro would otherwise pull the letter down past the title */
  align-items: start;
  margin-top: 40px;
  padding: 64px 0 52px;
}

.edu-stage::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--c) 0 10px, transparent 10px 14px);
}

.edu-stage__glyph {
  padding: 24px;
  background: color-mix(in srgb, var(--c) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  border-radius: 12px;
}

.edu-stage__letter {
  display: block;
  width: clamp(64px, 8vw, 106px);
  height: auto;
}

.edu-stage__letter rect {
  transition: fill 0.5s ease, opacity 0.5s ease;
  transition-delay: var(--d, 0s);
}

.edu-stage.is-armed:not(.is-lit) .edu-stage__letter rect {
  fill: #34343a;
}

.edu-stage__letter rect.is-dim {
  opacity: 0.6;
}

/* .dl-h2 comes later in the file: the double class outranks it */
.dl-h2.edu-stage__title {
  margin: 14px 0 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.04em;
  color: var(--c);
}

/* the rest of a stage title after its "|" (S · SEED has one), quieter */
.edu-stage__sub {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--mosaic-gray);
  vertical-align: middle;
}

.dl-main .edu-stage__text p {
  color: var(--mosaic-gray);
  line-height: 1.8;
  font-weight: 300;
}

/* the S·T·E·M route, this stage lit */
.dl-main .edu-route {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-main .edu-route__tile {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--mosaic-border);
  border-radius: 4px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mosaic-muted);
}

.dl-main .edu-route__tile.is-on {
  background: var(--c);
  border-color: var(--c);
  color: #0a0a0a;
}

/* ---- Activity ---- */
/* .dl-h3 comes later in the file: the double class outranks it */
.dl-h3.edu-activity__title {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 5px solid var(--c);
}

/* "Target Audience and Purpose", "Activity Overview", … — two pixel tiles
   in the stage colour lead each one. Not flex: the handbook's title carries
   an <em>, and flex would eat the space before it. */
.edu-h4 {
  position: relative;
  margin: 32px 0 12px;
  padding-left: 30px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

.edu-h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: var(--c, var(--mosaic-orange));
  box-shadow: 10px 0 0 color-mix(in srgb, var(--c, var(--mosaic-orange)) 45%, transparent);
}

.edu-h5 {
  margin: 24px 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mosaic-gray);
}

/* ---- S·T·E·M run inside an activity ----
   A track down the left with a square tile per step. The track's colour runs
   S → M; education.js uncovers it as the reader moves down (--fill), and
   lights each tile once its step is reached. Without the script both show in
   full. */
.edu-steps {
  position: relative;
  margin: 18px 0 8px;
  padding-left: 52px;
}

.edu-steps__track {
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--mosaic-border);
}

.edu-steps__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--mosaic-blue), var(--mosaic-lime) 33%, var(--mosaic-orange) 66%, var(--mosaic-pink));
  clip-path: inset(0 0 calc(100% - var(--fill, 100%)) 0);
}

.edu-step {
  position: relative;
  padding-bottom: 28px;
}

.edu-step:last-child {
  padding-bottom: 0;
}

.edu-step__node {
  position: absolute;
  left: -52px;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--c);
  border-radius: 4px;
  background: var(--c);
  color: #0a0a0a;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent);
  transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.edu-js .edu-step:not(.is-reached) .edu-step__node {
  background: var(--mosaic-bg);
  color: var(--c);
  box-shadow: none;
}

.edu-step__title {
  margin: 5px 0 12px;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--c);
}

/* a step that opens with a run-in label instead of a heading */
.dl-main .edu-step > p:first-of-type {
  padding-top: 4px;
}

.edu-runin {
  color: var(--c);
}

/* ---- Photos ---- */
.edu-photo {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  cursor: zoom-in;
}

.edu-photo img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.edu-photo:hover img {
  transform: scale(1.03);
}

.edu-photo:focus-visible {
  outline: 2px solid var(--c, var(--mosaic-orange));
  outline-offset: 3px;
}

/* .dl-figure rounds its image; the link around it does the clipping here */
.edu-figure .edu-photo img {
  border-radius: 0;
}

/* A small capture (the Desktiny event windows, ~230 × 400 px), centred in
   the column like any other photo but near its own size: blown up to a
   figure's width it filled the screen with a pixelated window. */
/* double class: .dl-figure's own max-width comes later in the file */
.dl-figure.dl-figure--small {
  max-width: 280px;
}

/* two photos side by side; the pairs in the markdown share a shape, so each
   keeps its own */
.edu-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 20px auto 26px;
  align-items: start;
}

.edu-duo--narrow {
  max-width: 560px;
}

.edu-duo__item {
  margin: 0;
}

/* a run of photos browsed sideways (the Home page's card row, in small) */
.edu-strip {
  margin: 20px 0 26px;
}

.edu-strip__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.edu-strip__track::-webkit-scrollbar {
  display: none;
}

.edu-strip__track:focus-visible {
  outline: 2px solid var(--c, var(--mosaic-orange));
  outline-offset: 4px;
  border-radius: 10px;
}

/* Every frame one height, each as wide as its own photo: the runs mix 4:3
   photos with 16:9 slides and video stills, and a common crop cut the
   slides' edges off. The width/height attributes give each frame its shape
   before the photo loads. */
.edu-strip__item {
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

.edu-strip__item .edu-photo img {
  width: auto;
  height: 280px;
  max-width: min(82vw, 560px);
  object-fit: cover;
}

.edu-strip__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.edu-strip__nav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.62);
  color: var(--mosaic-text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.edu-strip__nav svg {
  width: 52%;
  height: 52%;
}

.edu-strip__nav:hover:not(:disabled),
.edu-strip__nav:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--c, var(--mosaic-orange));
  outline: none;
}

.edu-strip__nav:hover:not(:disabled) svg path {
  stroke-width: 2.5;
}

.edu-strip__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.edu-strip.is-static .edu-strip__nav {
  visibility: hidden;
}

.edu-strip__dots {
  display: flex;
  gap: 6px;
}

.edu-strip__dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 0.25s ease;
}

.edu-strip__dot.is-on {
  background: var(--c, var(--mosaic-orange));
}

/* a picture or video still to come */
.dl-placeholder.edu-pending {
  min-height: 150px;
}

.edu-pending-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

.edu-pending-pair .edu-pending {
  margin-top: 0;
}

/* ---- PDFs ----
   Each is the Notebook page's reader (.nb-doc, COMPONENT 24, notebook.js);
   this only stacks them when an activity has more than one, and colours
   the open button and the focus ring in this page's orange. */
.edu-docs {
  display: grid;
  gap: 16px;
  margin: 18px 0 26px;
}

.edu-docs .nb-doc {
  margin-top: 0;
}

.page-education .dl-main a.nb-doc__btn:hover,
.page-education .dl-main a.nb-doc__btn:focus-visible {
  color: var(--mosaic-orange);
  border-color: var(--mosaic-orange);
}

.page-education .nb-doc__scroll:focus-visible {
  outline-color: var(--mosaic-orange);
}

/* ---- Three videos as one group (M · Merge) ----
   Two 16:9 videos stacked on the left, one 9:16 video on the right as tall
   as the pair. Column widths in proportion so the two sides end level:
   two stacked 16:9 frames of width L are 2 × 9/16 L = 1.125 L tall, and a
   9:16 frame that tall is 1.125 L × 9/16 ≈ 0.633 L wide. The 12px gap
   between the left pair makes the right frame a few pixels taller than
   9:16; the player letterboxes that. */
.edu-videos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.633fr);
  grid-template-areas:
    "a tall"
    "b tall";
  gap: 12px;
  /* As wide as the column allows, but never taller than 75% of the window:
     the group is 1.125 L + 12px tall and 1.633 L + 12px wide (L = the left
     column), so a height of 75vh means a width of 1.452 × (75vh − 12px)
     + 12px. Centred in the column. */
  max-width: min(100% - 16px, 1.452 * (85vh - 12px) + 12px);
  margin: 20px auto 26px;
}

.edu-videos__a { grid-area: a; }
.edu-videos__b { grid-area: b; }

/* the frame's own 16:9 is dropped: it takes the height of the two rows
   (double class: .dl-video__frame comes later in this file) */
.dl-video__frame.edu-videos__tall {
  grid-area: tall;
  aspect-ratio: auto;
  height: 100%;
}

/* phones: one column — the two landscape videos, then the portrait one,
   at a width that keeps it on one screen */
@media (max-width: 640px) {
  .edu-videos {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "a" "b" "tall";
  }

  .dl-video__frame.edu-videos__tall {
    justify-self: center;
    width: min(100%, 300px);
    height: auto;
    aspect-ratio: 9 / 16;
  }
}

/* ---- Accordion: question box, + on the right ---- */
/* A clear border at rest, in the stage colour, so the box reads as a box. */
.edu-acc {
  margin: 22px 0 26px;
  background: var(--mosaic-card);
  border: 1.5px solid color-mix(in srgb, var(--c, var(--mosaic-orange)) 55%, var(--mosaic-border));
  border-radius: 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.edu-acc:hover,
.edu-acc.is-open {
  border-color: var(--c, var(--mosaic-orange));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--mosaic-orange)) 14%, transparent);
}

.edu-acc__h {
  margin: 0;
  font-size: inherit;
}

.edu-acc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--mosaic-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.edu-acc__head:focus-visible {
  outline: 2px solid var(--c, var(--mosaic-orange));
  outline-offset: 2px;
}

/* the + : two bars; the upright one turns flat to make the − */
.edu-acc__icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--c, var(--mosaic-orange)) 55%, transparent);
  border-radius: 50%;
  transition: background-color 0.25s ease;
}

.edu-acc__icon::before,
.edu-acc__icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  background: var(--c, var(--mosaic-orange));
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.edu-acc__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.edu-acc.is-open .edu-acc__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.edu-acc__head:hover .edu-acc__icon {
  background: color-mix(in srgb, var(--c, var(--mosaic-orange)) 14%, transparent);
}

/* Open unless the script has taken over and it is closed. */
.edu-acc__panel {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.4s ease, opacity 0.3s ease;
}

.edu-acc.is-ready:not(.is-open) .edu-acc__panel {
  grid-template-rows: 0fr;
  opacity: 0;
}

.edu-acc__inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 18px;
}

/* the dashed line under the question, above whatever the answer opens with
   — a paragraph, or (WHY the Secretariat?) a sub-heading */
.dl-main .edu-acc__inner > :first-child {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--mosaic-border);
}

.dl-main .edu-acc__inner p {
  color: var(--mosaic-gray);
  font-size: 0.925rem;
  line-height: 1.7;
}

/* sub-headings inside an answer: the stage colour, so they read as one
   level under the box's own question */
.edu-acc__inner .edu-h5 {
  margin: 22px 0 8px;
  color: var(--c, var(--mosaic-orange));
}

/* a decision quoted word for word (CP-9/13, para. 11) */
.dl-main .edu-doc-quote {
  margin: 4px 0 18px;
  padding: 12px 16px 2px;
  border-left: 3px solid var(--c, var(--mosaic-orange));
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
}

.dl-main .edu-doc-quote p {
  color: var(--mosaic-text);
  margin-bottom: 10px;
}

/* ---- Circuit simulator: circuit part -- biological part ---- */
.dl-main .edu-analogy {
  display: grid;
  gap: 12px;
  margin: 16px 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: edu-analogy;
}

.dl-main .edu-analogy__item {
  position: relative;
  margin: 0;
  padding: 16px 18px 4px 64px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  counter-increment: edu-analogy;
}

.edu-analogy__item::before {
  content: counter(edu-analogy) ".";
  position: absolute;
  left: 18px;
  top: 16px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
  color: var(--c);
}

.dl-main .edu-analogy__pair {
  margin-bottom: 8px;
  font-weight: 700;
}

.edu-analogy__sep {
  margin: 0 4px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color: var(--c);
}

.edu-analogy__bio {
  color: var(--c);
}

.dl-main .edu-analogy__item p:last-child {
  color: var(--mosaic-gray);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* A cross-reference from one activity on this page to another: wikilinks.py
   marks it data-lk-preview -> data-lk-inline, and the wiki-links layer
   (COMPONENT 21) paints every inline link in var(--branch) or, failing that,
   the page's own navbar colour. This page has no --branch; what it has is
   --c, the colour of the stage the link sits in, so the link reads as part of
   its stage the way the Human Practices cross-references read as part of
   their chapter. Scoped to .dl-main: the preview windows are outside it.

   The games' own boxes below are now question boxes (.edu-acc); .edu-game*
   is kept in case the plain cards are wanted back. */
.page-education .dl-main a[data-lk-inline]:not(.lk-backlinks__link),
.page-education .dl-main a[data-lk-inline]:not(.lk-backlinks__link):hover,
.page-education .dl-main a[data-lk-inline]:not(.lk-backlinks__link):focus-visible {
  color: var(--c, var(--lk-h, var(--mosaic-orange)));
}

/* ---- SynBio games ---- */
.edu-games {
  display: grid;
  gap: 12px;
  margin: 18px 0 8px;
}

.edu-game {
  padding: 18px 20px 4px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
}

.edu-game__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.edu-game__num {
  display: inline-block;
  margin-right: 10px;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-radius: 4px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  color: var(--c);
  vertical-align: 1px;
}

.dl-main .edu-game p {
  color: var(--mosaic-gray);
  font-size: 0.925rem;
  line-height: 1.7;
}

/* ---- MUN: the S·T·E·M of one motion (a third level of the journey) ---- */
.dl-main .edu-procedure {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 18px 0 20px;
  padding: 0;
  list-style: none;
}

.dl-main .edu-procedure__step {
  position: relative;
  margin: 0;
  padding: 16px 14px 12px;
  background:
    repeating-linear-gradient(90deg, var(--c) 0 8px, transparent 8px 11px) top / 100% 4px no-repeat,
    color-mix(in srgb, var(--c) 7%, transparent);
  border-radius: 0 0 8px 8px;
  color: var(--mosaic-gray);
  font-size: 0.85rem;
  line-height: 1.55;
}

.edu-procedure__step strong {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 4px;
  border-radius: 4px;
  background: var(--c);
  color: #0a0a0a;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 1.25rem;
  vertical-align: middle;
}

/* a pixel chevron between the steps, in the colour of the step it leaves */
.edu-procedure__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 33px;
  right: -15px;
  width: 4px;
  height: 4px;
  background: var(--c);
  box-shadow:
    -4px -4px 0 var(--c), -4px 4px 0 var(--c),
    -8px -8px 0 var(--c), -8px 8px 0 var(--c);
}

/* ---- MUN agenda table: the state's first word as a coloured tag ---- */
.edu-state {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--s);
  color: #0a0a0a;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.edu-state--detailed { --s: var(--mosaic-lime); }
.edu-state--partly { --s: var(--mosaic-orange); }
.edu-state--open { --s: var(--mosaic-pink); }
.edu-state--written { --s: var(--mosaic-blue); }

.edu-state--placeholder {
  background: none;
  border: 1px dashed var(--mosaic-muted);
  color: var(--mosaic-muted);
}

.edu-agenda td:first-child {
  font-weight: 600;
}

/* ---- responsive ---- */
/* ---- The rail chip (education.js draws it) ----
   In the mascot's place at the foot of the rail. A core with STEM in it,
   four branches with one node per activity, and four layers that switch on
   as the reader reaches each stage:
     S  STEM lights white and the blue S branch grows out; the rest stays grey
     T  the other branches grow out one after another, each in its colour
     E  the nodes pulse and points of light run along the traces, out and in
     M  new points keep budding from the nodes and settle into small groups
   Each layer stays on once reached, so in M all four play together. A click
   on a stage in the rail plays that stage's layer alone for a moment. */
.edu-chip {
  position: relative;
  flex-shrink: 0;
  margin-top: auto;
  /* clear the back-to-top bubble, as the mascot does */
  margin-bottom: 96px;
  padding-top: 12px;
  border-top: 1px solid var(--mosaic-border);
}

.edu-chip__svg {
  display: block;
  width: 100%;
  height: auto;
}

.chip-layer {
  transition: opacity 0.5s ease;
}

/* base: the grey board */
.chip-frame {
  fill: #0e0e10;
  stroke: #2c2c32;
  stroke-width: 1.5;
}

.chip-base {
  fill: none;
  stroke: #26262b;
  stroke-width: 2;
}

.chip-leaf {
  fill: #141416;
  stroke: #34343a;
  stroke-width: 1.5;
}

/* S — STEM in the core */
.chip-word {
  font-family: 'Lexend', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  fill: #ffffff;
}

.chip-word--base {
  fill: #34343a;
}

/* a dark outline round the letters keeps the word clear of the tiles */
.chip-word {
  paint-order: stroke;
  stroke: #0e0e10;
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* the mosaic behind the word: faint grey on the board, the four stage
   colours once lit, a third of the tiles slowly breathing */
.chip-mosaic-base {
  fill: #1c1c20;
}

.chip-mosaic-tile {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.edu-chip.ph-s .chip-mosaic-tile,
.edu-chip.solo-s .chip-mosaic-tile {
  opacity: var(--o, 0.25);
  transition-delay: var(--d, 0s);
}

.edu-chip.ph-s .chip-mosaic-tile.is-breathing,
.edu-chip.solo-s .chip-mosaic-tile.is-breathing {
  animation: eduChipBreathe var(--bt, 3.4s) ease-in-out var(--bd, 0s) infinite;
}

@keyframes eduChipBreathe {
  0%, 100% { opacity: var(--o, 0.25); }
  50% { opacity: calc(var(--o, 0.25) * 2.2); }
}

.chip-core .chip-word {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.edu-chip.ph-s .chip-core .chip-word,
.edu-chip.solo-s .chip-core .chip-word {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55));
}

/* the traces, drawn out from the core. No delay on the way back, so a
   reader scrolling up sees them retract at once; the delays that make the
   branches grow in turn are given where they light. */
.chip-trace {
  fill: none;
  stroke-width: 2;
  stroke-linecap: butt;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  opacity: 0.75;
}

/* S: the S branch alone */
.edu-chip.ph-s .chip-trace[data-b="S"] {
  stroke-dashoffset: 0;
  transition-delay: var(--d, 0s), 0s;
}

/* T: the other branches, one after another */
.edu-chip.ph-t .chip-trace {
  stroke-dashoffset: 0;
  transition-delay: var(--d, 0s), 0s;
}

/* a T replay from the rail: all four in turn, S first */
.edu-chip.solo-t .chip-trace {
  stroke-dashoffset: 0;
  transition-delay: var(--dr, 0s), 0s;
}

/* the branch of the activity being read, a little brighter */
.edu-chip .chip-trace.is-hot {
  opacity: 1;
}

/* a node lights once its trace has reached it */
.chip-leaf-lit {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.4s ease;
}

.edu-chip.ph-s .chip-leaf-lit[data-b="S"],
.edu-chip.ph-t .chip-leaf-lit {
  opacity: 1;
  transition-delay: var(--d, 0s);
}

.edu-chip.solo-t .chip-leaf-lit {
  opacity: 1;
  transition-delay: var(--dr, 0s);
}

.edu-chip.solo-e .chip-leaf-lit,
.edu-chip.solo-m .chip-leaf-lit {
  opacity: 1;
}

/* E — the nodes pulse */
.edu-chip.ph-e .chip-leaf-lit,
.edu-chip.solo-e .chip-leaf-lit {
  animation: eduChipPulse 1.6s ease-in-out infinite;
  animation-delay: var(--pd, 0s);
}

@keyframes eduChipPulse {
  0%, 100% { transform: scale(1); filter: none; }
  50% { transform: scale(1.28); filter: brightness(1.5); }
}

.chip-pulse {
  fill: #ffffff;
}

/* the node of the activity being read */
.chip-marker {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip-marker.is-on {
  opacity: 0.9;
}

.chip-hit {
  fill: transparent;
  cursor: pointer;
}

/* a stage played alone: every other layer steps back */
.edu-chip.is-solo .chip-layer {
  opacity: 0.12;
}

.edu-chip.solo-s .chip-l-s,
.edu-chip.solo-t .chip-l-t,
.edu-chip.solo-e .chip-l-e,
.edu-chip.solo-m .chip-l-m,
.edu-chip.solo-t .chip-l-leaf,
.edu-chip.solo-e .chip-l-leaf,
.edu-chip.solo-m .chip-l-leaf,
.edu-chip.solo-s .chip-l-t,
.edu-chip.solo-s .chip-l-leaf,
.edu-chip.is-solo .chip-l-board {
  opacity: 1;
}

/* S played alone is STEM and the S branch: the other branches step back */
.edu-chip.solo-s .chip-trace:not([data-b="S"]) {
  opacity: 0.12;
}

.edu-chip.solo-s .chip-leaf-lit:not([data-b="S"]) {
  opacity: 0;
}

.edu-chip.solo-s .chip-trace[data-b="S"] {
  stroke-dashoffset: 0;
}

.edu-chip.solo-s .chip-leaf-lit[data-b="S"] {
  opacity: 1;
}

/* reduced motion: the M layer as a few groups that are already settled */
.chip-still {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.edu-chip.ph-m .chip-still,
.edu-chip.solo-m .chip-still {
  opacity: 0.85;
}

/* the traces regrow on a T replay: snap back without a transition first */
.edu-chip .chip-trace.is-reset {
  transition: none;
  stroke-dashoffset: 100;
}

@media (max-width: 1180px) {
  .edu-tenet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dl-main .edu-procedure {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edu-procedure__step:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .dl-section.edu-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 48px 0 40px;
  }

  .edu-stage__glyph {
    justify-self: start;
    padding: 16px;
  }

  .edu-stage__letter {
    width: 56px;
  }

  .dl-h2.edu-stage__title {
    font-size: 2rem;
  }

  .edu-steps {
    padding-left: 40px;
  }

  .edu-steps__track {
    left: 12px;
  }

  .edu-step__node {
    left: -40px;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .edu-step__title {
    margin-top: 2px;
  }

  .edu-duo,
  .edu-pending-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .edu-strip__item .edu-photo img {
    height: 210px;
  }

  .edu-journey {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edu-journey__flow {
    display: none;
  }

  .dl-main a.edu-journey__stage {
    min-width: 0;
  }

  .dl-main .edu-analogy__item {
    padding-left: 18px;
    padding-top: 44px;
  }

  /* Phones: a document takes nearly the full width of the screen — out past
     the column's padding, and out of a step's indent — so its pages are
     drawn as large as the screen allows. */
  .edu-docs {
    margin-left: -12px;
    margin-right: -12px;
  }

  .edu-step .edu-docs {
    margin-left: -52px;
  }
}

@media (max-width: 560px) {
  .edu-tenet,
  .dl-main .edu-procedure {
    grid-template-columns: minmax(0, 1fr);
  }

  .edu-procedure__step::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .edu-tenet-card,
  .edu-tenet-card__detail,
  .edu-acc__panel,
  .edu-acc__icon::before,
  .edu-acc__icon::after,
  .edu-photo img,
  .edu-stage__letter rect,
  .edu-step__node,
  .chip-layer,
  .chip-core .chip-word,
  .chip-trace,
  .chip-leaf-lit,
  .chip-marker,
  .chip-still {
    transition: none;
  }

  .edu-chip .chip-leaf-lit,
  .edu-chip .chip-mosaic-tile {
    animation: none !important;
  }

  .chip-mosaic-tile {
    transition: none;
  }

  .edu-tenet-card:hover,
  .edu-photo:hover img {
    transform: none;
  }
}

/* ============================================================
   COMPONENT 16: DRY LAB PAGES (Model · Software · Hardware)
   ============================================================ */

/* The three Dry Lab pages share one skeleton: a full-screen hero, then a
   sticky left rail (the page's own table of contents — the global Notion TOC
   is hidden here) beside a centred main column. Unlike the Education rail,
   there is no chip diagram: the nav list is the whole rail.
   The accent throughout is the blue of the navbar's Dry Lab entry.
   Human Practices (.page-hp) reuses this skeleton with the Engagement orange,
   and the Wet Lab pages (.page-wetlab) with the Wet Lab lime — see their
   components at the end of this file. */

/* Hide the default header — the full-screen hero (hero_drylab.html) replaces it. */
.page-drylab .bg-hero,
.page-hp .bg-hero,
.page-wetlab .bg-hero,
.page-engineering .bg-hero {
  display: none !important;
}

/* Pull the hero up under the fixed navbar so it fills the viewport edge-to-edge. */
.page-drylab,
.page-hp,
.page-wetlab,
.page-engineering {
  padding-top: 0;
  overflow-x: hidden;
  /* prevent any element from pushing a horizontal scrollbar on mobile */
}

.page-drylab .fancy-hero-m,
.page-hp .fancy-hero-m,
.page-wetlab .fancy-hero-m,
.page-engineering .fancy-hero-m {
  height: calc(100vh + 56px);
  margin-top: -56px;
}

.page-drylab .fancy-hero__pin-m,
.page-hp .fancy-hero__pin-m,
.page-wetlab .fancy-hero__pin-m,
.page-engineering .fancy-hero__pin-m {
  height: calc(100vh + 56px);
}

.page-drylab .container.content,
.page-hp .container.content,
.page-wetlab .container.content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* This page carries its own sticky rail — no global Notion TOC */
.page-drylab #notion-toc-wrapper,
.page-hp #notion-toc-wrapper,
.page-wetlab #notion-toc-wrapper {
  display: none;
}

.dl-container {
  display: flex;
}

/* ---- sticky left rail ---- */
.dl-rail {
  position: sticky;
  /* Flush to the top: the fixed navbar hides itself on downward scroll, so a
     top:56px offset would leave a gap above the rail once the navbar is gone. */
  top: 0;
  height: 100svh;
  width: 280px;
  min-width: 280px;
  background: var(--mosaic-dark);
  border-right: 1px solid var(--mosaic-border);
  /* Clears the fixed navbar: without the page name above it, the first entry
     was landing under the logo. */
  padding: 70px 20px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 5;
  box-sizing: border-box;
}

.dl-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  /* Let the list scroll internally if it doesn't fit the viewport */
  overflow-y: auto;
  margin-right: -6px;
  padding-right: 6px;
}

/* Slim scrollbar inside the rail nav */
/* These rails were briefly spread with `justify-content: space-between` to use
   the height of the column, which is worth knowing before anyone tries it
   again: the nav is 644px tall and an entry is 52px, so a rail with three
   entries — Software — came out with 155px between them, and Hardware with
   103px. There is no way to fill that column from three entries without gaps
   that size, and gaps that size read as a fault rather than as a layout. Every
   rail now takes the same 12px gap and lets the room fall below the list, the
   way the Human Practices rail does. */

.dl-rail__nav::-webkit-scrollbar {
  width: 4px;
}

.dl-rail__nav::-webkit-scrollbar-thumb {
  background: var(--mosaic-border);
  border-radius: 3px;
}

.dl-rail__nav::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

.dl-rail__nav a {
  --rail-accent: var(--mosaic-blue);
  position: relative;
  overflow: hidden;
  /* Without this the column squeezes every entry to fit rather than letting
     the nav scroll — a fixed-height line box inside `overflow: hidden` then
     slices the bottom off each label. Only shows up once a page has enough
     entries to overflow the rail. */
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #d1d5db;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  /* Hover paints the accent from the left edge inwards: the background image
     is the accent at rest and grows from 0 to full width. */
  background-image: linear-gradient(
    color-mix(in srgb, var(--rail-accent) 10%, transparent),
    color-mix(in srgb, var(--rail-accent) 10%, transparent));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  transition: color 0.3s ease, background-size 0.7s ease, transform 0.3s ease;
}

/* Left indicator bar — appears on hover, stays lit when active */
.dl-rail__nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--rail-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hover arrow */
.dl-rail__nav a::after {
  content: '→';
  margin-left: auto;
  font-size: 0.8125rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dl-rail__nav a:hover {
  color: var(--rail-accent);
  background-size: 100% 100%;
  transform: translateX(5px);
}

.dl-rail__nav a:hover::before,
.dl-rail__nav a:hover::after {
  opacity: 1;
}

.dl-rail__nav a.active {
  color: var(--rail-accent);
  background-color: color-mix(in srgb, var(--rail-accent) 15%, transparent);
  font-weight: 700;
}

.dl-rail__nav a.active::before {
  opacity: 1;
}

.dl-rail__label {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-muted);
  opacity: 0.6;
  margin-top: 24px;
  margin-bottom: 6px;
  padding-left: 12px;
  text-transform: uppercase;
}

.dl-rail__label:first-child {
  margin-top: 0;
}

/* ---- main column ---- */
.dl-main {
  flex: 1;
  min-width: 0;
  /* Fill whatever is left beside the rail rather than sitting in a fixed
     1100px column with a margin either side of it. That fixed width was what
     left a strip of empty page down the right — narrow on a 1440 window, half
     the screen once zoomed out or on a wide monitor — because the column
     stopped growing while the viewport did not. Pinning the width is a no-op in
     the row direction, where flex-basis already wins, and it is what keeps the
     ≤900px stack from sizing to its widest table instead of the container. */
  width: 100%;
  /* Body copy at the light end of Lexend's range; headings, bold runs and
     table heads keep their own heavier weights. */
  font-weight: 300;
  /* Wider gutters than 40px: the text now runs at ~85% of its old width,
     which gives the full-width column visible breathing room at both edges.
     The 13px term keeps that ratio exact as the window grows — main width is
     the window less the 280px rail, and the percentage resolves against the
     window. */
  padding: 0 calc(7.5% + 13px) 60px;
}

.dl-section {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--mosaic-border);
  /* Rail links are plain anchors, so land the section clear of the fixed
     navbar. The Overview sections carry no eyebrow, so without this their
     heading would end up underneath it. */
  scroll-margin-top: 80px;
}

.dl-section:last-child {
  border-bottom: none;
}

.dl-eyebrow {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--mosaic-blue);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* The navbar already says which page this is, and the section headings say
   what they open; the rail's own page name and the small repeat of it above
   every top-level heading only said it a third and fourth time. Kept in the
   markup — the names still mean something to anyone reading the templates —
   and taken out of the page here. */
.dl-rail__label--page,
.dl-eyebrow {
  display: none;
}

.dl-h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
}

.dl-desc {
  color: var(--mosaic-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  font-weight: 300;
  max-width: 760px;
}

.dl-quote {
  font-style: italic;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--mosaic-text);
  margin-top: 12px;
}

/* Overview — colourful arc bar above the mission line, width matched to it
   by hugging the quote's width via fit-content */
.dl-overview-bar-line {
  width: fit-content;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dl-overview-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--mosaic-gradient-h);
  margin-bottom: 18px;
}

/* Left-rail callout box — a thick MOSAIC-accent left bar plus padding.
   Applied only to key statements, never to body paragraphs. */
.dl-callout {
  border-left: 5px solid var(--mosaic-blue);
  padding-left: 16px;
}

.dl-callout--blue {
  border-left-color: var(--mosaic-blue);
}

.dl-callout--lime {
  border-left-color: var(--mosaic-lime);
}

.dl-callout--orange {
  border-left-color: var(--mosaic-orange);
}

.dl-callout--pink {
  border-left-color: var(--mosaic-pink);
}

.dl-callout--purple {
  border-left-color: var(--mosaic-purple);
}

/* Empty slot waiting for real content from the Dry Lab team */
.dl-placeholder {
  min-height: 84px;
  border: 1px dashed var(--mosaic-border);
  border-radius: 6px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mosaic-muted);
  opacity: 0.85;
  font-size: 0.7812rem;
  text-align: center;
  background: var(--mosaic-dark);
  padding: 18px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

/* An empty slot that should read as a data table rather than a paragraph */
.dl-placeholder--table {
  min-height: 140px;
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .dl-container {
    flex-direction: column;
  }

  /* Hide the sticky rail on mobile — the page just scrolls */
  .dl-rail {
    display: none;
  }

  .dl-main {
    padding: 0 20px 40px;
  }
}

@media (max-width: 640px) {
  .dl-quote {
    font-size: 0.9688rem;
  }
}

/* ============================================================
   COMPONENT 16b: SOFTWARE PAGE BODY
   (ML4OCRP · Hardware · Desktiny)

   Every class below is new. The .dl-* vocabulary is shared with the
   Wet Lab pages and the Human Practices page, so nothing here may
   change an existing rule — additions only.
   ============================================================ */

/* A block heading (ML4OCRP / Hardware / Desktiny) opening a run of sections.
   It is its own .dl-section so the rail can scroll to it, but it carries no
   bottom rule of its own — the first section under it draws that line. */
.dl-block {
  border-bottom: none;
  padding-bottom: 0;
}

.dl-block .dl-h2 {
  margin-bottom: 0;
}

/* One level under .dl-h2 — the sections inside a block. */
.dl-h3 {
  /* The Description page's scale, applied to every page that uses .dl-h3:
     Section 28px / Layer 24px under a 35.2px Part and 20px body. */
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
  /* A long single word (Characterisation, Transformation) is wider than a
     320px column at this size. */
  overflow-wrap: break-word;
}

/* The bar on its own at the top of the column. It has to be given a width —
   .dl-overview-bar-line is width: fit-content, sized to the mission line the
   Education page puts under its bar, and with no line under this one the
   wrapper would collapse to nothing. */
.dl-page-bar {
  width: 100%;
  margin: 16px 0 0;
}

/* nothing sits under the bar here, so its own bottom margin has nothing to
   separate it from */
.dl-page-bar .dl-overview-bar {
  margin-bottom: 0;
}

/* The bar opens the page, so the block under it should not also carry a whole
   section's worth of space above — that read as if the bar were a divider
   between two sections rather than the top of the first one. */
.dl-page-bar + .dl-section {
  padding-top: 28px;
}

/* ---- body copy ---- */
/* No measure cap: the copy follows the column, which follows the window. A
   fixed 860px line used to stop two thirds of the way across a wide window and
   leave the rest of the row empty — the gap grew with the window and with any
   zoom-out, which read as the page being stuck to the left. */
.dl-main p {
  margin: 0 0 14px;
}

.dl-main ul,
.dl-main ol {
  margin: 0 0 16px;
  padding-left: 1.3rem;
}

.dl-main li {
  margin-bottom: 8px;
}

.dl-main li > ul,
.dl-main li > ol {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* The version entries under Optimisation iteration lead with a bold label
   paragraph; it should hug the paragraph that follows rather than sit in its
   own block of space. */
.dl-main li > p:first-child {
  margin-bottom: 6px;
}

/* This page inverts the site default: links are the red one and the coloured
   inline text is the blue one (elsewhere it is blue links, and code in lime). */
.dl-main a {
  color: var(--mosaic-pink);
  /* A bare URL is a single unbreakable token. The ML4OCRP repository link is
     521 px wide, wider than a phone, and dragged the whole page sideways —
     the link, and everything after it, sat off-screen. Breaking the token
     only happens when it cannot fit, so ordinary links are unaffected. */
  overflow-wrap: anywhere;
}

.dl-main a:hover {
  color: color-mix(in srgb, var(--mosaic-pink) 70%, #ffffff);
}

/* Inline cross-page links are coloured by the wikilinks layer, which paints
   them in the colour of the page they sit on — coherent, but it means every
   link here reads as Software blue. This page is asked for red, so the colour
   is overridden and nothing else: the layer's extra weight, its underline on
   hover and its preview popovers all stay.
   Scoped to .page-software rather than .page-drylab, which the Wet Lab pages
   and the Human Practices page also carry. */
.page-software .dl-main a[data-lk-inline] {
  color: var(--mosaic-pink);
}

.page-software .dl-main a[data-lk-inline]:hover,
.page-software .dl-main a[data-lk-inline]:focus-visible {
  color: color-mix(in srgb, var(--mosaic-pink) 70%, #ffffff);
}

/* ---- code ---- */
.dl-main code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.85em;
  /* Outside the body copy's light weight: file and symbol names are read
     character by character, and thin monospace smears at this size. */
  font-weight: 400;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mosaic-blue);
}

.dl-main pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--mosaic-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

/* Inside a block the chip background would double up on the padding. */
.dl-main pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  color: inherit;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
}

/* ---- tables ----
   Quiet rules rather than a bordered box: these sit inside prose and a box
   would read as a component of its own. */
.dl-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 20px;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* A table will not shrink below the width its longest cell needs, so where the
   column is narrower than that the table used to push the whole page sideways —
   a horizontal scrollbar on the window, and everything on it looking shifted.
   Wrapping it is what the wrapper is for. */
.dl-table-wrap {
  overflow-x: auto;
}

.dl-table th,
.dl-table td {
  text-align: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--mosaic-border);
  vertical-align: top;
}

/* Columns the generator found to be short throughout. Centred like every other
   cell — the point of this rule is only that nothing in the column wraps: a
   squeezed column breaks "773 bp" across two lines, and takes its heading
   ("Default value") with it. Columns with any long cell in them are left out,
   so a list-valued cell can still wrap instead of widening the table. */
.dl-table th.nw,
.dl-table td.nw {
  white-space: nowrap;
}

/* Columns holding sentences rather than values. Centring prose leaves both
   edges ragged, so these stay left-aligned while short cells centre. */
.dl-table th.txt,
.dl-table td.txt {
  text-align: left;
}

.dl-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
}

.dl-table tbody tr:last-child td {
  border-bottom: none;
}

/* The seven-column score table cannot shrink below its own min-content width on
   a phone, and a table that overflows its parent takes the whole page with it.
   Let it scroll on its own instead. Below 900px only: on a wide screen the
   tables fit and this would just change how the rows lay out. */
@media (max-width: 900px) {
  .dl-table {
    display: block;
    overflow-x: auto;
  }
}

/* ---- figures ---- */
.dl-figure {
  margin: 20px auto 26px;
  max-width: 520px;          /* a plot run to the column width dwarfs the prose */
}

.dl-figure--wide {
  max-width: 720px;          /* charts and screenshots need the room */
}

.dl-figure--full {
  max-width: 100%;           /* wide schematics */
}

/* Drawings drawn in code rather than delivered as pictures — the Software
   interactive figures and the two Description mechanism schematics — are
   laid out at the column's width, so the wider body gutters would have
   scaled them down too. They are pulled back out to the width they had
   before: 8.8235% is exactly the share the gutters added (0.075 / 0.85),
   so the figure keeps the old full-column size at any window width. Only
   above 900px, where the wide gutters apply. */
@media (min-width: 901px) {
  .dl-main figure.dl-figure--full:has(> svg) {
    max-width: none;
    margin-left: -8.8235%;
    margin-right: -8.8235%;
  }
}

/* The two Description schematics stay inside the text measure: at the full
   pulled-out width they were wider than the prose they explain. */
@media (min-width: 901px) {
  .page-description .dl-main figure.dl-figure--full:has(> svg.desc-construct) {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Two views of the same thing, side by side: the source gives these pairs a
   single caption, and stacking them down the column would read as two separate
   figures. The caption spans both. */
.dl-figure--pair {
  max-width: 720px;
  display: grid;
  /* A pair is two views of one thing, so the two drawings should end on the
     same line. Equal columns do not do that: given a portrait and a landscape
     the same width, one stands half as tall again as the other, and the pair
     reads as ragged. Sizing the columns in proportion to the two drawings'
     aspect ratios makes the shared height fall out of the arithmetic — both
     are then the figure's width over the sum of the ratios — and it stays
     right at every width without cropping either drawing. A figure that does
     not set the two ratios keeps the equal split it had. */
  grid-template-columns: var(--pair-a, 1fr) var(--pair-b, 1fr);
  gap: 14px;
  align-items: start;
}

.dl-figure--pair figcaption {
  grid-column: 1 / -1;
}

/* A pair sits side by side, so the stacked-image gap below must not apply to
   it: it pushed the second drawing 14px down and the two never shared a line.
   The exclusion lives on the base rule rather than as a `margin-top: 0` here —
   the two selectors have the same specificity, so a later rule would win and
   this one would quietly do nothing. */


@media (max-width: 640px) {
  .dl-figure--pair {
    grid-template-columns: 1fr;
  }
}

.dl-figure--widget {
  max-width: 280px;          /* a tall desktop-widget capture, shown near its
                                own pixel width rather than stretched */
}

.dl-figure--tall {
  max-width: 380px;          /* a phone-shaped capture: at the 520 px default a
                                1206 × 2622 screenshot runs twice the column */
}

.dl-figure img,
.dl-figure > svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

/* A figure can hold more than one image when the source gives the pair a single
   shared caption (figures 2-6 and 2-7 do). Without a gap the two stack flush
   and read as one picture. */
.dl-figure:not(.dl-figure--pair) img + img {
  margin-top: 14px;
}

/* Same caption treatment as the Engineering page's figures — one style for
   captions across the site, so a reader does not have to relearn it per page.
   .dl-parts-figure is the grid wrapper's own caption, which sits outside
   .dl-parts and so needs naming here; .dl-table-caption is a table's, sitting
   under the table in a <p>; .hw3d is the 3D viewer, which on the Hardware page
   is a numbered figure like any other. */
.dl-figure figcaption,
.dl-parts-figure > figcaption,
.dl-table-caption,
.hw3d figcaption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
  font-weight: 700;
  color: var(--mosaic-text);
}

/* A run of small uniform renders sharing one caption — the printed part
   breakdown on the Hardware page. One image per .dl-figure would stack eleven
   of them down the column. */
.dl-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.8rem;
  max-width: 560px;
  margin: 1.25rem auto 0;
}

.dl-parts figure {
  margin: 0;
  text-align: center;
}

.dl-parts img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.dl-parts figcaption {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
  color: var(--mosaic-text);
}

/* A render that opens a 3D view of that one part; the button carries the node
   name inside the loaded model (see static/hardware3d.js). Kept as a bare
   wrapper so the grid's own layout is untouched, with the same lift the
   Engineering page's part grid uses. */
.dl-part {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.dl-part img {
  transition: transform 0.25s ease;
}

.dl-part:hover img,
.dl-part:focus-visible img {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--mosaic-blue);
}

.dl-part:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 3px;
  border-radius: 8px;
}

/* The line under a part's name saying what it does. Not bold and not the
   caption colour: it is a note about the part, not the part's label. */
.dl-parts__note {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.94em;
  color: rgba(243, 244, 246, 0.62);
}

/* ---- interactive inline figures ----
   Hovering a node fades the rest and swaps the caption line for that node's
   description; see the figure block in static/drylab.js. The :has() rule is the
   no-JS path, .is-focus is the one the script drives (and the only one that can
   work on touch, where there is no hover to key off). */
.dlfig-node {
  transition: opacity 0.18s ease;
}

.dlfig:has(.dlfig-node:hover) .dlfig-node:not(:hover),
.dlfig.is-focus .dlfig-node:not(.is-active) {
  opacity: 0.28;
}

.dlfig-node:hover,
.dlfig-node.is-active {
  opacity: 1;
}

/* The hover read-out, in the corner of the drawing — same pattern as the
   Human Practices map card: dark panel, a left bar in the diagram's own accent,
   and it never covers the caption below. */
.dlfig-figure {
  position: relative;
}

.dlfig-card {
  /* Positioned by static/drylab.js from the pointer, so it can sit at the
     cursor's upper-left or upper-right and flip near the viewport edge. */
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: rgba(10, 10, 12, 0.93);
  border: 1px solid var(--mosaic-border);
  border-left: 3px solid var(--mosaic-blue);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;          /* never steals the hover that opened it */
  opacity: 0;
  visibility: hidden;
  /* Same reveal as the link-preview windows: a 6px rise, no scale. Kept as a
     transition rather than their keyframe so the way out animates too. */
  transform: translateY(6px);
  /* visibility is discrete, so on the way out it is delayed by exactly the
     length of the fade — otherwise the panel would blink off before fading. */
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out,
    visibility 0s linear 0.18s;
}

.dlfig-figure.is-focus .dlfig-card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out,
    visibility 0s;                 /* visible straight away on the way in */
}

.dlfig-card__title {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--mosaic-text);
}

.dlfig-card__blurb {
  margin: 0;
  font-size: 0.7812rem;
  line-height: 1.55;
  font-weight: 300;
  color: var(--mosaic-muted);
}

/* On a phone the card would cover the drawing, so it docks under the figure
   instead of floating at the tap point. */
@media (max-width: 640px) {
  .dlfig-figure {
    display: flex;
    flex-direction: column;
  }

  .dlfig-card {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 10px;
    order: 1;                      /* after the drawing, before the caption */
  }

  .dlfig-figure figcaption {
    order: 2;
  }
}

/* On a touch screen :hover latches after a tap, which would leave the figure
   dimmed with no way back. The script's tap handler takes over there. */
@media (hover: none) {
  .dlfig:has(.dlfig-node:hover) .dlfig-node:not(:hover) {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The .is-focus selector is needed as well: it is more specific than the bare
     class, so without it the reveal would keep animating here. */
  .dlfig-node,
  .dlfig-card,
  .dlfig-figure.is-focus .dlfig-card {
    transition: none;
  }
}

/* ---- code highlighting ----
   Token colours for the vendored highlight.js (see static/code-highlight.js).
   This is the editor palette a reader already knows from writing code — muted
   blue for keywords, warm red-brown strings, pale green numbers, yellow for
   function and class names, light blue for variables and properties — rather
   than the five MOSAIC colours, so a code block reads as code at a glance.
   The surface is whatever .dl-main pre paints. */
.hljs {
  color: #d4d4d4;
  background: none;
}

.hljs-comment,
.hljs-quote {
  color: #6a9955;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-tag,
.hljs-link {
  color: #569cd6;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-meta .hljs-string {
  color: #ce9178;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet {
  color: #b5cea8;
}

.hljs-title,
.hljs-title.function_,
.hljs-title.class_,
.hljs-section,
.hljs-name,
.hljs-built_in,
.hljs-meta {
  color: #dcdcaa;
}

.hljs-type,
.hljs-class {
  color: #4ec9b0;
}

.hljs-variable,
.hljs-template-variable,
.hljs-attr,
.hljs-attribute,
.hljs-params,
.hljs-property,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id {
  color: #9cdcfe;
}

.hljs-operator,
.hljs-punctuation {
  color: #d4d4d4;
}

.hljs-deletion { color: #f44747; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ---- KaTeX blocks (typeset by static/math.js) ---- */
.dl-math-block {
  margin: 6px 0 20px;
  overflow-x: auto;
}

.dl-math {
  font-size: 0.9375rem;
}

/* Inline maths sits inside a sentence, so it inherits the paragraph's size
   rather than taking the display size above. static/math.js typesets this
   class with displayMode:false — see the note in that file. */
.dl-math-inline {
  font-size: 1em;
}

/* ---- numbered steps in GUI: WebOcrp ---- */
.dl-steps > li {
  margin-bottom: 24px;
}

/* Group labels in the rail, one colour per group. Same mapping as the bar down
   the left of each section heading and the bands inside the diagrams, so the
   colour means the same thing everywhere on the page. The base label is muted
   to 0.6; these raise it so the colour actually reads at 11px. */
/* Accent per group, the way the Education page does it: the colour belongs to
   the links, not to the group label above them. Group labels stay the muted
   dividers they already are; hovering or landing on a link is what shows the
   colour, in the text, the tint, the left bar and the arrow (all of which the
   base .dl-rail__nav rules already drive off --rail-accent). */
.page-software #dlRailNav a[href^="#dl-ml4-"] { --rail-accent: var(--mosaic-pink); }
.page-software #dlRailNav a[href^="#dl-hw-"]  { --rail-accent: var(--mosaic-lime); }
.page-software #dlRailNav a[href^="#dl-dt-"]  { --rail-accent: var(--mosaic-orange); }

/* The page's own name, sitting above the group labels: a size up from them so
   the rail reads as page → groups → sections. Scoped to this page because the
   Wet Lab pages carry a .dl-rail__label as their first child too. */
.page-software #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-blue);
  opacity: 1;
}

/* ---- Model: the Software page's rail treatment, colour for colour ----
   Page name blue, then pink / lime / orange down the three models. The same
   three colours drive each section's h3 left bar (see the CALLOUT map in
   projects/wiki-tools/make-model-page.py), so a colour means one thing across
   the rail, the headings and the diagrams — which is the point of the scheme.
   Scoped by page: these are the dry lab pages' colours, not a shared set. */
.page-model #dlRailNav a[href^="#dl-cre-"]   { --rail-accent: var(--mosaic-pink); }
.page-model #dlRailNav a[href^="#dl-unmix-"] { --rail-accent: var(--mosaic-lime); }
.page-model #dlRailNav a[href^="#dl-crs-"]   { --rail-accent: var(--mosaic-orange); }

.page-model #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-blue);
  opacity: 1;
}

/* ---- Hardware: the same rail treatment, one accent per group ----
   Blue is the page itself (the Overview group and the page name), lime is
   RATIO Pocket and orange is RATIO Bench. Each colour is also the colour of
   that group's section callouts down the left of the headings, so a colour
   means one device across the rail and the prose — the scheme the Model and
   Software pages use. */
.page-hardware #dlRailNav a[href="#dl-problem"],
.page-hardware #dlRailNav a[href="#dl-assumption"] { --rail-accent: var(--mosaic-blue); }

.page-hardware #dlRailNav a[href^="#dl-hw-"] { --rail-accent: var(--mosaic-lime); }
.page-hardware #dlRailNav a[href^="#dl-rb-"] { --rail-accent: var(--mosaic-orange); }

.page-hardware #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-blue);
  opacity: 1;
}

/* The wikilinks layer paints inline cross-page links in the colour of the page
   they sit on; Model wants them in the page's own link colour instead. Same
   override the Software page makes, and for the same reason. */
.page-model .dl-main a[data-lk-inline] {
  color: var(--mosaic-pink);
}

.page-model .dl-main a[data-lk-inline]:hover,
.page-model .dl-main a[data-lk-inline]:focus-visible {
  color: color-mix(in srgb, var(--mosaic-pink) 70%, #ffffff);
}

/* Sub-heading inside a section: the source's stage and M1..M7 levels. One step
   under the section's .dl-h3 callout, and deliberately without a bar of its
   own so the bars stay one-per-section as they are elsewhere. */
.dl-h4 {
  font-size: 24px;
  font-weight: 700;
  color: var(--mosaic-text);
  margin: 28px 0 10px;
}

/* Minor label inside a sub-section ("Mathematical assumptions", "Parameters",
   "Results") — quiet enough to read as a division of one, not a new level. */
.dl-h5 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
  margin: 22px 0 8px;
}

/* There was a `--dense` variant here that crammed the nav down to 9px/12px
   entries and 4px gaps: the Dry Lab rails used to list every h3 as well as
   every h2, and twenty entries do not fit a 100svh column. Those rails are
   down to their headings now, and a rail that is sized differently from the
   Human Practices one for no reason is just an inconsistency — every rail
   takes the default sizing above. */

/* ============================================================
   COMPONENT 17: IDLE MASCOT (Dry Lab rail)
   ============================================================ */

/* The MOSAIC logo, sitting at the bottom of the Dry Lab left rail and left to
   idle on its own — see static/mascot.js for the behaviour. This block only
   places it and styles the little it does; the logo itself is the shared
   .mosaic-logo-anim system, and its breathing is the shared CSS wave.
   Kept out of COMPONENT 16 because it is a brand component that merely lives
   on these pages for now — moving it elsewhere is an include change. */

.mosaic-mascot {
  position: relative;
  /* Never let flex squash it: it has no in-flow content (the logo box is
     absolutely positioned), so it would otherwise collapse to its border. */
  flex-shrink: 0;
  margin-top: auto;
  /* Clear the back-to-top bubble (fixed at bottom 24px, 70px tall). */
  margin-bottom: 96px;
  /* border-box: 1px rule + 16px gap + the 158.4px scaled logo. An explicit
     height is required — absolutely positioned children contribute nothing,
     so `auto` would collapse the box. */
  height: 176px;
  border-top: 1px solid var(--mosaic-border);
}

.mosaic-mascot .mosaic-logo-anim {
  position: absolute;
  /* The containing block of an absolutely positioned child is the padding box,
     so an equivalent padding-top on the parent would sit *below* it. */
  top: 16px;
  left: 50%;
  margin-left: -144px;           /* half of the 288px logo box */
  transform: scale(0.55);
  /* Centred origin: `top left` would leave the cloud ~34px left of the rail's
     centre line. */
  transform-origin: top center;
  transition: opacity 0.6s ease, transform 0.18s ease;
}

/* Poke — upward only. There is only ~22px of clearance to the back-to-top
   button, and .dl-rail clips anything that leaves the rail. */
.mosaic-mascot.is-poked .mosaic-logo-anim {
  transform: translateY(-8px) scale(0.55);
}

.mosaic-mascot.is-asleep .mosaic-logo-anim {
  opacity: 0.55;
}

/* ---- blink ----
   An animation, not a transform transition: growIn() leaves `transform:
   scale(1)` inline on every tile it fades in, and inline beats a plain
   stylesheet rule — so a class-driven transform would work on reused tiles and
   silently do nothing on freshly created ones, and which is which changes every
   morph. Animations outrank inline style, and !important is needed to outrank
   the .has-flow breathing rule. Clobbering the wave here is free: the eyes are
   black on both flow endpoints, so no colour shift is visible. */
.mosaic-mascot .mosaic-tile.is-blinking {
  animation: mosaic-blink 0.26s ease !important;
}

@keyframes mosaic-blink {
  50% { transform: scaleY(0.1); }
}

/* There was a white-eye override here, first on every mascot and then, after a
   round of "make the other pages' eyes black", on the Dry Lab ones only. It is
   gone: the mascot wears the mark's own eyes, the two tiles the shared colour
   tables paint black. The blink above clobbers the breathing wave, which is
   free precisely because those two tiles are black at both ends of it — so if
   anyone puts colour back into the eyes, re-check the blink first. */

/* Too short for the rail to hold both the section list and the mascot. */
@media (max-height: 640px) {
  .mosaic-mascot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-mascot .mosaic-logo-anim {
    transition: none;
  }

  .mosaic-mascot .mosaic-tile.is-blinking {
    animation: none !important;
  }
}

/* ============================================================
   COMPONENT 18: REFERENCES
   ============================================================ */

/* Markup comes from wiki/references.html — the .cite marker in the body and
   the .refs list at the end of the page. Pages supply their own wrapper
   styling through the macro's section_class, so nothing here assumes a
   particular page layout. */

/* The in-text [n] marker, sitting right after the claim it supports. */
.cite a {
  color: var(--mosaic-blue);
  text-decoration: none;
  font-size: 0.72em;
  font-weight: 700;
  padding: 0 1px;
}

.cite a:hover {
  text-decoration: underline;
}

/* An id that is not in REFS. Shown, never hidden — a silently missing
   reference is worse than an ugly one. */
.cite--broken {
  color: var(--mosaic-pink);
  font-weight: 700;
  cursor: help;
}

.refs__heading {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 14px;
}

/* Numbered [1], [2], ... with a hanging indent, the way a reference list is
   set in a paper: the label sits in the margin and a wrapped line starts under
   the entry text, not under the number. The bracket form is also what the
   in-text cite() markers use, so [3] in the prose and [3] in the list are
   visibly the same thing. */
.refs__list {
  list-style: none;
  counter-reset: refs;
  padding-left: 0;
  color: var(--mosaic-muted);
  font-size: 0.8438rem;
  line-height: 1.75;
}

.refs__list li {
  position: relative;
  counter-increment: refs;
  padding-left: 2.7em;
  margin-bottom: 10px;
  transition: color 0.4s ease;
}

.refs__list li::before {
  content: "[" counter(refs) "]";
  position: absolute;
  left: 0;
  font-variant-numeric: tabular-nums;
}

/* The entry a jump landed on prints in white; the rest of the list stays the
   muted grey. Covers both routes in: :target for a shared #ref- link opened
   directly, and .ref-target for the click handler, which sets it explicitly
   because history.replaceState does NOT update :target. The mark is left in
   place rather than timed out — the reader is looking at that line. */
.refs__list li:target,
.refs__list li.ref-target {
  color: var(--mosaic-text);
}

/* The way back. A jump into the bibliography used to be one-way: the reader
   got the entry and lost the sentence. The arrow sits on the entry they landed
   on, at the end of its line, and returns them to the [n] they pressed. */
.refs__list li > .ref-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.45em;
  padding: 0.15em 0.3em;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--mosaic-blue);
  line-height: 1;
  vertical-align: -0.05em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.refs__list li > .ref-back svg {
  display: block;
  width: 0.95em;
  height: 0.95em;
  flex: none;
}

/* The arrow alone is a symbol the reader has to decode; the words say where
   the press goes. */
.refs__list li > .ref-back .ref-back__label {
  margin-left: 0.35em;
  font-size: 0.92em;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.refs__list li > .ref-back:hover,
.refs__list li > .ref-back:focus-visible {
  color: #ffffff;
  background: rgba(36, 184, 236, 0.18);
}

/* The citation the reader came back to, so the return trip also lands on
   something visible rather than on a page that looks unchanged. */
.cite a.cite-return {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.refs__list a {
  color: var(--mosaic-blue);
  text-decoration: none;
  word-break: break-word;
}

.refs__list a:hover {
  text-decoration: underline;
}

/* Journal / book titles, italicised inside the entry. */
.refs__list i {
  color: var(--mosaic-text);
}

/* ============================================================
   COMPONENT 19: ALGORITHM LISTING (Software page)
   ============================================================ */

/* The nine procedures of the ML4OCRP workflow, set on the page rather than kept
   as screenshots: a reader can select the text, search it, and read it at their
   own zoom level, none of which a picture of pseudocode allows.

   Set as a numbered procedure in the page's own body type, not as a LaTeX
   float. The float — a rule above and below, a caption box, a monospaced
   listing, numbered lines — is a paper convention and does not appear on the
   iGEM wikis that publish a procedure at all; those set it as an ordinary
   indented, numbered list under a heading of its own. That is also what this
   site's prose already looks like, so the listing reads as part of the page
   instead of as an object dropped into it. */

.dl-algos {
  display: grid;
  /* minmax(0, 1fr), not the default `auto`: an auto column is sized to its
     widest item's max-content width, so one long line of pseudocode would push
     the whole listing — and with it the page — past the viewport. */
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
  margin: 30px 0 10px;
}

/* The workflow step a run of algorithms belongs to — the same grouping the
   table above uses. */
.dl-algos__step {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
  margin: 0 0 -16px;
}

.dl-algos__group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

.dl-algo {
  /* The statement numbers count up from here, so each algorithm starts at 1
     however many came before it. */
  counter-reset: algoline;
  scroll-margin-top: 90px;
}

/* A heading, not a chip: the number belongs to the title the way a section
   number does, and the boxed, monospaced label it used to carry was one of the
   loudest things in the run. */
.dl-algo__title {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--mosaic-text);
}

.dl-algo__num {
  margin-right: 8px;
  white-space: nowrap;
}

/* Input / Output, the two lines every one of these opens with. */
.dl-algo__io {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  color: var(--mosaic-muted);
}

.dl-algo__io-k {
  font-weight: 700;
  color: var(--mosaic-text);
}

.dl-algo__body {
  margin: 14px 0 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  /* A single term — a long \mathrm{} identifier or a whole call — typesets as
     one unbreakable box, so on a narrow screen the listing scrolls its own
     longest lines instead of widening the page under the reader. */
  overflow-x: auto;
}

/* One step per line. A statement carries the number; a for/if line does not, so
   the counter only advances on the statements, and the empty ::before keeps a
   control line's text in the same column as the numbered ones. --i is the
   line's indent level. */
.dl-algo__line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 6px calc(var(--i, 0) * 1.6rem);
  min-width: 0;
}

.dl-algo__body > .dl-algo__line:last-child {
  margin-bottom: 0;
}

.dl-algo__line::before {
  content: '';
  flex: 0 0 1.5rem;
}

.dl-algo__line--stmt::before {
  counter-increment: algoline;
  content: counter(algoline);
  text-align: right;
  color: var(--mosaic-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.dl-algo__line--ctrl {
  color: var(--mosaic-muted);
}

.dl-algo__line--ctrl strong {
  color: var(--mosaic-text);
}

/* The tinted chip behind an inline identifier is right in a paragraph of prose
   and wrong in a procedure: one line can carry four of them, and the boxes were
   most of what made the listing look busy. The colour stays — it is the site's
   colour for code — but the padding and background go. */
.dl-algo__body code {
  background: none;
  padding: 0;
}

/* The trailing comments the source hung off the right margin. Inline here: the
   column is as wide as the window, so a right-aligned comment ends up a screen
   away from the step it belongs to. */
.dl-algo__cmt {
  color: var(--mosaic-muted);
  font-size: 0.875rem;
}

/* ============================================================
   COMPONENT 20: HUMAN PRACTICES PAGE
   ============================================================ */

/* The Dry Lab skeleton (COMPONENT 16 — hero, sticky rail, main column),
   recoloured to the Engagement orange of the navbar. The research tree that
   drives the map, outline and journey lives in wiki/hp_tree.html. */

.page-hp .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-orange);
}

.page-hp .typing-cursor {
  background: var(--mosaic-orange);
}

.page-hp .dl-rail__nav a {
  --rail-accent: var(--mosaic-orange);
}

/* This rail is a little longer than the Dry Lab ones: when the window is too
   short, scroll the list instead of squashing its links, so the spacing and
   the mascot underneath stay exactly as on the Hardware page. */
.page-hp .dl-rail__nav > * {
  flex-shrink: 0;
}

.page-hp .dl-eyebrow {
  color: var(--mosaic-orange);
}

/* A target the map or outline just jumped to — one soft pulse */
.hp-flash {
  animation: hpFlash 1.5s ease-out;
  border-radius: 6px;
}

@keyframes hpFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--branch, var(--mosaic-orange)) 70%, transparent); background-color: color-mix(in srgb, var(--branch, var(--mosaic-orange)) 18%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; background-color: transparent; }
}

/* ---- Research Map (static/hp.js) ----
   No box: the map sits straight on the page over a dot grid that fades out
   toward the edges. Flat MOSAIC shapes, right-angled traces. */
.hp-map {
  position: relative;
  height: clamp(520px, 78vh, 760px);
  margin-top: 20px;
  user-select: none;
}

.hp-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 78%);
  pointer-events: none;
}

.hp-map__svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.hp-map__svg:active {
  cursor: grabbing;
}

/* touch screens scroll the page until "Tap to explore" (d3 sets touch-action inline) */
.hp-map:not(.is-live) .hp-map__svg {
  touch-action: pan-y !important;
}

.hp-map__svg text {
  font-family: inherit;
}

/* controls — top-left: the info card takes the top-right, and the bottom-right
   corner is where the site's fixed accessibility / back-to-top buttons float */
.hp-map__controls {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.hp-map__btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--mosaic-border);
  background: rgba(20, 20, 22, 0.88);
  color: var(--mosaic-text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hp-map__btn--reset {
  font-size: 0.8rem;
}

.hp-map__btn:hover,
.hp-map__btn:focus-visible {
  border-color: var(--mosaic-orange);
  color: var(--mosaic-orange);
  outline: none;
}

/* info card (noesis-style) */
.hp-map__card {
  --node: var(--mosaic-orange);
  position: absolute;
  top: 12px;
  right: 12px;
  width: 290px;
  padding: 14px 34px 14px 16px;
  background: rgba(20, 20, 22, 0.94);
  border: 1px solid var(--mosaic-border);
  border-left: 3px solid var(--node);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  user-select: text;
  animation: hpCardIn 0.25s ease;
}

@keyframes hpCardIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.hp-map__card-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  color: var(--mosaic-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.hp-map__card-close:hover {
  color: var(--mosaic-text);
}

.hp-map__card-type {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--node);
}

.hp-map__card-title {
  margin: 4px 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--mosaic-text);
}

.hp-map__card-blurb {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--mosaic-muted);
}

.hp-map__card-meta {
  margin: 0 0 8px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  color: var(--mosaic-gray);
}

.hp-map__card-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--node);
  text-decoration: none;
}

.hp-map__card-link:hover {
  text-decoration: underline;
}

.hp-map__crumb {
  margin: 8px 0 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--mosaic-muted);
  text-align: center;
}

/* touch screens: "Tap to explore" / "Done" pills */
.hp-map__gate,
.hp-map__done {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--mosaic-orange);
  background: rgba(20, 20, 22, 0.92);
  color: var(--mosaic-text);
  font-size: 0.85rem;
  cursor: pointer;
}

.hp-map__done {
  height: auto;
  min-width: 0;
}

/* traces */
.hp-link {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: round;
}

.hp-link.is-path {
  filter: brightness(1.3);
}

/* nodes */
.hp-node {
  cursor: pointer;
  outline: none;
}

.hp-node__hit {
  fill: transparent;
}

.hp-node__shape {
  transition: filter 0.2s ease;
}

.hp-node:hover .hp-node__shape {
  filter: brightness(1.2);
}

.hp-node__chip {
  stroke-width: 1.5;
}

/* The two Synthetic Systems module tiles: a heavier chip, so "Waste
   Degradation" and "Modular Synthesis" read as the two modules of
   Applications rather than as two more leaves of the branch. */
.hp-node__module {
  stroke-width: 2.5;
}

/* A side exploration given its own bordered box — the industrial-fermentation
   branch under "3 Literature". Outlined rather than filled, so it separates
   itself without reading as a step in the sequence. */
.hp-node__box {
  stroke-width: 1.5;
}

.hp-node.is-dropped .hp-node__chip {
  stroke-dasharray: 4 3;
}

.hp-node__sel {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hp-node.is-selected .hp-node__sel {
  opacity: 1;
}

.hp-node:focus-visible .hp-node__sel {
  opacity: 1;
  stroke: var(--mosaic-orange);
}

/* the pixel has arrived */
.hp-node.is-hit .hp-node__sel {
  animation: hpHit 0.6s ease-out;
}

@keyframes hpHit {
  0% { stroke: var(--node); stroke-width: 5; opacity: 1; }
  100% { stroke: #fff; stroke-width: 1.5; opacity: 1; }
}

.hp-node__label {
  fill: var(--mosaic-text);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: #000;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.hp-node__label--hub {
  fill: var(--mosaic-gray);
  stroke: none;
}

.hp-node__label--box {
  fill: #e5e7eb;
  stroke: none;
}

.hp-node__label--module {
  fill: #f3f4f6;
  stroke: none;
  letter-spacing: 0.01em;
}

.hp-node__label--topic {
  fill: #e5e7eb;
  stroke: none;
}

.hp-node__label--topic.is-dropped {
  fill: var(--mosaic-orange);
}

.hp-node__label--sub {
  fill: var(--mosaic-gray);
}

.hp-node__label--detail {
  fill: var(--mosaic-muted);
}

.hp-node__mark {
  fill: #141416;
  text-anchor: middle;
  font-weight: 800;
  pointer-events: none;
}

.hp-node__tag {
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hp-node__tag text {
  fill: #141416;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
}

.hp-node.is-open .hp-node__tag {
  opacity: 0;
}

/* ---- shared MOSAIC bits ----
   Square tiles everywhere: the pixel "signature" in card corners, pixel
   arrows (square dashes + a stepped head) and tile avatars. */
/* No measure cap, for the same reason .dl-main carries none on the Wet Lab
   pages: the copy follows the column, which follows the window. A 760px cap
   stopped the Preface and Mission two thirds of the way across a wide window
   and broke lines far earlier than the same prose breaks on Design or
   Results. Cards keep their own width — only the words outside them run to
   the column. */
.hp-prose {
  margin-top: 18px;
}

/* Preface and Mission are page copy. They carry NO type of their own, so they
   resolve to exactly what .dl-main p resolves to on the Design, Model and
   Results pages — same size, same line height, same colour, same weight.
   .hp-prose keeps only its measure. Do not add font rules here: any one of
   them is what would make this page read differently from the others. */
.hp-prose p {
  margin: 0 0 14px;
}

/* Section descriptions on this page are page copy too, so they take the
   column's width rather than .dl-desc's 760px measure. */
.page-hp .dl-desc {
  font-size: 1rem;
  max-width: none;
}

.hp-mono {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

/* pixel arrow, built on a 6px grid:
     - a still, dim track of square dots (12px apart) that stops short of the head
     - the head: a five-pixel chevron in the travel direction (::after)
     - ::before is a hidden layer that the TRIP loop below turns into either a
       running pixel (long arrows) or a dot-by-dot fill (short arrows); plain
       arrows elsewhere stay still.
   A horizontal arrow is 30px tall with the track on its middle row; a vertical
   one is 30px wide. */
.hp-flow {
  --c: var(--mosaic-muted);
  --track: color-mix(in srgb, var(--c) 38%, transparent);
  --px: color-mix(in srgb, var(--c) 40%, #ffffff);
  position: relative;
  display: block;
  background-repeat: no-repeat;
}

.hp-flow--right,
.hp-flow--left {
  height: 30px;
  background-image: repeating-linear-gradient(90deg, var(--track) 0 6px, transparent 6px 12px);
  background-size: calc(100% - 18px) 6px;
}

.hp-flow--right { background-position: 0 12px; }
.hp-flow--left  { background-position: 100% 12px; }

.hp-flow--up,
.hp-flow--down {
  width: 30px;
  background-image: repeating-linear-gradient(180deg, var(--track) 0 6px, transparent 6px 12px);
  background-size: 6px calc(100% - 18px);
}

.hp-flow--down { background-position: 12px 0; }
.hp-flow--up   { background-position: 12px 100%; }

/* the head */
.hp-flow::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--c);
}

.hp-flow--right::after { right: 0;  top: 12px;
  box-shadow: -6px -6px 0 var(--c), -6px 6px 0 var(--c), -12px -12px 0 var(--c), -12px 12px 0 var(--c); }
.hp-flow--left::after  { left: 0;   top: 12px;
  box-shadow: 6px -6px 0 var(--c), 6px 6px 0 var(--c), 12px -12px 0 var(--c), 12px 12px 0 var(--c); }
.hp-flow--down::after  { bottom: 0; left: 12px;
  box-shadow: -6px -6px 0 var(--c), 6px -6px 0 var(--c), -12px -12px 0 var(--c), 12px -12px 0 var(--c); }
.hp-flow--up::after    { top: 0;    left: 12px;
  box-shadow: -6px 6px 0 var(--c), 6px 6px 0 var(--c), -12px 12px 0 var(--c), 12px 12px 0 var(--c); }

/* the moving layer — hidden until the TRIP loop animates it */
.hp-flow::before {
  content: '';
  position: absolute;
  opacity: 0;
}

/* long arrows: one bright pixel with a short trail runs up to the head */
@keyframes hpRunRight {
  0%        { left: 16px; opacity: 1; animation-timing-function: steps(16, end); }
  15%       { left: calc(100% - 24px); opacity: 1; }
  17%, 100% { left: calc(100% - 24px); opacity: 0; }
}
@keyframes hpRunLeft {
  0%        { right: 16px; opacity: 1; animation-timing-function: steps(16, end); }
  15%       { right: calc(100% - 24px); opacity: 1; }
  17%, 100% { right: calc(100% - 24px); opacity: 0; }
}
@keyframes hpRunUp {
  0%        { bottom: 16px; opacity: 1; animation-timing-function: steps(28, end); }
  15%       { bottom: calc(100% - 24px); opacity: 1; }
  17%, 100% { bottom: calc(100% - 24px); opacity: 0; }
}

/* short arrows: the very same pixel and trail, at the same hop size and the
   same pace per hop as the long ones — it just has fewer hops to make
   (4 hops = 0.3s = 3.75% of the 8s cycle) */
@keyframes hpRunDownShort {
  0%          { top: 0; opacity: 1; animation-timing-function: steps(4, end); }
  3.75%       { top: calc(100% - 24px); opacity: 1; }
  5.75%, 100% { top: calc(100% - 24px); opacity: 0; }
}
@keyframes hpRunUpShort {
  0%          { bottom: 0; opacity: 1; animation-timing-function: steps(4, end); }
  3.75%       { bottom: calc(100% - 24px); opacity: 1; }
  5.75%, 100% { bottom: calc(100% - 24px); opacity: 0; }
}

/* the head glows softly as the pixel arrives */
@keyframes hpArrive {
  0%, 14%   { filter: none; }
  17%       { filter: brightness(1.8); }
  28%, 100% { filter: none; }
}
@keyframes hpArriveShort {
  0%, 3%    { filter: none; }
  5.5%      { filter: brightness(1.8); }
  16%, 100% { filter: none; }
}

/* tile avatar: a 4×4 mosaic in the branch colour (hp-page.js fills it), or a photo */
.hp-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px;
  background: var(--mosaic-dark);
  border: 2px solid var(--mosaic-border);
  border-radius: 10px;
  overflow: hidden;
}

.hp-tiles i {
  border-radius: 1px;
  background: var(--branch, var(--mosaic-orange));
}

.hp-tiles img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Mission: number tiles ---- */
.hp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.hp-stat {
  position: relative;
  padding: 20px 18px 16px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 8px;
}

/* the pixel signature — three tiles in the corner */
.hp-stat::before,
.hp-row__card::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 22px;
  width: 6px;
  height: 6px;
  background: var(--c, var(--branch));
  box-shadow:
    8px 0 0 color-mix(in srgb, var(--c, var(--branch)) 55%, transparent),
    8px 8px 0 color-mix(in srgb, var(--c, var(--branch)) 25%, transparent);
}

.hp-stat__num {
  display: block;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}

.hp-stat__label {
  display: block;
  margin-top: 10px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
}

/* ---- TRIP cycle ----
   T R on top, P I below; the hub column carries the T→R arrow, the pixel
   diamond and the I→P arrow; the side rows carry R↓I and P↑T. */
.hp-trip {
  margin-top: 28px;
}

.hp-trip__cycle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  grid-template-rows: auto 72px auto;
  grid-template-areas:
    "t  hub r"
    "pt hub ri"
    "p  hub i";
}

.hp-trip-card--t { grid-area: t; }
.hp-trip-card--r { grid-area: r; }
.hp-trip-card--i { grid-area: i; }
.hp-trip-card--p { grid-area: p; }

.hp-trip-card {
  position: relative;
  padding: 20px 20px 16px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.hp-trip-card:hover {
  border-color: var(--c);
  transform: translateY(-3px);
}

.hp-trip-card.is-linked {
  cursor: pointer;
}

.hp-trip-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hp-glyph {
  flex: none;
  fill: var(--c);
}

.hp-glyph rect {
  transition: opacity 0.2s ease;
}

.hp-trip-card:hover .hp-glyph rect:nth-child(odd) {
  opacity: 0.55;
}

.hp-trip-card__step {
  margin: 0 0 3px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
}

.hp-trip-card__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
}

.hp-trip-card__text {
  margin: 14px 0 12px;
  color: var(--mosaic-gray);
  font-size: 0.9375rem;
  line-height: 1.7;
  font-weight: 300;
}

.hp-trip-card__input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 10px;
  border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--mosaic-text);
}

.hp-trip-card__input svg {
  width: 16px;
  height: 16px;
  color: var(--c);
}

.hp-trip__hub {
  grid-area: hub;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 58px 0;
}

.hp-trip__hub .hp-flow--right,
.hp-trip__hub .hp-flow--left {
  width: calc(100% - 30px);
}

/* the four arrows of the loop, each in its source stage's colour (the
   hp-flow--m arrows are the phone layout's column version of the same loop) */
.hp-flow--tr,
.hp-flow--m1 { --c: var(--mosaic-blue); }
.hp-flow--ri,
.hp-flow--m2 { --c: var(--mosaic-lime); }
.hp-flow--ip,
.hp-flow--m3 { --c: var(--mosaic-orange); }
.hp-flow--pt,
.hp-trip__return { --c: var(--mosaic-pink); }

.hp-flow--ri { grid-area: ri; justify-self: center; align-self: center; height: 52px; }
.hp-flow--pt { grid-area: pt; justify-self: center; align-self: center; height: 52px; }

.hp-flow--m,
.hp-trip__return {
  display: none;
}

/* long arrows (T→R, I→P, and the phone's return line): the running pixel */
.hp-flow--tr::before,
.hp-flow--ip::before,
.hp-trip__return::before {
  width: 6px;
  height: 6px;
  background: var(--px);
}

.hp-flow--tr::before { top: 12px; left: 16px;
  box-shadow: -8px 0 0 color-mix(in srgb, var(--c) 70%, transparent), -16px 0 0 color-mix(in srgb, var(--c) 30%, transparent); }
.hp-flow--ip::before { top: 12px; right: 16px;
  box-shadow: 8px 0 0 color-mix(in srgb, var(--c) 70%, transparent), 16px 0 0 color-mix(in srgb, var(--c) 30%, transparent); }
.hp-trip__return::before { left: 12px; bottom: 16px;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 70%, transparent), 0 16px 0 color-mix(in srgb, var(--c) 30%, transparent); }

/* short arrows (R→I, P→T, and the phone's T↓R↓I↓P): the same running pixel.
   It starts right at the tail; the box clips its trail, so the trail slides
   in from the tail instead of hanging outside the arrow. */
.hp-flow--ri,
.hp-flow--pt,
.hp-flow--m {
  overflow: hidden;
}

.hp-flow--ri::before,
.hp-flow--pt::before,
.hp-flow--m::before {
  left: 12px;
  width: 6px;
  height: 6px;
  background: var(--px);
}

.hp-flow--ri::before,
.hp-flow--m::before {
  top: 0;
  box-shadow: 0 -8px 0 color-mix(in srgb, var(--c) 70%, transparent), 0 -16px 0 color-mix(in srgb, var(--c) 30%, transparent);
}

.hp-flow--pt::before {
  bottom: 0;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 70%, transparent), 0 16px 0 color-mix(in srgb, var(--c) 30%, transparent);
}

/* ---- the TRIP loop: one calm 8s cycle shared by the diamond, the arrows
   and (on small screens) the cards ----
   T's quarter of the diamond lights; as it fades, T's arrow carries the light
   to R; R's quarter lights; then on to I, P, and back to T. Two seconds per
   stage. (Each delay is written into the same rule as its animation, so
   nothing more specific can reset it.) */
/* Long runs take 1.2s and short ones 0.3s; each starts so that its pixel
   arrives just as the next quarter of the diamond lights up (T at 0.4s,
   R at 2.4s, I at 4.4s, P at 6.4s). P→T's short run starts at 8.3s, i.e.
   0.3s into the next loop. */
.hp-trip .hp-flow--tr::before     { animation: hpRunRight     8s 1.4s infinite; }
.hp-trip .hp-flow--m1::before     { animation: hpRunDownShort 8s 2.3s infinite; }
.hp-trip .hp-flow--ri::before     { animation: hpRunDownShort 8s 4.3s infinite; }
.hp-trip .hp-flow--m2::before     { animation: hpRunDownShort 8s 4.3s infinite; }
.hp-trip .hp-flow--ip::before     { animation: hpRunLeft      8s 5.4s infinite; }
.hp-trip .hp-flow--m3::before     { animation: hpRunDownShort 8s 6.3s infinite; }
.hp-trip .hp-flow--pt::before     { animation: hpRunUpShort   8s 0.3s infinite; }
.hp-trip .hp-trip__return::before { animation: hpRunUp        8s 7.4s infinite; }

.hp-trip .hp-flow--tr::after { animation: hpArrive      8s 1.4s infinite; }
.hp-trip .hp-flow--m1::after { animation: hpArriveShort 8s 2.3s infinite; }
.hp-trip .hp-flow--ri::after,
.hp-trip .hp-flow--m2::after { animation: hpArriveShort 8s 4.3s infinite; }
.hp-trip .hp-flow--ip::after { animation: hpArrive      8s 5.4s infinite; }
.hp-trip .hp-flow--m3::after { animation: hpArriveShort 8s 6.3s infinite; }
.hp-trip .hp-flow--pt::after { animation: hpArriveShort 8s 0.3s infinite; }

/* a stage's outgoing arrow lights up while its card is hovered */
.hp-trip__cycle:has(.hp-trip-card--t:hover) .hp-flow--tr,
.hp-trip__cycle:has(.hp-trip-card--r:hover) .hp-flow--ri,
.hp-trip__cycle:has(.hp-trip-card--i:hover) .hp-flow--ip,
.hp-trip__cycle:has(.hp-trip-card--p:hover) .hp-flow--pt {
  --track: var(--c);
}

.hp-trip__core {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hp-diamond {
  width: 132px;
  height: 132px;
}

.hp-diamond__t { fill: var(--mosaic-blue); }
.hp-diamond__r { fill: var(--mosaic-lime); }
.hp-diamond__i { fill: var(--mosaic-orange); }
.hp-diamond__p { fill: var(--mosaic-pink); }
.hp-diamond__c { fill: var(--mosaic-text); opacity: 0.85; }

/* each quarter rests dim, brightens on its turn, then dims again */
.hp-diamond__t,
.hp-diamond__r,
.hp-diamond__i,
.hp-diamond__p {
  opacity: 0.28;
  animation: hpQuarter 8s ease-in-out infinite backwards;
}

/* 2s apart; each one eases up over ~0.6s, holds ~1.5s, eases down ~0.8s */
.hp-diamond__t { animation-delay: 0.4s; }
.hp-diamond__r { animation-delay: 2.4s; }
.hp-diamond__i { animation-delay: 4.4s; }
.hp-diamond__p { animation-delay: 6.4s; }

@keyframes hpQuarter {
  0%        { opacity: 0.28; }
  8%, 26%   { opacity: 1; }
  36%, 100% { opacity: 0.28; }
}

.hp-trip__why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

/* a pixel strip on top instead of a solid border */
.hp-why {
  padding: 16px 16px 14px;
  background:
    repeating-linear-gradient(90deg, var(--c) 0 8px, transparent 8px 11px) top / 100% 4px no-repeat,
    color-mix(in srgb, var(--c) 6%, transparent);
  border-radius: 0 0 8px 8px;
}

.hp-why__q {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--c);
}

.hp-why__a {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--mosaic-gray);
}

/* ---- Journey timeline (NYU-Abu-Dhabi structure, MOSAIC skin) ----
   A track down the left with a square tile per card; group headings sit on
   the track as square pins. The coloured fill grows as cards scroll in. */
.hp-chapter__title {
  border-left: 5px solid var(--branch);
  padding-left: 14px;
}

.hp-chapter .hp-chapter__eyebrow {
  color: var(--branch);
}

.hp-chapter__count {
  margin: 6px 0 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--branch);
}

.hp-timeline {
  --track-x: 32px;
  --dot: 64px;
  --rail-w: 290px;
  position: relative;
  margin-top: 24px;
  padding-bottom: 8px;
}

.hp-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--track-x) - 1px);
  width: 2px;
  overflow: hidden;
  background: var(--mosaic-border);
}

/* one solid colour: the chapter's own */
.hp-track__fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: var(--branch);
  transition: height 0.5s cubic-bezier(0.22, 0.7, 0.26, 1);
}

/* group headings on the track */
.hp-group {
  position: relative;
  padding: 26px 0 4px calc(var(--track-x) + 26px);
  scroll-margin-top: 96px;
}

.hp-group__pin {
  position: absolute;
  left: calc(var(--track-x) - 7px);
  top: 31px;
  width: 14px;
  height: 14px;
  background: var(--branch);
}

.hp-group--d1 .hp-group__pin {
  left: calc(var(--track-x) - 6px);
  width: 12px;
  height: 12px;
  background: var(--mosaic-bg, #000);
  border: 2px solid var(--branch);
}

.hp-group--d2 .hp-group__pin {
  left: calc(var(--track-x) - 4px);
  top: 30px;
  width: 8px;
  height: 8px;
  background: color-mix(in srgb, var(--branch) 60%, transparent);
}

/* Three heading levels on the track. They used to shrink and fade as they
   went deeper, which left "4.2 Phase 1 Research Objectives" smaller and
   greyer than the card titles under it. Now each level stays a heading: the
   top two take weight and size, and the third takes the chapter's colour so
   it reads as a heading rather than as body copy. */
.hp-group__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--mosaic-text);
}

.hp-group--d1 .hp-group__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mosaic-text);
}

.hp-group--d2 .hp-group__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--branch, var(--mosaic-orange));
}

/* Words that belong to a heading rather than to one of its cards — the
   objectives paragraph under "4.2 Phase 1 Research Objectives", say. Set to
   the card column's width so a lede and a card below it line up. */
.hp-group__lede {
  margin-top: 10px;
}

/* Words that hang off a heading rather than a card — the objectives under
   "5.2 Phase 2 Research Objectives". They are set at the card title's size
   (1.05rem) so a heading's own words carry the same weight on the page as
   the titles of the cards beneath it, and at the cards' line height so the
   two read as one column rather than two typographic systems. */
.hp-group__lede p,
.hp-group__lede li {
  margin: 0 0 10px;
  color: var(--mosaic-gray);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hp-group__lede ul,
.hp-group__lede ol {
  margin: 0 0 8px;
  padding-left: 20px;
}

.hp-group.is-muted .hp-group__pin {
  background: transparent;
  border: 2px dashed var(--mosaic-orange);
}

.hp-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--mosaic-orange) 18%, transparent);
  color: var(--mosaic-orange);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* one card */
.hp-row {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  scroll-margin-top: 96px;
}

.hp-row__rail {
  position: relative;
  min-height: var(--dot);
}

.hp-row__dot {
  position: absolute;
  left: calc(var(--track-x) - var(--dot) / 2);
  top: 50%;
  width: var(--dot);
  height: var(--dot);
  transform: translateY(-50%);
  z-index: 1;
}

.hp-row__side {
  margin: 0;
  padding-left: calc(var(--track-x) + var(--dot) / 2 + 18px);
  font-size: clamp(1rem, 0.5vw + 0.85rem, 1.25rem);
  line-height: 1.3;
  color: var(--mosaic-muted);
}

/* A step on the track with no write-up behind it. It keeps the rail of every
   other step — same tile, same title, same rhythm — and simply has no card to
   its right, which is the honest reading: the step happened, it has not been
   written up. Shrinking the tile made these rows look like a rendering fault
   rather than a gap in the documents. The rail spans both columns, so the
   title runs the width of the row instead of wrapping inside the rail's. */
.hp-row--bare .hp-row__rail {
  grid-column: 1 / -1;
}

/* A cross-reference from one step of the journey to another carries no style
   of its own: wikilinks.py marks it data-lk-preview → data-lk-inline, and the
   wiki-links layer (COMPONENT 21) paints every inline link in var(--branch),
   which the chapter sets and the "Read more" window copies onto its panel. So
   these read exactly like the links between pages, which is the point. */

.hp-row__card {
  position: relative;
  max-width: 620px;
  padding: 18px 22px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.hp-row__card:hover {
  border-color: color-mix(in srgb, var(--branch) 65%, transparent);
}

.hp-card__date {
  margin-bottom: 6px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--branch);
}

.hp-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

/* The TRIP stage line — "P · Pathway Forward" — reads as coloured type in the
   stage's own colour rather than a filled pill, and it opens the card, in the
   slot the date line used to hold. .hp-card__date is now this same line in
   the "Read more" window's header, so both take the colour rules below. */
/* One colour, not four: the stage line takes the colour of the part it is
   being read in — the chapter's own --branch — so it sits with the chapter
   rather than cutting across it with a fifth palette. --branch falls back to
   the page's orange outside a chapter. */
.hp-chip,
.hp-modal__date {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  background: none;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--branch, var(--mosaic-orange));
}

/* The stage letter carries the line, so it is set well above the words that
   name it — the T of "T · Targeted Insight". */
.hp-chip__k {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: -0.1em;
  letter-spacing: 0;
}

/* ---- Mission line ----
   The gradient was a 3px bar above this sentence. It is now the sentence:
   painted through the glyphs, with a plain-colour fallback underneath for
   anything that cannot clip a background to text. */
.page-hp .hp-mission-line {
  margin: 12px 0 18px;
  font-size: clamp(1.25rem, 1.6vw + 0.7rem, 1.9rem);
  font-weight: 800;
  font-style: normal;
  line-height: 1.3;
  color: var(--mosaic-orange);
  background: var(--mosaic-gradient-h);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-hp .hp-mission-line {
    color: transparent;
  }
}

/* ---- Tip line ----
   The one place the map explains itself. The bulb sits in the margin so the
   sentence still starts on the text's own left edge. */
.hp-tip {
  position: relative;
  padding-left: 32px;
}

.hp-tip__sign {
  position: absolute;
  left: 0;
  top: 0.15em;
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--mosaic-orange);
}

.hp-tip__sign svg {
  width: 100%;
  height: 100%;
}

/* A portrait illustrating a step lives in the "Read more" window beside the
   write-up, never on the card face in the timeline. It floats so the first
   sections run alongside it, and goes full width on a phone, where a 180px
   float would leave two-word lines next to it. */
.hp-card__portrait {
  float: right;
  width: 180px;
  margin: 0 0 14px 20px;
  border: 1px solid var(--mosaic-border);
  border-radius: 8px;
}

/* The float is a child of the modal body, so the body closes over it rather
   than letting it hang past the last section. */
.hp-modal__body::after {
  content: '';
  display: block;
  clear: both;
}

@media (max-width: 560px) {
  .hp-card__portrait {
    float: none;
    width: 100%;
    margin: 0 0 14px;
  }
}

/* Lists get the paragraphs' type. Without li here a card whose source is a
   bullet list — "1.3 Engineered Synthetic Systems for Degradation and
   Synthesis" was the one that showed it — fell back to the 1rem body size
   and read larger than every card around it. */
.hp-card__short p,
.hp-card__short li {
  margin: 0 0 8px;
  color: var(--mosaic-gray);
  font-size: 0.9375rem;
  line-height: 1.65;
  font-weight: 300;
}

.hp-card__short ul,
.hp-card__short ol {
  margin: 0 0 8px;
  padding-left: 20px;
}

.hp-card__short blockquote {
  margin: 0 0 8px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--mosaic-border);
}

.hp-card__short blockquote p:last-child {
  margin-bottom: 0;
}

.hp-card__more {
  margin-top: 4px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--branch);
  color: #141416;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.hp-card__more::after {
  content: ' \2192';
}

.hp-card__more:hover,
.hp-card__more:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.hp-row.is-muted .hp-row__card {
  border-style: dashed;
}

.hp-row.is-muted .hp-row__dot {
  opacity: 0.55;
}

/* entrance (NYU): only once JS is running, so the text is never hidden without it */
.hp-js .hp-row {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.7, 0.26, 1);
}

.hp-js .hp-row .hp-row__dot {
  transform: translateY(-50%) scale(0.72);
  transition: transform 0.5s cubic-bezier(0.22, 0.7, 0.26, 1) 0.1s;
}

.hp-js .hp-row.is-in {
  opacity: 1;
  transform: none;
}

.hp-js .hp-row.is-in .hp-row__dot {
  transform: translateY(-50%) scale(1);
}

.hp-row.is-in .hp-row__card:hover {
  transform: translateY(-2px);
}

/* ---- "Read more" window ---- */
html.hp-modal-open,
html.hp-modal-open body {
  overflow: hidden;
}

.hp-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 24px;
}

.hp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hp-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 92vw);
  max-height: calc(100vh - 96px);
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-top: 3px solid var(--branch, var(--mosaic-orange));
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: hpModalIn 0.28s cubic-bezier(0.22, 0.7, 0.26, 1);
}

@keyframes hpModalIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hp-modal__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--mosaic-border);
}

.hp-modal__avatar {
  position: relative;
  width: 72px;
  height: 72px;
}

.hp-modal__date {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--branch, var(--mosaic-orange));
}

.hp-modal__title {
  margin: 2px 0;
  font-size: clamp(1.15rem, 1.2vw + 0.95rem, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
}

.hp-modal__person {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--mosaic-gray);
}

.hp-modal__close {
  align-self: start;
  border: 0;
  background: none;
  color: var(--mosaic-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.hp-modal__close:hover {
  color: var(--mosaic-text);
}

.hp-modal__close:focus {
  outline: none;
}

.hp-modal__close:focus-visible,
.hp-modal__step:focus-visible {
  outline: 2px solid var(--branch, var(--mosaic-orange));
  outline-offset: 2px;
}

.hp-modal__body {
  overflow: auto;
  padding: 4px 24px 18px;
}

.hp-modal__section {
  padding: 16px 0 6px;
}

.hp-modal__section + .hp-modal__section {
  border-top: 1px solid var(--mosaic-border);
}

.hp-modal__section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--branch, var(--mosaic-orange));
}

.hp-modal__section h4::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
}

.hp-modal__section p,
.hp-modal__section li {
  color: var(--mosaic-gray);
  font-size: 0.9375rem;
  line-height: 1.75;
  font-weight: 300;
}

.hp-modal__section a {
  color: var(--branch, var(--mosaic-orange));
  text-decoration: underline;
}

/* The long visible image description the Therapeutic chapter prints under
   each reproduced figure, as that chapter's own provenance note requires:
   the same words as the alt attribute, on the page as well as in the
   accessibility tree. Set apart from the running text so it reads as
   apparatus rather than argument. */
.hp-figalt {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 2px solid var(--mosaic-border);
  color: var(--mosaic-muted);
  font-size: 0.8125rem !important;
  line-height: 1.6;
}

.hp-modal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--mosaic-border);
}

.hp-modal__step {
  padding: 6px 12px;
  border: 1px solid var(--mosaic-border);
  border-radius: 6px;
  background: transparent;
  color: var(--mosaic-text);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hp-modal__step:hover:not(:disabled) {
  border-color: var(--branch, var(--mosaic-orange));
  color: var(--branch, var(--mosaic-orange));
}

.hp-modal__step:disabled {
  opacity: 0.35;
  cursor: default;
}

.hp-modal__pos {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--mosaic-muted);
}

/* ---- Summary: before → after ---- */
.hp-shift {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.hp-shift__head,
.hp-shift__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr);
  align-items: stretch;
}

.hp-shift__head span {
  padding: 0 4px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
}

.hp-shift__cell {
  padding: 14px 16px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--c);
}

.hp-shift__row > :nth-child(1) { --c: var(--mosaic-blue); }
.hp-shift__row > :nth-child(3) { --c: var(--mosaic-orange); }
.hp-shift__row > :nth-child(5) { --c: var(--mosaic-pink); }

.hp-shift__cell p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--mosaic-gray);
}

.hp-shift__from {
  display: inline-block;
  margin-top: 6px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  color: var(--mosaic-orange);
  text-decoration: none;
}

.hp-shift__arrow {
  width: 30px;
  align-self: center;
  justify-self: center;
}

/* ---- Responsibility: links to the related pages ---- */
/* two cards — Safety & Security and Education, the pages Human Practices
   feeds into (Engagement keeps only Human Practices and Education) */
.hp-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.hp-link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px 14px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.hp-link-card:hover {
  border-color: var(--c);
  transform: translateY(-3px);
}

/* a 2×2 tile mark */
.hp-link-card__tiles {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 14px;
  background: var(--c);
  box-shadow:
    12px 0 0 color-mix(in srgb, var(--c) 60%, transparent),
    0 12px 0 color-mix(in srgb, var(--c) 35%, transparent),
    12px 12px 0 color-mix(in srgb, var(--c) 80%, transparent);
}

.hp-link-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--mosaic-text);
}

.hp-link-card__text {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--mosaic-muted);
}

.hp-link-card__go {
  margin-top: auto;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--c);
}

/* desktop: the title beside the tile is the visible one; the card's own
   heading stays for screen readers */
@media (min-width: 901px) {
  .hp-card__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 1100px) {
  .hp-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* TRIP, tablets: the same loop as on desktop, made compact */
  .hp-trip__cycle {
    grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
    grid-template-rows: auto 72px auto;
  }

  .hp-trip__hub {
    padding: 40px 0;
  }

  .hp-trip__hub .hp-flow--right,
  .hp-trip__hub .hp-flow--left {
    width: calc(100% - 16px);
  }

  .hp-flow--ri,
  .hp-flow--pt {
    height: 52px;
  }

  .hp-diamond {
    width: 92px;
    height: 92px;
  }

  .hp-trip-card {
    padding: 14px 14px 12px;
  }

  .hp-trip-card__head {
    gap: 12px;
  }

  .hp-glyph {
    width: 30px;
    height: auto;
  }

  .hp-trip-card__name {
    font-size: 0.95rem;
  }

  .hp-trip-card__text {
    margin: 10px 0;
    font-size: 0.8125rem;
    line-height: 1.55;
  }

  .hp-trip-card__input {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  /* the diamond is further from the cards here, so each card lights with
     its quarter of the diamond */
  .hp-trip-card {
    animation: hpCardLit 8s ease-in-out infinite backwards;
  }

  .hp-trip-card--t { animation-delay: 0.4s; }
  .hp-trip-card--r { animation-delay: 2.4s; }
  .hp-trip-card--i { animation-delay: 4.4s; }
  .hp-trip-card--p { animation-delay: 6.4s; }

  .hp-trip__why {
    gap: 8px;
  }

  /* timeline: narrow rail, title inside the card (NYU mobile) */
  .hp-timeline {
    --track-x: 22px;
    --dot: 44px;
    --rail-w: 44px;
  }

  .hp-row {
    gap: 14px;
  }

  .hp-row__side {
    display: none;
  }

  /* …except on a bare row, where the title is the only text there is. */
  .hp-row--bare .hp-row__side {
    display: block;
  }

  .hp-tiles {
    padding: 4px;
    gap: 1px;
    border-radius: 8px;
  }

  .hp-group {
    padding-left: calc(var(--track-x) + 20px);
  }

  .hp-shift__head {
    display: none;
  }

  .hp-shift__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .hp-shift__arrow {
    display: none;
  }

  .hp-shift__cell::before {
    content: attr(data-k);
    display: block;
    margin-bottom: 4px;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c);
  }
}

/* a TRIP card glowing with its quarter of the diamond (small screens) */
@keyframes hpCardLit {
  0%        { border-color: var(--mosaic-border); box-shadow: none; }
  8%, 26%   { border-color: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 8px 26px color-mix(in srgb, var(--c) 12%, transparent); }
  36%, 100% { border-color: var(--mosaic-border); box-shadow: none; }
}

/* TRIP, phones: the loop as a column — T ↓ R ↓ I ↓ P — with a pink line up the
   left edge carrying P back to T (hp-page.js places it between the two cards) */
@media (max-width: 620px) {
  .hp-trip__cycle {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "hub" "t" "m1" "r" "m2" "i" "m3" "p";
    padding-left: 30px;
  }

  .hp-trip__hub {
    margin-left: -30px;          /* centre the diamond on the full width */
    padding: 0 0 10px;
  }

  .hp-trip__hub .hp-flow,
  .hp-flow--ri,
  .hp-flow--pt {
    display: none;
  }

  .hp-diamond {
    width: 84px;
    height: 84px;
  }

  .hp-flow--m {
    display: block;
    justify-self: center;
    height: 46px;
  }

  .hp-flow--m1 { grid-area: m1; }
  .hp-flow--m2 { grid-area: m2; }
  .hp-flow--m3 { grid-area: m3; }

  .hp-trip__return {
    display: block;
    position: absolute;
    left: -2px;                  /* its dots line up with the turns drawn below */
    top: var(--ret-top, 0);
    height: var(--ret-h, 0);
    background-size: 6px 100%;   /* no head: the line turns into T at the top */
  }

  .hp-trip__return::after {
    display: none;
  }

  /* the turns of the return line: into T (with a head), out of P */
  .hp-trip-card--t::before,
  .hp-trip-card--p::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 6px;
    height: 6px;
  }

  .hp-trip-card--t::before {
    left: -8px;
    background: var(--mosaic-pink);
    box-shadow:
      -6px -6px 0 var(--mosaic-pink),
      -6px 6px 0 var(--mosaic-pink),
      -12px -12px 0 var(--mosaic-pink),
      -12px 12px 0 var(--mosaic-pink),
      -12px 0 0 color-mix(in srgb, var(--mosaic-pink) 38%, transparent);
  }

  .hp-trip-card--p::before {
    left: -8px;
    background: color-mix(in srgb, var(--mosaic-pink) 38%, transparent);
  }

  .hp-trip-card {
    padding: 14px 14px 12px;
  }

  .hp-trip-card__head {
    gap: 10px;
  }

  .hp-glyph {
    width: 24px;
  }

  .hp-trip__why {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .hp-why {
    padding: 12px 14px 10px;
  }
}

@media (max-width: 640px) {
  .hp-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .hp-modal {
    padding: 64px 8px 12px;
  }

  .hp-modal__header {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .hp-modal__avatar {
    width: 52px;
    height: 52px;
  }

  .hp-modal__body {
    padding: 4px 16px 14px;
  }
}

/* ---- responsive ---- */
@media (max-width: 640px) {
  /* small screens: the card leaves the map and sits under it */
  .hp-map {
    height: auto;
  }

  .hp-map__svg {
    height: 420px;
  }

  .hp-map__card {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin-top: 8px;
  }

  /* "Done" takes the top-left on touch screens */
  .hp-map__controls {
    top: 10px;
    left: auto;
    right: 10px;
  }

  .hp-map__gate {
    top: 190px;
    bottom: auto;
  }

  .hp-map__done {
    top: 10px;
    bottom: auto;
    left: 10px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-flash,
  .hp-map__card,
  .hp-node.is-hit .hp-node__sel,
  .hp-trip .hp-flow::before,
  .hp-trip .hp-flow::after,
  .hp-trip .hp-trip-card,
  .hp-diamond rect,
  .hp-modal__panel {
    animation: none;
  }

  /* the loop stands still: every quarter fully lit, no running pixels */
  .hp-diamond rect {
    opacity: 1;
  }

  .hp-js .hp-row,
  .hp-js .hp-row .hp-row__dot,
  .hp-track__fill {
    transition: none;
  }

  .hp-js .hp-row {
    opacity: 1;
    transform: none;
  }

  .hp-js .hp-row .hp-row__dot {
    transform: translateY(-50%);
  }
}

/* ============================================================
   COMPONENT 21: WET LAB PAGES
   (Design · Experiments · Notebook · Measurement ·
    Alternative Platform · Safety and Security)
   ============================================================ */

/* The Dry Lab skeleton (COMPONENT 16 — hero, sticky rail, main column),
   recoloured to the Wet Lab lime of the navbar. The hero carries the shared
   Wet Lab photo (drylab_hero's `image`, styled in hero_drylab.html). */

/* The picture's bottom edge is pinned to the hero's bottom, so the hero must
   end exactly at the bottom of the visible screen. svh, not vh: on phones vh
   includes the area behind the browser toolbar, which would hide the edge. */
.page-wetlab .fancy-hero-m,
.page-wetlab .fancy-hero__pin-m {
  height: calc(100svh + 56px);
}

.page-wetlab .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-lime);
}

.page-wetlab .typing-cursor {
  background: var(--mosaic-lime);
}

.page-wetlab .dl-rail__nav a {
  --rail-accent: var(--mosaic-lime);
}

.page-wetlab .dl-eyebrow {
  color: var(--mosaic-lime);
}

/* ---- Safety and Security: the Hardware page's rail treatment ----
   Lime is the page itself (its name, Overview, Compliance, Future
   Applications), blue is Laboratory Safety and Training and orange is
   Project Materials and Biosafety — the same colours as each group's h3
   callout bars, so a colour means one chapter across the rail and the prose. */
.page-safety #dlRailNav a[href^="#ss-lab-"] { --rail-accent: var(--mosaic-blue); }
.page-safety #dlRailNav a[href^="#ss-mat-"] { --rail-accent: var(--mosaic-orange); }

.page-safety #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* The last two chapters have no subsections, so no group label of their own;
   a label's worth of space keeps them from reading as part of the group above. */
.page-safety #dlRailNav a[href="#ss-compliance"] {
  margin-top: 24px;
}

/* ---- Parts: the same rail treatment, one accent per plasmid ----
   Lime is the page itself (its name, Parts in Registry, Notes), blue is
   Aspire and orange is Bxb1_plus — the same colours as each group's h3
   callout bars, so a colour means one plasmid across the rail and the
   tables. */
.page-parts #dlRailNav a[href^="#pt-aspire-"] { --rail-accent: var(--mosaic-blue); }
.page-parts #dlRailNav a[href^="#pt-bxb1-"]   { --rail-accent: var(--mosaic-orange); }
.page-parts #dlRailNav a[href^="#pt-aspire-"] { --rail-accent: var(--mosaic-blue); }
.page-parts #dlRailNav a[href^="#pt-bxb1-"]   { --rail-accent: var(--mosaic-orange); }
.page-parts #dlRailNav a[href^="#pt-plactera-"] { --rail-accent: var(--mosaic-orange); }

/* The plasmid name opening each paragraph of Parts in Registry — pink so the
   five names stand out as the list the section is. */
.page-parts #pt-overview p > strong {
  color: var(--mosaic-pink);
}

.page-parts #dlRailNav > .dl-rail__label--page {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* Notes has no group label of its own; a label's worth of space keeps it
   from reading as part of the Bxb1_plus group above. */
.page-parts #dlRailNav a[href="#pt-notes"] {
  margin-top: 24px;
}

/* Part numbers are identifiers, not prose: a monospace face makes BBa_26N8LGVK
   and BBa_26ZZYSJ4 tell themselves apart at a glance down the column. */
.page-parts .dl-table td.nw a {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.8125rem;
}

@media (max-width: 900px) {
  /* Every other .dl-table holds values, so letting it shrink to the screen is
     fine. This page's third column is a paragraph: squeezed to a phone it
     collapses to three words a line and a single part grows taller than the
     screen. Hold the table at a readable width and let .dl-table-wrap scroll
     it sideways instead — which is what that wrapper is there for. The
     display:table undoes the blanket .dl-table rule above, which would
     otherwise make the table, not the wrapper, the scrolling box. */
  .page-parts .dl-table {
    display: table;
    min-width: 700px;
  }
}

/* ---- Design: the same rail treatment, one accent per chapter ----
   Lime is the page itself (its name, Design Overview, Parts Link); blue is
   Binary Differentiation, pink is Reporter State Switching, and the two
   application extensions take orange (Crest) and purple (Ratiomics). Each
   colour is also that group's h3 callout bar, so a colour means one chapter
   across the rail and the prose. */
.page-design #dlRailNav a[href^="#dsn-bd-"]    { --rail-accent: var(--mosaic-blue); }
.page-design #dlRailNav a[href^="#dsn-rs-"]    { --rail-accent: var(--mosaic-pink); }
.page-design #dlRailNav a[href^="#dsn-crest-"] { --rail-accent: var(--mosaic-orange); }
.page-design #dlRailNav a[href^="#dsn-rat-"]   { --rail-accent: var(--mosaic-purple); }

.page-design #dlRailNav > .dl-rail__label--page {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* Parts Link and References close the page and belong to no chapter, so they
   get a group label's worth of space rather than reading as part of Ratiomics. */
.page-design #dlRailNav a[href="#dsn-parts"] {
  margin-top: 24px;
}

/* Two sources are quoted as a bare link rather than cited, and the artificial
   sRNA section quotes its reference in full. No other .dl-* page uses a
   blockquote, so the style lives here with the page that needs it. */
.page-design .dl-main blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-left: 3px solid var(--mosaic-border);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--mosaic-muted);
  font-size: 0.9375rem;
}

.page-design .dl-main blockquote p:last-child {
  margin-bottom: 0;
}

/* The two halves of the Aspire-Bxb1 system are named often enough in the prose
   that they read as terms. Orange for the memory, purple for the executor, so
   the word carries its own colour wherever it appears in the body text. */
.page-design .dsn-term--memory {
  color: var(--mosaic-orange);
}

.page-design .dsn-term--executor {
  color: var(--mosaic-purple);
}

/* ---- Results: one accent per chapter ----
   Same scheme as the Design page it reports on, so a colour means the same
   chapter on both: lime is the page itself (its name, the Overview, the
   Conclusion), blue is Binary Differentiation, pink is the Aspire-Bxb1
   system, orange is Reporter-Signal Suppression and purple is the
   Multistate Circuit. Each colour is also that group's h3 callout bar. */
.page-results #dlRailNav a[href^="#res-bd-"] { --rail-accent: var(--mosaic-blue); }
.page-results #dlRailNav a[href^="#res-ab-"] { --rail-accent: var(--mosaic-pink); }
.page-results #dlRailNav a[href^="#res-rs-"] { --rail-accent: var(--mosaic-orange); }
.page-results #dlRailNav a[href^="#res-ms-"] { --rail-accent: var(--mosaic-purple); }

/* The two module names carry a colour wherever they appear in the prose, so a
   reader can see which half of the system a sentence is about: memory in
   MOSAIC orange, executor in MOSAIC purple. Both clear WCAG AA as body text
   on the black page (7.5:1 and 5.1:1). The <em> keeps its italic, as on the
   Design page — only the colour is added, and `att` and `E. coli` are left
   uncoloured because they are not module names. */
.page-results .res-mem  { color: var(--mosaic-orange); }
.page-results .res-exec { color: var(--mosaic-purple); }

/* The Overview and the Conclusion frame the four numbered chapters rather
   than sitting inside one, so their titles are set a step above the shared
   .dl-h2 scale and given room before the paragraph that follows. Scoped to
   these two ids so the chapter headings I-IV keep the shared size; the id
   also outranks `.dl-block .dl-h2 { margin-bottom: 0 }`. */
.page-results #res-overview .dl-h2,
.page-results #res-conclusion .dl-h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 22px;
}

/* The Conclusion closes the page and belongs to no chapter, so it gets a
   group label's worth of space rather than reading as part of chapter IV. */
.page-results #dlRailNav a[href="#res-conclusion"] {
  margin-top: 24px;
}

/* "Purpose" / "Results" open every section, so they read as a heading level
   of their own: the site's .dl-h4 step (24px), one below the 28px .dl-h3
   section titles, instead of the shared .dl-h5 small-caps label. */
.page-results .dl-h5 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mosaic-text);
  margin: 28px 0 10px;
}

/* The figures here are multi-panel plots whose panel labels and axis text
   are small at the shared 720px cap, so they run to the full column — the
   same width as the paragraphs — and the paragraph-long source captions
   with them. */
.page-results .dl-figure--wide {
  max-width: 100%;
}

.page-results #dlRailNav > .dl-rail__label--page {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* ---- Notebook: the page's own rail accent ---- */
.page-notebook #dlRailNav > .dl-rail__label--page {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* ---- Experiments: one accent per chapter ----
   Lime is the page itself; blue is Molecular Clone, pink is Transformation
   and orange is Measurement, matching each group's h3 callout bar. */
.page-experiments #dlRailNav a[href^="#ex-mc-"] { --rail-accent: var(--mosaic-blue); }
.page-experiments #dlRailNav a[href^="#ex-tf-"] { --rail-accent: var(--mosaic-pink); }
.page-experiments #dlRailNav a[href^="#ex-ms-"] { --rail-accent: var(--mosaic-orange); }

.page-experiments #dlRailNav > .dl-rail__label--page {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--mosaic-lime);
  opacity: 1;
}

/* ---- Experiments: subtitles ----
   Fifteen protocols nest three levels deep, and at 1rem bold and 0.75rem grey
   caps the two lower levels read as body copy. They take the chapter's own
   colour instead, so a subtitle says which chapter it belongs to as well as
   how deep it sits. Each section hands its colour down through --sub-accent;
   anything outside a chapter falls back to the page's lime. */
.page-experiments [id^="ex-mc-"] { --sub-accent: var(--mosaic-blue); }
.page-experiments [id^="ex-tf-"] { --sub-accent: var(--mosaic-pink); }
.page-experiments [id^="ex-ms-"] { --sub-accent: var(--mosaic-orange); }

/* The site's step under .dl-h3 (28px) is 24px; the h3 keeps its thick callout
   bar, so the step down still reads clearly. */
.page-experiments .dl-h4 {
  font-size: 24px;
  color: var(--sub-accent, var(--mosaic-lime));
  margin: 34px 0 12px;
}

/* "Protocol 7:" at the head of a heading is the number people cite and look
   for down a page of fifteen, so it carries the chapter's colour and a heavier
   weight while the title itself stays in the reading colour. */
.page-experiments .dl-h3__tag {
  color: var(--sub-accent, var(--mosaic-lime));
  font-weight: 800;
  /* em, so it keeps its lead over the title as the heading's own clamp
     resizes it down the breakpoints */
  font-size: 1.2em;
}

.page-experiments .dl-h5 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  /* the same hue as the sub-heading, softened towards the body colour so the
     two levels are told apart by weight of colour, not only by size */
  color: color-mix(in srgb, var(--sub-accent, var(--mosaic-lime)) 55%, var(--mosaic-text));
  margin: 26px 0 8px;
}

/* A two-column table of short values, stretched across the full column, leaves
   its two cells a hand's width apart and reads as two unrelated lists. These
   hug their own content and centre in the column instead. Below 900px the
   blanket .dl-table rule turns the table into a block scroller, where a width
   of auto means nothing, so this quietly stops applying. */
.dl-table--tight {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
}

/* Sized to its content, a table has no slack of its own, so the air between
   one column and the next has to come from the cells. Wider than the 14px the
   full-width tables use, because there the spare width already does this. */
.dl-table--tight th,
.dl-table--tight td {
  padding-left: 26px;
  padding-right: 26px;
}

@media (max-width: 900px) {
  /* On a phone that same air is what pushes a row past the edge of its own
     table and makes it scroll, so the cells go back to the standard padding
     where the width is the scarce thing. */
  .dl-table--tight th,
  .dl-table--tight td {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ---- Embedded video (video.igem.org) ----
   The iGEM video host gives a 16:9 player. The wrapper holds that shape
   before the frame loads, so nothing on the page jumps when it arrives. */
.dl-video {
  margin: 20px auto 26px;
  max-width: 880px;
}

/* A still that sits beside a video of the same subject: same width, so the
   pair reads as one piece rather than two of different importance. */
.dl-figure--media {
  max-width: 880px;
}

.dl-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--mosaic-dark);
}

.dl-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   COMPONENT 24: NOTEBOOK DOCUMENTS (static/notebook.js)
   ============================================================ */

/* One notebook PDF. The bar names the file and carries the two escapes —
   open in a tab, download — and under it sits a box of a fixed height that
   holds whichever reader this device can use: the browser's own plugin in an
   <iframe> on a computer, or pages drawn by PDF.js on a phone or an iPad,
   where that plugin does not exist. Both are the same shape, so the page
   reads the same either way. */
.nb-doc {
  margin: 22px 0 0;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  overflow: hidden;
}

.nb-doc__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--mosaic-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9375rem;
}

/* four squares, the MOSAIC tile motif at document size */
.nb-doc__icon {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
}

.nb-doc__icon i {
  display: block;
  border-radius: 1px;
  background: var(--mosaic-lime);
}

.nb-doc__icon i:nth-child(2) { background: var(--mosaic-blue); }
.nb-doc__icon i:nth-child(3) { background: var(--mosaic-pink); }
.nb-doc__icon i:nth-child(4) { background: var(--mosaic-orange); }

/* takes the slack, so the open button stays against the right edge */
.nb-doc__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--mosaic-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-main a.nb-doc__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--mosaic-border);
  border-radius: 7px;
  color: var(--mosaic-muted);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dl-main a.nb-doc__btn:hover,
.dl-main a.nb-doc__btn:focus-visible {
  color: var(--mosaic-lime);
  border-color: var(--mosaic-lime);
}

.nb-doc__btn svg {
  width: 16px;
  height: 16px;
}

/* ---- the computer's reader ---- */
.nb-doc__frame {
  display: grid;
  place-items: center;
  height: 900px;
  max-height: 85vh;
  background: var(--mosaic-dark);
}

/* A supplier datasheet runs to one or two pages and sits inside a protocol
   rather than being the content itself, so it is given a shorter frame than
   a hundred-page notebook. Everything else about it is the same. */
.nb-doc--compact .nb-doc__frame,
.nb-doc--compact .nb-doc__scroll {
  height: 520px;
}

.nb-doc__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* what is left when the script never runs */
.dl-main a.nb-doc__fallback {
  padding: 14px 18px;
  font-weight: 600;
}

/* ---- the reader we draw ourselves ---- */
.nb-doc__scroll {
  height: 80vh;
  overflow-y: auto;
  /* a flick that reaches the end of the pages must not then drag the article
     behind it, which is what makes a scroller inside a page feel broken */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--mosaic-dark);
}

.nb-doc__scroll:focus-visible {
  outline: 2px solid var(--mosaic-lime);
  outline-offset: -2px;
}

.nb-doc__status {
  margin: 0;
  padding: 28px 18px;
  text-align: center;
  color: var(--mosaic-muted);
  font-size: 0.875rem;
}

.nb-doc__pages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

/* A page before it is drawn: the right shape already, so the scrollbar is
   honest about the length of the notebook from the first moment. */
.nb-page {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
}

.nb-page__num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--mosaic-muted);
  opacity: 0.5;
}

.nb-page.is-drawn .nb-page__num {
  display: none;
}

.nb-page__canvas {
  display: block;
  width: 100%;
  height: auto;
}

.nb-doc__foot {
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid var(--mosaic-border);
  background: rgba(255, 255, 255, 0.03);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  color: var(--mosaic-muted);
  text-align: center;
}


/* ---- Contribution: the emphasis colour is the page's own ----
   <strong> marks the words that matter, and on this page only it carries the
   purple of the navbar's Project entry, which is where this page is listed.
   Scoped to the body class so bold everywhere else keeps the inherited colour. */
.page-contribution .content strong {
  color: var(--mosaic-purple);
}

/* The section label carries the same purple. This page is listed under Project
   in the navbar and purple is that entry's colour, so the eyebrow above each
   section is purple rather than the Wet Lab lime the page's other accents use.
   Placed after the Wet Lab eyebrow rule, which it matches in specificity. */
.page-contribution .dl-eyebrow {
  color: var(--mosaic-purple);
}

/* The hero and the rail take the same purple. The split layout ships with the
   Wet Lab lime, which belongs to the Wet Lab pages proper; this page is filed
   under Project, so the title, its typing cursor and the rail's active colour
   all follow that entry instead. Each rule matches the Wet Lab rule it replaces
   in specificity and sits after it, which is what lets it win. */
.page-contribution .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-purple);
}
.page-contribution .typing-cursor {
  background: var(--mosaic-purple);
}
.page-contribution .dl-rail__nav a {
  --rail-accent: var(--mosaic-purple);
}

/* Cross-page links in the body: the wikilinks layer paints them in the page's
   own colour, which here would be purple. They are asked for blue instead, so
   only the colour is overridden — the layer's weight, hover underline and
   preview popovers are untouched. */
.page-contribution .dl-main a,
.page-contribution .dl-main a[data-lk-inline] {
  color: var(--mosaic-blue);
}
.page-contribution .dl-main a:hover,
.page-contribution .dl-main a:focus-visible,
.page-contribution .dl-main a[data-lk-inline]:hover,
.page-contribution .dl-main a[data-lk-inline]:focus-visible {
  color: color-mix(in srgb, var(--mosaic-blue) 70%, #ffffff);
}

/* ---- Description: the emphasis colour is the page's own ----
   The same arrangement as Contribution above, and for the same reason: this
   page is listed under Project in the navbar, and purple is that entry's
   colour. It carries the hero title, its typing cursor, the eyebrow above each
   part, the rail's active link and <strong>. The dry-lab skeleton the page is
   built on ships the Dry Lab blue; each rule here matches the rule it replaces
   in specificity and sits after it, which is what lets it win. The per-section
   colour bars are untouched — those say which part a section belongs to, the
   way they do on the Model and Software pages. */
.page-description .dl-main strong {
  font-weight: 700;
  color: var(--mosaic-lime);
}

/* Emphasis in the Introduction runs red — the theme's first colour, used here
   for the words that carry the page's argument. */
.page-description .dl-main strong.desc-red {
  color: var(--mosaic-pink);
}

/* System design carries the second colour of the palette. */
.page-description .dl-main strong.desc-orange {
  color: var(--mosaic-orange);
}

/* One colour per sub-section of System design: the three run orange, yellow,
   blue down the page. */
.page-description .dl-main strong.desc-lime {
  color: var(--mosaic-lime);
}

.page-description .dl-main strong.desc-blue {
  color: var(--mosaic-blue);
}

/* Applications carries the fifth colour. */
.page-description .dl-main strong.desc-purple {
  color: var(--mosaic-purple);
}

/* The one sentence that closes the argument carries the whole palette rather
   than one colour of it — the same painted text the slogan under it uses. */
.page-description .dl-main strong.desc-gradient {
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* A caption's bold is the figure number, not emphasis in the prose: it keeps the
   caption's own colour instead of turning every caption purple at its start. */
.page-description .dl-main figcaption strong {
  color: inherit;
}
/* The third level on this page is a subsection heading in its own right —
   "Layer 1 — Cre: Generate genetic diversity", "Step 1 …", "Biomanufacturing" —
   where the Dry Lab pages use it as a small label over a block. It reads above
   the body text (20px) rather than under it, and gets the space a heading
   needs to separate the subsections it divides. The section heading it sits
   under is raised to match, so the two keep the order the draft gives them
   (Part 35px → Section 28px → Layer/Step 24px → body 20px). */
.page-description .dl-main .dl-h3 {
  font-size: 28px;
  line-height: 1.3;
}
.page-description .dl-main .dl-h4 {
  font-size: 24px;
  line-height: 1.3;
  margin: 44px 0 18px;
}
.page-description .dl-eyebrow {
  color: var(--mosaic-purple);
}
.page-description .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-purple);
}
.page-description .typing-cursor {
  background: var(--mosaic-purple);
}

.page-description .dl-rail__nav a {
  --rail-accent: var(--mosaic-purple);
}
/* The page's own name at the top of the rail, in the page colour — the same
   treatment the Model and Software pages give theirs in blue. Without it the
   label falls back to the grey shared by the group labels. */
.page-description #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-purple);
  opacity: 1;
}
/* Cross-page links are blue here. The wikilinks pass draws an inline link in
   the navbar colour of the page it points at; the "See our X page" notes are
   one kind of remark in four places, so they read as one colour. */
/* The two drawn figures carry no panel. The shared rule gives a figure's image
   a 3 % white plate so a screenshot sits on something; these two are drawn on
   the page's own background, so the plate only draws a rectangle around them.
   The delivered third figure is a picture and keeps its plate. */
.page-description .dl-figure > svg.desc-construct {
  background: none;
  border-radius: 0;
}

/* The substitution animation is a two-target drag: on a phone the targets are
   too small to hit and the drawing is unreadable, so the page leaves it out
   below 720px — the same width the ratio animation treats as its mobile
   layout. The hints drawn inside it go with it. */
/* The opening sentence and the deck's headline are one thought, so the two
   lose the screen-edge spacing that used to separate them. */
.home-mechanism .home-library {
  padding-bottom: 0.4rem;
}
.home-mechanism .home-mech__head {
  padding-top: 0.4rem;
}

/* The mechanism screen arrives in order: the sentence, then the deck's own
   headline, then the drawing. The class is added when the screen comes into
   view; without it — or without JS — everything is simply shown, so nothing
   can be left invisible by a script that never runs. */
/* Opacity only: the deck moves the track with a transform of its own, and a
   transition on transform (or a delay left on the element) makes every act
   switch wait for it. */
.home-mechanism .home-library,
.home-mechanism .home-mech__head,
.home-mechanism .home-mech__track {
  transition: opacity 0.7s ease;
}
.home-mechanism:not(.mech-enter) .home-library,
.home-mechanism:not(.mech-enter) .home-mech__head,
.home-mechanism:not(.mech-enter) .home-mech__track {
  opacity: 0;
}
.home-mechanism.mech-enter .home-library { transition-delay: 0s; }
.home-mechanism.mech-enter .home-mech__head { transition-delay: 0.55s; }
.home-mechanism.mech-enter .home-mech__track { transition-delay: 1.1s; }
/* Once it has arrived, the track is the deck's again. */
.home-mechanism.mech-settled .home-mech__track { transition: none; }

/* The Software hero is a full-frame 16:9 drawing on black, where the cover
   variant was tuned on a 1.392 white-ground product photo: its width was
   computed from that ratio (so the picture stopped short of the edges) and its
   scrim was heavy enough to bury a dark drawing. Same layout, this picture's
   numbers and a much lighter veil. */
.page-software .fancy-hero-dl.fancy-hero-dl--img-cover {
  --img-ratio: 1.778;
  --img-w: max(100vw, (100svh + 56px) * 1.778);
  --img-x: 50%;
  --img-bg: #000;
  --scrim: linear-gradient(180deg,
    rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.28) 38%,
    rgba(0, 0, 0, 0.42) 70%, rgba(0, 0, 0, 0.78) 100%);
}

/* The ASCII hero is 16:9. Covering a portrait phone crops it to a slice of
   two letters; fitting its width to the screen shows the whole drawing, and
   the empty bands above and below are the picture's own black. */
@media (orientation: portrait) {
  .page-software .fancy-hero-dl.fancy-hero-dl--img-cover {
    background:
      var(--scrim),
      var(--hero-img) center / 100vw auto no-repeat,
      var(--img-bg);
  }
}

/* The Model hero is a 3:1 plot drawn on black. Same reasoning as the Software
   hero above: the cover variant's numbers belong to the 1.392 white-ground
   product shot, and its scrim would hide a dark drawing, so this page sets its
   own. A 3:1 picture at viewport width is shorter than the screen, hence the
   width computed from the height below the navbar. */
.page-model .fancy-hero-dl.fancy-hero-dl--img-cover {
  --img-ratio: 3;
  --img-w: max(100vw, (100svh + 56px) * 3);
  --img-x: 50%;
  --img-bg: #000;
  --scrim: linear-gradient(180deg,
    rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.22) 38%,
    rgba(0, 0, 0, 0.36) 70%, rgba(0, 0, 0, 0.72) 100%);
}

/* The Desktiny recording is embedded from the iGEM video server: the iframe
   fills a 16:9 box instead of carrying the embed's own 560 × 315. */
.dt-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.dt-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The cards screen: the body sentence opens it, so the row starts a little
   further down, and the progress squares are pulled up towards the cards they
   belong to. */
#home-hscroll-apps-cards .home-library {
  padding-bottom: clamp(3rem, 6vh, 4.2rem);
}
#home-hscroll-apps-cards .home-hscroll__pin {
  padding-top: clamp(1.2rem, 3.2vh, 2.4rem);
}

@media (max-width: 720px) {
  /* !important: the components set their own inline display on the host. */
  #mosaic-functional-substitution,
  #mosaic-differentiation-animation {
    display: none !important;
  }
}

/* The Bxb1 → TP901 expansion animation makes its own viewport a scroll
   container and sets overscroll-behavior: contain on it (inline style). That
   trapped the wheel: with the pointer over the drawing the page would not
   scroll at all, which reads as the page freezing once the reader has
   interacted with it. Chaining the scroll back to the page at the widget's
   edges is the normal behaviour for a page that is much longer than it. */
#mosaic-differentiation-animation [data-mosaic-differentiation],
#mosaic-differentiation-animation [data-mosaic-stage-scroll] {
  overscroll-behavior: auto !important;
}

/* The Description page sets the type scale for these pages: section heading
   28px, the level under it 24px, against 20px body. The Model page's own sizes
   (21.6 / 16) belong to the dry-lab pages' older scale and read as a different
   document beside it, so it follows the same steps. */
.page-model .dl-main .dl-h3 {
  font-size: 28px;
  line-height: 1.3;
}
.page-model .dl-main .dl-h4 {
  font-size: 24px;
  line-height: 1.3;
  margin: 40px 0 16px;
}

.page-description .dl-main p a[data-lk-inline] {
  color: var(--mosaic-blue);
}
.page-description .dl-main p a[data-lk-inline]:hover,
.page-description .dl-main p a[data-lk-inline]:focus-visible {
  color: color-mix(in srgb, var(--mosaic-blue) 70%, #ffffff);
}

/* ---- Description: the word, the sentence, the trio -------------------
   Three treatments the draft asks for, and they stack: bold text is the lime
   of the wordmark's A; the word MOSAIC carries the five brand colours; a
   sentence with a yellow ground is set a step above the body. */

.page-description .desc-mosaic {
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}
.page-description .desc-mosaic span:nth-child(1) { color: var(--mosaic-pink); }
.page-description .desc-mosaic span:nth-child(2) { color: var(--mosaic-purple); }
.page-description .desc-mosaic span:nth-child(3) { color: var(--mosaic-lime); }
.page-description .desc-mosaic span:nth-child(4) { color: var(--mosaic-blue); }
.page-description .desc-mosaic span:nth-child(5) { color: var(--mosaic-orange); }

/* One sentence carried a step above the body: the line the part turns on, so
   it is set at reading size rather than swept with a marker. */
.page-description .desc-big {
  margin: 1.9rem 0;
  font-size: 1.6rem;
  line-height: 1.45;
  font-weight: 500;
}

/* The slogan closes the Introduction: the word keeps the mark's own five
   colours, and everything after it runs the full palette through the letters. */
.page-description .desc-slogan {
  margin: 2.6rem 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2.7rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-align: center;
}

/* The last phrase takes its own line, so the sentence closes on the words it
   is about rather than breaking wherever the column runs out. */
.page-description .desc-slogan__break {
  display: block;
}

.page-description .desc-slogan__rest {
  background: var(--mosaic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Three examples side by side: one row to compare, not three stacked cases. */
.page-description .desc-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.8rem);
  margin: 1.8rem 0 2.4rem;
  align-items: start;
}
.page-description .desc-trio__item {
  min-width: 0;
}
.page-description .desc-trio__item p {
  font-size: 1.05rem;
  line-height: 1.5;
}
.page-description .desc-fig {
  margin: 0;
}
.page-description .desc-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .page-description .desc-trio {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }
  .page-description .desc-trio__item p {
    font-size: 1.25rem;
  }
}

/* Captions keep the size and the centring every other page gives them; what
   this page adds is the split — a bold title, the description under it in
   italic. */
.page-description .dl-figure figcaption,
.page-description .desc-fig figcaption {
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 400;
  text-align: center;
}
.page-description .dl-figure figcaption em,
.page-description .desc-fig figcaption em {
  font-style: italic;
  color: var(--mosaic-gray);
}

/* The two mechanism animations sit in the reading column like a figure. */
.page-description .desc-anim {
  margin: 2rem 0 2.6rem;
}

/* A figure in two states. The drawings sit side by side in a track that slides
   one frame per press, so the change between them is a movement the eye can
   follow rather than a swap. The frame keeps the taller drawing's proportions
   and both are fitted inside it on black, which is what they are drawn on. */
.page-description .desc-switch {
  max-width: 780px;
}

.page-description .desc-switch__viewport {
  overflow: hidden;
  aspect-ratio: 1200 / 684;
  border-radius: 10px;
  background: transparent;
}

.page-description .desc-switch__track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.page-description .desc-switch__img {
  flex: 0 0 100%;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-description .desc-switch__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 0.85rem;
}

.page-description .desc-switch__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mosaic-muted);
  cursor: pointer;
  transition: color 0.25s ease;
}

.page-description .desc-switch__btn svg {
  width: 1.9rem;
  height: 1.9rem;
}

.page-description .desc-switch__btn:hover,
.page-description .desc-switch__btn:focus-visible {
  color: #fff;
}

.page-description .desc-switch__count {
  min-width: 3.2rem;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--mosaic-muted);
}

@media (prefers-reduced-motion: reduce) {
  .page-description .desc-switch__track {
    transition: none;
  }
}

/* The rail now has two levels: the parts are entries, the sections under them
   are indented entries a step down. */
.page-description #dlRailNav a.dl-rail__sub {
  padding: 5px 14px 5px 30px;
  font-size: 0.875rem;
  font-weight: 500;
}
/* The indicator stays on the rail's own left edge, as it is on every other
   entry: indenting it with the label made the second level read as a separate
   column rather than as a step under the first. */
.page-description #dlRailNav a.dl-rail__sub::before {
  width: 2px;
}

/* ============================================================
   COMPONENT 21: WIKI LINKS (static/wikilinks.js + wikilinks.py)
   ============================================================ */

/* Links between pages, Obsidian-style and read-only: a link in running text
   carries a dotted underline and a pixel in the linked page's navbar colour;
   hovering it opens a preview window. Every page ends with its "Linked
   mentions" — the pages that link to it. */

[data-lk-c="pink"]   { --lk-c: var(--mosaic-pink); }
[data-lk-c="purple"] { --lk-c: var(--mosaic-purple); }
[data-lk-c="blue"]   { --lk-c: var(--mosaic-blue); }
[data-lk-c="lime"]   { --lk-c: var(--mosaic-lime); }
[data-lk-c="orange"] { --lk-c: var(--mosaic-orange); }

[data-lk-h="pink"]   { --lk-h: var(--mosaic-pink); }
[data-lk-h="purple"] { --lk-h: var(--mosaic-purple); }
[data-lk-h="blue"]   { --lk-h: var(--mosaic-blue); }
[data-lk-h="lime"]   { --lk-h: var(--mosaic-lime); }
[data-lk-h="orange"] { --lk-h: var(--mosaic-orange); }

/* a linked word: extra bold, in the colour of the part it sits in — the
   journey chapter's colour (--branch) where there is one, else this page's */
a[data-lk-inline]:not(.lk-backlinks__link) {
  color: var(--branch, var(--lk-h, var(--mosaic-orange)));
  font-weight: 800;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a[data-lk-inline]:not(.lk-backlinks__link):hover,
a[data-lk-inline]:not(.lk-backlinks__link):focus-visible {
  color: var(--branch, var(--lk-h, var(--mosaic-orange)));
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* The link a "Linked mentions" entry pointed at, just arrived on: centred
   by wikilinks.js, then a short glow in its own colour that spreads and
   fades. clone: a link that wraps onto two lines glows on both. */
a.lk-arrived {
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: lkArrive 2.6s ease-out;
}

@keyframes lkArrive {
  0% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
  14% {
    background-color: color-mix(in srgb, currentColor 22%, transparent);
    box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 30%, transparent);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 16px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.lk-arrived {
    animation: none;
    background-color: color-mix(in srgb, currentColor 18%, transparent);
  }
}

/* ---- preview windows ---- */
.lk-layer {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
}

/* The layer deliberately sits under the navbar menu and the page-loading
   curtain. A "Read more" window is at 100000, though, and a preview opened
   from a link inside one has to be visible above it — so it is raised only
   while such a window is open. */
html.hp-modal-open .lk-layer {
  z-index: 100002;
}

.lk-pop {
  --lk-c: var(--mosaic-orange);
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 160px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-top: 3px solid var(--lk-c);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  pointer-events: auto;
  color: var(--mosaic-text);
  text-align: left;
}

/* A window onto a passage of the page you are already reading (data-lk-local).
   It is as tall as the passage, up to the max-height the script sets, instead
   of a fixed window you scroll a whole page through. */
.lk-pop--fit {
  height: auto;
  min-height: 0;
}

.lk-pop--fit .lk-pop__body {
  flex: 0 1 auto;
}

.lk-pop.is-new {
  animation: lkPopIn 0.18s ease-out;
}

@keyframes lkPopIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.lk-pop.is-pinned {
  border-color: color-mix(in srgb, var(--lk-c) 55%, var(--mosaic-border));
  border-top-color: var(--lk-c);
}

.lk-pop.is-moving {
  opacity: 0.92;
}

.lk-pop.is-min {
  height: auto !important;
  min-height: 0;
}

.lk-pop.is-min .lk-pop__body,
.lk-pop.is-min .lk-pop__grip {
  display: none;
}

.lk-pop__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--mosaic-border);
  background: var(--mosaic-dark);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.lk-pop.is-moving .lk-pop__bar {
  cursor: grabbing;
}

.lk-pop__tile {
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--lk-c);
  box-shadow: 7px 0 0 color-mix(in srgb, var(--lk-c) 50%, transparent);
}

.lk-pop__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--mosaic-text);
}

.lk-pop__sub {
  color: var(--mosaic-muted);
}

.lk-pop__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--mosaic-border);
  border-radius: 7px;
  background: transparent;
  color: var(--mosaic-muted);
  font-size: 0.85rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.lk-pop__btn svg {
  width: 17px;
  height: 17px;
}

.lk-pop__btn:hover,
.lk-pop__btn:focus-visible {
  color: var(--lk-c);
  border-color: var(--lk-c);
  outline: none;
}

.lk-pop__close {
  font-size: 1.3rem;
}

.lk-pop__pin[aria-pressed="true"] {
  background: var(--lk-c);
  border-color: var(--lk-c);
  color: #141416;
}

.lk-pop__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 18px 18px;
  outline: none;
}

.lk-pop__body::-webkit-scrollbar {
  width: 6px;
}

.lk-pop__body::-webkit-scrollbar-thumb {
  background: var(--mosaic-border);
  border-radius: 3px;
}

/* resize corner — two pixels */
.lk-pop__grip {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  touch-action: none;
}

.lk-pop__grip::before {
  content: '';
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--mosaic-muted);
  box-shadow: -6px 0 0 var(--mosaic-border), 0 -6px 0 var(--mosaic-border);
}

/* ---- reading view inside a window or sheet ---- */
.lk-read {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--mosaic-gray);
}

.lk-read h1,
.lk-read h2,
.lk-read h3,
.lk-read h4,
.lk-read h5,
.lk-read h6 {
  margin: 18px 0 8px;
  color: var(--mosaic-text);
  font-weight: 800;
  line-height: 1.3;
}

.lk-read h1 { font-size: 1.35rem; }
.lk-read h2 { font-size: 1.15rem; }
.lk-read h3 { font-size: 1rem; }
.lk-read h4,
.lk-read h5,
.lk-read h6 { font-size: 0.9rem; }

.lk-read > :first-child {
  margin-top: 0;
}

.lk-read p,
.lk-read ul,
.lk-read ol,
.lk-read dl,
.lk-read blockquote,
.lk-read table,
.lk-read figure {
  margin: 0 0 10px;
}

.lk-read ul,
.lk-read ol {
  padding-left: 20px;
}

.lk-read img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.lk-read table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.lk-read th,
.lk-read td {
  padding: 4px 6px;
  border: 1px solid var(--mosaic-border);
}

.lk-read a {
  color: var(--mosaic-text);
}

/* linked words inside a preview look the same as on the page */
.lk-read a[data-lk-inline] {
  color: var(--lk-h, var(--mosaic-orange));
}

.lk-read mark {
  background: color-mix(in srgb, var(--lk-c, var(--mosaic-orange)) 30%, transparent);
  color: var(--mosaic-text);
}

/* the part the link points at */
.lk-read .lk-hit {
  margin-left: -10px;
  padding-left: 10px;
  background: color-mix(in srgb, var(--lk-c) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--lk-c);
}

.lk-note {
  margin: 8px 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--mosaic-muted);
}

.lk-loading {
  animation: lkPulse 1s ease-in-out infinite;
}

@keyframes lkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lk-pop__more {
  font-size: 0.8rem;
  color: var(--lk-c);
}

/* ---- touch: bottom sheet ---- */
html.lk-sheet-open,
html.lk-sheet-open body {
  overflow: hidden;
}

.lk-sheet {
  --lk-c: var(--mosaic-orange);
  position: fixed;
  inset: 0;
  z-index: 99995;
}

/* Same as the hover layer above: a sheet opened from a link inside a "Read
   more" window (100000) has to come up over it, not behind it, or on a phone
   the tap looks as if it did nothing. */
html.hp-modal-open .lk-sheet {
  z-index: 100002;
}

.lk-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.lk-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  height: 72vh;
  background: var(--mosaic-card);
  border-top: 3px solid var(--lk-c);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  animation: lkSheetIn 0.22s ease-out;
}

@keyframes lkSheetIn {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.lk-sheet .lk-pop__bar {
  cursor: default;
}

/* ---- "Linked mentions" at the end of a page ---- */
.lk-backlinks {
  margin: 48px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--mosaic-border);
  text-align: left;
}

/* right after a Dry Lab–style section, whose own bottom rule already divides */
.dl-section + .lk-backlinks {
  margin-top: 8px;
  border-top: none;
}

.lk-backlinks__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.lk-backlinks__title {
  margin: 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mosaic-orange);
}

.lk-backlinks__count {
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--mosaic-dark);
  border: 1px solid var(--mosaic-border);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  color: var(--mosaic-muted);
}

.lk-backlinks__group {
  --lk-c: var(--mosaic-orange);
  margin: 0 0 10px;
  background: var(--mosaic-card);
  border: 1px solid var(--mosaic-border);
  border-radius: 10px;
  overflow: hidden;
}

.lk-backlinks__group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--mosaic-text);
}

.lk-backlinks__group > summary::-webkit-details-marker {
  display: none;
}

.lk-backlinks__group > summary::after {
  content: '+';
  margin-left: auto;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color: var(--mosaic-muted);
}

.lk-backlinks__group[open] > summary::after {
  content: '\2212';
}

.lk-backlinks__tile {
  width: 8px;
  height: 8px;
  background: var(--lk-c);
  box-shadow: 10px 0 0 color-mix(in srgb, var(--lk-c) 45%, transparent);
  margin-right: 10px;
}

.lk-backlinks__n {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--mosaic-muted);
}

.lk-backlinks__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--mosaic-border);
}

.lk-backlinks__item + .lk-backlinks__item {
  border-top: 1px solid var(--mosaic-border);
}

.lk-backlinks__link {
  display: block;
  padding: 10px 14px 10px 16px;
  text-decoration: none;
  box-shadow: inset 3px 0 0 transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.lk-backlinks__link:hover,
.lk-backlinks__link:focus-visible {
  background: color-mix(in srgb, var(--lk-c) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--lk-c);
  outline: none;
}

.lk-backlinks__ctx {
  display: block;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--mosaic-gray);
}

.lk-backlinks__ctx mark {
  padding: 0 2px;
  background: color-mix(in srgb, var(--lk-c) 28%, transparent);
  color: var(--mosaic-text);
}

.lk-backlinks__sec {
  display: block;
  margin-top: 4px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--mosaic-muted);
}

.lk-backlinks__none {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mosaic-muted);
}

@media (prefers-reduced-motion: reduce) {
  .lk-pop.is-new,
  .lk-sheet__panel,
  .lk-loading {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   COMPONENT 22: ENGINEERING — HARDWARE FIGURES & DATA TABLES
   The Hardware track carries CAD renders, experiment photos and
   regression plots; the other tracks carry none. These are the
   only additions it needs — a captioned figure, a grid for the
   part renders, and a table that scrolls instead of squashing.
   ═══════════════════════════════════════════════════════════ */

.dbTL-figure {
  /* Figures are capped and centred rather than run to the column width —
     a full-width plot dwarfs the prose around it and pushes the rest of
     the card off the screen. */
  margin: 1.25rem auto 0;
  max-width: 460px;
}
.dbTL-figure--wide {
  max-width: 560px;   /* charts need the width to stay legible */
}
.dbTL-figure--full {
  max-width: 100%;    /* wide schematics and part sheets */
}
.dbTL-figure--sm {
  max-width: 350px;   /* single CAD renders */
}
.dbTL-figure--pair {
  max-width: 900px;   /* two images side by side need the room */
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;  /* tops line up even when the two differ in size */
  gap: 0.9rem;
}
.dbTL-figure--pair > figcaption {
  grid-column: 1 / -1;
}

/* Three to a row: the source gives the Voyager test photographs one caption
   across all three, and two-plus-one would read as a pair and a stray. */
.dbTL-figure--trio {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 0.9rem;
}
.dbTL-figure--trio > figcaption {
  grid-column: 1 / -1;
}

/* Four confocal panels from one imaging round: the source gives each round a
   single caption, and a 2×2 grid keeps every panel large enough to read. */
.dbTL-figure--quad {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.9rem;
}
.dbTL-figure--quad > figcaption {
  grid-column: 1 / -1;
}
.dbTL-figure--quad > .dbTL-figure__cell {
  min-width: 0;
}
.dbTL-figure__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
  opacity: 0.75;
}
@media (max-width: 640px) {
  .dbTL-figure--trio {
    grid-template-columns: 1fr;
  }
  .dbTL-figure--quad {
    grid-template-columns: 1fr;
  }
}
/* Two classes so this beats the stacked `.dbTL-figure img + img` spacing rule
   further down the file — at equal specificity that one won and pushed the
   second image 10px below the first. */
.dbTL-figure.dbTL-figure--pair > img + img {
  margin-top: 0;
}
.dbTL-figure.dbTL-figure--trio > img + img {
  margin-top: 0;
}
.dbTL-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

/* An inline SVG carries its own width/height attributes, so it ignores the
   figure's max-width and overflows — the code-drawn diagrams are 980 units
   across and were spilling out of a 460px figure. Same treatment as the img. */
.dbTL-figure > svg {
  display: block;
  width: 100%;
  height: auto;
}
.dbTL-figure img + img {
  margin-top: 0.6rem;
}
/* One caption style for every figure and table on the page. */
/* A table caption is a <p>, so the prose rules reach it before these do —
   hence the extra class on the last selector. */
.dbTL-figure figcaption,
.dbTL-parts-figure figcaption,
.dbTL-card-body .dbTL-table-caption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
  font-weight: 700;
  color: var(--mosaic-text);
}
.dbTL-figure figcaption strong,
.dbTL-parts-figure figcaption strong,
.dbTL-card-body .dbTL-table-caption strong {
  font-weight: 700;
  margin-right: 0.25rem;
}
/* The Wet Lab and Software tracks put their tables straight in the container
   (inside the track's own <section>) rather than in a card body, so the rule
   above never reaches those captions. A descendant selector, not a child one:
   those sections are the caption's parent, not .dbTL-container. Everything it
   sets is what a card-body caption already resolves to, so nothing shifts. */
.dbTL-container .dbTL-table-caption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
  font-weight: 700;
  color: var(--mosaic-text);
}
.dbTL-container .dbTL-table-caption strong {
  font-weight: 700;
  margin-right: 0.25rem;
}

/* CAD part renders — uniform tiles, several to a row */
.dbTL-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.8rem;
  max-width: 560px;
  margin: 1.25rem auto 0;
}
.dbTL-parts figure {
  margin: 0;
  text-align: center;
}
.dbTL-parts img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.dbTL-parts figcaption {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
  color: var(--mosaic-text);
}
@media (max-width: 640px) {
  .dbTL-figure,
  .dbTL-figure--wide,
  .dbTL-figure--sm,
  .dbTL-figure--pair,
  .dbTL-parts {
    max-width: 100%;
  }
  .dbTL-figure--pair {
    grid-template-columns: 1fr;
  }
}

.hw3d__btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--mosaic-border);
  background: rgba(20, 20, 22, 0.88);
  color: var(--mosaic-text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.hw3d__btn--reset {
  font-size: 0.8rem;
}
.hw3d__btn:hover,
.hw3d__btn:focus-visible {
  border-color: var(--mosaic-blue);
  color: var(--mosaic-blue);
  outline: none;
}

/* The line over a row of part renders: the thumbnails are buttons that open
   a 3D view of that part, and nothing else on the screen says so. */
.dbTL-card .dbTL-parts-hint {
  margin: 0 0 0.7rem;
  text-align: center;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
}

/* The line over a group of part renders on the Hardware page: each render
   is a button that opens that part in 3D. Sized like the body copy, white. */
.dl-parts-figure .dl-parts-hint {
  margin: 1rem 0 0.7rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 300;
  color: #fff;
}

/* Part thumbnail — opens a 3D view of that one part */
.dbTL-part {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.dbTL-part img {
  transition: transform 0.25s ease;
}
.dbTL-part:hover img,
.dbTL-part:focus-visible img {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--mosaic-blue);
}
.dbTL-part:focus-visible {
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Single-part 3D preview (built by static/hardware3d.js) */
.partview {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.partview[hidden] {
  display: none;
}
.partview__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
}
.partview__panel {
  position: relative;
  width: min(560px, 100%);
  padding: 1rem 1rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #15151a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.partview__close {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--mosaic-border);
  background: rgba(20, 20, 22, 0.9);
  color: var(--mosaic-text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.partview__close:hover,
.partview__close:focus-visible {
  border-color: var(--mosaic-blue);
  color: var(--mosaic-blue);
  outline: none;
}
.partview__stage {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.partview__stage canvas {
  display: block;
  touch-action: none;
}
.partview__label {
  margin: 0.7rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--mosaic-text);
}
.partview__hint {
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--mosaic-muted);
}

/* Sub-headings inside a Build card (the four structure blocks) */
.dbTL-subhead {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}


/* Interactive 3D exploded view (see static/hardware3d.js) */
.hw3d {
  margin: 1.5rem 0 0;
}
.hw3d__stage {
  position: relative;
  /* Capped and centred like the other figures. At full column width the
     canvas read as the end of the page rather than as one figure among many. */
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  min-height: 220px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.hw3d__stage canvas {
  display: block;
  touch-action: none;
}
.hw3d__fallback {
  margin: 0;
  padding: 4.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--mosaic-muted);
}

/* Shown until the model arrives; the script writes the byte progress here. */
.hw3d__loading,
.hw3d__fallback {
  margin: 0;
  padding: 4.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--mosaic-muted);
}
.hw3d.is-ready .hw3d__loading {
  display: none;
}

/* Must out-specify the base .hw3d__controls rule further down the file. */
.hw3d:not(.is-ready) .hw3d__controls,
.hw3d:not(.is-ready) .hw3d__hint {
  display: none;
}
.hw3d__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.hw3d__label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mosaic-muted);
  white-space: nowrap;
}
.hw3d__range {
  flex: 1;
  min-width: 0;
  accent-color: var(--mosaic-blue);
}
.hw3d__value {
  width: 3.4em;
  text-align: right;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--mosaic-muted);
}
.hw3d__hint {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: var(--mosaic-muted);
}

/* Narrow screens: label, value and +/- together leave the explode slider about
   86px. It drops to a row of its own and keeps a 24px touch height. */
@media (max-width: 640px) {
  .hw3d__controls {
    flex-wrap: wrap;
    row-gap: 0.55rem;
  }
  .hw3d__range {
    order: 1;
    flex: 0 0 100%;
    width: 100%;
    height: 24px;
  }
}
/* The keyboard clause is for a machine with a keyboard and a scroll wheel. On a
   touch screen it is not merely useless, it is the wrong instruction, so the
   line reads "drag to rotate · pinch to zoom" and stops there. */
@media (hover: none) {
  .hw3d__hint-mouse {
    display: none;
  }
}
/* The 3D viewer's caption is styled with the rest of the site's figure
   captions, up in the .dl-figure block — it was a small muted grey line here,
   which read as a note rather than as a numbered figure caption. */

/* ═══════════════════════════════════════════════════════════
   COMPONENT 23: ENGINEERING — TYPESET FORMULAS & PIPELINE NOTES
   Formulas and short method summaries sit centred on the page
   rather than inside a bordered code card.
   ═══════════════════════════════════════════════════════════ */

.dbTL-math-block {
  margin: 1.7rem auto 0;
  max-width: 760px;
  text-align: center;   /* display maths is centred by convention */
}

.dbTL-flow {
  margin: 1.5rem 0 0;   /* prose-like block: stays in the column, left-aligned */
}

.dbTL-card-body .dbTL-math {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  color: var(--mosaic-text);
  overflow-x: auto;
  overflow-y: hidden;
}

.dbTL-card-body .dbTL-flow p {
  margin: 0.32rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--mosaic-text);
}

.dbTL-card-body .dbTL-flow p strong {
  display: inline-block;
  min-width: 5.5rem;
  margin-right: 0.7rem;
  color: var(--mosaic-muted);
}


/* ── Thumbnails inside a table ─────────────────────────
   The algorithm figures are tall pseudocode screenshots; at cell size they are
   only good for recognising which one you want, so each opens the full image
   in the lightbox and says so on hover. */
.dl-thumb-cell {
  width: 1%;              /* let the cell hug the thumbnail, not stretch */
}

/* The workflow table: three short entries per row that read as one line. Set
   left, because centred in a full-width table each entry floats a hand's width
   from the heading over it; and vertically centred, because a step spanning
   four rows should sit against the run it covers.
   Scoped: `.dl-table th/td` is `vertical-align: top` and centred across the
   dry-lab pages, which is what a table of long descriptions wants. */
.dl-table--figs th,
.dl-table--figs td {
  text-align: left;
  vertical-align: middle;
}

.dl-thumb {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.dl-thumb img {
  width: 148px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--mosaic-border);
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.dl-thumb:hover img,
.dl-thumb:focus-visible img {
  border-color: var(--mosaic-blue);
}

.dl-thumb__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 6px;
  border-radius: 0 0 6px 6px;
  background: rgba(10, 10, 12, 0.85);
  color: var(--mosaic-text);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.dl-thumb:hover .dl-thumb__hint,
.dl-thumb:focus-visible .dl-thumb__hint {
  opacity: 1;
}
/* MOSAIC Homepage animation — only the styles not already present in style.css.
   All selectors are scoped to this animation; no global reset or body styles. */
.mosaic-scroll-section {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  isolation: isolate;
  overflow: hidden;
  background: #000;
  touch-action: pan-y;
}

.mosaic-scroll-section .mosaic-sticky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.mosaic-scroll-section .mosaic-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

/* Phones: the mosaic is the full width of the screen, not the page column. */
@media (max-width: 720px) {
  .mosaic-scroll-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

/* Folded reference blocks on the Model page. */
.dl-details {
  margin: 1rem 0 1.6rem;
}

.dl-details > summary {
  cursor: pointer;
  color: var(--mosaic-blue);
  font-weight: 700;
}

.dl-details[open] > summary {
  margin-bottom: 0.7rem;
}

/* ============================================================
   COMPONENT 25: ATTRIBUTIONS PAGE (Team)
   ============================================================ */

/* The Dry Lab skeleton (COMPONENT 16 — hero, sticky rail, main column),
   recoloured to the Team pink of the navbar, as .page-wetlab does in lime. */
.page-attributions .fancy-hero-dl .fancy-title-m {
  color: var(--mosaic-pink);
}

.page-attributions .typing-cursor {
  background: var(--mosaic-pink);
}

.page-attributions .dl-rail__nav a {
  --rail-accent: var(--mosaic-pink);
}

.page-attributions .dl-eyebrow {
  color: var(--mosaic-pink);
}

.page-attributions #dlRailNav > .dl-rail__label--page {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--mosaic-pink);
  opacity: 1;
}

/* The iGEM Attributions Form (an iframe from teams.igem.org). The form draws
   its own light page, so it sits in a rounded card on the dark column rather
   than bleeding to the column's edges. */
.at-frame {
  margin-top: 8px;
  border: 1px solid var(--mosaic-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.at-frame__iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* ============================================================
   COMPONENT 26: AWARDS PAGE (Team)
   ============================================================ */

.page-awards .lk-backlinks:has(.lk-backlinks__none) {
  display: none;
}

.awards-hero {
  --awards-progress: 0;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 4.5rem 1rem;
  background:
    radial-gradient(ellipse at center, rgba(5, 5, 8, 0.35), transparent 65%),
    linear-gradient(180deg, rgba(5, 5, 8, 0.66), rgba(5, 5, 8, 0.46) 42%, #0a0a0d),
    #0a0a0d url("https://static.igem.wiki/teams/6334/wiki/team/all-new.avif") center / cover no-repeat;
  text-align: center;
}

.awards-hero h1,
.awards-hero__copy p,
.awards-hero__scroll {
  color: var(--mosaic-text);
  opacity: calc(1 - var(--awards-progress));
}

.awards-hero h1 {
  margin: 0;
  color: var(--mosaic-pink);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.1;
  transform: translateY(calc(-24vh * var(--awards-progress)));
}

.awards-hero__copy p {
  margin: 1rem 0 0;
  font-size: clamp(1.15rem, 2.7vw, 1.6rem);
  transform: translateY(calc(-12vh * var(--awards-progress)));
}

.awards-hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(10, 10, 13, 0.65);
  font-size: 0.95rem;
  text-decoration: none;
  transform: translateX(-50%);
}

.awards-hero__scroll:hover {
  color: #fff;
  background: var(--mosaic-card);
}

.awards-hero__scroll:focus-visible {
  opacity: 1;
  outline: 2px solid var(--mosaic-blue);
  outline-offset: 3px;
}

.awards-hero__mouse {
  position: relative;
  width: 1rem;
  height: 1.5rem;
  border: 2px solid currentColor;
  border-radius: 0.625rem;
}

.awards-hero__mouse::after {
  position: absolute;
  top: 0.25rem;
  left: calc(50% - 1px);
  width: 2px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  animation: awards-wheel 1.8s ease-in-out infinite;
}

@keyframes awards-wheel {
  70%, 100% { transform: translateY(6px); opacity: 0; }
}

.awards-wall {
  padding: clamp(1rem, 3.5vw, 3rem) clamp(0.3125rem, 3vw, 2rem);
  background:
    linear-gradient(rgba(10, 10, 13, 0.92), rgba(10, 10, 13, 0.97)),
    #0a0a0d url("https://static.igem.wiki/teams/5553/homepage/rhinoboat/1.webp") center / cover;
}

.awards-poster {
  max-width: 70.375rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 4.5vw, 4rem);
  scroll-margin-top: 4.5rem;
  border-radius: 0.875rem;
  background: rgba(10, 10, 13, 0.72);
  box-shadow: inset 0 0 0 1px var(--mosaic-border);
  text-align: center;
}

.awards-poster h2 {
  margin: 0 0 clamp(1.125rem, 4vw, 3.375rem);
  color: var(--mosaic-text);
  font-size: clamp(1.3rem, 4vw, 3rem);
  font-style: italic;
  font-weight: 800;
}

.awards-poster__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(0.625rem, 3.4vw, 3rem);
  max-width: 53.125rem;
  margin-inline: auto;
}

.awards-poster__card {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: clamp(0.75rem, 2.8vw, 2.25rem);
  border-radius: clamp(0.75rem, 2.2vw, 2rem);
  background: var(--mosaic-card);
  box-shadow: inset 0 0 0 1px var(--mosaic-border);
}

.awards-poster__card h3 {
  margin: 0;
  font-weight: 700;
}

.awards-poster__card--gold h3 {
  color: #f3c86b;
  font-size: clamp(1rem, 3.5vw, 2.375rem);
}

.awards-poster__card--nomination {
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
}

.awards-poster__card--nomination h3 {
  color: #f1a48c;
  font-size: clamp(0.875rem, 2.1vw, 1.5rem);
}

.awards-poster__card--nomination p {
  margin: 0.4rem 0 0;
  color: var(--mosaic-text);
  font-size: clamp(0.875rem, 2vw, 1.4rem);
  font-weight: 650;
}

/* Icon crops from the 2025 ShanghaiTech-China Awards poster (CC BY 4.0). */
.awards-poster__icon {
  display: block;
  width: 100%;
  background-image: url("https://static.igem.wiki/teams/5553/awards/group-460.avif");
  background-repeat: no-repeat;
  filter: url("#awards-remove-paper");
}

.awards-poster__icon--gold {
  aspect-ratio: 460 / 516;
  background-size: calc(1416 / 460 * 100%) auto;
  background-position: 6.49% 49.90%;
}

.awards-poster__icon--village {
  max-width: 6.625rem;
  aspect-ratio: 176 / 188;
  background-size: calc(1416 / 176 * 100%) auto;
  background-position: 60.32% 27.18%;
}

.awards-poster__sources {
  margin: clamp(0.875rem, 3vw, 2rem) 0 0;
  font-size: 0.8125rem;
}

.awards-poster__sources a {
  color: var(--mosaic-blue);
}

@media (max-width: 575.98px) {
  .awards-poster__card--nomination {
    grid-template-columns: minmax(0, 1fr);
  }

  .awards-poster__icon--village {
    max-width: 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .awards-hero {
    --awards-progress: 0 !important;
  }

  .awards-hero__mouse::after {
    animation: none;
  }
}
