﻿/* =====================================================================
   THEME: the only place colours are chosen.
   Change a value here and the whole site follows (pages, cards, nav,
   banners, team page, side nav, back-to-top). Don't hardcode hex colours
   elsewhere; use var(--name).
   Default is the LIGHT theme. To use the dark one, put data-theme="dark"
   on the <html> tag in layout.html (to make only the home page dark, add
   ", body.home-page" after the dark selector below).
   Palette: soft white-green, brand green, teal, violet, a little yellow.
   ===================================================================== */
:root {
  /* surfaces */
  --bg: #e7f1d4;            /* page background */
  --surface: #ffffff;       /* cards, panels */
  --panel-bg: #f4f9ec;      /* background of the big section boxes (try #f6f1fb for a faint purple, #ffffff for white) */
  --surface-2: #f3f9f6;     /* inset boxes inside cards */
  --surface-hover: #e0efe7;
  --border: #c3dcd0;

  /* text */
  --ink: #0a0a0a;           /* main text: near-black */
  --ink-muted: #33413d;     /* secondary text: dark grey, still easy to read */
  --on-light: #1e2b1a;      /* text on yellow / mint fills */
  --on-dark: #ffffff;       /* text on green / violet / teal fills */

  /* brand */
  --green: #38761d;         /* main brand green: fills, borders */
  --green-bright: #4a8f2c;  /* strokes and lines */
  --green-text: #2c6a19;    /* green text, links, headings on a light page */
  --green-soft: #a1d6b7;    /* mint: fills and tints */
  --green-deep: #12240c;    /* darkest green: banner base */
  --banner-tint: rgba(28, 58, 16, 0.78);
  --strand: #86bb98;        /* side-nav strand */

  /* side-nav panel: raise the % to make it darker (more green mixed into the page colour) */
  --nav-panel: color-mix(in srgb, var(--green) 22%, var(--bg));
  --nav-panel-border: color-mix(in srgb, var(--green) 40%, var(--bg));

  /* top navigation bar */
  --navbar-bg: var(--green-deep);                         /* bar background */
  --navbar-text: #e9f2e4;                                 /* links and brand */
  --navbar-text-hover: var(--green-soft);                 /* hover / current link */
  --navbar-line: var(--box-accent);                       /* thin line under the bar */

  /* the filled bar on a lone dropdown ("Additional Details") */
  --dropdown-bar: var(--green);
  --dropdown-bar-hover: var(--green-text);
  --dropdown-bar-text: var(--on-dark);

  /* the SEC_01 tag in each section's title bar. Set display to none to remove it. */
  --sec-tag-display: none;        /* none = removed (the SEC_01 pills). block = show them again */
  --sec-tag-bg: #ffffff;
  --sec-tag-text: #3b1a73;

  /* purple accent on every page box (the bar under the title band, the SEC tag, group tags) */
  --box-accent: #6a3fb0;

  /* supporting colours */
  --violet: #4f2185;        --violet-text: #6b3fa0;
  --teal: #2d7676;          --teal-text: #1f5c5c;
  --yellow: #fff2cc;        /* highlight fill */
  --warm-text: #8a6400;     /* the yellow's readable text version */
  --alert: #da3633;         --alert-deep: #9b2c2a;  --alert-text: #b3261e;
  --terminator: #51655f;    /* terminator glyphs */

  /* labels used in notebook bullets: tag("Team") etc. Add more with .tag-name below the THEME block */
  --tag-team: var(--violet);
  --tag-wet-lab: var(--green);
  --tag-dry-lab: var(--teal);
  --tag-hp: var(--yellow);
  --tag-default: var(--green);

  /* colours of the moving signals in the page banners (banner is always dark green) */
  --banner-sig-1: #6aa84f;
  --banner-sig-2: #a1d6b7;
  --banner-sig-3: #b99ae0;
}

:root[data-theme="dark"] {
  --bg: #0e2220;
  --surface: #153230;
  --panel-bg: #153230;
  --surface-2: #0b1b1a;
  --surface-hover: #1b3d3a;
  --border: #2c524e;
  --ink: #eaf4ef;
  --ink-muted: #9fbab2;
  --green-bright: #6aa84f;
  --green-text: #6aa84f;
  --strand: #a1d6b7;
  --violet-text: #b99ae0;
  --teal-text: #a1d6b7;
  --warm-text: #fff2cc;
  --alert-text: #ef7b75;
  --terminator: #c3d6cf;
}

:root {
  /* old names, kept so files that still use them keep working */
  --bg-dark: var(--bg);
  --bg-card: var(--surface);
  --text-main: var(--ink);
  --text-muted: var(--ink-muted);
  --border-color: var(--border);
  --accent-alert: var(--alert);

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 58px; /* home.html overwrites this with the measured navbar height */
}

/* ===== Site-wide base ===== */
html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-family);
}

/* Only the home page locks the window; every other page scrolls normally */
html:has(body.home-page),
body.home-page {
  height: 100%;
  overflow: hidden;
}

/* ===== Subpage header banner (used by layout.html) ===== */
.page-header {
  position: relative;
  min-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
}

/* Green tint over the photo. Flat colour, no gradient: the photo shows through
   at about 40%. With no photo it is a dark green panel; banner-anim.js draws the moving circuit on top. */
.page-header {
  border-bottom: 4px solid var(--green);
  background-color: var(--green-deep);
}
.page-header-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--banner-tint);
}

.page-header-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page-header-inner {
  position: relative;
  z-index: 1;
  padding: 2rem 1rem;
  text-align: center;
}

.page-header-title {
  margin: 0;
  font-size: clamp(3rem, 6.5vw, 4.75rem);   /* banner words: bigger. change here for every page */
  line-height: 1.1;
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* ===== Home page: scroll-snap container ===== */
/* Fixed under the navbar so no parent margin/padding can push it sideways */
.snap-container {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* Thin scroll progress line under the navbar */
.home-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 3px;
  width: 0;
  background: var(--green-bright);
  z-index: 2;
  pointer-events: none;
}

/* Snap Sections */
.snap-section {
  min-height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  opacity: 0.15;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.snap-section.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

/* Dot grid, faded out toward the edges */
.circuit-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}

/* Faint green light behind the hero */
.hero-bg-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 50% 58%, color-mix(in srgb, var(--green) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.relative-z {
  position: relative;
  z-index: 2;
}

/* Layout Splits */
.snap-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.snap-split.flex-reverse {
  flex-direction: row-reverse;
}

.snap-text-side, .snap-media-side {
  flex: 1;
  min-width: 0;
}

/* Typography & Diagnostic Badges */
.diagnostic-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--green-text);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--green);
  border-radius: 4px;
  margin-bottom: 1.2rem;
  background: color-mix(in srgb, var(--green) 15%, transparent);
}

.diagnostic-badge.badge-alert {
  color: var(--accent-alert);
  border-color: var(--accent-alert);
  background: color-mix(in srgb, var(--alert) 8%, transparent);
}

.diagnostic-badge.badge-success {
  color: var(--warm-text);
  border-color: var(--warm-text);
  background: color-mix(in srgb, var(--yellow) 45%, transparent);
}

.giant-center-heading {
  font-size: 2.2rem;
  line-height: 1.35;
  text-align: center;
  max-width: 900px;
  font-weight: 600;
  margin: 0 auto 2.5rem auto;
}

.snap-heading { font-size: clamp(2rem, 4vw, 3rem); }

.grand-vision-heading {
  font-size: 2.1rem;
  line-height: 1.4;
  text-align: center;
  max-width: 950px;
  margin: 0 auto;
}

.highlight-alert { color: var(--accent-alert); font-weight: 700; }
.highlight-accent { color: var(--green-text); font-weight: 700; }
.highlight-soft { color: var(--warm-text); font-weight: 700; }

.center-statement-wrapper {
  text-align: center;
  max-width: 1000px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* ===== Hero circuit diagram ===== */
.hero-circuit-stage {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.75rem;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 55%, transparent);
  border-radius: 12px;
}

.assembly-sbol-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The DNA strand slowly streams left to right so the diagram feels alive */
.dna-strand-line {
  stroke: var(--border);
  stroke-width: 3;
  stroke-dasharray: 6 6;
  animation: dnaFlow 1.2s linear infinite;
}

@keyframes dnaFlow {
  to { stroke-dashoffset: -12; }
}

.sbol-part {
  fill: none;
  stroke: var(--green-bright);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.5s ease;
}

.part-cds {
  fill: color-mix(in srgb, var(--green) 25%, transparent);
}

.cds-primary { stroke: var(--green-bright); fill: color-mix(in srgb, var(--green) 40%, transparent); }
.cds-alpha { stroke: var(--teal); fill: color-mix(in srgb, var(--teal) 18%, transparent); }
.cds-beta { stroke: var(--warm-text); fill: color-mix(in srgb, var(--yellow) 55%, transparent); }

/* The broken gene: red, dashed, and twitching */
.cds-repressor {
  stroke: var(--accent-alert);
  stroke-dasharray: 7 5;
  fill: color-mix(in srgb, var(--alert) 15%, transparent);
  transform-box: fill-box;
  transform-origin: center;
  animation: cdsGlitch 2.4s infinite;
}

@keyframes cdsGlitch {
  0%, 84%, 100% { transform: translate(0, 0); }
  87% { transform: translate(-3px, 1px); }
  90% { transform: translate(3px, -1px); }
  93% { transform: translate(-2px, 0); }
  96% { transform: translate(0, 0); }
}

/* Crack in the DNA line next to the broken gene */
.circuit-crack {
  fill: none;
  stroke: var(--accent-alert);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.operator-node {
  fill: var(--accent-alert);
  stroke: var(--accent-alert);
  /* without these the pulse scales from the SVG corner and the dot drifts */
  transform-box: fill-box;
  transform-origin: center;
  animation: pulseNode 1.8s infinite ease-in-out;
}

/* Flip through the three circuit structures, one at a time (12s loop, 4s each) */
.sbol-circuit-assembly {
  opacity: 0;
  animation: circuitFlip 12s infinite both;
}

@keyframes circuitFlip {
  0%   { opacity: 0; transform: translateY(8px); }
  4%   { opacity: 1; transform: translateY(0); }
  29%  { opacity: 1; transform: translateY(0); }
  33%  { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes pulseNode {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent-alert)); }
  50% { transform: scale(1.3); filter: drop-shadow(0 0 8px var(--accent-alert)); }
}

/* Caption under the circuit, flips in sync */
.circuit-caption-row {
  position: relative;
  height: 1.8rem;
  margin-top: 0.25rem;
}

.circuit-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: var(--green-text);
  opacity: 0;
  animation: circuitFlip 12s infinite both;
}

.circuit-caption.circuit-state-3 { color: var(--accent-alert); }

/* Delays live AFTER the animation shorthands so nothing resets them.
   (Before, the caption shorthand reset every delay to 0, so all captions overlapped.) */
.sbol-circuit-assembly.circuit-state-1, .circuit-caption.circuit-state-1 { animation-delay: 0s; }
.sbol-circuit-assembly.circuit-state-2, .circuit-caption.circuit-state-2 { animation-delay: 4s; }
.sbol-circuit-assembly.circuit-state-3, .circuit-caption.circuit-state-3 { animation-delay: 8s; }

/* Scroll hint at the bottom of the hero */
.scroll-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--ink-muted);
  animation: hintBob 2s ease-in-out infinite;
}

@keyframes hintBob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* ===== Flip Cards (3D) ===== */
.flip-card {
  width: 100%;
  height: 340px;
  perspective: 1200px;
  position: relative;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
  border-color: var(--green);
}

.flip-card img, .animatic-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* ===== Video Section ===== */
.broken-launch-container {
  text-align: center;
}

.launch-team-tag-clear {
  font-family: monospace;
  letter-spacing: 3px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.broken-anim-stage {
  width: min(900px, 100%);
  min-height: 24vh; /* keeps the layout from jumping while the video loads */
  margin: 0.5rem auto 1.25rem;
  /* The logo art sits small inside its canvas, so scale it up visually.
     Raise or lower this number to resize (1 = original size). */
  --broken-scale: 1.45;
}

.solution-lead {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1.5rem;
}

.broken-title-video, .broken-static-fallback {
  display: block;
  width: 100%;
  height: auto;
  max-height: 38vh;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(var(--broken-scale));
}

.broken-acronym-sub {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  letter-spacing: 1px;
  margin-top: 2rem;
}

/* B R O K E N initials in the main green, words rise in one after another */
.broken-acronym-sub strong {
  color: var(--green-text);
  font-size: 1.5em;
  font-weight: 800;
}

.acr-word {
  display: inline-block;
  margin: 0 0.3em;
  opacity: 0;
}

.snap-section.reveal-active .acr-word {
  animation: acrIn 0.6s ease-out both;
  animation-delay: calc(0.3s + var(--i) * 0.22s);
}

@keyframes acrIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ===== Outro Grid ===== */
.outro-wrapper {
  max-width: 1100px;
  width: 100%;
  text-align: center;
}

.outro-grid-title {
  font-size: 2.2rem;
  margin-bottom: 2rem;
}

.outro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.outro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  text-decoration: none;
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.outro-card:hover {
  transform: translateY(-5px);
  border-color: var(--green-bright);
  background: var(--surface-hover);
}

.outro-card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--green-text);
}

.outro-card p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 1.2rem 0;
}

.card-arrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--warm-text);
}

/* ===== Content pages: boxed sections =====
   Every section is a box drawn with the same pictures as the side nav
   (static/nav/box-intact.svg, box-broken.svg). The box you are currently in
   shows the broken picture, like the nav. Title bands are brand green.
   Optional colours per section: .accent-violet / -teal / -yellow / -sage / -red. */

:root {
  --glyph-promoter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 18V6h17'/%3E%3Cpath d='M16 1l6 5-6 5'/%3E%3C/g%3E%3C/svg%3E");
  --glyph-rbs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 17h26'/%3E%3Cpath d='M8 17a7 7 0 0 1 14 0'/%3E%3C/g%3E%3C/svg%3E");
  --glyph-cds: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 10h4M25 10h4'/%3E%3Crect x='6' y='3' width='18' height='14' rx='3'/%3E%3C/g%3E%3C/svg%3E");
  --glyph-terminator: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 17h26'/%3E%3Cpath d='M15 17V5M8 5h14'/%3E%3C/g%3E%3C/svg%3E");
  /* a crack, used as a mask so it takes whatever colour it sits in */
  --crack: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18'%3E%3Cpath d='M13 0L9 6L16 9L10 14L13 18' fill='none' stroke='black' stroke-width='2.6' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

.page-with-nav-content { counter-reset: panel; }

.content-box,
.content-panel {
  --accent: var(--green); --accent-text: var(--green-text); --on-accent: var(--on-dark); --glyph: var(--glyph-cds);
  --frame: 12px;
  counter-increment: panel;
  position: relative;
  background: var(--panel-bg);
  border: var(--frame) solid transparent;
  border-image: none 30 stretch;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 2rem;
  scroll-margin-top: 90px;
}

/* the box you are in breaks, like the nav item does */
.content-box.is-current,
.content-panel.is-current { border-image-source: none; }

/* optional per-section colours */
.content-box.accent-violet, .content-panel.accent-violet {
  --accent: var(--violet); --accent-text: var(--violet-text); --glyph: var(--glyph-promoter);
}
.content-box.accent-teal, .content-panel.accent-teal {
  --accent: var(--teal); --accent-text: var(--teal-text); --glyph: var(--glyph-rbs);
}
.content-box.accent-yellow, .content-panel.accent-yellow {
  --accent: var(--yellow); --accent-text: var(--warm-text); --on-accent: var(--on-light); --glyph: var(--glyph-promoter);
}
.content-box.accent-sage, .content-panel.accent-sage {
  --accent: var(--green-soft); --accent-text: var(--green-text); --on-accent: var(--on-light); --glyph: var(--glyph-rbs);
}
.content-box.accent-red, .content-panel.accent-red {
  --accent: var(--alert-deep); --accent-text: var(--alert-text); --glyph: var(--glyph-terminator);
}

/* title band: one corner is chipped off */
.content-box > .content-panel-title,
.content-panel > .content-panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  border-bottom: 5px solid var(--box-accent);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}

.content-panel-title::before {
  content: "";
  flex: none;
  width: 30px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.content-panel-title::after {
  content: "SEC_" counter(panel, decimal-leading-zero);
  display: var(--sec-tag-display);
  margin-left: auto;
  margin-right: 22px;
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  background: var(--sec-tag-bg);
  color: var(--sec-tag-text);
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.content-panel-body { padding: 1.5rem 1.75rem; }
.content-panel-body > :first-child { margin-top: 0; }
.content-panel-body > :last-child { margin-bottom: 0; }

/* a box with no title band still needs to breathe */
.content-box > :not(.content-panel-title):not(.content-panel-body) { margin-left: 1.75rem; margin-right: 1.75rem; }

.content-panel [id] { scroll-margin-top: 90px; }

.content-box h3,
.content-panel h3 {
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
  color: var(--accent-text);
}

.content-panel-body ul li::marker,
.content-panel-body ol li::marker { color: var(--accent-text); }

/* links in page content follow the site colours instead of default blue */
.page-with-nav-content a:not(.btn) { color: var(--green-text); }
.page-with-nav-content a:not(.btn):hover { color: var(--violet-text); }

/* ===== Page components ===== */

/* Summary: a flat yellow note at the top of the page */
.executive-summary-card {
  background: var(--yellow);
  color: var(--on-light);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  font-size: 1.1rem;
  line-height: 1.6;
}
.executive-summary-card p { margin: 0; }
.executive-summary-card .highlight-text { color: var(--green); }
.executive-summary-card .highlight-text-red { color: var(--alert-deep); }

.highlight-text { color: var(--green-text); font-weight: 700; }
.highlight-text-red { color: var(--alert-text); font-weight: 700; }

.lead-text { font-size: 1.15rem; line-height: 1.6; }

/* dashed like the DNA strand on the home page */
.content-divider {
  border: 0;
  border-top: 3px dashed var(--border);
  margin: 1.75rem 0;
  opacity: 1;
}

.citation-badge {
  font-size: 0.8em;
  vertical-align: super;
  text-decoration: none;
}

.asset-flex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.asset-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.asset-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: var(--surface);
}
.asset-card h5 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--accent-text); }
.asset-card p { margin: 0; font-size: 0.9rem; color: var(--ink-muted); }

/* numbered case boxes: CASE tag in the section's colour */
.content-panel-body,
.content-panel [id] { counter-reset: sub; }

.subsection-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
}
.subsection-block h4 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.subsection-block h4::before {
  counter-increment: sub;
  content: counter(sub, decimal-leading-zero);
  flex: none;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: monospace;
  font-size: 0.75rem;
}
.subsection-block p { margin: 0; color: var(--ink-muted); }

.showcase-media-wrapper { margin-top: 1.25rem; }
.media-container video {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #000;
}
.media-caption { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--ink-muted); }

.content-panel blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-style: italic;
}
.content-panel blockquote::before {
  content: "\201C";
  margin-right: 0.3rem;
  font-family: Georgia, serif;
  font-size: 2.2rem;
  line-height: 0;
  vertical-align: -0.4em;
  color: var(--accent-text);
}

.pdf-container embed {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ===== Dividers: a line that cracks ===== */
/* plain: <hr class="crack-divider"> */
.crack-divider {
  position: relative;
  height: 28px;
  margin: 2rem 0;
  border: 0;
  opacity: 1;
  color: var(--green);
  background:
    linear-gradient(currentColor, currentColor) 0 50% / calc(50% - 28px) 3px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 50% / calc(50% - 28px) 3px no-repeat;
}
.crack-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 44px;
  height: 28px;
  transform: translateX(-50%);
  background: currentColor;
  -webkit-mask: var(--crack) center / contain no-repeat;
  mask: var(--crack) center / contain no-repeat;
}

/* with a label: solid line, crack, LABEL, crack, broken (dashed) line */
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2.25rem 0 1.25rem;
  color: var(--green);
  scroll-margin-top: 90px;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 3px solid currentColor;
}
.section-divider::after { border-top-style: dashed; }
.section-divider > span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
}
.section-divider > span::before,
.section-divider > span::after {
  content: "";
  flex: none;
  width: 22px;
  height: 16px;
  background: var(--green);
  -webkit-mask: var(--crack) center / contain no-repeat;
  mask: var(--crack) center / contain no-repeat;
}

/* ===== Dropdowns: a closed box that breaks open ===== */
.content-panel-body { counter-reset: sub dd; }

details.dropdown {
  --frame: 10px;
  counter-increment: dd;
  margin: 0.8rem 0;
  background: var(--surface);
  border: var(--frame) solid transparent;
  border-image: none 30 stretch;
  border-radius: 6px;
  scroll-margin-top: 90px;
}
details.dropdown[open] { border-image-source: none; }

details.dropdown > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
}
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown > summary::before {
  content: counter(dd, decimal-leading-zero);
  flex: none;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--green);
  color: var(--on-dark);
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 400;
}
details.dropdown > summary::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 0.5em;
  height: 0.5em;
  border-right: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: translateY(-0.12em) rotate(45deg);
  transition: transform 0.2s ease;
}
details.dropdown[open] > summary::after { transform: translateY(0.1em) rotate(-135deg); }
details.dropdown > summary:hover { color: var(--green-text); }
details.dropdown > summary:focus-visible { outline: 2px solid var(--green-text); outline-offset: 2px; }

.dd-title { flex: 0 1 auto; }
.dd-tag {
  flex: none;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dropdown-body {
  counter-reset: dd;
  padding: 0.35rem 1.1rem 1rem;
  border-top: 3px dashed var(--border);
  margin: 0 0.5rem;
}
.dropdown-body > :first-child { margin-top: 0.8rem; }
.dropdown-body > :last-child { margin-bottom: 0; }
.dropdown-body h4 {
  margin: 1.1rem 0 0.35rem;
  font-family: monospace;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-text);
}
details.dropdown[open] { animation: dd-break 0.3s ease-out; }
@keyframes dd-break {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(-3px); }
  65%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.dropdown-controls { display: flex; gap: 0.6rem; margin: 0 0 0.9rem; }
.dropdown-controls button {
  padding: 0.3rem 0.8rem;
  border: 2px solid var(--green);
  border-radius: 6px;
  background: transparent;
  color: var(--green-text);
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}
.dropdown-controls button:hover { background: var(--green); color: var(--on-dark); }

/* ===== Group boxes: a box of dropdowns with its own title strip ===== */
.group-box {
  --frame: 12px;
  counter-increment: grp;
  counter-reset: dd;
  margin: 1.6rem 0;
  background: var(--surface-2);
  border: var(--frame) solid transparent;
  border-image: none 30 stretch;
  border-radius: 6px;
  scroll-margin-top: 90px;
}
.content-panel-body { counter-reset: sub dd grp; }
.group-head {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  border-bottom: 3px dashed var(--border);
  color: var(--ink);
  font-family: monospace;
  font-size: 0.98rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.group-head::before {
  content: "GROUP " counter(grp, decimal-leading-zero);
  flex: none;
  margin-right: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: var(--box-accent);
  color: var(--on-dark);
  font-size: 0.72rem;
  letter-spacing: 1px;
}
.group-head::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 22px;
  height: 16px;
  background: var(--green);
  -webkit-mask: var(--crack) center / contain no-repeat;
  mask: var(--crack) center / contain no-repeat;
}
.group-body { padding: 0.5rem 0.9rem 0.8rem; }
.group-body details.dropdown { background: var(--surface); }

/* ===== Protocol content: tables, figures, warnings ===== */
.protocol-table {
  width: 100%;
  margin: 0.4rem 0 0.9rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.protocol-table caption {
  caption-side: bottom;
  padding-top: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: left;
}
.protocol-table th,
.protocol-table td { padding: 0.45rem 0.7rem; border: 1px solid var(--border); text-align: left; }
.protocol-table th { background: color-mix(in srgb, var(--green) 14%, var(--surface)); color: var(--ink); }

.protocol-figure { margin: 1.1rem 0; }
.protocol-figure img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.protocol-figure figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink-muted); }
.figure-placeholder {
  padding: 2.2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-family: monospace;
  font-size: 0.85rem;
  text-align: center;
}

.protocol-warning {
  margin: 1.1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid color-mix(in srgb, var(--alert) 45%, var(--surface));
  border-left: 6px solid var(--alert);
  border-radius: 6px;
  background: color-mix(in srgb, var(--alert) 7%, var(--surface));
}
.protocol-warning > strong {
  display: inline-block;
  margin-bottom: 0.3rem;
  padding: 0.05rem 0.5rem;
  border-radius: 4px;
  background: var(--alert-deep);
  color: var(--on-dark);
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.protocol-warning p { margin: 0; }

/* ===== Shattering: cracks on title bands, flying shards ===== */
.content-box > .content-panel-title,
.content-panel > .content-panel-title { position: relative; }

.band-crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.band-crack path {
  fill: none;
  stroke: rgba(0, 0, 0, 0.38);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: crack-draw 0.45s ease-out forwards;
}
.band-crack path:nth-child(2) { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; transform: translate(1.5px, 0); animation-delay: 0.05s; }
@keyframes crack-draw { to { stroke-dashoffset: 0; } }

.is-shattered > .content-panel-title { animation: band-hit 0.4s ease-out; }
@keyframes band-hit {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4px, 1px) rotate(-0.4deg); }
  45%  { transform: translate(4px, -1px) rotate(0.4deg); }
  70%  { transform: translate(-2px, 0); }
  100% { transform: translate(0, 0); }
}

.shard-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2000;
  pointer-events: none;
}
.shard { position: absolute; will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .band-crack path { animation: none; stroke-dashoffset: 0; }
  .is-shattered > .content-panel-title { animation: none; }
}

@media (max-width: 768px) {
  .content-box > .content-panel-title,
  .content-panel > .content-panel-title { font-size: 1.1rem; padding: 0.7rem 1rem; }
  .content-panel-body { padding: 1.1rem 1rem; }
}

/* ===== Motion and small screens ===== */
@media (prefers-reduced-motion: reduce) {
  .sbol-circuit-assembly,
  .circuit-caption,
  .cds-repressor,
  .dna-strand-line,
  .scroll-hint { animation: none; }
  .acr-word { opacity: 1; animation: none !important; }
  details.dropdown[open] { animation: none; }
  .sbol-circuit-assembly.circuit-state-1,
  .circuit-caption.circuit-state-1 { opacity: 1; }
}

@media (max-width: 768px) {
  .snap-split,
  .snap-split.flex-reverse { flex-direction: column; gap: 2rem; }
  .flip-card { height: 260px; }
  .page-header { min-height: 200px; }
  .page-header-title { font-size: 2.6rem; }
}
/* ===== PARTS TABLES (parts.html) ===== */
.table-scroll { overflow-x: auto; margin: 1rem 0 1.6rem; }
.parts-table { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.97rem; background: var(--surface); }
.parts-table thead, .parts-table tbody { display: table-row-group; }
.parts-table tr { display: table-row; }
.parts-table th, .parts-table td { display: table-cell; padding: 0.6rem 0.8rem; border: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; background: var(--surface); color: var(--ink); }
.parts-table caption { caption-side: top; text-align: left; font-weight: 700; padding: 0 0 0.5rem; color: var(--ink); }
.parts-table .c-num { width: 17%; } .parts-table .c-title { width: 22%; } .parts-table .c-type { width: 14%; } .parts-table .c-desc { width: 47%; }
.parts-table thead th { background: color-mix(in srgb, var(--green) 18%, var(--surface)); border-bottom: 3px solid var(--box-accent); }
.parts-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--green) 6%, var(--surface)); }
.parts-table tbody tr:hover td { background: color-mix(in srgb, var(--box-accent) 10%, var(--surface)); }
.parts-table td:first-child { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
@media (max-width: 700px) { .parts-table { table-layout: auto; min-width: 560px; } }

/* ===== ENGINEERING ITERATION CYCLES (engineering.html) ===== */
.iter-set { margin: 1.4rem 0 2rem; }
.iter-set-title { margin: 0 0 0.6rem; }
.iter-tabs { display: none; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.iter-set.is-tabbed .iter-tabs { display: flex; }
.iter-tab, .iter-arrow {
  font: inherit; font-weight: 700; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 2px solid var(--green); border-radius: 6px;
  min-width: 2.4rem; height: 2.4rem; padding: 0 0.7rem;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.iter-tab:hover, .iter-arrow:hover:not(:disabled) { background: color-mix(in srgb, var(--green) 16%, var(--surface)); }
.iter-tab.is-active { background: var(--box-accent); border-color: var(--box-accent); color: var(--on-dark); transform: translateY(-2px) rotate(-2deg); }
.iter-arrow:disabled { opacity: 0.35; cursor: default; }
.iter-tab:focus-visible, .iter-arrow:focus-visible { outline: 3px solid var(--box-accent); outline-offset: 2px; }

.iter-card { background: var(--surface); border: 2px solid var(--green); border-radius: 8px; padding: 1rem 1.2rem 0.4rem; margin-bottom: 1rem; }
.iter-card[hidden] { display: none; }
.iter-card.iter-enter { animation: iter-in 0.35s ease-out; }
@keyframes iter-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.iter-card-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.iter-badge { background: var(--box-accent); color: var(--on-dark); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.25rem 0.7rem; clip-path: polygon(0 0, 100% 0, 100% 70%, 92% 100%, 0 100%); }
.iter-card-title { font-weight: 700; font-size: 1.1rem; }

.iter-stage { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.8rem 0; border-top: 1px dashed var(--border); }
.iter-stage-name { margin: 0; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--stage, var(--green)) 55%, var(--ink)); }
.iter-stage-name::before { content: ""; display: block; width: 2rem; height: 4px; margin-bottom: 0.4rem; background: var(--stage, var(--green)); }
.iter-stage-body > :first-child { margin-top: 0; }
.stage-design { --stage: var(--violet); }
.stage-build  { --stage: var(--green); }
.stage-test   { --stage: var(--teal); }
.stage-learn  { --stage: var(--yellow); }
.iter-card figure { margin: 0 0 1rem; }
@media (max-width: 640px) { .iter-stage { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ===== NOTEBOOK (notebook.html) ===== */
details.week > summary { flex-wrap: wrap; gap: 0.5rem 0.8rem; }
.week-num { background: var(--box-accent); color: var(--on-dark); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.6rem; clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%); white-space: nowrap; }
.week-title { font-weight: 400; color: var(--ink-muted); }
.note-tag { display: inline-block; margin-right: 0.45rem; vertical-align: 0.05em; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.4; color: var(--ink); background: color-mix(in srgb, var(--tag, var(--tag-default)) 22%, var(--surface)); border: 1px solid var(--tag, var(--tag-default)); border-radius: 999px; padding: 0.05rem 0.6rem; white-space: nowrap; }
.tag-team { --tag: var(--tag-team); }
.tag-wet-lab { --tag: var(--tag-wet-lab); }
.tag-dry-lab { --tag: var(--tag-dry-lab); }
.tag-human-practices { --tag: var(--tag-hp); }
.period-dates { color: var(--ink-muted); margin: -0.3rem 0 1rem; }

details.week > summary::before { display: none; }

/* ===== TOP NAVIGATION BAR (colours come from the THEME block) ===== */
.navbar.bg-dark { background-color: var(--navbar-bg) !important; border-bottom: 3px solid var(--navbar-line); }
.navbar {
  --bs-navbar-color: var(--navbar-text);
  --bs-navbar-hover-color: var(--navbar-text-hover);
  --bs-navbar-active-color: var(--navbar-text-hover);
  --bs-navbar-brand-color: var(--navbar-text);
  --bs-navbar-brand-hover-color: var(--navbar-text-hover);
  --bs-navbar-toggler-border-color: color-mix(in srgb, var(--navbar-text) 40%, transparent);
}
.navbar .dropdown-menu {
  --bs-dropdown-bg: var(--navbar-bg);
  --bs-dropdown-color: var(--navbar-text);
  --bs-dropdown-link-color: var(--navbar-text);
  --bs-dropdown-link-hover-color: var(--navbar-text-hover);
  --bs-dropdown-link-hover-bg: color-mix(in srgb, var(--green) 35%, var(--navbar-bg));
  --bs-dropdown-link-active-bg: var(--green);
  --bs-dropdown-border-color: color-mix(in srgb, var(--navbar-text) 25%, transparent);
}

/* ===== OVERVIEW / KEY RESULTS ===== */
.key-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin: 1rem 0 0.4rem; }
.key-stat { background: var(--surface-2); border: 2px solid var(--green); border-radius: 8px; padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; border-top: 5px solid var(--box-accent); }
.key-stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.key-stat-label { font-size: 0.9rem; color: var(--ink-muted); }

.discussion-title { margin: 1.6rem 0 0.4rem; padding-top: 1rem; border-top: 3px solid var(--box-accent); }

/* ===== MATHS (MathJax output) ===== */
mjx-container { color: inherit; }                 /* maths takes the text colour of the page */
mjx-container[jax="SVG"] { font-size: 108%; }     /* slightly larger than the sentence around it */
mjx-container[jax="SVG"][display="true"] { margin: 0 !important; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.equation { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.6rem 0; padding: 1.5rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--box-accent); border-radius: 0 6px 6px 0; }
.equation-body { flex: 1; min-width: 0; text-align: center; font-size: 1.12rem; }
.equation-body mjx-container[display="true"] { padding: 0.5rem 0; }   /* room above and below so tall maths is never clipped */
.equation-num { color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.var-table td:first-child { font-family: inherit; font-size: 1.05rem; white-space: nowrap; }
.var-table td { vertical-align: middle; }

/* ===== EDUCATION MINI SECTIONS: title, centred picture, then paragraphs underneath ===== */
.content-panel-body { counter-reset: edu; }
.edu-mini { margin: 2.2rem 0; padding-top: 1.8rem; border-top: 3px dashed var(--border); counter-increment: edu; }
.edu-mini:first-of-type { border-top: 0; padding-top: 0; }
.edu-mini-title { margin: 0 0 1.2rem; padding: 0.35rem 0.9rem; font-size: 1.25rem; background: color-mix(in srgb, var(--green) 12%, var(--surface)); border-left: 6px solid var(--box-accent); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); color: var(--ink); }
.edu-mini-title::before { content: counter(edu, decimal-leading-zero); margin-right: 0.7rem; font-family: monospace; font-size: 0.8rem; font-weight: 700; color: var(--on-dark); background: var(--box-accent); padding: 0.1rem 0.45rem; border-radius: 4px; vertical-align: 0.12em; }
.edu-mini-media { margin: 0 auto 1.3rem; max-width: 640px; text-align: center; }   /* picture size: change max-width */
.edu-mini-media img { display: block; width: 100%; height: auto; margin: 0 auto; border: 2px solid var(--green); border-radius: 8px; }
.edu-mini-media .figure-placeholder { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.edu-mini-media figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink-muted); }
.edu-mini-text > :first-child { margin-top: 0; }

/* ===== HUMAN PRACTICES MAP ===== */
.hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: start; margin: 0 0 1rem; }
.hub-col { background: var(--surface); border: 2px solid var(--green); border-top: 8px solid var(--box-accent); padding: 1rem 1rem 1.2rem; }
.hub-col-title { margin: 0 0 1rem; padding-bottom: 0.5rem; font-size: 1.3rem; color: var(--ink); border-bottom: 3px double var(--border); }
.hub-col-body { display: flex; flex-wrap: wrap; gap: 1rem 0.9rem; justify-content: center; }
.hub-group { flex: 1 1 100%; }
.hub-group-label { display: inline-block; margin: 0.2rem 0 0.8rem; padding: 0.15rem 0.7rem; font-weight: 700; font-size: 0.9rem; color: var(--on-dark); background: var(--green); border: 2px solid var(--green); }
.hub-bubbles { display: flex; flex-wrap: wrap; gap: 1rem 0.9rem; justify-content: center; }
.bubble { display: flex; flex-direction: column; align-items: center; width: 92px; text-decoration: none; color: var(--ink); text-align: center; }
.bubble-pic { display: block; width: 82px; height: 82px; border-radius: 50%; overflow: hidden; border: 3px solid var(--green); background: var(--surface-2); box-shadow: 0 0 0 0 var(--box-accent); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.bubble-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-empty { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font: 700 0.85rem monospace; color: var(--ink-muted); }
.bubble-name { margin-top: 0.4rem; font-size: 0.82rem; line-height: 1.2; font-weight: 600; }
.bubble:hover .bubble-pic, .bubble:focus-visible .bubble-pic { transform: scale(1.08); border-color: var(--box-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--box-accent) 30%, transparent); }
.bubble:focus-visible { outline: none; }
.hub-hero { margin: 0 0 1.4rem; background: var(--surface); border: 2px solid var(--green); }
.hub-hero img { display: block; width: 100%; height: auto; }
.hub-hero figcaption { padding: 0.5rem 0.9rem; font-size: 0.9rem; color: var(--ink-muted); }
.hub-back { margin: 0.7rem 0 0; text-align: right; font-size: 0.9rem; }
@media (max-width: 900px) { .hub { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bubble-pic { transition: none; } }
.hub-back a { color: var(--green-text); font-weight: 600; }

/* a lone dropdown: no 01 number */
details.dropdown.dropdown-solo > summary::before { display: none; }
details.dropdown.dropdown-solo { border: 0; border-image: none; background: transparent; border-radius: 0; margin: 0.8rem 0 0; }
details.dropdown.dropdown-solo > summary { padding: 0.7rem 1rem; background: var(--dropdown-bar); color: var(--dropdown-bar-text); border-radius: 6px; box-shadow: 0 2px 0 color-mix(in srgb, var(--dropdown-bar) 60%, black); }
details.dropdown.dropdown-solo > summary:hover { background: var(--dropdown-bar-hover); color: var(--dropdown-bar-text); }
details.dropdown.dropdown-solo > summary::after { border-color: var(--dropdown-bar-text); }
details.dropdown.dropdown-solo[open] > summary { border-radius: 6px 6px 0 0; box-shadow: none; }
details.dropdown.dropdown-solo > .dropdown-body { margin: 0; padding: 0.4rem 1.2rem 1.1rem; border: 2px solid var(--dropdown-bar); border-top: 0; border-radius: 0 0 6px 6px; background: var(--surface-2); }

/* ===== HUMAN PRACTICES MAP: one big box, columns split by lines ===== */
.hub { gap: 0; align-items: stretch; background: var(--surface); border: 2px solid var(--green); border-top: 8px solid var(--box-accent); }
.hub-col { background: transparent; border: 0; border-top: 0; padding: 1.1rem 1.2rem 1.4rem; }
.hub-col + .hub-col { border-left: 2px solid var(--green); }
@media (max-width: 900px) { .hub-col + .hub-col { border-left: 0; border-top: 2px solid var(--green); } }

/* picture of the person at the top of a human-practices section */
.hp-photo { margin: 0 auto 1.3rem; max-width: 420px; text-align: center; }
.hp-photo img { display: block; width: 100%; height: auto; border: 2px solid var(--green); border-radius: 6px; background: var(--surface-2); }
.hp-photo .figure-placeholder { min-height: 220px; }
.hp-photo figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--ink-muted); }

/* big leading line at the top of an executive summary */
.summary-lead { margin: 0 0 1.1rem; padding: 0.2rem 0 0.2rem 1rem; border-left: 6px solid var(--box-accent); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3; font-weight: 800; color: var(--ink); }
.content-panel-body > .summary-lead + p { font-size: 1.05rem; line-height: 1.65; }

/* space and a dashed line between medium sections (sub(...)) */
.content-panel-body > div[id] + div[id] { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 3px dashed var(--border); }

/* a box with no title bar (panel("id", "") or overview("")): does not use up a SEC_ number */
.content-panel.no-title { counter-increment: none; }
.content-panel.no-title > .content-panel-body { padding-top: 1.6rem; }

/* ===== BULLET MODE: add the word "bullets" to a panel's colour string and its sub(...) sections
   become bullet points (no dashed dividers). Example: panel("id", "Title", "accent-violet bullets") ===== */
.content-panel.bullets > .content-panel-body > div[id] { position: relative; margin: 0 0 1.1rem; padding: 0 0 0 1.6rem; border-top: 0; }
.content-panel.bullets > .content-panel-body > div[id] + div[id] { margin-top: 0; padding-top: 0; border-top: 0; }
.content-panel.bullets > .content-panel-body > div[id]::before { content: ""; position: absolute; left: 0.35rem; top: 0.55rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.content-panel.bullets > .content-panel-body > div[id] > h3 { margin: 0 0 0.3rem; font-size: 1.12rem; }
.content-panel.bullets > .content-panel-body > div[id] > :last-child { margin-bottom: 0; }

/* one medium section as a bullet point: sub("id", "Title", bullet=True) */
.content-panel-body > div.sub-bullet[id], .content-panel-body > div.sub-bullet[id] + div[id].sub-bullet { position: relative; margin: 0 0 1.1rem; padding: 0 0 0 1.6rem; border-top: 0; }
.content-panel-body > div.sub-bullet[id]::before { content: ""; position: absolute; left: 0.35rem; top: 0.55rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.content-panel-body > div.sub-bullet[id] > h3 { margin: 0 0 0.3rem; font-size: 1.12rem; }
.content-panel-body > div.sub-bullet[id] > :last-child { margin-bottom: 0; }
.content-panel-body > div[id] + div.sub-bullet[id] { margin-top: 0; padding-top: 0; }

/* bullet mode, made sturdy: nothing can bring the divider line back inside a "bullets" panel */
.content-panel.bullets > .content-panel-body > div[id],
.content-panel.bullets > .content-panel-body > div[id] + div[id] { border-top: 0 !important; padding-top: 0 !important; margin-top: 0 !important; }
.content-panel.bullets > .content-panel-body > div[id] > h3 { color: var(--accent-text); }


/* ===== Dropdown hint: every dropdown says "Click here for details" (macros.html adds the text) ===== */
.dd-hint {
  flex: none;
  margin-left: auto;
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-text);
  white-space: nowrap;
}
.dd-hint-close { display: none; }
details.dropdown[open] > summary .dd-hint-open { display: none; }
details.dropdown[open] > summary .dd-hint-close { display: inline; }
details.dropdown > summary::after { margin-left: 0; }          /* the arrow now sits right after the hint */
details.dropdown.dropdown-solo > summary .dd-hint { color: var(--dropdown-bar-text); }
@media (max-width: 560px) { .dd-hint { display: none; } details.dropdown > summary::after { margin-left: auto; } }

/* ===== Boxed projects: put class "boxed" on a panel, e.g. panel("big-one", "Title", "accent-violet boxed").
   Each medium section (sub) becomes ONE box: its title is the box header and its iterations / content sit inside. ===== */
.content-panel.boxed > .content-panel-body > div[id] {
  margin: 1.4rem 0 0 !important;
  padding: 0 !important;
  border: 2px solid var(--accent) !important;
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.content-panel.boxed > .content-panel-body > div[id] > h3 {
  margin: 0;
  padding: 0.85rem 1.2rem;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  border-bottom: 2px solid var(--accent);
}
.content-panel.boxed > .content-panel-body > div[id] > p { margin: 0.9rem 1.2rem 0; }
.content-panel.boxed .iter-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1.1rem 1.2rem 0.5rem;
}
.content-panel.boxed .iter-card + .iter-card { border-top: 3px dashed var(--border); }
.content-panel.boxed .dropdown { margin-left: 1.2rem; margin-right: 1.2rem; }

/* ===== Flow arrows between iterations: add class "flow" to a panel, e.g. panel("big-one", "Title", "accent-violet boxed flow").
   An arrow points down from each iteration to the next (between iteration cards AND between iteration dropdowns). ===== */
.content-panel.flow .iter-card,
.content-panel.flow details.dropdown { position: relative; }

.content-panel.flow .iter-card + .iter-card::before,
.content-panel.flow details.dropdown + details.dropdown::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 26px;
  height: 30px;
  transform: translateX(-50%);
  background: var(--accent, var(--green));
  clip-path: polygon(34% 0, 66% 0, 66% 52%, 100% 52%, 50% 100%, 0 52%, 34% 52%);
  pointer-events: none;
  z-index: 2;
}
/* between cards: sits on the dashed divider */
.content-panel.flow .iter-card + .iter-card::before { top: -15px; }
.content-panel.flow .iter-card + .iter-card { padding-top: 1.7rem; }
/* between dropdowns: sits in the gap (the gap is widened to fit it) */
.content-panel.flow details.dropdown + details.dropdown { margin-top: 2.6rem; }
.content-panel.flow details.dropdown + details.dropdown::before { top: -2.2rem; }

/* PDF embed */
.pdf-embed { margin: 0.8rem 0; }
.pdf-embed object, .pdf-embed iframe { display: block; border: 1px solid var(--dropdown-bar, var(--green)); border-radius: 6px; background: var(--surface-2); }
.pdf-link { margin: 0.5rem 0 0; font-size: 0.95rem; }

.content-panel-body > div[id] { scroll-margin-top: 90px; }
