/* ============================================================================
   SWARM Ai · 思沃智創 — site.css
   Design system for swarmai-usv.com. Every page loads this one file and
   nothing else. Brand identity (palette, mark) follows the corporate identity
   sheet; see assets/css/NOTES-brand.md for the derivations and the
   measured contrast results.

   Conventions (read before extending):
     · Naming: block / block__element / block--modifier. State classes are
       `is-*` (toggled by JS). Utilities are `u-*` and are the only classes
       allowed to carry !important.
     · Colour is tokens only. No hex outside the TOKENS section. The three
       identity colours are the source; every other value is a documented
       derivation of them (mix ratios are written beside each value).
     · Geometry follows the product UI (usv_mobile / usv_gcs): square corners,
       1px hairlines, no drop shadows. Emphasis is weight and tone, not chrome.
     · The page is dark-first and committed to one look. Light "bands" are a
       reading surface for long spec sections, scoped with `.band--light`;
       every colour inside a band comes from the band's own token overrides,
       so components never need to know which band they sit in.
     · Language: Latin display type is Barlow Condensed, uppercase. Under
       `html:lang(zh-Hant)` headings switch to Noto Sans TC, keep case, and
       get a wider tracking. Do not uppercase or condense Chinese.

   Table of contents
     §1  Tokens
     §2  Reset & base
     §3  Typography (EN + ZH treatments)
     §4  Layout: container, band, section rhythm
     §5  Header & navigation (dropdowns, mobile menu, language switch)
     §6  Buttons & links
     §7  Hero
     §8  Cards & grids
     §9  Spec tables & definition lists
     §10 Stat tiles (verified numbers)
     §11 Figures & diagrams (inline SVG)
     §12 Forms (contact page)
     §13 Footer
     §14 Utilities
     §15 Motion
     §16 Media: photography & footage (markup in NOTES-media.md)
   ========================================================================== */


/* ============================================================================
   §1 TOKENS
   Source of truth is the corporate identity sheet: three colours.
     #232323 near-black · #102B4E deep navy · #168DD2 bright blue
   Everything else here is derived from those three (sRGB mixes, written next
   to each value so it can be recomputed). Semantic tokens are what components
   use; a band re-points the semantic tokens, never the raw ones.

   Contrast rules the derivations were built to (all measured, see NOTES):
     · #168DD2 is a graphics colour, not a text colour: 3.4:1 on paper and
       3.9:1 on navy. It is used for rules, markers, facets, focus rings and
       diagram highlights (≥ 3:1 everywhere), never for body text.
     · Accent TEXT on dark is --blue-300 (5.9:1 on navy, 7.6:1 on ground).
     · Accent TEXT on light is --blue-700 (6.7:1 on paper, 5.9:1 on paper-200).
     · Filled controls use --blue-700 (white text 7.1:1); hover --blue-600
       on dark (white 5.0:1) and navy on light (white 14:1).
   ========================================================================== */
:root {
  color-scheme: dark;

  /* ---- identity colours (the sheet) — do not use directly in components */
  --brand-black: #232323;
  --brand-navy:  #102B4E;
  --brand-blue:  #168DD2;

  /* ---- dark surfaces: navy mixed toward #000 (hue kept, lightness dropped) */
  --ink-900: #071424;            /* navy 46 %  — page ground            */
  --ink-800: #0A1A2F;            /* navy 60 %  — alternate band         */
  --ink-700: #0D223E;            /* navy 80 %  — cards, table heads     */
  --ink-600: var(--brand-navy);  /* navy 100 % — raised controls, hover */
  --ink-500: #304866;            /* navy 86 % + paper-100 — hairlines   */
  --ink-400: #3E5471;            /* navy 80 % + paper-100 — strong lines*/

  /* ---- blue scale: the sheet blue mixed toward navy (down) or white (up) */
  --blue-300: #5CAFE0;           /* blue 70 % + white — accent text on dark  */
  --blue-500: var(--brand-blue); /* rules, markers, facets, focus            */
  --blue-600: #1474B1;           /* blue 75 % + navy — hover fill (white 5.0)*/
  --blue-700: #135C90;           /* blue 50 % + navy — fills, text on light  */

  /* ---- neutrals for text on dark and for light papers (cool greys, kept
          from v1; they carry no hue claim of their own) */
  --slate-400: #8C99A8;
  --slate-300: #AEBBCC;
  --paper-100: #F5F8FC;
  --paper-200: #E4EBF4;
  --line-300: #D3DCE8;
  --white: #FFFFFF;

  /* ---- text on light papers: the sheet black, and navy mixed toward paper */
  --text-light-2: #324A68;       /* navy 85 % + paper-100 — 8.4:1 on paper  */
  --text-light-3: #50647F;       /* navy 72 % + paper-100 — 5.7:1 on paper, 5.0:1 on paper-200 */

  /* semantic — dark surface (the default) */
  --bg: var(--ink-900);          /* page ground */
  --bg-band: var(--ink-800);     /* alternate dark band */
  --surface: var(--ink-700);     /* cards, table heads */
  --surface-2: var(--ink-600);   /* raised controls, hover */
  --line: var(--ink-500);        /* hairlines */
  --line-strong: var(--ink-400);
  --fg: var(--paper-100);        /* primary text */
  --heading: var(--fg);          /* display headings */
  --fg-2: var(--slate-300);      /* lede / body on dark */
  --fg-3: var(--slate-400);      /* secondary / captions (4.9:1 on navy) */
  --fg-mute: rgba(174, 187, 204, .74); /* kickers: 5.0:1 composited on ink-700 */
  --brand: var(--blue-500);      /* rules, strokes, markers — not text */
  --brand-fill: var(--blue-700); /* filled surfaces (buttons): white text 7.1:1 */
  --brand-hover: var(--blue-600);
  --brand-soft: var(--blue-300); /* accent text */
  --on-brand: var(--white);
  --focus: var(--blue-500);      /* 5.1:1 on ground, 4.4:1 on surface */
  --mark-body: var(--fg);        /* logo: knockout body on dark */
  --mark-facet: var(--blue-500); /* logo: the three blue facets */
  --diagram-grid: rgba(140, 153, 168, .18);
  --sweep: rgba(22, 141, 210, .22);

  /* ---- media (§16). Scrims need the ground colours as bare channels so the
          alpha can be set where the scrim is drawn; these two repeat
          --ink-900 / --ink-800 and must be changed together with them. */
  --ink-900-rgb: 7, 20, 36;
  --ink-800-rgb: 10, 26, 47;
  --scrim-a: .94;                /* worst case (pure white pixel under the scrim):
                                    eyebrow #8C99A8 5.5:1 on ink-900, 5.2:1 on
                                    ink-800; lede 8.2 / 7.7; headline 15 / 14 */
  --scrim-fade: 7rem;            /* how far past the copy the scrim dissolves */
  /* The two track colours of the shore-station map, sampled from the footage.
     Used ONLY by the legend that sits beside that screenshot (§16) — they are
     the screenshot's colours, not brand colours. Graphics, never text. */
  --track-plan: #58C070;
  --track-actual: #E0A040;

  /* type */
  /* Latin stacks end in the ZH stack so a Chinese fragment inside an EN-mode
     eyebrow, kicker or mono string (思沃智創 in "SWARM Ai · 思沃智創 · Taiwan")
     falls to Noto Sans TC instead of whatever the OS picks for CJK. */
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", monospace;

  /* type scale (fluid). h1 is hero-only; h2 is section titles. The scale was
     stepped down one notch for density: a page should read in one or two
     screens, with the section title clearly above the lede but not shouting. */
  --fs-h1: clamp(2.4rem, 1.5rem + 3.4vw, 4.4rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 1.7vw, 2.75rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-h4: 1.1rem;
  --fs-lede: clamp(1rem, .95rem + .3vw, 1.15rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-micro: .75rem;
  --lh-body: 1.6;
  --lh-zh: 1.8;

  /* spacing & geometry */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section-y: clamp(3rem, 2rem + 3vw, 5rem);   /* was 4–8rem */
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --container: 1200px;
  --container-narrow: 760px;
  --container-wide: 1400px;
  --radius: 0px;                 /* square, like the product */
  --hairline: 1px;
  --header-h: 60px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 180ms;
}

/* Light band: a reading surface. Re-points semantic tokens only.
   Text is the sheet black; headings are the sheet navy; the accent text
   colour is --blue-700, a real derivation and not an alias of the fill. */
.band--light {
  color-scheme: light;
  --bg: var(--paper-100);
  --bg-band: var(--paper-100);
  --surface: var(--white);
  --surface-2: var(--paper-200);
  --line: var(--line-300);
  --line-strong: #B9C5D4;        /* paper-200 toward navy */
  --fg: var(--brand-black);      /* 14.8:1 on paper */
  --heading: var(--brand-navy);  /* 13.3:1 on paper */
  --fg-2: var(--text-light-2);
  --fg-3: var(--text-light-3);
  --fg-mute: var(--fg-3);        /* a translucent mute fails AA on paper at 12px; use the solid tone */
  --brand: var(--blue-500);      /* rules & markers: 3.4:1 on paper, graphics only */
  --brand-fill: var(--blue-700); /* white text 7.1:1 */
  --brand-hover: var(--brand-navy);
  --brand-soft: var(--blue-700); /* accent text: 6.7:1 paper, 5.9:1 paper-200 */
  --focus: var(--blue-700);
  --mark-body: var(--brand-navy);
  --diagram-grid: rgba(80, 100, 127, .2);
}


/* ============================================================================
   §2 RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt and braces; nothing should need it */
}

img, svg, video { max-width: 100%; height: auto; display: block; }
svg { overflow: visible; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-soft); }

p, ul, ol, figure, h1, h2, h3, h4, h5, h6, table { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: var(--hairline) solid var(--line); margin: 0; }
[hidden] { display: none !important; }

/* visible focus everywhere; one style so keyboard users can predict it */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--blue-700); color: var(--white); }

/* skip link: first focusable element on every page */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 200;
  padding: .6rem 1rem;
  background: var(--brand-fill);
  color: var(--on-brand);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + .5rem); }


/* ============================================================================
   §3 TYPOGRAPHY
   Latin: Barlow Condensed uppercase for display; Barlow for body.
   ZH:    Noto Sans TC, normal case, wider tracking, taller line-height.
   ========================================================================== */
.display, h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  text-wrap: balance;
  color: var(--heading);
}
h1, .h1 { font-size: var(--fs-h1); line-height: .95; }
h2, .h2 { font-size: var(--fs-h2); line-height: 1; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.1; font-weight: 600; }
h4, .h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

/* eyebrow: the small label above a title. Uppercase, tracked, muted. */
.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--fg-3);
}
.eyebrow--brand { color: var(--brand-soft); }

/* kicker: module numbering `01 / Autonomy`. Monospace, low opacity. */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--fg-2);
  max-width: 62ch;
  text-wrap: pretty;
}
.prose { max-width: 65ch; color: var(--fg-2); }
.prose p + p { margin-top: .75em; }
.prose strong { color: var(--fg); font-weight: 600; }

.small { font-size: var(--fs-small); }
.micro { font-size: var(--fs-micro); }
.muted { color: var(--fg-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Chinese treatment --------------------------------------------------
   Applied when i18n.js sets <html lang="zh-Hant">. Headings keep case, use
   a heavy Noto weight, and are tracked out rather than in. Sizes step down
   one notch because a CJK glyph carries more ink per em than a condensed
   Latin capital. */
html:lang(zh-Hant) body { font-family: var(--font-zh); line-height: var(--lh-zh); }
html:lang(zh-Hant) .display,
html:lang(zh-Hant) h1, html:lang(zh-Hant) h2, html:lang(zh-Hant) h3,
html:lang(zh-Hant) .h1, html:lang(zh-Hant) .h2, html:lang(zh-Hant) .h3 {
  font-family: var(--font-zh);
  font-weight: 700;
  text-transform: none;
  letter-spacing: .04em;
  line-height: 1.25;
}
html:lang(zh-Hant) h1, html:lang(zh-Hant) .h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.25rem); line-height: 1.2; }
html:lang(zh-Hant) h2, html:lang(zh-Hant) .h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2.1rem); }
html:lang(zh-Hant) h3, html:lang(zh-Hant) .h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); }
html:lang(zh-Hant) h4, html:lang(zh-Hant) .h4 { font-family: var(--font-zh); font-weight: 700; }
html:lang(zh-Hant) .eyebrow { font-family: var(--font-zh); font-weight: 500; letter-spacing: .3em; text-transform: none; font-size: var(--fs-small); }
html:lang(zh-Hant) .lede { line-height: 1.7; max-width: 38em; }
html:lang(zh-Hant) .prose { max-width: 40em; }
html:lang(zh-Hant) .btn { font-family: var(--font-zh); font-weight: 500; letter-spacing: .12em; text-transform: none; }
html:lang(zh-Hant) .nav__link,
html:lang(zh-Hant) .nav__menu-link,
html:lang(zh-Hant) .footer__heading { font-family: var(--font-zh); text-transform: none; letter-spacing: .08em; font-weight: 500; }
/* Latin fragments inside ZH copy (product names, numbers) keep Barlow via the
   .latin helper; use it on <span> when a mixed heading needs it. */
.latin { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0; }
/* wordmark: "SWARM Ai" keeps its lowercase i. Wrap it in this when it sits
   inside an uppercase display heading. Normal-width Barlow, tracked out, to
   echo the extended letterforms of the sheet's wordmark. */
.wordmark { font-family: var(--font-body); font-weight: 600; text-transform: none; letter-spacing: .12em; }


/* ============================================================================
   §4 LAYOUT
   Page skeleton:
     <header class="site-header"> … </header>
     <main id="main">
       <section class="band band--hero|band--dark|band--light|band--deep">
         <div class="container section">
           <header class="section__head"> .eyebrow / h2 / .lede </header>
           … content …
         </div>
       </section>
     </main>
     <footer class="site-footer"> … </footer>
   A band paints full width; the container sets gutter and max width; the
   section sets vertical rhythm. Keep them separate so a band can hold two
   sections or a full-bleed figure.
   ========================================================================== */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) + var(--gutter-r));
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) + var(--gutter-r)); }
.container--wide { max-width: calc(var(--container-wide) + var(--gutter) + var(--gutter-r)); }

.band { background: var(--bg); color: var(--fg); position: relative; }
.band--dark { background: var(--bg-band); }
.band--deep { background: var(--ink-900); }
.band--light { background: var(--bg); color: var(--fg); }
.band + .band { border-top: var(--hairline) solid var(--line); }
.band--light + .band--light { border-top-color: var(--line-300); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section--flush-top { padding-top: 0; }

/* section head: eyebrow → title → lede → (optional) single CTA */
.section__head {
  display: grid;
  gap: var(--space-3);
  margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  max-width: 54rem;
}
.section__head .lede { margin-top: var(--space-2); }
.section__head--center { margin-inline: auto; text-align: center; justify-items: center; }

/* The page head on the eleven inner pages.

   One column left it as a third of a screen of empty navy with nothing in
   the right half, identical on every page. Two columns put the lede in that
   half: the eyebrow and the h1 stack on the left, the lede sits beside them,
   bottom-aligned so it meets the baseline of the headline rather than
   floating at the top of the band.

   The lede spans BOTH rows on purpose. Placed in row 2 only, a lede taller
   than the headline would push the grid open and leave a gap between the
   eyebrow and the h1 — which is the common case in Chinese, where the
   headline is short and the lede is not.

   Do not combine with .band--media: that band gives .section__head its own
   max-width so the copy clears the picture, and the two rules fight. */
@media (min-width: 900px) {
  .page-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--space-7);
    row-gap: var(--space-3);
    align-items: start;
    max-width: none;
    margin-bottom: 0;
  }
  .page-head > .eyebrow { grid-column: 1; grid-row: 1; }
  .page-head > h1       { grid-column: 1; grid-row: 2; }
  .page-head > .lede    { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin-top: 0; }
}
.section__cta { margin-top: var(--space-4); }

/* two-column editorial split: head on the left, content right (desktop) */
.split {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-7); }
  .split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* The default puts the narrow column first, because the thing on the left
     is normally a heading or a picture introducing what is on the right.
     contact.html is the other way round: the form is the content and the
     two notes beside it are the margin, so the widths swap. A form in the
     narrow column also wraps its own field pairs for no reason. */
  .split--lead { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split .section__head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 2rem); }
}
.split > * { min-width: 0; }

/* The short column.

   align-items:start above is right for text -- a six-row table must not have
   its rows stretched to match a 900px photograph standing next to it. The
   cost is that the grid never tells you the two columns disagree: nothing
   overflows, nothing overlaps, and the band simply stops on one side while
   the other keeps going. It is invisible in every other check in tools/ and
   obvious in a screenshot, which is how it was found. tools/check-gaps.js
   measures it now.

   There are exactly two honest answers, and which one applies is an
   editorial decision about what the short column is FOR:

     .split__aside   it is a reference for the long column, so it rides along
                     instead of ending -- the same mechanism as the sticky
                     .section__head above. Use it when reading the long side
                     means looking back at the short side (a diagram beside
                     the rules it illustrates).
     .split__fill    it is a set of discrete items that are happy to breathe,
                     so it spreads over the whole row instead of bunching at
                     the top.

   If neither reads true, the content is unbalanced and the fix is the
   content, not a class. gcs.html was that case. */
@media (min-width: 900px) {
  .split__aside { align-self: stretch; }
  .split__aside > .sticky,
  .split__aside.sticky { position: sticky; top: calc(var(--header-h) + 2rem); }
  .split__fill { align-self: stretch; display: grid; align-content: space-between; }
  /* .stats is the exception: it draws its border grid out of the tile edges,
     so a gap opened between its rows would cut that grid in half. It grows
     its rows instead, which gives the numbers room and keeps the grid. */
  .stats.split__fill { align-content: stretch; }
  .stats.split__fill > .stat { align-content: center; }
}

/* The module pager.

   It used to be a band of its own: about 190px of deep navy holding three
   buttons, sitting straight on top of the footer. On a page whose content
   band was roughly 510px that made two of the four things on screen chrome.
   It now closes the content band instead -- a hairline, one row, and the
   next module as the only filled button.

   Pages with no previous module (autonomy) carry two links, which land left
   and right: the overview, then the next one. That is intended. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: var(--hairline) solid var(--line);
}
@media (max-width: 599.98px) {
  .pager { flex-direction: column; align-items: stretch; }
}

/* hairline-ruled list: rows separated by lines (used for integrated systems) */
.rule-list { border-top: var(--hairline) solid var(--line); }
.rule-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-5);
  padding-block: var(--space-3);
  border-bottom: var(--hairline) solid var(--line);
}
@media (min-width: 640px) {
  .rule-list > li { grid-template-columns: 11rem minmax(0, 1fr); align-items: baseline; }
}
.rule-list__key { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-small); font-weight: 600; color: var(--fg-3); }
html:lang(zh-Hant) .rule-list__key { font-family: var(--font-zh); text-transform: none; letter-spacing: .2em; font-weight: 500; }
.rule-list__val { color: var(--fg); }
.rule-list__note { color: var(--fg-3); font-size: var(--fs-small); }


/* ============================================================================
   §5 HEADER & NAVIGATION
   Markup (copy verbatim into every page; mark the current page with
   aria-current="page" on its top-level link):

   <header class="site-header">
     <div class="container site-header__inner">
       <a class="brand" href="index.html"> svg.brand__mark + .brand__word </a>
       <button class="nav-toggle" aria-expanded="false" aria-controls="site-nav">…</button>
       <nav class="nav" id="site-nav" aria-label="Primary">
         <ul class="nav__list">
           <li class="nav__item nav__item--has-menu">
             <a class="nav__link" href="platform.html">Platform</a>
             <button class="nav__caret" aria-expanded="false" aria-controls="menu-platform">…</button>
             <ul class="nav__menu" id="menu-platform"> <li><a class="nav__menu-link">…</a></li> </ul>
           </li>
           <li class="nav__item"><a class="nav__link" href="integration.html">Integration</a></li>
           …
         </ul>
         <div class="nav__tools"> .lang-switch + .btn.btn--primary.btn--sm </div>
       </nav>
     </div>
   </header>
   ========================================================================== */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  background: rgba(7, 20, 36, .92);   /* ink-900 at 92 % */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: var(--hairline) solid var(--line);
  color: var(--fg);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}

/* brand lockup: hexagon mark + wordmark + ZH line.
   The mark is the block in assets/img/brand-mark-inline.html (one body path,
   one facet path). Body is a knockout on dark, navy inside a light band;
   facets are always the identity blue. Both come from tokens. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--fg);
  flex-shrink: 0;
}
.brand:hover { color: var(--fg); }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__mark .mark-body { fill: var(--mark-body); }
.brand__mark .mark-facet { fill: var(--mark-facet); }
/* legacy two-path stroked mark — keeps old pages drawing until every page
   carries the new block; delete these two lines after the splice. */
.brand__word { display: grid; line-height: 1; }
.brand__en {
  font-family: var(--font-body);   /* normal width + tracking ≈ the sheet's extended wordmark */
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .12em;
  text-transform: none;            /* "SWARM Ai" — the i stays lowercase */
}
.brand__zh {
  font-family: var(--font-zh);
  font-size: .72rem;
  letter-spacing: .3em;
  color: var(--fg-3);
  margin-top: .3rem;
  padding-top: .25rem;
  border-top: var(--hairline) solid var(--line-strong);
  white-space: nowrap;
}

/* mobile toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-right: -8px;
  color: var(--fg);
}
.nav-toggle__bars { position: relative; width: 22px; height: 2px; background: currentColor; transition: background var(--dur) var(--ease); }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

/* nav links */
.nav__list { display: flex; align-items: center; gap: .25rem; }
.nav__item { position: relative; display: flex; align-items: center; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .85rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-2);
  border-bottom: 2px solid transparent;
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--fg); }
.nav__link[aria-current="page"] { border-bottom-color: var(--brand); }
.nav__caret {
  width: 28px; height: 44px;
  margin-left: -.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3);
}
.nav__caret svg { width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }
.nav__caret[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__caret:hover { color: var(--fg); }

/* dropdown menu */
.nav__menu {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 16rem;
  padding: .5rem 0;
  background: var(--ink-700);
  border: var(--hairline) solid var(--line);
  display: none;
  z-index: 110;
}
.nav__item.is-open > .nav__menu { display: block; }
.nav__menu-link {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .65rem 1rem;
  color: var(--fg-2);
  font-weight: 500;
}
.nav__menu-link:hover, .nav__menu-link:focus-visible { background: var(--surface-2); color: var(--fg); outline-offset: -2px; }
.nav__menu-link .kicker { min-width: 2.2rem; }

/* right-hand tools */
.nav__tools { display: flex; align-items: center; gap: var(--space-5); margin-left: var(--space-5); }

/* Language switch: two quiet labels, the active one underlined.
   It used to be a bordered box with the active half filled solid, which put
   a second high-contrast block immediately beside the Contact button. The
   header should carry exactly one solid element and that is the action;
   choosing a language is a setting and should not compete with it.
   The active state is marked by colour AND an underline, because colour
   alone is not a state indicator. The transparent border reserves the
   underline's space so nothing shifts when the language changes. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.lang-switch__btn {
  min-width: 2.2rem;
  min-height: 32px;
  padding: 0 .3rem;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--fg-3);
  border-bottom: 2px solid transparent;
}
.lang-switch__btn[lang="zh-Hant"] { font-family: var(--font-zh); font-weight: 500; letter-spacing: 0; }
.lang-switch__btn[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--brand-soft); }
.lang-switch__btn:hover:not([aria-pressed="true"]) { color: var(--fg); }
.lang-switch__btn:focus-visible { outline-offset: 2px; }

/* ---- desktop: hover opens too (pointer only); JS handles keyboard --------- */
@media (min-width: 960px) and (hover: hover) {
  .nav__item--has-menu:hover > .nav__menu { display: block; }
}

/* ---- mobile / tablet: nav becomes a panel under the header --------------- */
@media (max-width: 959.98px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    background: var(--ink-900);
    border-bottom: var(--hairline) solid var(--line);
    padding: var(--space-3) var(--gutter-r) var(--space-6) var(--gutter);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item { flex-wrap: wrap; border-bottom: var(--hairline) solid var(--line); }
  .nav__link { flex: 1; min-height: 52px; padding-inline: 0; font-size: 1.25rem; border-bottom: 0; }
  .nav__link[aria-current="page"] { color: var(--brand-soft); }
  .nav__caret { width: 44px; height: 52px; margin: 0; }
  .nav__menu {
    position: static;
    width: 100%;
    min-width: 0;
    border: 0;
    border-top: var(--hairline) solid var(--line);
    background: transparent;
    padding: .25rem 0 .75rem;
  }
  .nav__menu-link { padding: .6rem 0 .6rem 1rem; }
  .nav__tools { margin: var(--space-5) 0 0; justify-content: space-between; }
}
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav { display: flex; align-items: center; gap: var(--space-3); }
}


/* ============================================================================
   §6 BUTTONS & LINKS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: var(--hairline) solid transparent;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn--primary { background: var(--brand-fill); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--fg); color: var(--fg); }
.btn--sm { min-height: 36px; padding: 0 1rem; font-size: .95rem; }
.btn--block { width: 100%; }
.btn svg { width: 1em; height: 1em; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* arrow link: `View details →` */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-soft);
}
.arrow-link::after { content: "→"; transition: transform var(--dur) var(--ease); }
.arrow-link:hover::after { transform: translateX(4px); }
html:lang(zh-Hant) .arrow-link { font-family: var(--font-zh); text-transform: none; letter-spacing: .1em; font-weight: 500; }

/* ---- the system map ------------------------------------------------------
   index.html and platform.html say "three on the vessel, three on shore"
   and then printed a list, so the sentence described a shape the page never
   drew. This draws it: two panels, three links between them, and the six
   nodes ARE the navigation -- no separate list of the same links.

   HTML and CSS, not SVG, deliberately. A node has to hold a wrapping
   Chinese sentence, SVG text does not wrap, and the i18n pass cannot reach
   into it. It also keeps the svg-fit audit out of the picture.

   The three wires carry no arrowheads. A head pointing shore-to-vessel
   would assert more about dispatch than BRIEF §7.2 allows; "missions go out
   to the onboard stack" is the strongest wording we have, and a line cannot
   carry that qualification. Leave them undirected. */
.sysmap { display: grid; gap: var(--space-5); }
@media (min-width: 900px) {
  .sysmap { grid-template-columns: minmax(0, 1fr) 9rem minmax(0, 1fr); gap: 0; }
}
.sysmap__panel {
  display: grid;
  align-content: start;
  background: var(--surface);
  border: var(--hairline) solid var(--line-strong);
}
.sysmap__head {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--hairline) solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.sysmap__node {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  color: inherit;
  text-decoration: none;
}
.sysmap__node + .sysmap__node { border-top: var(--hairline) solid var(--line); }
.sysmap__node:hover, .sysmap__node:focus-visible { background: var(--surface-2); }
.sysmap__node:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sysmap__key {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.sysmap__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-soft);
}
html:lang(zh-Hant) .sysmap__title { font-family: var(--font-zh); text-transform: none; letter-spacing: .08em; font-weight: 500; }
.sysmap__node:hover .sysmap__title::after { transform: translateX(4px); }
.sysmap__title::after { content: " →"; display: inline-block; transition: transform var(--dur) var(--ease); }
.sysmap__note { color: var(--fg-3); font-size: var(--fs-small); line-height: 1.5; }

/* The wires are spread down the column rather than centred, so each one
   falls roughly beside a pair of nodes. They are not pinned to row
   boundaries on purpose: the nodes hold sentences and their heights differ
   between English and Chinese, so an exact tie would break in one language
   or the other. */
.sysmap__links { display: grid; align-content: space-around; gap: var(--space-5); padding-block: var(--space-6); }
.sysmap__wire { display: grid; justify-items: center; gap: .4rem; }
.sysmap__wire::after { content: ""; width: 100%; height: 2px; background: var(--brand); opacity: .75; }
.sysmap__wire-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
@media (max-width: 899.98px) {
  /* stacked: the wires become one short row of labels between the panels */
  .sysmap__links { grid-auto-flow: column; justify-content: center; gap: var(--space-5); }
  .sysmap__wire::after { width: 2.5rem; }
}

/* inline text link inside prose */
.link { color: var(--brand-soft); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
.link:hover { text-decoration-color: currentColor; }


/* ============================================================================
   §7 HERO
   Two forms.
     .hero               text left, radar PPI right (the original; kept so a
                         page without footage still has a hero).
     .hero.hero--media   text left over footage: add .band--media and a
                         .band__media block (§16). The PPI is NOT used in this
                         form — a sweep and a moving picture are one effect
                         too many — and the copy takes the full row.
   Under 900px both forms are single-column: the PPI drops below the text,
   the footage sits above it as a 16:9 poster (no video is ever loaded).
   ========================================================================== */
.hero { overflow: hidden; }
.hero__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding-block: clamp(3rem, 2rem + 3vw, 5rem) clamp(2.5rem, 1.5rem + 2.5vw, 4rem);
}
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-7); }
}
.hero__copy { display: grid; gap: var(--space-4); max-width: 42rem; }
.hero__copy h1 { max-width: 12em; }
html:lang(zh-Hant) .hero__copy h1 { max-width: 14em; }
.hero__copy .lede { max-width: 36rem; }
.hero__actions { margin-top: var(--space-2); }
.hero__ppi {
  width: min(100%, 440px);
  margin-inline: auto;
  aspect-ratio: 1;
  max-width: 100%;
}
@media (max-width: 899.98px) { .hero__ppi { width: min(100%, 300px); } }

/* footage form: one column; the copy is capped so the picture keeps the right
   of the band clear in both languages (the scrim follows the copy box, §16) */
.hero--media .hero__inner { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .hero--media .hero__inner { min-height: min(34rem, 66vh); align-content: center; }
  .hero--media .hero__copy { max-width: min(42rem, 56%); }
}


/* ============================================================================
   §8 CARDS & GRIDS
   .card is a bordered surface. Use it for things that are discrete objects
   (a module, an audience). Do not wrap running prose in a card.
   ========================================================================== */
.grid { display: grid; gap: var(--space-4); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
@media (min-width: 1100px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.grid--gapless { gap: 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: var(--hairline) solid var(--line);
  color: var(--fg);
  min-width: 0;
}
.card--flat { background: transparent; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.card__body { color: var(--fg-2); }
.card__body p + p { margin-top: .75em; }
.card__foot { margin-top: auto; padding-top: var(--space-3); }
.card .h3 { margin-top: var(--space-1); }
a.card:hover { border-color: var(--line-strong); color: var(--fg); }

/* module card: numbered, linked. Whole card is the link. */
.module {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface);
  border: var(--hairline) solid var(--line);
  color: var(--fg);
  min-height: 12rem;
  transition: border-color var(--dur) var(--ease);
}
.module:hover, .module:focus-within { border-color: var(--brand); color: var(--fg); }
.module__code { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.module__title { font-weight: 600; font-size: 1.05rem; color: var(--fg); }
.module__desc { color: var(--fg-2); font-size: var(--fs-small); line-height: 1.55; }
html:lang(zh-Hant) .module__desc { line-height: 1.75; }
.module__link { align-self: end; }
.module__link::before { content: ""; position: absolute; inset: 0; } /* stretch the link */
.module__link:focus-visible { outline: none; }
.module:has(.module__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

/* pillar: a numbered column with a diagram on top (What we do) */
.pillar { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.pillar__figure { border: var(--hairline) solid var(--line); background: var(--bg-band); padding: var(--space-3); }
.pillar__figure svg { width: 100%; height: auto; max-height: 220px; }
.pillar .h3 { margin-top: var(--space-2); }
.pillar__body { color: var(--fg-2); }

/* group label row above a card grid (e.g. "On the vessel" / "On shore") */
.group-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fg-3);
}
.group-label::after { content: ""; flex: 1; border-top: var(--hairline) solid var(--line); }
.group-label:first-child { margin-top: 0; }
html:lang(zh-Hant) .group-label { font-family: var(--font-zh); text-transform: none; letter-spacing: .25em; font-weight: 500; }


/* ============================================================================
   §9 SPEC TABLES & DEFINITION LISTS
   For the platform / integration pages. Tables scroll inside .table-wrap at
   narrow widths; the page itself never scrolls sideways.
   ========================================================================== */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: var(--hairline) solid var(--line); }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: .55rem 1rem .55rem 0; border-bottom: var(--hairline) solid var(--line); }
.spec-table th { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--fg-3); white-space: nowrap; }
.spec-table tbody th { color: var(--fg); font-family: var(--font-body); text-transform: none; letter-spacing: 0; white-space: normal; width: 11rem; }
.spec-table td { color: var(--fg-2); }
.spec-table td.num, .spec-table th.num { font-variant-numeric: tabular-nums; text-align: right; padding-right: 1rem; }
html:lang(zh-Hant) .spec-table th { font-family: var(--font-zh); text-transform: none; letter-spacing: .2em; }

/* key/value definition list */
/* The row rule has to run the whole width, the way .spec-table draws it on
   the sibling module pages -- a column gap here leaves a notch in every
   rule, and two pages that do the same job then look like two designs. The
   gap is therefore padding on the key, which the key's own border covers. */
.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2) 0; border-top: var(--hairline) solid var(--line); }
.kv > div { display: contents; }
.kv dt { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-small); font-weight: 600; color: var(--fg-3); padding-top: var(--space-2); }
.kv dd { margin: 0; color: var(--fg-2); padding-bottom: var(--space-2); border-bottom: var(--hairline) solid var(--line); }
@media (min-width: 640px) {
  .kv { grid-template-columns: calc(11rem + var(--space-5)) minmax(0, 1fr); }
  .kv dt { padding-block: var(--space-2); padding-right: var(--space-5); border-bottom: var(--hairline) solid var(--line); }
  .kv dd { padding-top: var(--space-2); }
}
html:lang(zh-Hant) .kv dt { font-family: var(--font-zh); text-transform: none; letter-spacing: .2em; }

/* a short honest note set apart from body copy (e.g. the 300 m window) */
.note {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--brand);
  background: var(--surface);
  color: var(--fg-2);
  max-width: 65ch;
}
.note__label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em; font-size: var(--fs-micro); font-weight: 600; color: var(--brand-soft); }
html:lang(zh-Hant) .note__label { font-family: var(--font-zh); text-transform: none; letter-spacing: .25em; }


/* ============================================================================
   §10 STAT TILES — verified numbers only (BRIEF §4.5)
   ========================================================================== */
.stats { display: grid; gap: 0; border-top: var(--hairline) solid var(--line); border-left: var(--hairline) solid var(--line); }
/* Four tiles today (index.html). Stepped 1 -> 2 -> 4 so the row never ends
   with a single orphan tile; revisit the step if the count changes. */
.stats { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px)  { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* index.html stands these four beside the radar picture they were measured
   from, so they live in a half-width column: two across, never four. The
   column is narrower but the count is fixed at four, which is what lets the
   value run larger here than in the full-width arrangement. */
@media (min-width: 1100px) { .stats--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats--pair .stat__value { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 4rem); }
.stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border-right: var(--hairline) solid var(--line);
  border-bottom: var(--hairline) solid var(--line);
  min-width: 0;
}
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.stat__value small { font-size: .5em; font-weight: 600; color: var(--fg-3); letter-spacing: .04em; }
.stat__label { color: var(--fg-2); font-size: var(--fs-small); line-height: 1.5; }
.stat__source { color: var(--fg-3); font-size: var(--fs-micro); font-family: var(--font-mono); letter-spacing: .04em; }


/* ============================================================================
   §11 FIGURES & DIAGRAMS
   Inline SVG only. Strokes use currentColor or the diagram tokens below so a
   figure can sit in a dark or light band unchanged. `.dg-*` classes are the
   drawing vocabulary; reuse them on every page's diagrams.
   ========================================================================== */
.figure { display: grid; gap: var(--space-3); min-width: 0; }
.figure svg { width: 100%; height: auto; max-height: min(60vh, 440px); color: var(--fg); } /* cap: a figure never owns a whole screen */
.figure--framed { border: var(--hairline) solid var(--line); background: var(--bg-band); padding: var(--space-4); }
.figure--scroll { overflow-x: auto; }
.figure--scroll svg { min-width: 560px; }
.figcaption, figcaption { color: var(--fg-3); font-size: var(--fs-small); line-height: 1.5; }

.dg-text { font-family: var(--font-body); font-size: 12px; fill: var(--fg-2); }
.dg-text--strong { fill: var(--fg); font-weight: 600; }
.dg-text--mute { fill: var(--fg-3); font-size: 10.5px; }
.dg-text--mono { font-family: var(--font-mono); font-size: 10px; fill: var(--fg-3); letter-spacing: .06em; }
.dg-text--accent { fill: var(--brand-soft); font-weight: 600; }
.dg-text--display { font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; fill: var(--fg-3); }
html:lang(zh-Hant) .dg-text, html:lang(zh-Hant) .dg-text--display { font-family: var(--font-zh); text-transform: none; letter-spacing: .05em; }
.dg-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.dg-box--deep { fill: var(--bg); }
.dg-box--accent { stroke: var(--brand); }
.dg-line { stroke: var(--line-strong); stroke-width: 1; fill: none; }
.dg-line--fg { stroke: var(--fg-3); }
.dg-line--accent { stroke: var(--brand); stroke-width: 1.5; }
.dg-line--dashed { stroke-dasharray: 4 4; }
.dg-grid { stroke: var(--diagram-grid); stroke-width: 1; fill: none; }
.dg-fill-accent { fill: var(--brand); }
.dg-fill-fg { fill: var(--fg); }
.dg-fill-mute { fill: var(--fg-3); }
.dg-arrow { fill: var(--fg-3); }
.dg-arrow--accent { fill: var(--brand); }

/* radar PPI (hero) */
.ppi { color: var(--fg); }
.ppi__ring { fill: none; stroke: var(--diagram-grid); stroke-width: 1; }
.ppi__ring--outer { stroke: var(--line-strong); }
.ppi__tick { stroke: var(--line-strong); stroke-width: 1; }
.ppi__label { font-family: var(--font-mono); font-size: 11px; fill: var(--fg-3); letter-spacing: .06em; }
.ppi__heading { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 2 4; }
.ppi__contact { fill: var(--brand); }
.ppi__vector { stroke: var(--brand-soft); stroke-width: 1.25; }
.ppi__own { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.ppi__sweep { fill: url(#ppi-sweep-grad); transform-origin: 300px 300px; transform-box: view-box; }
.ppi__sweep-stop { stop-color: var(--brand); }


/* ============================================================================
   §12 FORMS (contact page)
   mailto: submission first; see BRIEF §4.8.
   ========================================================================== */
.form { display: grid; gap: var(--space-5); max-width: 40rem; }
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field__label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-small); font-weight: 600; color: var(--fg-3); }
html:lang(zh-Hant) .field__label { font-family: var(--font-zh); text-transform: none; letter-spacing: .2em; }
.field__hint { font-size: var(--fs-small); color: var(--fg-3); }
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  background: var(--surface);
  border: var(--hairline) solid var(--line-strong);
  color: var(--fg);
  border-radius: var(--radius);
}
.textarea { min-height: 10rem; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--brand); }
.input::placeholder, .textarea::placeholder { color: var(--fg-3); }
.form__row { display: grid; gap: var(--space-5); }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }


/* ============================================================================
   §13 FOOTER
   Markup (copy verbatim):
   <footer class="site-footer">
     <div class="container">
       <div class="footer__grid"> .footer__brand + 3 × .footer__col </div>
       <div class="footer__bottom"> … </div>
     </div>
   </footer>
   ========================================================================== */
.site-footer {
  background: var(--ink-900);
  color: var(--slate-300);
  border-top: var(--hairline) solid var(--ink-500);
  padding-block: var(--space-7) var(--space-5);
  padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  font-size: var(--fs-small);
}
.footer__grid {
  display: grid;
  gap: var(--space-6) var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
@media (min-width: 900px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer__brand { display: grid; gap: var(--space-3); max-width: 24rem; align-content: start; }
.site-footer .brand__mark { width: 20px; height: 20px; }
.footer__tagline { color: var(--slate-400); }
.footer__heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--paper-100);
  margin-bottom: var(--space-3);
}
.footer__links { display: grid; gap: .5rem; }
.footer__links a { color: var(--slate-300); }
.footer__links a:hover { color: var(--paper-100); }
.footer__email { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--paper-100); overflow-wrap: anywhere; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: var(--hairline) solid var(--ink-500);
  color: var(--slate-400);
  font-size: var(--fs-micro);
}
.footer__bottom .kicker { color: var(--slate-400); }


/* ============================================================================
   §14 UTILITIES
   ========================================================================== */
.u-visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}
.u-center { text-align: center; }
.u-nowrap { white-space: nowrap; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-4 { margin-top: var(--space-4) !important; }
.u-mt-6 { margin-top: var(--space-6) !important; }
.u-mt-8 { margin-top: var(--space-8) !important; }
.u-mb-4 { margin-bottom: var(--space-4) !important; }
.u-mb-6 { margin-bottom: var(--space-6) !important; }
.u-max-prose { max-width: 65ch; }
.u-stack { display: grid; gap: var(--space-4); }
.u-stack--lg { gap: var(--space-6); }
.u-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.u-hide-mobile { display: none; }
@media (min-width: 640px) { .u-hide-mobile { display: initial; } }
@media (min-width: 640px) { .u-hide-desktop { display: none !important; } }
/* language-gated blocks: for content that has no sensible counterpart, use
   data-en/data-zh on text; for whole blocks use these two. */
html:lang(zh-Hant) .u-en-only { display: none !important; }
html:lang(en) .u-zh-only { display: none !important; }


/* ============================================================================
   §15 MOTION
   One slow radar sweep in the hero; a soft rise-in on section heads.
   Everything is gated on prefers-reduced-motion; resting state is visible.
   ========================================================================== */
@keyframes ppi-sweep { to { transform: rotate(360deg); } }
.ppi__sweep { animation: ppi-sweep 14s linear infinite; }

.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: .4; transform: translateY(10px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ppi__sweep { animation: none; opacity: .35; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}


/* ============================================================================
   §16 MEDIA — photography & footage
   The site was built without pictures; this section is the whole of what was
   added when footage arrived. Paste-ready markup is in NOTES-media.md.

   Rules of the system (read before adding a picture):
     · A picture never gets a row of its own on a module page. It goes behind
       a band that already exists (.band--media) or inside a column that has
       slack (.figure--evidence). Pages must not get longer for a photo.
     · Every image sits in a .media box whose aspect ratio is set in CSS, and
       every <img> carries width/height. Nothing shifts when it loads.
     · Text is never laid on bare footage. Inside .band--media the copy block
       draws its own scrim, sized from the copy box itself, so the guarantee
       holds for any headline length in either language and at any width:
       wherever a glyph can be, there is --scrim-a of the band colour under
       it (ratios beside the token in §1, computed for a pure-white pixel).
       The caption plate (.media__tag) is opaque; the pause glyph draws its
       own translucent disc, measured against a white pixel (5.3:1).
     · Footage keeps its own colour. No duotone: the point of the picture is
       that it is real. The only treatment is the mask that dissolves it into
       the band.
     · The loops autoplay on every visit and every width (owner's decision,
       2026-11-16). The <video> still ships with no src and site.js sets it
       after window.load, so the poster <img> is what paints first and is
       still the resting state if the file never arrives.
     · .band--media is for dark bands only. Do not combine with .band--light.

   Vocabulary
     .media                 aspect-ratio box (16:9). --media-ar / --media-pos
       .media--wide         12:5
       .media--strip        88:31, the planned-vs-actual track crop
       .media__img          the still / poster (always present)
       .media__video        the loop; invisible until .media.is-playing
       .media__toggle       pause/play (WCAG 2.2.2). Covers the whole box
                            and is invisible until hovered, focused, or
                            paused: clicking the picture is the control.
                            Comes BEFORE the tag in the markup
       .media__tag          small caption plate, bottom-left (bottom-right
                            inside .band__media); never takes a click
     .band--media           a band with a picture behind its right side
       .band__media         that picture: a .media, first child of the band
     .figure--photo         a framed still with a caption
     .figure--evidence      screenshot + legend + caption, for a column
     .legend                key for the track colours
   ========================================================================== */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--media-ar, 16 / 9);
  background: var(--bg-band);      /* what shows before the image arrives */
}
/* A crop has a real width and there are no more pixels behind it. Painting
   a 404px screen crop at 478 because that is how wide the column came out
   is how the instrument readings a caption points at go soft -- and those
   readings are the entire reason the crop is on the page. Declare the
   crop's own width and the figure stops short of the column edge instead,
   which inside a hairline border reads as deliberate. tools/check-gaps.js
   fails on any img painted more than 5% over its natural width. */
.media { max-width: var(--media-max, none); }
.media--wide { --media-ar: 12 / 5; }
.media--strip { --media-ar: 88 / 31; }
.media__img,
.media__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--media-pos, 50% 50%);
}
.media__video { opacity: 0; transition: opacity 600ms var(--ease); }
.media.is-playing .media__video { opacity: 1; }

/* plates: opaque on purpose, so the contrast audit can see them and the
   picture underneath cannot change the result */
.media__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: .3rem .65rem;
  background: var(--bg);
  color: var(--fg-2);
  border-top: var(--hairline) solid var(--line);
  border-right: var(--hairline) solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}
html:lang(zh-Hant) .media__tag { font-family: var(--font-zh); letter-spacing: .14em; text-transform: none; }
.media__tag { pointer-events: none; }
/* The control is the picture.

   Clicking anywhere on the clip pauses or resumes it. The glyph is drawn
   only on hover, on keyboard focus, and whenever the clip is actually
   paused -- so a stopped clip still says it is stopped, and a running one
   is just the footage, with no plate sitting on top of it.

   It stays a real <button>: tab-reachable, labelled, aria-pressed. That,
   not the plate, is what satisfies WCAG 2.2.2, and the paused state is
   never invisible. Do not swap it for a click handler on the <video>. */
.media__toggle {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--fg);
  border: 0;
  cursor: pointer;
}
.media__toggle[hidden] { display: none; }
.media__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.media__toggle::after {             /* the plate, only while revealed */
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(var(--ink-900-rgb), .62);
  border: var(--hairline) solid var(--line);
}
.media__toggle::before, .media__toggle::after { opacity: 0; transition: opacity 160ms ease; }
.media:hover > .media__toggle::before,
.media:hover > .media__toggle::after,
.media__toggle:focus-visible::before,
.media__toggle:focus-visible::after,
.media__toggle[aria-pressed="true"]::before,
.media__toggle[aria-pressed="true"]::after { opacity: 1; }
.media__toggle::before {            /* pause: two bars */
  content: "";
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 13px;
  height: 15px;
  border-inline: 4px solid currentColor;
}
.media__toggle[aria-pressed="true"]::before {   /* paused: show play */
  width: 0;
  height: 0;
  margin-left: 3px;                 /* a triangle centres to the left of its box */
  border-inline: 0;
  border-block: 8px solid transparent;
  border-left: 13px solid currentColor;
}

/* ---- a band with a picture behind it ------------------------------------ */
.band--media { overflow: hidden; isolation: isolate; --scrim-rgb: var(--ink-900-rgb); }
.band--media.band--dark { --scrim-rgb: var(--ink-800-rgb); }
.band--media > .container { position: relative; z-index: 1; }
/* The container spans the whole band and sits above the picture, so left to
   itself it swallows the click that pauses the clip -- an invisible, empty
   box eating the control. Events are handed back to its direct children,
   which are the copy blocks and are narrower than the band.
   CONSTRAINT: a direct child of this container that spans the full width
   will take those clicks back. tools/audit.js (HITTEST_FN) fails on it. */
.band--media > .container { pointer-events: none; }
.band--media > .container > * { pointer-events: auto; }
/* a head that fades in would take its scrim down with it */
.js .band--media .reveal { opacity: 1; transform: none; }

@media (max-width: 899.98px) {
  /* small screens: the picture is a strip above the copy, in normal flow.
     Nothing overlaps, so no scrim is needed. */
  .band__media { border-bottom: var(--hairline) solid var(--line); }
  .band--media:not(.hero) .band__media { --media-ar: 3 / 1; }
}
@media (min-width: 900px) {
  .band__media {
    position: absolute;
    inset-block: 0;
    right: 0;
    z-index: 0;
    width: var(--media-w, 58%);
    aspect-ratio: auto;
    background: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32%);
            mask-image: linear-gradient(to right, transparent 0, #000 32%);
  }
  /* the left of the picture is masked away, so its plates move to the right */
  .band__media .media__tag { left: auto; right: 0; border-right: 0; border-left: var(--hairline) solid var(--line); }
  .band__media .media__toggle { left: 32%; }   /* match the mask: only the visible picture is clickable */
  .band--media:not(.hero) { --media-w: 50%; }
  .band--media:not(.hero) .section__head { max-width: min(54rem, 52%); margin-bottom: 0; }

  /* the scrim: belongs to the copy block, not to the band. It runs from far
     left of the viewport to --scrim-fade past the copy's right edge and far
     above and below it (the band clips it), at full strength across the
     whole copy box. */
  .band--media .hero__copy,
  .band--media .section__head { position: relative; z-index: 1; }
  .band--media .hero__copy::before,
  .band--media .section__head::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset-block: -60rem;
    left: -100vw;
    right: calc(-1 * var(--scrim-fade));
    background: linear-gradient(to right,
      rgba(var(--scrim-rgb), var(--scrim-a)) 0,
      rgba(var(--scrim-rgb), var(--scrim-a)) calc(100% - var(--scrim-fade)),
      rgba(var(--scrim-rgb), 0) 100%);
    pointer-events: none;
  }
}

/* ---- stills inside the page --------------------------------------------- */
.figure--photo .media { border: var(--hairline) solid var(--line); }

/* Two figures standing side by side.

   A pair like this has to agree about three horizontal lines or it reads as
   a mistake rather than a pair: the bottom of the picture, the top of the
   caption, and the source credit. Nothing enforced any of them, and on
   helm.html the two clips are genuinely different shapes (912x672 against
   832x576), so the pictures ended at different heights and the captions
   started on different lines. tools/check-gaps.js now fails on it.

   The first two lines come from stretching the figures and giving each one
   a single flexible row for its caption. The third is the credit pushed to
   the bottom of its own caption, so the pair still lines up when one side
   wraps to an extra line -- which English and Chinese do differently on the
   same two captions, so it is not a thing you can fix by shortening copy.

   The aspect ratio itself is NOT set here: it belongs to the clip and is
   declared on the page. Both media in a pair must carry the same one. */
.figure-pair { align-items: stretch; }
.figure-pair > .figure { grid-template-rows: auto 1fr; height: 100%; }
.figure-pair .figcaption { display: flex; flex-direction: column; gap: var(--space-2); }
.figure-pair .figcaption > .credit { margin-top: auto; }

.figure--evidence {
  gap: 0;
  border: var(--hairline) solid var(--line);
  background: var(--bg-band);
}
.figure--evidence .media { max-width: 27.5rem; }   /* 440px: the crop's real pixels, never upscaled */
.figure--evidence figcaption { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-3) var(--space-4); }
@media (min-width: 1200px) {
  .figure--evidence { grid-template-columns: minmax(0, 27.5rem) minmax(0, 1fr); align-items: stretch; }
  .figure--evidence .media { aspect-ratio: auto; min-height: 9.6875rem; height: 100%; }
}

.legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); color: var(--fg-2); font-size: var(--fs-small); line-height: 1.5; }
.legend__item { display: inline-flex; align-items: center; gap: var(--space-2); }
.legend__swatch { flex: none; width: 1.75rem; height: 0; border-top: 2px solid var(--track-actual); }
.legend__swatch--plan { border-top: 2px dashed var(--track-plan); }

/* Track strokes inside inline SVG, bound to the same two tokens as .legend
   above so the diagram and its key can never drift apart. Plan is dashed and
   run is solid in BOTH places: the dash is doing the work for anyone who
   cannot separate the green from the amber. */
.dg-track--plan   { fill: none; stroke: var(--track-plan);   stroke-width: 2;   stroke-dasharray: 7 5; stroke-linecap: round; }
.dg-track--actual { fill: none; stroke: var(--track-actual); stroke-width: 2.5; stroke-linecap: round; }
.dg-track-mark    { fill: var(--surface); stroke: var(--track-plan); stroke-width: 1.5; }
.dg-track-ship    { fill: var(--track-actual); }
.dg-xte           { stroke: var(--fg-3); stroke-width: 1; }

/* Source credit on a figure. Deliberately the smallest readable thing on the
   page: an attribution has to be present, it does not have to compete. */
.credit { display: block; margin-top: var(--space-2); font-size: .72rem; line-height: 1.4; color: var(--fg-mute); }

/* ---- mission-planning animation (helm.html) ------------------------------
   Waypoints drop in, the route draws between them, the mission is dispatched,
   the vessel runs it. One 11s loop.

   This is a diagram, not a reconstruction of a screen. The real planning
   screen cannot be published: its left panel is a list of waypoint latitudes
   and longitudes and its map carries a tiled third-party basemap watermark,
   which is to say the two things the screen is made of are the two things
   that may not go out.

   Every animation here is also expressed as a static end state, so the
   reduced-motion block at the bottom only has to switch the animations off:
   nothing needs re-positioning and nothing disappears. */
.mp-wp, .mp-ping, .mp-ship, .mp-route--draw, .mp-badge { animation: none; }

@media (prefers-reduced-motion: no-preference) {
  .mp-wp      { animation: mp-pop 11s var(--wp-delay, 0s) infinite both; }
  .mp-ping    { animation: mp-ping 11s var(--wp-delay, 0s) infinite both; }
  .mp-route--draw { animation: mp-draw 11s infinite both; }
  .mp-badge   { animation: mp-badge 11s infinite both; }
  .mp-ship    { animation: mp-run 11s infinite both; }
}

@keyframes mp-pop {
  0%, 2%      { opacity: 0; transform: scale(.4); }
  6%, 100%    { opacity: 1; transform: scale(1); }
}
@keyframes mp-ping {        /* the tap that placed it */
  0%, 2%      { opacity: .9; r: 4; }
  10%, 100%   { opacity: 0;  r: 15; }
}
@keyframes mp-draw {        /* route is laid in after the last point lands */
  0%, 24%     { stroke-dashoffset: 520; }
  44%, 100%   { stroke-dashoffset: 0; }
}
@keyframes mp-badge {       /* DISPATCHED */
  0%, 46%     { opacity: 0; }
  52%, 94%    { opacity: 1; }
  100%        { opacity: 0; }
}
@keyframes mp-run {
  0%, 50%     { offset-distance: 0%;   opacity: 0; }
  53%         { offset-distance: 2%;   opacity: 1; }
  96%, 100%   { offset-distance: 100%; opacity: 1; }
}

.mp-route      { fill: none; stroke: var(--track-plan); stroke-width: 2; stroke-dasharray: 7 5; opacity: .45; }
.mp-route--draw{ fill: none; stroke: var(--track-plan); stroke-width: 2.5; stroke-dasharray: 520; stroke-dashoffset: 0; }
.mp-wp         { fill: var(--surface); stroke: var(--track-plan); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.mp-ping       { fill: none; stroke: var(--track-plan); stroke-width: 1.5; opacity: 0; }
.mp-ship       { fill: var(--track-actual);
                 offset-path: path("M58 196 L140 96 L286 80 L376 156 L300 220");
                 offset-rotate: auto; offset-distance: 100%; }

/* No prefers-reduced-motion override for the loops: by the owner's decision
   they autoplay regardless. The pause control is always on screen, which is
   what WCAG 2.2.2 actually requires. The .reveal entrance animations below
   still honour the preference -- those are decoration, the footage is not. */
@media print {
  .band__media, .media__video, .media__toggle { display: none; }
}
