/* ============================================================
   CERNAL Design System — TAU-Israel iGEM 2026 wiki theme
   ------------------------------------------------------------
   Ported from the CERNAL website style ("CERNAL Website.html").
   Concept: a bright cartoon RNA-logic factory. Warm cream
   "paper", charcoal ink lines, hand-drawn "sticker" cards and
   buttons, and a set of reporter accent colors.

   This file layers ON TOP of Bootstrap 5 (loaded first in
   layout.html) and re-skins every component the wiki pages use:
   navbar, hero, callouts, cards, buttons, footer, headings,
   links, rules, lists, tables and images.
   ============================================================ */

/* ------------------------------------------------------------
   Webfonts — the three CERNAL voices, hosted on static.igem.wiki (SIL OFL 1.1).
   Space Grotesk = display, Nunito = body/UI, Space Mono = the
   "compiler" voice (labels, code, data). Served from iGEM infrastructure so
   the wiki makes no third-party font requests (iGEM Requirements §1).
   License/credits: static/fonts/OFL.txt.
   Only the weights the CSS actually uses are included.
   ------------------------------------------------------------ */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/nunito-v32-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/nunito-v32-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/nunito-v32-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/nunito-v32-latin-800.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/space-grotesk-v22-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/space-mono-v17-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://static.igem.wiki/teams/6196/wiki/fonts/space-mono-v17-latin-700.woff2") format("woff2");
}

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* ============================================================
     COLOUR — two tiers.

     TIER 1 (main) is the only set allowed to carry structure:
     surfaces, all text, navbar, hero, footer, borders, links,
     primary buttons, focus rings.

     TIER 2 (accents) never owns a surface. It appears as a 3px
     callout bracket, a 0.4rem accordion bar, an 11px mono kicker
     or a role label — tone, not mass — and only ever to index a
     category (which case line, which callout, which role).

     The deck's rules: 1) blue is environment only; 2) red marks
     one thing per frame; 3) accents are ranked, not banned (see
     the note on tier 2); 4) no gradients, no glow.
     ============================================================ */

  /* --- TIER 1: paper / neutrals --- */
  --paper: #FFFFFF;
  /* page background — replaces the old cream */
  --paper-sink: #F2F2F2;
  /* recessed wells, code blocks */
  --paper-edge: #DADADA;
  /* chassis gray, doubling as the hairline divider */
  --card: #FFFFFF;
  --card-tint: #FAFAFA;

  --ink: #1A1A1A;
  /* the only stroke color — every outline and all primary text */
  --ink-2: #4A4A4A;
  /* body copy */
  --ink-3: #8F8F8F;
  /* joint gray — shading, rejected states, secondary labels */
  --ink-line: #1A1A1A;

  /* --- TIER 1: the one signal ---
     Reserved. No tier 2 colour may approach it, so red always
     reads as "this is the action point". */
  --cernal-red: #C41E3A;
  --cernal-red-deep: #9E1830;
  --cernal-red-soft: #F7DDE2;

  /* --- TIER 1: environment, the pipework blues ---
     Blueprint is the solid readable blue (navbar, footer, dark
     panels, schematics); pipe blue is the pale flow fill. */
  --pipe-blue: #3E5C7E;
  --pipe-blue-deep: #2C4460;
  --pipe-blue-soft: #D3E8F5;
  --pipe-shade: #9CC6DF;

  /* --- TIER 2: six indexing accents ---
     Mixed for WHITE paper against #1A1A1A ink; the pre-2026 values
     were mixed for cream and go muddy here. Each is mid-dark so it
     holds contrast at bracket and 11px-label size, and each is held
     clear of the signal red. */
  --acc-blue: #3E5C7E;
  --acc-blue-soft: #D3E8F5;
  --acc-green: #2F7D4A;
  --acc-green-soft: #DDEFE3;
  --acc-gold: #A87C12;
  --acc-gold-soft: #F7EBCF;
  --acc-kraft: #8C6440;
  --acc-kraft-soft: #F0E5D6;
  --acc-teal: #1F7A82;
  --acc-teal-soft: #D8EDEF;
  --acc-violet: #6A4C93;
  --acc-violet-soft: #E7E0F2;

  /* --- Lamp tones ---
     Three exceptions, used nowhere but the Experiments sorter's
     status lights. A 10px circle inside a 2px ink border fills in
     as black at accent weight, so a lamp that must read as LIT
     gets a brighter version of its line's hue. */
  --lamp-blue: #7FB5D8;
  --lamp-green: #4FA96B;
  --lamp-gold: #E0AE2E;

  /* --- Legacy names ---
     Older aliases still used by selectors below; they resolve into tier 2. */
  --gate-green: var(--acc-green);
  --gate-green-deep: #24603A;
  --gate-green-soft: var(--acc-green-soft);

  --rna-amber: var(--acc-gold);
  --rna-amber-deep: #855F0C;
  --rna-amber-soft: var(--acc-gold-soft);

  --kraft-deep: #6E4E32;

  /* Semantic aliases */
  --surface-page: var(--paper);
  --surface-sink: var(--paper-sink);
  --surface-card: var(--card);
  --text-strong: var(--ink);
  --text-body: var(--ink-2);
  --text-muted: var(--ink-3);
  --border-ink: var(--ink-line);
  --border-soft: var(--paper-edge);
  --accent: var(--cernal-red);
  --accent-deep: var(--cernal-red-deep);
  --accent-soft: var(--cernal-red-soft);
  --accent-2: var(--pipe-blue);
  --accent-2-deep: var(--pipe-blue-deep);
  --accent-2-soft: var(--pipe-blue-soft);
  --focus-ring: var(--pipe-blue);

  /* Interface states: hover, open, "you are here". Blueprint, not red.
     The page chrome (navbar, table of contents, floating buttons, footer
     links, accordions) lights up in blue so that red never appears as
     decoration. Red is kept for content that means something: alerts,
     primary buttons, the signal lamps. */
  --ui-active: var(--pipe-blue);
  --ui-active-deep: var(--pipe-blue-deep);
  --ui-active-soft: var(--pipe-blue-soft);

  /* Type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-sans: "Nunito", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Borders */
  --border-w: 2px;
  --border-w-bold: 3px;

  /* Shadows — warm, tinted with ink (not pure black) */
  --shadow-sm: 0 1px 0 rgba(26, 26, 26, 0.06), 0 2px 6px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 2px 0 rgba(26, 26, 26, 0.05), 0 8px 18px rgba(26, 26, 26, 0.10);
  --shadow-lg: 0 4px 0 rgba(26, 26, 26, 0.05), 0 18px 40px rgba(26, 26, 26, 0.14);

  /* The "sticker" offset — a hard charcoal drop, pasted-paper feel */
  --shadow-sticker: 4px 4px 0 var(--ink);
  --shadow-sticker-sm: 2px 2px 0 var(--ink);
  --shadow-sticker-lift: 6px 6px 0 var(--ink);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
}

/* ============================================================
   Base elements
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  padding-top: 64px;
  /* clears the fixed navbar */
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--surface-page);
  /* faint warm "paper" dot texture, evoking the blueprint pipes wallpaper */
  background-image: radial-gradient(rgba(26, 26, 26, 0.045) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Content pages: a flat, opaque ground.
   The pipe network belongs to the landing page and to the hero band at
   the top of every page. Running it a third time across the full height
   of each content page put moving wallpaper behind the body copy on
   seventeen pages and cost a second independent 80s animation. Those
   pages now sit on flat paper instead.

   `background-image: none` is explicit rather than omitted: without it
   the base `body` rule above reasserts its dot texture, which is a
   texture and not the flat ground we want here.

   The hero is deliberately untouched. It keeps `hero-pipes` and
   `hero-fx-drift` from layout.html, so the drifting pipework still
   runs in the band at the top of every page — only the sheet under
   the content changed. */
body:not(.page-home) {
  background-color: var(--paper);
  background-image: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.375rem;
}

.display-4 {
  font-size: clamp(2.6rem, 6vw, 4rem);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease-standard);
}

a:hover {
  color: var(--accent-2-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  background: var(--paper-sink);
  color: var(--cernal-red-deep);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--paper-edge);
}

::selection {
  background: var(--rna-amber-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Hand-drawn divider — the "pen" line */
hr {
  height: 0;
  border: 0;
  border-top: var(--border-w) solid var(--ink);
  opacity: 1;
  margin: 1rem 0 1.25rem;
  border-radius: 2px;
}

/* Lists: warm spacing + reporter-colored markers */
.container ul,
.container ol {
  padding-left: 1.35rem;
}

.container li {
  margin-bottom: 0.4rem;
}

.container ul>li::marker {
  color: var(--cernal-red);
}

.container ol>li::marker {
  color: var(--pipe-blue);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Images become sticker cutouts: ink outline + hard offset shadow */
.container img.img-fluid,
.bd-callout img {
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sticker);
}

blockquote,
.blockquote {
  border-left: var(--border-w-bold) solid var(--rna-amber);
  background: var(--rna-amber-soft);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  color: var(--ink-2);
}

/* ============================================================
   Navbar — charcoal ink bar with a hand-drawn brand
   ============================================================ */
.navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.navbar.navbar-cernal {
  /* Pale pipe blue, ink line art on top — the inverse of the 2026
     opening treatment, which was blueprint (#3E5C7E) with white text.
     Blue is still environment-only (rule 1); it just holds the light
     end of the pipework range instead of the dark end, which lets the
     bar sit in the same family as the hero and footer.

     Ink #1A1A1A on #D3E8F5 is 13.6:1 — AAA at every size, and a wider
     margin than the white-on-blueprint it replaces. The seam below
     stays one step deeper in the same hue (blueprint), not signal red:
     a permanent red rule on every page is decoration, which rule 2
     forbids. */
  background-color: var(--pipe-blue-soft) !important;
  border-bottom: var(--border-w-bold) solid var(--pipe-blue-deep);
  box-shadow: 0 2px 0 rgba(26, 26, 26, 0.12);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-logo {
  height: 40px;
  width: auto;
  display: block;
  transition: transform var(--dur-fast) var(--ease-bounce);
}

.navbar-brand:hover .navbar-logo {
  transform: scale(1.04) rotate(-1deg);
}

.navbar-cernal .navbar-nav .nav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* Blueprint rather than flat ink: on a pale blue bar it still clears
     7.9:1, and it keeps the bar reading as one blue object instead of
     black text dropped onto a tint. The current/hover state goes to
     full ink for the extra step of emphasis. */
  color: var(--pipe-blue-deep) !important;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard);
}

.navbar-cernal .navbar-nav .nav-link:hover,
.navbar-cernal .navbar-nav .nav-link:focus,
.navbar-cernal .navbar-nav .show>.nav-link {
  /* A white pill. The bar itself is already pale blue, so the pale-blue
     wash the dropdown items use would not show here; paper does, and
     #2C4460 on white is 10:1. */
  color: var(--ui-active-deep) !important;
  background-color: var(--paper);
}

.navbar-toggler {
  border: var(--border-w) solid var(--ui-active-deep);
  border-radius: var(--radius-sm);
}

/* The collapsed menu on small screens drops out of the bar and onto the
   page, so it needs its own opaque surface — otherwise the links would
   sit straight on top of whatever is scrolled underneath. */
@media (max-width: 991.98px) {
  .navbar-cernal .navbar-collapse {
    background-color: var(--pipe-blue-soft);
    border-top: var(--border-w) solid var(--pipe-blue-deep);
    margin-top: 0.6rem;
    padding: 0.5rem 0 0.75rem;
  }
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px var(--pipe-shade);
}

/* Dropdown menus become little sticker cards */
.dropdown-menu {
  font-family: var(--font-sans);
  background-color: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sticker-sm);
  padding: 0.35rem;
  margin-top: 0.5rem;
}

.dropdown-item {
  font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--ui-active-soft);
  color: var(--ui-active-deep);
}

/* ============================================================
   Hero header — cream paper band with an ink title
   ============================================================ */
.bg-hero {
  position: relative;
  background-color: var(--paper-sink) !important;
  background-image:
    radial-gradient(rgba(26, 26, 26, 0.05) 1.6px, transparent 1.6px),
    linear-gradient(180deg, var(--card-tint), var(--paper-sink));
  background-size: 24px 24px, 100% 100%;
  border-bottom: var(--border-w-bold) solid var(--ink);
  overflow: hidden;
}

.bg-hero .container {
  position: relative;
  z-index: 1;
}

/* Hero wallpaper: the CERNAL "blueprint pipes" pattern, extracted from the
   original site, under a cream wash that keeps it faint enough to read over.
   Both are drawn on the .hero-fx layer (see "Hero motion" below) instead of
   this element's background, because the wallpaper moves and the wash above
   it must not. All this rule still does is clear the plain hero's dot grid,
   which would otherwise show through the wash. */
.bg-hero.hero-pipes {
  background-image: none;
}

/* Big hand-drawn hero title. Overrides Bootstrap's text-white utility. */
.bg-hero h1,
.bg-hero .display-4,
.bg-hero .text-white {
  color: var(--ink) !important;
  text-shadow: 2px 2px 0 rgba(196, 30, 58, 0.18);
}

/* Mono kicker sits above the title (added in layout.html) */
.hero-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cernal-red);
  background: var(--cernal-red-soft);
  border: var(--border-w) solid var(--cernal-red);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.9rem;
  margin-bottom: 0.75rem;
}

/* The lead paragraph under the title */
.bg-hero .lead,
.bg-hero .text-white-50 {
  color: var(--ink-2) !important;
  font-weight: 600;
  max-width: 60ch;
}

/* ============================================================
   Factory hero — every page except the landing page
   ------------------------------------------------------------
   static/hero-factory.js draws an endless production line into
   a layer behind the header's content (RNA-seq in, then SELECT,
   DESIGN, RANK, ASSEMBLE, and CERNAL crates out). This block only
   lays out the band and the card the title sits on; the drawing,
   the motion and the reduced-motion handling all live in the
   script.

   The band is flat paper. The extra space under the card is
   deliberate: it is where the conveyor runs, so the belt and what
   is on it stay visible while the tall machinery passes behind
   the card.
   ============================================================ */
.bg-hero.hero-factory {
  background-color: var(--paper) !important;
  background-image: none;
  min-height: 420px;
  padding: 3.25rem 0 6.75rem;
}

/* The title card is a callout: the same pale wash, hairline border
   and four corner brackets as .bd-callout, so the hero and the page's
   content boxes are one family. It is restated here rather than
   reusing the class because .bd-callout also sets body-copy type
   sizes and injects its own "// NOTE" kicker. */
.hero-card {
  position: relative;
  display: inline-block;
  max-width: min(640px, 100%);
  --callout-accent: var(--pipe-blue-deep);
  background: var(--card-tint);
  background: color-mix(in srgb, var(--pipe-blue-soft) 55%, var(--card));
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.6rem 1.4rem;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: -9px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent));
  background-size:
    16px 3px, 3px 16px,
    16px 3px, 3px 16px,
    16px 3px, 3px 16px,
    16px 3px, 3px 16px;
  background-position:
    left top, left top,
    right top, right top,
    left bottom, left bottom,
    right bottom, right bottom;
}

/* No red offset shadow on the card's title. The base .bg-hero h1 rule
   adds one for titles set straight on the band; on the blue-washed
   callout it reads as a second, stray accent. (.bg-hero is in the
   selector to outrank that base rule.) */
.bg-hero .hero-card h1 {
  margin: 0 0 0.35rem;
  text-shadow: none;
}

.hero-card .lead {
  margin: 0;
}

/* Most pages have no lead; the empty paragraph should not add height. */
.hero-card .lead:empty {
  display: none;
}

/* ============================================================
   Hero motion — the hero band's living layers
   ------------------------------------------------------------
   `.hero-fx` is the empty decorative <span> that layout.html puts
   at the top of every hero. It holds the blueprint wallpaper and
   the wash over it, which the header's own background can no
   longer do: the wallpaper moves and the wash above it must not.

   One effect, decorative, switched on by a class on the <header>
   (layout.html, or a page's {% block hero_class %}):

     hero-fx-drift  the wallpaper glides along its own isometric
                    diagonal — one tile per 80s.

   Painting order, bottom to top:

     .bg-hero background   the paper
     .hero-fx::before      the wallpaper (moving, under hero-fx-drift)
     .hero-fx::after       the wash that keeps the wallpaper faint
     .bg-hero .container   kicker / title / lead (z-index 1)

   The glint sits on the header's own ::after because the span's two
   pseudo-elements are spent; tree order puts it above the span and
   its z-index keeps it below the text. Every layer here is
   pointer-transparent, so the title and lead stay selectable, and
   all the motion stops under prefers-reduced-motion (end of the
   section).
   ============================================================ */

.hero-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-pipes .hero-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.55));
}

/* --- Flow drift ----------------------------------------------------- */
.hero-fx-drift .hero-fx::before {
  animation: hero-drift 80s linear infinite;
}

/* Exactly one tile (720 x 392.35px at this scale) per cycle, so the loop
   restarts on an identical frame and the glide never visibly jumps. */
@keyframes hero-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-720px, -392.35px, 0);
  }
}

/* --- Signal glint --------------------------------------------------- */

/* The pass takes 4s of the 12s cycle; the remaining 8s is the hero at
   rest, which is what keeps this a glint rather than a strobe. */

@media (prefers-reduced-motion: reduce) {

  /* Left in place, just not moving — the hero then looks exactly like the
     static version. */
  .hero-fx-drift .hero-fx::before {
    animation: none;
  }
}

/* The content sheet. Body copy on this page is bare headings and
   lists rather than callouts or cards, so it still needs one opaque
   surface to sit on — but it is a surface, not a card. No border, no
   radius, no sticker drop: white paper on a white-washed page, so the
   reader sees text on paper and the wallpaper survives only in the
   gutters either side. That is the 2025 wiki's arrangement reached
   from the other direction — they mask the page down to two narrow
   edge rails, we let a full-width sheet cover everything between the
   gutters. Same result on screen.

   It is pulled out past the container's own padding so the paper
   reaches closer to the viewport edge and the remaining wallpaper
   reads as a deliberate margin rather than a leftover strip. */
.home-sheet {
  background-color: transparent;
  border-radius: 0;
  padding: 0 3rem 3rem;
  margin: 0 -3rem 3.5rem;
}

.home-panel {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(126, 148, 158, 0.45);
  box-sizing: border-box;
  margin-left: auto;
  margin-bottom: 1.5rem;
  margin-right: auto;
  max-width: 980px;
  padding: 2.75rem 3rem;
  width: 100%;
}

/* --- Home story ----------------------------------------------------
   The landing page uses the reference site's short narrative rhythm while
   keeping this wiki's paper, ink, and pipe-blue visual language. */
.home-intro {
  margin: 0 auto;
  padding: 2.75rem 3rem 3.75rem;
  text-align: center;
}

.home-kicker,
.home-problems article > span,
.home-section-head p {
  color: var(--cernal-red);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-kicker {
  align-items: center;
  color: var(--ink-3);
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.4rem;
}

.home-kicker span {
  background: var(--cernal-red);
  border-radius: 50%;
  display: inline-block;
  height: 0.4rem;
  width: 0.4rem;
}

.home-intro h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 auto;
  max-width: 760px;
}

.home-intro h2 em {
  color: var(--cernal-red);
  font-style: normal;
}

.home-problems {
  display: flex;
  margin: 0 auto 1.5rem;
  padding: 3.5rem 0;
}

.home-problems article {
  flex: 1;
  padding: 0 2.25rem;
  text-align: center;
}

.home-problems article + article {
  border-left: 1px solid var(--paper-edge);
}

.home-problems h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 0.55rem 0;
}

.home-problems p {
  color: var(--ink-2);
  font-size: 0.9rem;
  margin: 0;
}

.home-pipeline {
  margin: 0 auto 1.5rem;
  padding: 4.5rem 3rem 3.5rem;
}

.home-section-head {
  margin-bottom: 3rem;
  text-align: center;
}

.home-section-head h2,
.home-output h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  margin: 0 0 0.45rem;
}

.home-section-head p {
  color: var(--ink-3);
  margin: 0;
}

.home-stages {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.home-stages article {
  border-top: 3px solid var(--cernal-red);
  flex: 1 1 0;
  min-height: 150px;
  padding: 1rem 1.25rem 0;
}

.home-stages article + article {
  border-left: 1px solid var(--paper-edge);
}

.home-stages span {
  color: var(--cernal-red);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.home-stages h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  margin: 0.35rem 0;
}

.home-stages p {
  color: var(--ink-2);
  font-size: 0.9rem;
  margin: 0;
}

.home-output {
  padding: 3.5rem 3rem 1rem;
  text-align: center;
}

.home-output .pill-btn {
  margin-top: 1rem;
}

@media (max-width: 575.98px) {
  /* No negative margin on phones — the container's padding is all the
     breathing room there is, and pulling out of it would push the
     sheet off-screen. */
  .home-sheet {
    padding: 0 1.1rem 2rem;
    margin-left: 0;
    margin-right: 0;
  }

  .home-panel {
    padding: 2rem 1.25rem;
  }

  .home-intro {
    padding: 2rem 1.25rem 2.75rem;
  }

  .home-problems {
    display: block;
    padding: 2.5rem 0;
  }

  .home-problems article {
    padding: 0 0.5rem;
  }

  .home-problems article + article {
    border-left: 0;
    border-top: 1px solid var(--paper-edge);
    margin-top: 2rem;
    padding-top: 2rem;
  }

  .home-pipeline {
    padding-top: 3rem;
  }

  .home-stages {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .home-stages article + article {
    border-left: 0;
  }
}

/* --- The landing hero ----------------------------------------------
   Tall enough to hold the page on open, and paper white rather than
   the cream every other hero uses, so it runs continuously into the
   page below it — the wallpaper is what marks the band out, not a
   change of ground colour. */
.bg-hero.hero-home {
  background-color: var(--paper) !important;
  /* Tall enough to hold the screen on open, but bounded at both ends.
     A bare `68vh` balloons to ~1600px of mostly empty blue on a tall
     monitor, and collapses below the logo on a short laptop; the clamp
     keeps it between half a laptop screen and a comfortable maximum. */
  min-height: clamp(420px, 68vh, 640px);
  display: flex;
  align-items: center;
}

.bg-hero.hero-home>.container {
  width: 100%;
}

/* The hero's own wash sits over the moving wallpaper inside the band.
   Paper white, matching the page below — the pipes carry their own
   blue and the wash only holds them back far enough to read the
   wordmark over them. Lighter than the page's 0.80 because this is
   the one place the drift is meant to be noticed. Flat fill, no
   gradient. */
.hero-home .hero-fx::after {
  background: rgba(255, 255, 255, 0.70);
}

/* The wordmark stands in for the hero's <h1> text on the landing page, so
   the heading's own type metrics have to get out of its way. */
.hero-home h1 {
  margin-bottom: 0.5rem !important;
}

.hero-logo {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 200px;
  margin: 0 auto;
}

/* The hero is centred on this page, so the kicker pill and the lead
   have to be centred too — the lead carries a 60ch max-width from the
   base hero rules, which would otherwise leave it hugging the left. */
.hero-home .lead {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767.98px) {
  .bg-hero.hero-home {
    min-height: 0;
  }

  .hero-logo {
    max-height: 130px;
  }
}

/* ============================================================
   Callouts — the wiki's main content boxes → sticker cards
   ============================================================ */
/* Viewfinder-bracket style: a sticker card with four L-shaped corner
   brackets floating just outside each corner. Tone is carried by the bracket
   color (--callout-accent), a small mono kicker line, and a pale wash of the
   same hue behind the text so the box stands off the white page. Each tone
   sets --callout-soft to its palette "-soft" pastel; --callout-bg thins it
   with white. Raise or lower the % below to tune how much callouts pop. */
.bd-callout {
  position: relative;
  --callout-accent: var(--pipe-blue-deep);
  --callout-fg: var(--pipe-blue-deep);
  --callout-soft: var(--pipe-blue-soft);
  --callout-bg: color-mix(in srgb, var(--callout-soft) 55%, var(--card));
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  background: var(--card-tint);
  background: var(--callout-bg);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Four corner brackets, drawn as eight solid slivers on one overlay that sits
   9px outside the card on every side (so the brackets frame each corner). */
.bd-callout::after {
  content: "";
  position: absolute;
  inset: -9px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent)),
    linear-gradient(var(--callout-accent), var(--callout-accent));
  background-size:
    16px 3px, 3px 16px,
    /* top-left */
    16px 3px, 3px 16px,
    /* top-right */
    16px 3px, 3px 16px,
    /* bottom-left */
    16px 3px, 3px 16px;
  /* bottom-right */
  background-position:
    left top, left top,
    right top, right top,
    left bottom, left bottom,
    right bottom, right bottom;
}

/* Kicker: an explicit <h4> becomes the tag line; callouts without one get an
   automatic kicker (// NOTE, // CHECK, …) matching the tone. */
.bd-callout h4,
.bd-callout:not(:has(h4))::before {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  /* The kicker is set here rather than trusted to the markup, so a
     callout reads the same however its <h4> happens to be typed — and
     matches the ALL-CAPS defaults below, which pages get when they omit
     the <h4> entirely. Wrap anything whose capitalisation carries
     meaning (iGEM, PoC, pH, a unit) in .no-caps. */
  text-transform: uppercase;
  color: var(--callout-fg);
  margin: 0 0 0.5rem;
}

.bd-callout:not(:has(h4))::before {
  content: "// NOTE";
}

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

.bd-callout code {
  border-radius: var(--radius-sm);
}

/* Corner brackets extend 9px past the box, so stacked callouts need a gap wide
   enough that adjacent brackets don't collide. */
.bd-callout+.bd-callout {
  margin-top: 1.75rem;
}

.bd-callout hr {
  border-top-width: 1px;
  opacity: 0.55;
}

.bd-callout-blue {
  --callout-accent: var(--pipe-blue-deep);
  --callout-fg: var(--pipe-blue-deep);
  --callout-soft: var(--pipe-blue-soft);
}

.bd-callout-yellow {
  --callout-accent: var(--rna-amber-deep);
  --callout-fg: var(--rna-amber-deep);
  --callout-soft: var(--rna-amber-soft);
}

.bd-callout-yellow:not(:has(h4))::before {
  content: "// FLAG";
}

.bd-callout-red {
  --callout-accent: var(--cernal-red);
  --callout-fg: var(--cernal-red-deep);
  --callout-soft: var(--cernal-red-soft);
}

.bd-callout-red:not(:has(h4))::before {
  content: "// ALERT";
}

.bd-callout-green {
  --callout-accent: var(--gate-green-deep);
  --callout-fg: var(--gate-green-deep);
  --callout-soft: var(--gate-green-soft);
}

.bd-callout-green:not(:has(h4))::before {
  content: "// CHECK";
}

.bd-callout-teal {
  --callout-accent: var(--acc-teal);
  --callout-fg: var(--acc-teal);
  --callout-soft: var(--acc-teal-soft);
}

.bd-callout-teal:not(:has(h4))::before {
  content: "// METHOD";
}

.bd-callout-violet {
  --callout-accent: var(--acc-violet);
  --callout-fg: var(--acc-violet);
  --callout-soft: var(--acc-violet-soft);
}

.bd-callout-violet:not(:has(h4))::before {
  content: "// MODEL";
}

.bd-callout-kraft {
  --callout-accent: var(--acc-kraft);
  --callout-fg: var(--acc-kraft);
  --callout-soft: var(--acc-kraft-soft);
}

.bd-callout-kraft:not(:has(h4))::before {
  content: "// PROTOCOL";
}

/* ============================================================
   Bootstrap cards → sticker cards
   ============================================================ */
.card {
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm);
}

.card-header,
.card-footer {
  background: var(--paper-sink);
  border-color: var(--paper-edge);
  font-family: var(--font-mono);
  font-weight: 700;
}

.card:hover {
  box-shadow: var(--shadow-sticker);
}

/* ============================================================
   Buttons — hand-drawn sticker buttons with a hard offset
   ============================================================ */
.btn {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: 0.01em;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  box-shadow: var(--shadow-sticker-sm);
  transition: transform var(--dur-fast) var(--ease-bounce),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sticker);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-primary {
  background-color: var(--cernal-red);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--cernal-red-deep);
  border-color: var(--ink);
  color: #fff;
}

.btn-secondary {
  background-color: var(--pipe-blue);
  border-color: var(--ink);
  color: #fff;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--pipe-blue-deep);
  border-color: var(--ink);
  color: #fff;
}

.btn-success {
  background-color: var(--gate-green);
  border-color: var(--ink);
  color: #fff;
}

.btn-warning {
  background-color: var(--rna-amber);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-danger {
  background-color: var(--cernal-red);
  border-color: var(--ink);
  color: #fff;
}

.btn-outline-primary {
  color: var(--cernal-red-deep);
  border-color: var(--ink);
  background: var(--card);
}

.btn-outline-primary:hover {
  background: var(--cernal-red);
  color: #fff;
}

/* ============================================================
   Pill buttons (.pill-btn) - the site's button for calls to action
   and for "read more" style disclosure controls.
   ------------------------------------------------------------
   Works on <a> and <button> alike.
   Default: soft fill, accent border and label. Hover or keyboard
   focus: solid accent fill with a white label, a small lift.
   .pill-btn--primary: filled at rest, for the one main action.
   .pill-btn--sm: a smaller pill for toolbars.
   aria-expanded="true": dashed border, so an open disclosure
   differs from its hover state. Disabled (.is-disabled,
   aria-disabled or :disabled): muted and inert.
   Recolour a group by setting --pill-accent and --pill-soft on it
   or on the button; both default to the blue track colours.
   Not for navigation, tabs, accordion headers or form controls.
   ============================================================ */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--pill-accent, var(--pipe-blue-deep));
  background: var(--pill-soft, var(--pipe-blue-soft));
  border: 1.5px solid var(--pill-accent, var(--pipe-blue-deep));
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}

.pill-btn[hidden] {
  display: none;
}

.pill-btn:hover,
.pill-btn:focus-visible {
  color: var(--paper);
  background: var(--pill-accent, var(--pipe-blue-deep));
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.pill-btn:focus-visible {
  outline: 3px solid var(--pill-accent, var(--pipe-blue-deep));
  outline-offset: 3px;
}

.pill-btn:active {
  transform: none;
  box-shadow: none;
}

.pill-btn[aria-expanded="true"] {
  border-style: dashed;
}

.pill-btn[aria-expanded="true"]:hover,
.pill-btn[aria-expanded="true"]:focus-visible {
  transform: none;
}

.pill-btn--primary {
  color: var(--paper);
  background: var(--pill-accent, var(--pipe-blue-deep));
}

.pill-btn--primary:hover,
.pill-btn--primary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
}

.pill-btn--sm {
  min-height: 2rem;
  padding: 0.25rem 0.8rem;
  font-size: 0.8125rem;
}

.pill-btn.is-disabled,
.pill-btn[aria-disabled="true"],
.pill-btn:disabled {
  color: var(--ink-3);
  background: var(--paper-sink);
  border-color: var(--ink-3);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .pill-btn {
    transition: none;
  }
  .pill-btn:hover,
  .pill-btn:focus-visible {
    transform: none;
  }
}

/* ============================================================
   Badges & pills
   ============================================================ */
.badge {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.35em 0.7em;
}

.badge.bg-primary {
  background-color: var(--cernal-red) !important;
  color: #fff;
}

.badge.bg-secondary {
  background-color: var(--pipe-blue) !important;
  color: #fff;
}

.badge.bg-success {
  background-color: var(--gate-green) !important;
  color: #fff;
}

.badge.bg-warning {
  background-color: var(--rna-amber) !important;
  color: var(--ink);
}

/* ============================================================
   Tables — clean ledger look on cream
   ============================================================ */
.table {
  --bs-table-bg: transparent;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--ink-2);
}

.table thead th {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--border-w) solid var(--ink);
}

.table td,
.table th {
  border-color: var(--paper-edge);
  padding: 0.65rem 0.8rem;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
  --bs-table-accent-bg: var(--paper-sink);
  background-color: var(--paper-sink);
}

.table-hover>tbody>tr:hover>* {
  background-color: var(--rna-amber-soft);
}

/* ============================================================
   Accordion (in case content pages use it)
   ============================================================ */
.accordion-item {
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md) !important;
  margin-bottom: 0.6rem;
  overflow: hidden;
  background: var(--card);
}

/* Bootstrap ships `.accordion-item:not(:first-of-type){border-top:0}`
   because its accordions are a flush stack: the items butt together
   and share one edge, so a top border on each would double up.
   Ours don't stack — every item is a separate rounded card with a
   0.6rem gap — so each one needs all four sides. Bootstrap's rule
   is (0,2,0) and outranks the (0,1,0) above it, which left every
   card after the first open-topped.

   Only the top edge is restated, and .acc-yellow (the one variant
   that recolors the whole border) gets its color back on the next
   rule. The acc-red/blue/green/amber variants only touch
   border-left, so --ink is already right for them. */
.accordion-item:not(:first-of-type) {
  border-top: var(--border-w) solid var(--ink);
}

.acc-yellow:not(:first-of-type) {
  border-top-color: var(--rna-amber-deep);
}

.accordion-button {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
}

.accordion-button:not(.collapsed) {
  color: var(--ui-active-deep);
  background: var(--ui-active-soft);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px var(--ui-active-soft);
}

/* --- Yellow variant (references, warnings) --- */
.acc-yellow {
  border-color: var(--rna-amber-deep);
}

.acc-yellow .accordion-button {
  color: var(--ink);
  background: var(--rna-amber-soft);
}

.acc-yellow .accordion-button:not(.collapsed) {
  color: var(--rna-amber-deep);
  background: var(--rna-amber-soft);
  box-shadow: none;
}

.acc-yellow .accordion-button::after {
  filter: brightness(0.6) sepia(1) hue-rotate(10deg) saturate(2);
}

.acc-yellow .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--rna-amber-soft);
}

/* Color variants — add one class to the .accordion-item:
   acc-red (default look), acc-blue, acc-green, acc-amber.
   Each recolors the open header + focus ring and adds a left accent bar. */
.accordion-item.acc-red {
  border-left: 0.4rem solid var(--cernal-red);
}

.accordion-item.acc-blue {
  border-left: 0.4rem solid var(--pipe-blue);
}

.accordion-item.acc-blue .accordion-button:not(.collapsed) {
  color: var(--pipe-blue-deep);
  background: var(--pipe-blue-soft);
}

.accordion-item.acc-blue .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--pipe-blue-soft);
}

.accordion-item.acc-green {
  border-left: 0.4rem solid var(--gate-green);
}

.accordion-item.acc-green .accordion-button:not(.collapsed) {
  color: var(--gate-green-deep);
  background: var(--gate-green-soft);
}

.accordion-item.acc-green .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--gate-green-soft);
}

.accordion-item.acc-amber {
  border-left: 0.4rem solid var(--rna-amber);
}

.accordion-item.acc-amber .accordion-button:not(.collapsed) {
  color: var(--rna-amber-deep);
  background: var(--rna-amber-soft);
}

.accordion-item.acc-amber .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--rna-amber-soft);
}

.accordion-item.acc-teal {
  border-left: 0.4rem solid var(--acc-teal);
}

.accordion-item.acc-teal .accordion-button:not(.collapsed) {
  color: var(--acc-teal);
  background: var(--acc-teal-soft);
}

.accordion-item.acc-teal .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--acc-teal-soft);
}

.accordion-item.acc-violet {
  border-left: 0.4rem solid var(--acc-violet);
}

.accordion-item.acc-violet .accordion-button:not(.collapsed) {
  color: var(--acc-violet);
  background: var(--acc-violet-soft);
}

.accordion-item.acc-violet .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--acc-violet-soft);
}

/* ============================================================
   Footer — pale pipe-blue slab with ink text

   Matched to the navbar so the page is bracketed by the same
   surface top and bottom. Every value below was re-picked for the
   light ground: the old set was mixed for white-on-blueprint and
   most of it (white text, amber links) drops under 3:1 here.
   ============================================================ */
.footer {
  background-color: var(--pipe-blue-soft) !important;
  color: var(--ink-2);
  border-top: var(--border-w-bold) solid var(--pipe-blue-deep);
}

footer h4 {
  font-family: var(--font-mono);
  color: var(--pipe-blue-deep);
}

footer p,
footer li {
  color: var(--ink-2);
}

footer a {
  color: var(--pipe-blue-deep);
  font-weight: 700;
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* `.subfoot` (the CC-BY licence link) deliberately has no colour rule of
   its own: it takes `footer a` / `footer a:hover` like the GitLab repository
   link beside it, so both required footer links behave identically —
   blueprint blue at rest, ink and underlined on hover.

   Do not re-add a `footer a.subfoot { color: … }` rule. It would have the
   same specificity as `footer a:hover` (0,1,2 both) and, sitting later in
   the file, would win on hover too and leave the link stuck on one colour.
   Restyle it via `footer a` if it needs to change.

   Contrast on the pale-blue footer is 7.9:1 at rest and 13.6:1 on hover. */

footer hr {
  border-top-color: rgba(44, 68, 96, 0.3);
}

footer ul {
  list-style: none;
  padding-left: 0;
}

footer ul li {
  margin-bottom: 0.3rem;
}

/* ============================================================
   CERNAL pipeline — numbered vertical process (Description page)
   ============================================================ */
.cernal-pipeline {
  margin: 1.5rem 0;
}

.pipeline-step {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.1rem;
}

.pipeline-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: -2px;
  width: 2px;
  background: var(--pipe-blue);
  opacity: 0.45;
}

.pipeline-num {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--pipe-blue);
  color: #fff;
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow-sticker-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.pipeline-body {
  flex: 1;
  min-width: 0;
  background: var(--pipe-blue-soft);
  border: var(--border-w) solid var(--ink);
  border-left: 0.4rem solid var(--pipe-blue);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm);
  padding: 1rem 1.2rem;
  color: var(--ink-2);
}

.pipeline-body strong:first-child {
  color: var(--pipe-blue-deep);
}

/* ============================================================
   Tabs — CERNAL sticker style (case studies)
   ============================================================ */
/* Standalone chips above a self-contained card. Each tab is its own bordered
   sticker, so nothing has to "bridge" into the panel — the layout stays correct
   at any width even when the strip wraps to multiple rows. */
.cernal-tabs {
  border-bottom: 0;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cernal-tabs .nav-link {
  font-family: var(--font-sans);
  font-weight: 800;
  color: var(--ink-2);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sticker-sm);
  padding: 0.5rem 1rem;
}

.cernal-tabs .nav-link:hover {
  color: var(--pipe-blue-deep);
  background: var(--pipe-blue-soft);
}

.cernal-tabs .nav-link.active {
  color: var(--pipe-blue-deep);
  background: var(--pipe-blue-soft);
  border-color: var(--pipe-blue-deep);
}

.cernal-tabpane {
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sticker-sm);
  padding: 1.4rem 1.5rem;
}

.cernal-tabpane .tab-pane> :first-child {
  margin-top: 0;
}

/* Default-closed: with no tab selected, collapse the panel so there's no empty box */
.cernal-tabpane:not(:has(.tab-pane.active)) {
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Blue outline button — cross-page "keep reading" links */
.btn-outline-secondary {
  color: var(--pipe-blue-deep);
  border-color: var(--ink);
  background: var(--card);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--pipe-blue);
  border-color: var(--ink);
  color: #fff;
}

/* ============================================================
   Team cards — portrait "sticker" cards (Team page)
   ------------------------------------------------------------
   Layout is Bootstrap's own grid: each section on the Team page is
   a `.row.team-row.row-cols-*` with one `.col` per person, so the
   column counts sit in the page markup like every other page here.
   This block styles the card itself and nothing else — the one
   exception is the accent rotation at the bottom, which utility
   classes can't express.
   ============================================================ */
/* A section's cards end flush with no trailing space of their own, so without
   a deliberate gap the next heading reads as a label on the grid above it
   rather than the start of a new group. Only between sections — no dead space
   before the first heading or after the last row. */
.team-section+.team-section {
  margin-top: clamp(3rem, 6vw, 5rem);
}

/* The card is a <button>: reset the UA styling, then dress it as a sticker. */
.team-card {
  display: flex;
  flex-direction: column;
  /* Cols stretch to the tallest in their row; this passes that height
     down so cards in a row line up even with uneven blurb lengths. */
  height: 100%;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard);
}

.team-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sticker);
}

/* Open card: keep it lifted and ring it in its own accent colour so it's
   obvious which card the strip below belongs to. */
.team-card.is-open {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sticker), 0 0 0 3px var(--card-accent, var(--accent));
}

/* Square crop keeps every row aligned no matter what the source photos
   are; faces stay centred because object-fit crops from the middle. */
.team-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: var(--border-w) solid var(--ink);
  background: var(--paper-sink);
}

/* Stand-in shown until a photo URL is filled in: the person's initials
   on the recessed paper tone, so an unfinished grid still reads cleanly. */
.team-card__photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  background-color: var(--paper-sink);
  background-image: radial-gradient(rgba(26, 26, 26, 0.06) 1.4px, transparent 1.4px);
  background-size: 14px 14px;
}

/* Card text is made of <span>s (a <button> may not contain headings). */
.team-card__body {
  display: block;
  padding: 0.85rem 1rem 1rem;
}

.team-card__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  color: var(--text-strong);
}

.team-card__role {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card-accent, var(--accent));
  margin-top: 0.35rem;
}

/* ------------------------------------------------------------
   The description panel — a second card tucked behind the photo
   card that slides out past its right edge, adding 75% of the
   card's width in text. Small screens get a plain drop-down
   instead, where there is no room to slide sideways.
   ------------------------------------------------------------ */
.team-slot {
  /* How far the panel stays tucked under the card once open, so the two
     read as overlapping cards rather than two boxes end to end. */
  --tuck: 0px;
  /* Shared timing for the slide and for the nudge the neighbouring cards
     make to get out of its way, so the whole row moves as one gesture.
     Long, heavily decelerating ease — the panel has real weight. */
  --team-dur: 420ms;
  --team-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* The gesture runs in two beats: the cards make room, then the panel slides
     into it. Without the gap the middle card of a full row moves 267px left
     while its panel slides 287px right, so the panel covers 20px of screen —
     it appears rather than slides. Waiting lets it travel the full width. */
  --team-lag: calc(var(--team-dur) * 0.32);
  position: relative;
  /* team.js sets translateX here to open up room. Closing is the gesture in
     reverse: the panel tucks away first, then the cards drift back. */
  transition: transform var(--team-dur) var(--team-ease) var(--team-lag);
}

/* Opening: the cards move immediately, on the first beat. */
.team-slot.is-shifted {
  transition: transform var(--team-dur) var(--team-ease) 0s;
}

/* Card above panel, so the panel is genuinely hidden behind it when shut. */
.team-slot .team-card {
  position: relative;
  z-index: 2;
}

/* A card that has slid aside overlaps the one it moved over, so it has to
   paint above it — and a deeper shadow sells it as lifted rather than clipped.
   Declared before .is-active so an open card that also moved keeps z-index 5. */
.team-slot.is-shifted {
  z-index: 3;
}

.team-slot.is-shifted .team-card {
  box-shadow: var(--shadow-sticker);
}

/* Raised while open so the panel passes over its neighbours, not under. */
.team-slot.is-active {
  z-index: 5;
}

.team-detail {
  display: none;
  margin-top: 0.9rem;
}

.team-detail.is-open {
  display: block;
}

.team-detail__inner {
  position: relative;
  height: 100%;
  overflow-y: auto;
  /* Column flex so the links row can take `margin-top: auto` and sit against
     the bottom edge when the text is short. */
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm);
  padding: 1.1rem 1.2rem 1.15rem calc(1.2rem + var(--tuck));
}

/* The grid is 3 columns with only 2 filled per line, so the spare column is
   the slack the cards step into when a panel opens — no width capping needed. */
@media (min-width: 992px) {
  .team-slot {
    --tuck: 20px;
    height: 100%;
  }

  /* Closed state is translateX(-100%) — the panel's own width — which parks
     it entirely behind the card. Opening slides it out to sit `--tuck` under
     the card's right edge, extending 75% of the card's width beyond it. */
  .team-detail {
    display: block;
    position: absolute;
    top: 0;
    left: calc(100% - var(--tuck));
    width: calc(75% + var(--tuck));
    height: 100%;
    margin-top: 0;
    z-index: 1;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%);
    /* Closing runs on the first beat, with no lag, so the panel is out of the
       way before the cards drift back. Opacity is shorter than the slide so it
       fades during the travel rather than blinking off at the end. */
    transition:
      transform var(--team-dur) var(--team-ease) 0s,
      opacity calc(var(--team-dur) * 0.5) var(--team-ease) 0s,
      visibility 0s linear var(--team-dur);
  }

  /* Opening waits out --team-lag so the cards have already opened the gap. */
  .team-detail.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition:
      transform var(--team-dur) var(--team-ease) var(--team-lag),
      opacity calc(var(--team-dur) * 0.65) var(--team-ease) var(--team-lag),
      visibility 0s;
  }

  /* Cards with no room to their right (last in a visual row) open the other
     way instead of pushing the panel outside the grid. */
  .team-detail.is-flipped {
    left: auto;
    right: calc(100% - var(--tuck));
    transform: translateX(100%);
  }

  .team-detail.is-flipped.is-open {
    transform: translateX(0);
  }

  .team-detail.is-flipped .team-detail__inner {
    padding-left: 1.2rem;
    padding-right: calc(1.2rem + var(--tuck));
  }
}

.team-detail__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  line-height: 1;
  font-size: 1.15rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* Flipped panels are tucked under the card on their RIGHT edge, so the close
   button swaps to the free side rather than sitting over the overlap. */
.team-detail.is-flipped .team-detail__close {
  right: auto;
  left: 0.55rem;
}

.team-detail__close:hover {
  color: var(--ink);
  background: var(--paper-sink);
}

.team-detail__name {
  font-size: 1.15rem;
  /* Keeps the title clear of the close button, whichever corner it's in. */
  margin: 0 1.6rem 0 0;
}

.team-detail.is-flipped .team-detail__name {
  margin: 0 0 0 1.6rem;
}

.team-detail__role {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0.35rem 0 0;
}

/* A second role line, for someone who also sits on another team. Same mono
   label voice as the primary role but muted and unaccented, so it reads as
   subordinate to the line above rather than competing with it. */
.team-card__role--extra,
.team-detail__role--extra {
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.team-detail__blurb {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0.7rem 0 0;
}

/* Favourite-animal footnote — a small block below the blurb, fenced off by a
   hairline so it reads as an aside rather than more of the description. Uses
   the mono "label" voice the callouts and role tags already use. */
.team-detail__animal {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--paper-edge);
}

.team-detail__animal-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.team-detail__animal-name {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text-strong);
}

.team-detail__animal-why {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-body);
}

/* Profile links. `margin-top: auto` drops the row to the bottom of the panel
   when the text is short; when the text overflows it resolves to 0 and the row
   simply follows the content, scrolling with it. `flex-shrink: 0` stops the
   icons being squashed in that case. Built as a row so a second service could
   be added later without changing the layout. */
.team-detail__links {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.9rem;
  flex-shrink: 0;
}

.team-detail__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--paper-sink);
  border: 1px solid var(--paper-edge);
  /* The global link rule adds an underline on hover; icons don't want one. */
  text-decoration: none;
  transition:
    color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.team-detail__link:hover,
.team-detail__link:focus-visible {
  color: #fff;
  background: var(--pipe-blue);
  border-color: var(--ink);
  text-decoration: none;
}

.team-detail__link svg, .team-detail__link span.wiki-webp-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Role labels cycle through the reporter palette so a long grid keeps some
   colour rhythm. Set on the `.col`, inherited by the card inside it. The
   index is stamped by the template rather than read with :nth-child, because
   the grid also carries line-break helpers that would throw the count off. */
.accent-0 {
  --card-accent: var(--cernal-red);
}

/* The mid tier-2 tones, not the `-deep` ones. At the role label's
   11px uppercase mono the deep variants (#2C4460 / #24603A /
   #855F0C) all read as "dark" and the category coding disappears.
   accent-0 stays signal red so each row of the grid carries exactly
   one, per rule 2. */
.accent-1 {
  --card-accent: var(--acc-blue);
}

.accent-2 {
  --card-accent: var(--acc-green);
}

.accent-3 {
  --card-accent: var(--acc-gold);
}

.accent-4 {
  --card-accent: var(--acc-teal);
}

.accent-5 {
  --card-accent: var(--acc-violet);
}

@media (prefers-reduced-motion: reduce) {

  .team-card,
  .team-card__photo,
  .team-detail,
  .team-slot {
    transition: none;
  }

  .team-card:hover,
  .team-card.is-open {
    transform: none;
  }

  /* The panel still needs its transform — that's its position, not motion —
     so only the closed state's slide is dropped. */
  .team-detail:not(.is-open) {
    opacity: 0;
  }
}

/* ============================================================
   Small helpers
   ============================================================ */
/* ------------------------------------------------------------
   Text whose capitalisation carries meaning, sitting inside
   something that forces uppercase: units (µl is U+00B5 MICRO
   SIGN, and uppercasing it yields U+039C GREEK CAPITAL MU —
   which reads as an M, turning microlitres into millilitres),
   species names, and proper nouns like iGEM or PoC.

   It works wherever it is dropped, not because of specificity
   but because text-transform is inherited: a declaration on the
   element itself always beats a value inherited from an
   ancestor, however specific that ancestor's selector was.
   ------------------------------------------------------------ */
.no-caps {
  text-transform: none;
  letter-spacing: normal;
}

/* ============================================================
   Responsive tuning
   ============================================================ */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: 0.5rem;
    background: rgba(26, 26, 26, 0.35);
    border-radius: var(--radius-md);
    padding: 0.5rem;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.9rem;
  }
}

/* ============================================================
   Page table of contents
   ------------------------------------------------------------
   lg and up: a sticker card pinned in the left column of the
   content row (see layout.html). Below lg: the same list inside
   an offcanvas, opened by a floating button. Both are filled by
   static/toc.js; when a page has too few headings the script
   adds .wiki-page--no-toc and the content returns to full width.
   ============================================================ */

/* Anchors land below the fixed navbar, not under it. */
#wikiMain h1,
#wikiMain h2,
#wikiMain h3,
#wikiMain .accordion {
  scroll-margin-top: 80px;
}

.wiki-toc__inner {
  position: sticky;
  top: 80px;
  /* The column grows to 330px at xxl; the card itself reads better capped. */
  max-width: 285px;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 1.5rem;
  padding: 0.9rem 0.75rem 1rem;
  background: var(--surface-card);
  border: var(--border-w) solid var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker-sm);
  scrollbar-width: thin;
}

.wiki-toc__title {
  display: block;
  padding: 0 0.5rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wiki-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Two levels, told apart at rest and when selected.
     Section (h2)      bold ink, flush left.
     Sub-section (h3)  regular weight, quieter, indented behind a hairline
                       rail that shows it belongs to the section above.
   Selected, they differ in kind and not just in indent:
     a section fills SOLID blueprint with white text;
     a sub-section gets a PALE wash with a blueprint bar, and the section
     it sits under is marked as well (--parent, set by toc.js), so the
     rail reads "in this section, at this sub-section". */
.wiki-toc__link {
  display: block;
  padding: 0.3rem 0.55rem;
  border-left: var(--border-w-bold) solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-strong);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.wiki-toc__link:hover,
.wiki-toc__link:focus-visible {
  color: var(--text-strong);
  background-color: var(--paper-sink);
  border-left-color: var(--border-ink);
}

/* Collapsed sub-sections are removed from layout and from the a11y tree
   (toc.js sets [hidden]); this keeps a display rule from overriding it. */
.wiki-toc__list li[hidden] {
  display: none;
}

/* Sub-sections (h3): one step in, behind a rail. */
.wiki-toc__link--sub {
  margin-left: 0.8rem;
  padding-left: 0.7rem;
  border-left: var(--border-w) solid var(--paper-edge);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--text-body);
}

/* Selected section: solid. (:hover is listed so pointing at the current
   item does not swap it back to the neutral hover look.) */
.wiki-toc__link--active,
.wiki-toc__link--active:hover {
  color: var(--paper);
  background-color: var(--ui-active);
  border-left-color: var(--ui-active-deep);
}

/* Selected sub-section: pale, with the bar. */
.wiki-toc__link--sub.wiki-toc__link--active,
.wiki-toc__link--sub.wiki-toc__link--active:hover {
  color: var(--ui-active-deep);
  font-weight: 700;
  background-color: var(--ui-active-soft);
  border-left-color: var(--ui-active);
}

/* The section that contains the selected sub-section. */
.wiki-toc__link--parent {
  color: var(--ui-active-deep);
  border-left-color: var(--ui-active);
}

/* ---- Small screens: floating button + offcanvas ---- */
.wiki-toc-fab {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 1035;
  padding: 0.5rem 0.95rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--card);
  background-color: var(--ink);
  border: var(--border-w) solid var(--ink-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sticker-sm);
}

.wiki-toc-fab:hover,
.wiki-toc-fab:focus-visible {
  background-color: var(--ui-active-deep);
}

.wiki-toc-offcanvas {
  max-width: 82vw;
  background-color: var(--surface-page);
  border-right: var(--border-w-bold) solid var(--ink-line);
}

.wiki-toc-offcanvas .offcanvas-title {
  font-family: var(--font-display);
  color: var(--text-strong);
}

/* ---- Pages without enough headings ---- */
.wiki-page--no-toc .wiki-toc {
  display: none !important;
}

.wiki-page--no-toc>#wikiMain {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
}

/* The button lives outside the content row, so it is switched off from
   <body> instead of from the row. */
body.wiki-no-toc .wiki-toc-fab {
  display: none !important;
}
/* ============================================================
   Judging block (wiki/judging.html)
   ------------------------------------------------------------
   The "what the judges ask" panel at the top of every page a
   medal or award is judged on: one accordion row per ballot
   question, opening on a direct answer and links to the evidence.
   ============================================================ */
.judging {
  margin: 1.5rem 0 2.5rem;
  padding: 1.1rem 1.25rem 0.6rem;
  background: var(--card-tint);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
}

.judging__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pipe-blue-deep);
  margin-bottom: 0.35rem;
}

.judging__title {
  font-size: 1.35rem;
  margin: 0 0 0.6rem;
}

.judging__blurb {
  font-size: 0.9rem;
  color: var(--ink-2);
}

.judging__list {
  margin-top: 0.9rem;
}

.judging .accordion-button {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.judging__num {
  flex: none;
  min-width: 1.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--pipe-blue-deep);
}

.judging__num::before {
  content: "Q";
}

.judging__q {
  flex: 1;
}

.judging__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.judging__a {
  margin-bottom: 0.75rem;
}

.judging__a p { margin: 0 0 0.6rem; }
.judging__a ul, .judging__a ol { margin: 0 0 0.75rem; padding-left: 1.3rem; }
.judging__a li { margin-bottom: 0.4rem; }
.judging__a li > ul { margin: 0.3rem 0 0.2rem; }

.judging__a--todo {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--rna-amber-deep);
}

.judging__where {
  margin: 0;
}

.judging__where-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}

.judging__chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-sm);
}

.judging__chip:hover {
  color: var(--pipe-blue-deep);
  border-color: var(--pipe-blue-deep);
  background: var(--pipe-blue-soft);
}

/* ============================================================
   Back-to-top button (static/back-to-top.js)
   ------------------------------------------------------------
   Bottom-right, mirroring the mobile "Contents" pill bottom-left.
   Hidden until the reader scrolls down; --return is the "back to
   where you were" mode after following an in-page link.
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1035;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--card);
  background-color: var(--ink);
  border: var(--border-w) solid var(--ink-line);
  border-radius: 50%;
  box-shadow: var(--shadow-sticker-sm);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition:
    opacity var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-standard),
    visibility 0s linear var(--dur-base),
    background-color var(--dur-fast) var(--ease-standard);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-to-top:hover,
.back-to-top--return {
  background-color: var(--ui-active);
}

.back-to-top--return:hover {
  background-color: var(--ui-active-deep);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

@media print {
  .back-to-top {
    display: none;
  }
}

/* ============================================================
   Experiments — the CERNAL production line (Experiments page)
   ------------------------------------------------------------
   Left column: a vertical line of cardboard boxes. Every case
   runs the same three shared stages, drops into a sorter, and
   comes out on one of three case lines. Right column: a sticky
   panel showing whichever box is currently open.

   Structure and copy live in wiki/pages/experiments.html; the
   buttons and the panel are built by static/experiments.js, the
   same way the tab strips are built in layout.html.

   Box art is two cut-outs of the same carton, shut and open, as
   RGBA PNGs — so they sit on the cream paper directly with no
   blend-mode or masking tricks.
   ============================================================ */

/* This page is a diagram, not a column of prose, and the two
   columns are both load-bearing — so it opts out of the standard
   container width instead of leaving a wide margin either side.
   (`:has()` is already a dependency of this stylesheet — see the
   callout kicker and the default-closed tab panel.) */
.container:has(.exp-line) {
  max-width: 1440px;
}

/* The page's row uses `gx-lg-5`, i.e. a 3rem gutter, so it carries -1.5rem
   side margins — but .container only pads 0.75rem. On the narrower default
   container the difference disappears into the leftover margin; at full
   width it becomes 24px of horizontal page overflow. Pad to match. */
@media (min-width: 992px) {
  .container:has(.exp-line) {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
}

.exp-line {
  --exp-art: 124px;
  /* carton tile, shared stages */
  --exp-art-sm: 100px;
  /* carton tile, case lines */
  --exp-accent: var(--acc-kraft);
  --exp-accent-soft: var(--acc-kraft-soft);
  position: relative;
  padding: 0.25rem 0 0.5rem;
}

/* Accent per case line. The line sets it; every box, connector,
   header and the panel inherit or copy it. */
.exp-line [data-exp-accent="blue"] {
  --exp-accent: var(--acc-blue);
  --exp-accent-soft: var(--acc-blue-soft);
}

.exp-line [data-exp-accent="green"] {
  --exp-accent: var(--acc-green);
  --exp-accent-soft: var(--acc-green-soft);
}

.exp-line [data-exp-accent="amber"] {
  --exp-accent: var(--acc-gold);
  --exp-accent-soft: var(--acc-gold-soft);
}

/* A fourth and fifth case line, should the page grow one: add
   data-exp-accent="teal" to the .exp-branch and a matching
   .exp-sorter__outlet, then widen the two grids noted at the top
   of wiki/pages/experiments.html. */
.exp-line [data-exp-accent="teal"] {
  --exp-accent: var(--acc-teal);
  --exp-accent-soft: var(--acc-teal-soft);
}

.exp-line [data-exp-accent="violet"] {
  --exp-accent: var(--acc-violet);
  --exp-accent-soft: var(--acc-violet-soft);
}

/* ---- The shared protocols: a routed board --------------- */
/* Qualified with .exp-line throughout so these resets outrank
   `.container ol { padding-left: 1.35rem }` in Base elements.

   These six are a set of shared protocols, not a numbered
   sequence, so they are laid out like pads on a board rather
   than as a column: crates sit along both edges, and the
   channel down the middle is left clear for the traces that
   carry each of them to the ground rail at the bottom.

   The traces themselves are drawn by static/experiments.js,
   which measures where each crate actually landed and routes a
   lane per crate. CSS only guarantees the corridor stays empty
   — the cartons are alpha cut-outs, so a trace passing behind
   one would show straight through it.  */
.exp-line .exp-trunk {
  /* Clear channel the traces route through. */
  --exp-corridor: 180px;
  /* Distance from the corridor, set per crate below. The variation is
     what stops the board reading as a ladder; the floor keeps a real
     straight run before each trace's 45° jog. */
  --exp-gap: 20px;
  /* Where a trace leaves its crate: level with the carton's middle.
     experiments.js measures this rather than trusting the number,
     but it is what the layout is built around. */
  --exp-connect: 72px;
  position: relative;
  /* Room below the last crate for the lanes to converge on the rail. */
  padding: 0 0 3.25rem;
  list-style: none;
}

.exp-trunk .exp-item:nth-of-type(1) {
  --exp-gap: 20px;
}

.exp-trunk .exp-item:nth-of-type(2) {
  --exp-gap: 44px;
}

.exp-trunk .exp-item:nth-of-type(3) {
  --exp-gap: 28px;
}

.exp-trunk .exp-item:nth-of-type(4) {
  --exp-gap: 56px;
}

.exp-trunk .exp-item:nth-of-type(5) {
  --exp-gap: 24px;
}

.exp-trunk .exp-item:nth-of-type(6) {
  --exp-gap: 48px;
}

/* ---- One stop on the line ------------------------------ */
.exp-line .exp-item {
  position: relative;
  margin: 0;
  list-style: none;
}

/* Crates alternate edges and stop short of the corridor. Carton and
   label range toward it, so each trace leaves the crate rather than
   from empty space beside it. */
.exp-trunk .exp-item .exp-box {
  width: calc(50% - var(--exp-corridor) / 2 - var(--exp-gap));
}

.exp-trunk .exp-item:nth-of-type(odd) .exp-box {
  margin-right: auto;
  align-items: flex-end;
  text-align: right;
}

.exp-trunk .exp-item:nth-of-type(even) .exp-box {
  margin-left: auto;
  align-items: flex-start;
  text-align: left;
}

/* Alternating edges means consecutive crates cannot collide, so they
   ride up past each other; only same-side neighbours (n, n+2) have to
   clear, and two pitches is more than a crate's height. */
.exp-trunk .exp-item+.exp-item {
  margin-top: -3.25rem;
}

.exp-trunk .exp-item:nth-of-type(4),
.exp-trunk .exp-item:nth-of-type(6) {
  margin-top: -4rem;
}

/* The traces, drawn into this layer by experiments.js. It is the
   trunk's first child, and the crates are positioned, so they paint
   over it without needing a z-index. */
.exp-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.exp-traces path {
  fill: none;
  stroke: var(--exp-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

/* The ground rail every lane lands on. */
.exp-traces .exp-traces__rail {
  opacity: 0.85;
}

/* The case lines keep the plain drop between stops. */
.exp-branch__line .exp-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: var(--border-w-bold);
  height: 1.05rem;
  margin-top: 0.2rem;
  background: var(--exp-accent);
  border-radius: 2px;
  opacity: 0.7;
  transform: translateX(-50%);
}

/* Carton over label, centred — the same shape at every stop, so
   the shared stages sit squarely above the sorter and the three
   case lines below it. */
.exp-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.55rem 0.4rem 0.7rem;
  text-align: center;
  background: transparent;
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    border-radius var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    opacity var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-standard);
}

/* ============================================================
   Callout brackets — shared with .bd-callout
   ------------------------------------------------------------
   The four L-shaped corner brackets that mark a content box on
   this wiki, drawn as eight solid slivers on one overlay sitting
   9px outside the box. Content wears these; interface (buttons,
   chips, lamps) keeps the rounded sticker style instead.

   An open crate animates into the frame: its overlay starts
   tucked inside the button with zero-length brackets and expands
   outwards as it opens. `inset` and `background-size` are both
   animatable, so this is a real transition, not a swap.
   ============================================================ */
.exp-panel::before,
.exp-sorter__machine::after,
.exp-box::after {
  content: "";
  position: absolute;
  inset: -9px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent)),
    linear-gradient(var(--exp-accent), var(--exp-accent));
  background-size:
    16px 3px, 3px 16px,
    /* top-left */
    16px 3px, 3px 16px,
    /* top-right */
    16px 3px, 3px 16px,
    /* bottom-left */
    16px 3px, 3px 16px;
  /* bottom-right */
  background-position:
    left top, left top,
    right top, right top,
    left bottom, left bottom,
    right bottom, right bottom;
}

/* A shut crate keeps its brackets folded away inside the button. */
.exp-box::after {
  inset: 6px;
  opacity: 0;
  background-size:
    0 3px, 3px 0,
    0 3px, 3px 0,
    0 3px, 3px 0,
    0 3px, 3px 0;
  transition:
    top var(--dur-base) var(--ease-standard),
    right var(--dur-base) var(--ease-standard),
    bottom var(--dur-base) var(--ease-standard),
    left var(--dur-base) var(--ease-standard),
    opacity var(--dur-base) var(--ease-standard),
    background-size 320ms var(--ease-bounce);
}

/* Opening one expands the square into the callout frame. The offset
   is 7px rather than 9px so brackets clear the neighbouring case
   line — see the gap on .exp-branches. */
.exp-box.is-open::after {
  inset: -7px;
  opacity: 1;
  background-size:
    16px 3px, 3px 16px,
    16px 3px, 3px 16px,
    16px 3px, 3px 16px,
    16px 3px, 3px 16px;
}

.exp-box:hover,
.exp-box:focus-visible {
  background: var(--card);
  border-color: var(--ink);
  box-shadow: var(--shadow-sticker-sm);
}

/* Open: the square resolves into a callout — hairline frame, tighter
   radius, and the corner brackets below. The border stays 2px wide and
   only changes colour, so nothing inside shifts as it opens. */
.exp-box.is-open {
  background: var(--card);
  border-color: var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* Dim the rest of the line while one box is open, so the eye goes
   to the pair of open box + panel. */
.exp-line.has-open .exp-box:not(.is-open) {
  opacity: 0.55;
}

.exp-line.has-open .exp-box:not(.is-open):hover,
.exp-line.has-open .exp-box:not(.is-open):focus-visible {
  opacity: 1;
}

/* ---- The carton ---------------------------------------- */
.exp-box__art {
  position: relative;
  flex: 0 0 var(--exp-art);
  width: var(--exp-art);
  aspect-ratio: 1 / 1;
}

.exp-box__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* The carton PNGs were painted kraft brown for cream paper. At
     full saturation they read heavier against #FFFFFF than a
     container should, and brown is a second accent the ranking
     doesn't sanction. Held back to 75% they stay recognisably
     cardboard while sitting closer to the chassis grays.

     A stopgap: a filter cannot put the red signal light on an open
     crate the way redrawn art could. Replace the two PNGs with ink
     + chassis + joint gray versions and delete this line. */
  filter: saturate(0.75);
  transition:
    opacity 140ms linear,
    transform 320ms var(--ease-bounce);
}

.exp-box__img--open {
  opacity: 0;
  transform: scale(0.9);
}

.exp-box.is-open .exp-box__img--closed {
  opacity: 0;
  transform: scale(0.9);
}

.exp-box.is-open .exp-box__img--open {
  opacity: 1;
  transform: scale(1.06);
}

/* ---- The shipping label -------------------------------- */
.exp-box__label {
  width: 100%;
  min-width: 0;
}

.exp-box__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--exp-accent);
}

.exp-box__title {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
}

/* ============================================================
   The sorter — full-width slab the shared stages feed into, with
   one outlet dropping to each case line. Because the outlet strip
   is the same 3-column grid as .exp-branches, the drops always
   land dead centre over their line at any width.
   ============================================================ */
.exp-sorter {
  position: relative;
  z-index: 1;
  margin: 1.35rem 0 0;
}

.exp-sorter__machine {
  --exp-accent: var(--cernal-red);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  background: var(--card);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.exp-sorter__tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cernal-red-deep);
  white-space: nowrap;
}

.exp-sorter__name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
}

/* Three indicator lamps, one per outgoing line, in that line's colour. */
.exp-sorter__lights {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.exp-sorter__lights i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--lamp, var(--paper));
  animation: exp-lamp 2.4s var(--ease-standard) infinite;
}

/* The bright lamp tones, not the accents: a 10px circle inside a
   2px ink border fills in as a black dot at accent weight. */
.exp-sorter__lights i:nth-child(1) {
  --lamp: var(--lamp-blue);
  animation-delay: 0s;
}

.exp-sorter__lights i:nth-child(2) {
  --lamp: var(--lamp-green);
  animation-delay: 0.8s;
}

.exp-sorter__lights i:nth-child(3) {
  --lamp: var(--lamp-gold);
  animation-delay: 1.6s;
}

@keyframes exp-lamp {

  0%,
  70%,
  100% {
    opacity: 0.35;
  }

  10%,
  40% {
    opacity: 1;
  }
}

.exp-sorter__outlets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 26px;
}

.exp-sorter__outlet {
  justify-self: center;
  width: var(--border-w-bold);
  height: 100%;
  background: var(--exp-accent);
  border-radius: 2px;
}

/* ============================================================
   The three case lines
   ------------------------------------------------------------
   Grid items stretch, so all three columns are already the same
   height; each is a flex column whose run-out spacer takes up
   the slack. That puts every "end of line" plate on one row no
   matter how many stops each case has.
   ============================================================ */
.exp-branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Wide enough that the 7px brackets of an open crate clear the
     crates either side of it. */
  gap: 0.9rem;
}

.exp-branch {
  display: flex;
  flex-direction: column;
}

/* Interface, so it keeps the rounded chip shape. The min-height holds
   two- and three-line case names on one baseline, so the first crate of
   every line starts level whatever the labels are renamed to. */
.exp-branch__head {
  display: grid;
  place-items: center;
  min-height: 3.7rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--exp-accent);
  background: var(--exp-accent-soft);
  border: var(--border-w) solid var(--exp-accent);
}

.exp-line .exp-branch__line {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The run-out: whatever vertical space this case line doesn't use,
   carrying the line down to the stop plate. */
.exp-branch__run {
  position: relative;
  flex: 1 1 auto;
  min-height: 1.25rem;
}

.exp-branch__run::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 50%;
  width: var(--border-w-bold);
  background: var(--exp-accent);
  border-radius: 2px;
  opacity: 0.7;
  transform: translateX(-50%);
}

/* Case-line cartons are a size down — three of them share the width. */
.exp-branch .exp-box__art {
  flex: 0 0 var(--exp-art-sm);
  width: var(--exp-art-sm);
}

.exp-branch .exp-box__title {
  font-size: 0.86rem;
}

/* The line ends in a stop plate, so it doesn't just trail off. */
.exp-branch__end {
  display: block;
  padding: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  border-top: var(--border-w) solid var(--exp-accent);
}

/* ============================================================
   The detail panel — what's inside the open box
   ============================================================ */
.exp-panel {
  --exp-accent: var(--acc-kraft);
  --exp-accent-soft: var(--acc-kraft-soft);
  position: sticky;
  top: 88px;
  margin-top: 0.25rem;
}

.exp-panel[data-exp-accent="blue"] {
  --exp-accent: var(--acc-blue);
  --exp-accent-soft: var(--acc-blue-soft);
}

.exp-panel[data-exp-accent="green"] {
  --exp-accent: var(--acc-green);
  --exp-accent-soft: var(--acc-green-soft);
}

.exp-panel[data-exp-accent="amber"] {
  --exp-accent: var(--acc-gold);
  --exp-accent-soft: var(--acc-gold-soft);
}

.exp-panel[data-exp-accent="teal"] {
  --exp-accent: var(--acc-teal);
  --exp-accent-soft: var(--acc-teal-soft);
}

.exp-panel[data-exp-accent="violet"] {
  --exp-accent: var(--acc-violet);
  --exp-accent-soft: var(--acc-violet-soft);
}

.exp-panel__card,
.exp-panel__idle {
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.3rem 1.45rem 1.45rem;
  background: var(--card);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

/* Nothing open yet. This is what the right-hand column shows on
   arrival, so it carries the page's own introduction rather than a
   placeholder — otherwise half the layout is blank until the first
   click. experiments.js swaps it for the detail card and back. */
.exp-panel__idle> :first-child {
  margin-top: 0;
}

.exp-panel__idle h4 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--exp-accent);
}

/* Which colour belongs to which case line. */
.exp-legend {
  margin: 0;
  padding: 0;
  list-style: none;
}

.exp-legend li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.exp-legend i {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: var(--exp-accent, var(--kraft-deep));
  border: var(--border-w) solid var(--ink);
  border-radius: 3px;
  transform: translateY(1px);
}

.exp-legend li[data-exp-accent="blue"] {
  --exp-accent: var(--pipe-blue);
}

.exp-legend li[data-exp-accent="green"] {
  --exp-accent: var(--gate-green);
}

.exp-legend li[data-exp-accent="amber"] {
  --exp-accent: var(--rna-amber);
}

.exp-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.exp-panel__heading {
  flex: 1;
  min-width: 0;
}

/* Not a chip — the same mono kicker line .bd-callout uses, with the
   `//` supplied here so the markup keeps a clean data-tag. */
.exp-panel__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  color: var(--exp-accent);
}

.exp-panel__tag::before {
  content: "// ";
}

.exp-panel__title {
  margin: 0.35rem 0 0;
  font-size: 1.6rem;
}

.exp-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.exp-panel__meta span {
  padding: 0.15rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-body);
  background: var(--paper-sink);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-sm);
}

.exp-panel__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sticker-sm);
  cursor: pointer;
}

.exp-panel__close:hover,
.exp-panel__close:focus-visible {
  color: var(--card);
  background: var(--cernal-red);
}

.exp-panel__body> :first-child {
  margin-top: 0;
}

.exp-panel__body h4 {
  margin: 1.3rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--exp-accent);
}

.exp-panel__body hr {
  border-top: var(--border-w) solid var(--exp-accent);
  opacity: 0.5;
}

/* Detail markup waiting its turn is parked here by experiments.js. */
.exp-store {
  display: none;
}

/* ============================================================
   Experiments — responsive
   ============================================================ */
@media (min-width: 992px) and (max-width: 1199.98px) {

  /* The column is barely 450px here. Channel, cartons and the gaps
     either side all come down together, or the carton ends up wider
     than the crate holding it. */
  .exp-line {
    --exp-art: 92px;
  }

  .exp-line .exp-trunk {
    --exp-corridor: 140px;
    --exp-connect: 56px;
  }

  .exp-trunk .exp-item:nth-of-type(1) {
    --exp-gap: 18px;
  }

  .exp-trunk .exp-item:nth-of-type(2) {
    --exp-gap: 34px;
  }

  .exp-trunk .exp-item:nth-of-type(3) {
    --exp-gap: 24px;
  }

  .exp-trunk .exp-item:nth-of-type(4) {
    --exp-gap: 44px;
  }

  .exp-trunk .exp-item:nth-of-type(5) {
    --exp-gap: 20px;
  }

  .exp-trunk .exp-item:nth-of-type(6) {
    --exp-gap: 38px;
  }
}

@media (max-width: 991.98px) {

  /* Panel flows under the line instead of pinning beside it. It stays
     positioned so the bracket overlay keeps resolving against it. */
  .exp-panel {
    position: relative;
    margin-top: 1.5rem;
  }

  .exp-panel__card {
    max-height: none;
  }
}

@media (max-width: 767.98px) {

  /* Half a column is narrower than a carton here, so the routed board
     folds back into one plain centred stack. Selectors mirror the
     board's :nth-of-type ones so they outrank them. */
  .exp-trunk .exp-item:nth-of-type(odd) .exp-box,
  .exp-trunk .exp-item:nth-of-type(even) .exp-box {
    width: 100%;
    margin: 0;
    align-items: center;
    text-align: center;
  }

  .exp-line .exp-trunk {
    padding-bottom: 0;
  }

  .exp-trunk .exp-item,
  .exp-trunk .exp-item+.exp-item {
    margin-top: 0;
    margin-bottom: 1.45rem;
  }

  /* No corridor to route through once the crates are centred — and the
     cartons are cut-outs, so any trace behind one would show through.
     A plain drop between crates carries the line instead. */
  .exp-traces {
    display: none;
  }

  .exp-trunk .exp-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: var(--border-w-bold);
    height: 1.05rem;
    margin-top: 0.2rem;
    background: var(--exp-accent);
    border-radius: 2px;
    opacity: 0.7;
    transform: translateX(-50%);
  }

  /* Three columns is too narrow to read on a phone: the case lines
     stack, and the sorter drops one outlet straight into the first. */
  .exp-branches {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .exp-sorter__outlets {
    grid-template-columns: 1fr;
    height: 18px;
  }

  .exp-sorter__outlets .exp-sorter__outlet:not(:first-child) {
    display: none;
  }

  /* Stacked, the run-out has no slack to take up and would just
     leave a stray line hanging under the last stop. */
  .exp-branch__run {
    display: none;
  }

  .exp-branch__end {
    margin-top: 0.6rem;
  }

  .exp-branch .exp-box__art {
    flex: 0 0 var(--exp-art);
    width: var(--exp-art);
  }

  .exp-branch .exp-box__title {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .exp-sorter__lights i {
    animation: none;
  }

  .exp-box,
  .exp-box::after,
  .exp-box__img {
    transition: none;
  }
}

/* A card with nothing to reveal is rendered as a <div> instead of a <button>:
   no pointer, no hover lift, and no focus ring, so it reads as a portrait
   rather than something that failed to respond to a click. */
.team-card--static {
  cursor: default;
}

.team-card--static:hover {
  transform: none;
  box-shadow: var(--shadow-sticker-sm);
}

/* ============================================================
   Quadrant (.quad) — a 2x2 panel
   ------------------------------------------------------------
   Four .quad__cell sections in one frame, split by a hairline
   cross. Rows and columns are equal, so the collapsed panel reads
   as a square; it never clips, and below 768px it is one column.

   .quad--axes  adds mono labels along the top and left edges
                (a real matrix: the SWOT on Entrepreneurship).
   .quad--bare  drops the frame, for a quad placed inside a
                callout (the values on Human Practices).

   Neutral by design: ink and grays only. A page may tint a cell's
   kicker or bullet markers, never its surface.
   ============================================================ */
.quad {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 1.5rem 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.quad__cell {
  min-width: 0;
  padding: 1.1rem 1.25rem 1.2rem;
  border-top: 1px solid var(--ink-3);
}

.quad > section.quad__cell:first-of-type {
  border-top: 0;
}

.quad__axis {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-2);
  background: var(--paper-sink);
}

.quad__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.quad__mark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
}

.quad__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.quad__kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* The sentence behind each lead-in. Inline, so it opens in place; no
   transition, because height cannot animate on inline text. */
.quad__more {
  transition: none;
}

.quad--bare {
  margin: 0;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quad--bare > .quad__cell {
  padding: 1.1rem 0;
  border-top-color: var(--paper-edge);
}

.quad--bare > section.quad__cell:first-of-type {
  padding-top: 0;
}

.quad--bare > section.quad__cell:last-of-type {
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
  }

  /* Opened, the cells differ too much in length to share a row height. */
  .quad:has(.collapse.show) {
    grid-auto-rows: auto;
  }

  .quad > section.quad__cell:nth-of-type(-n + 2) {
    border-top: 0;
  }

  .quad > section.quad__cell:nth-of-type(even) {
    border-left: 1px solid var(--ink-3);
  }

  .quad--axes {
    grid-template-columns: 2rem repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .quad--axes > section.quad__cell {
    border-top: 1px solid var(--ink-3);
    border-left: 1px solid var(--ink-3);
  }

  .quad--axes > .quad__axis {
    display: block;
  }

  .quad__axis--col {
    padding: 0.4rem 0.5rem;
    border-left: 1px solid var(--ink-3);
  }

  .quad__axis--row {
    padding: 0.5rem 0;
    line-height: 2rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    /* rotated: this is the visual top edge */
    border-bottom: 1px solid var(--ink-3);
  }

  /* The edges already name the axes; keep the kicker for screen readers. */
  .quad--axes .quad__kicker {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .quad--axes .quad__mark {
    grid-row: auto;
  }

  .quad--bare > section.quad__cell {
    padding: 1.1rem 1.4rem;
    border-color: var(--paper-edge);
  }

  .quad--bare > section.quad__cell:nth-of-type(odd) {
    padding-left: 0;
  }

  .quad--bare > section.quad__cell:nth-of-type(even) {
    padding-right: 0;
  }

  .quad--bare > section.quad__cell:nth-of-type(-n + 2) {
    padding-top: 0;
  }

  .quad--bare > section.quad__cell:nth-last-of-type(-n + 2) {
    padding-bottom: 0;
  }
}

/* "Read more" for a framed quad: one pill opens every .quad__more in it.
   Ink, not an accent, so it matches the neutral panel. */
.quad-toggle {
  --pill-accent: var(--ink);
  --pill-soft: var(--card);
  margin: -0.5rem 0 1.5rem;
}

.quad-toggle::after {
  content: "\2192";
  font-family: var(--font-mono);
  font-weight: 700;
}

.quad-toggle[aria-expanded="true"]::after {
  content: "\2191";
}

.quad-toggle__close,
.quad-toggle[aria-expanded="true"] .quad-toggle__open {
  display: none;
}

.quad-toggle[aria-expanded="true"] .quad-toggle__close {
  display: inline;
}
