/* OpenJSQ site — one stylesheet, dark single theme ("Waterfall").
   Tokens are verbatim from the style board, direction B. */

:root {
  --ground: #0B1220;   /* navy, never pure black */
  --panel:  #111B2E;
  --line:   #22304A;
  --ink:    #E6EDF6;
  --brand-accent: #4da3ff;  /* the app's own accent: main_window.cpp brand, theme.cpp "accent" */
  --muted:  #8D9BB0;
  --cyan:   #39D0FF;   /* exactly one thing per screen */
  /* amber #FFC857 exists only inside the waterfall gradient (assets/js/hero.js);
     it is deliberately not a CSS token so it cannot become a UI colour. */

  --display: "Chivo", "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
  --body:    "Karla", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:    "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;

  --max: 1240px;
  --gutter: 44px;
}

html { color-scheme: dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

::selection { background: rgba(230, 237, 246, .22); }

.skip {
  position: absolute; left: 12px; top: -60px;
  padding: 8px 12px; background: var(--ink); color: var(--ground);
  font-weight: 700; z-index: 20;
}
.skip:focus { top: 12px; }

/* ---------- shell ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.bar {
  display: flex; align-items: center; gap: 30px;
  padding: 18px var(--gutter);
  max-width: var(--max); margin: 0 auto;
  font: 500 14px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.bar .logo {
  font: 900 20px/1 var(--display); color: var(--ink); letter-spacing: .14em; text-transform: none;
  text-decoration: none;
}
.bar .logo b { color: var(--brand-accent); font-weight: inherit; }
/* Letters of a heading set in the logo's own blue: JSQ, and on the transport
   page the J of JS8 and SQ of FSQ it takes its name from. Colour only: weight
   and size stay the heading's. */
.brand-letters { color: var(--brand-accent); }
.bar .logo small { font: 500 14px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-left: 14px; }
/* The author's byline beside the logo, in the case it is written in. */
.bar .logo small.byline { text-transform: none; letter-spacing: .02em; }
.bar nav { margin-left: auto; display: flex; gap: 26px; flex-wrap: wrap; }
.bar nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.bar nav a:hover { color: var(--ink); }
.bar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

main { display: block; }

section.band { padding: 44px var(--gutter); max-width: var(--max); margin: 0 auto; }
section.rule { border-top: 1px solid var(--line); }

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
footer.site .in {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px 40px; font-size: 15px; color: var(--muted);
}
footer.site b { color: var(--ink); font-weight: 700; }
footer.site p { margin: 0 0 8px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer.site .ver { font: 14px/1.6 var(--mono); }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-weight: 300; font-size: clamp(38px, 5.4vw, 70px); line-height: 1.02; }
h1 b, h2 b { font-weight: 900; }
h2 { font-weight: 300; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.08; }
h3 { font-weight: 700; font-size: 22px; line-height: 1.2; }
h4 { font: 700 17px/1.3 var(--body); margin: 0 0 6px; }

p { margin: 0 0 16px; }
.lede { font-size: 22px; line-height: 1.35; max-width: 32ch; margin: 0 0 22px; }
.muted { color: var(--muted); }
.kicker { font: 500 14px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.ver, code, kbd, .hash { font-family: var(--mono); font-size: 14px; }
.hash { font-size: 15px; word-break: break-all; color: var(--ink); }
.fine { font: 14px/1.6 var(--body); color: var(--muted); margin-top: 16px; }
.measure { max-width: 66ch; }
ul, ol { padding-left: 22px; }
li { margin: 0 0 6px; }

/* Citations: every on-air claim carries one of these. */
.ref {
  display: inline-block; font: 500 14px/1.3 var(--body); letter-spacing: .02em; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid var(--line); white-space: nowrap; margin-left: 6px;
}
.ref:hover, .ref:focus-visible { color: var(--ink); border-bottom-color: var(--muted); }
.ref::before { content: "§ "; }
.ref.guide::before { content: ""; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; padding: 13px 22px; border-radius: 2px; text-decoration: none;
  font: 700 15px/1.2 var(--body); letter-spacing: .02em; margin: 0 12px 10px 0;
  border: 1px solid var(--muted); color: var(--ink); background: transparent;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--cyan); color: #062033; border-color: var(--cyan); }
.btn.primary:hover { background: #5ad8ff; border-color: #5ad8ff; }

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(180deg, #0d1a33 0%, #10264d 60%, #0B1220 100%); /* no-JS fallback ground */
  border-bottom: 1px solid var(--line);
  padding: 44px 0 40px;
}
.hero-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.hero-head { margin-bottom: 28px; }
.hero-head h1 { color: #fff; font-weight: 700; font-size: clamp(38px, 4.6vw, 60px); text-shadow: 0 2px 24px rgba(0,0,0,.65); }
.hero-head h1 b { font-weight: inherit; }
.hero-intro { max-width: 64ch; margin: 22px 0 10px; font-size: clamp(19px, 2vw, 24px); line-height: 1.4; }
.hero-explainer { max-width: 88ch; margin: 0; color: #becbde; }
.hero-explainer a { white-space: nowrap; }
.transport-layer { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; padding: 22px 26px 0; border: 1px solid #355a83; border-top: 2px solid var(--brand-accent); border-radius: 8px; background: linear-gradient(120deg, #13243c, var(--panel)); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.transport-layer strong { font: 700 18px/1.3 var(--body); }
.transport-layer > span { color: var(--ink); }
.transport-layer .transport-services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 30px; width: 100%; margin: 16px 0 22px; padding: 0; list-style: none; line-height: 1.4; }
.transport-services li { display: flex; align-items: center; gap: 14px; margin: 0; font-weight: 500; }
.transport-services svg { flex: 0 0 23px; width: 23px; height: 23px; fill: none; stroke: var(--brand-accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.transport-layer .transport-benefits { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 24px; width: calc(100% + 52px); margin: 0 -26px; padding: 16px 26px; border-top: 1px solid #2a405e; border-radius: 0 0 8px 8px; background: rgba(6,16,30,.28); color: #becbde; line-height: 1.6; }
.transport-benefits strong { font: 700 14px/1.6 var(--body); color: var(--ink); }
.transport-benefits ul { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 0; margin: 0; list-style: none; font-size: 15px; }
.transport-benefits li { margin: 0; }
.transport-benefits li::before { content: '✓'; color: var(--brand-accent); margin-right: 8px; }
@media (max-width: 600px) { .transport-layer .transport-services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; } }
.transport-layer a { margin-left: auto; font-size: 14px; color: #becbde; }
.transport-layer::after { content: ''; position: absolute; left: 50%; top: 100%; height: 30px; border-left: 1px solid var(--brand-accent); }
.transport-layer + .hero-panels { position: relative; padding-top: 30px; }
.transport-layer + .hero-panels::before { content: ''; position: absolute; top: 14px; left: calc(100% / 6 - 22px / 3); right: calc(100% / 6 - 22px / 3); height: 16px; border: 1px solid var(--brand-accent); border-bottom: 0; }
.modem-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--line); }
.modem-label span { font: 14px/1.3 var(--mono); color: var(--muted); }
@media (max-width: 820px) {
  .transport-layer { align-items: flex-start; flex-direction: column; gap: 6px; }
  .transport-layer a { margin-left: 0; }
  .transport-layer::after { left: 10px; height: 30px; }
  .transport-layer + .hero-panels { padding-left: 22px; padding-top: 24px; }
  .transport-layer + .hero-panels::before { left: 10px; right: auto; top: 0; bottom: 0; width: 0; height: auto; border: 0; border-left: 1px solid var(--brand-accent); }
  .transport-layer + .hero-panels .wf-panel { position: relative; overflow: visible; }
  .transport-layer + .hero-panels .wf-panel::before { content: ''; position: absolute; top: 23px; left: -13px; width: 12px; border-top: 1px solid var(--brand-accent); }
}
/* Three modem options with illustrative waterfalls. */
.hero-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.wf-panel { margin: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); overflow: hidden; }
.wf-view { position: relative; }
.wf-view canvas { display: block; width: 100%; height: clamp(180px, 17vw, 250px); }
.wf-view::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,18,32,0) 52%, rgba(11,18,32,.8) 100%);
}
.wf-panel figcaption { padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.wf-panel figcaption b { color: var(--ink); font-weight: 700; }
.hero-fine { margin: 16px 0 0; max-width: 96ch; }
.hero .scale {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px; z-index: 2;
  margin: 0; padding: 0; list-style: none;
  font: 500 13px/1 var(--body); color: rgba(230,237,246,.8);
}
.hero .scale li { position: absolute; bottom: 9px; transform: translateX(-50%); white-space: nowrap; }
.hero .scale li::before {
  content: ""; position: absolute; left: 50%; bottom: 18px; width: 1px; height: 11px; background: rgba(230,237,246,.6);
}

/* ---------- home sections ---------- */

.sub { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding: 40px var(--gutter) 48px; max-width: var(--max); margin: 0 auto; border-bottom: 1px solid var(--line); }
.modes { display: grid; gap: 10px; align-content: start; }
.mode {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); border-radius: 2px;
}
.mode .n { font: 900 18px/1.3 var(--display); letter-spacing: .06em; }
.mode .d { font-size: 15px; color: var(--muted); }
.mode .d b { color: var(--ink); font-weight: 500; }

.feat { display: grid; grid-template-columns: repeat(5, 1fr); max-width: var(--max); margin: 0 auto; border-bottom: 1px solid var(--line); }
.feat > div { padding: 26px 24px 28px; border-right: 1px solid var(--line); }
.feat > div:first-child { padding-left: var(--gutter); }
.feat > div:last-child { border-right: 0; padding-right: var(--gutter); }
.feat .k { font: 500 14px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.feat b { display: block; font: 700 18px/1.2 var(--display); margin-bottom: 8px; }
.feat span { font-size: 15px; color: var(--muted); display: block; }

.split { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.split.wide-text { grid-template-columns: 1fr 1fr; }
.split .side p { color: var(--muted); }
.split h2 { margin-bottom: 12px; }

figure { margin: 0; }
figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* layer diagram */
.diagram { width: 100%; height: auto; }
.diagram text { font-family: var(--body); }

.cta {
  display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center;
  padding: 40px var(--gutter); max-width: var(--max); margin: 0 auto; border-top: 1px solid var(--line);
}
.cta h2 { margin-bottom: 8px; }

.emcomm { padding-top: 54px; padding-bottom: 32px; }
.emcomm h2 { max-width: 24ch; }
.emcomm-intro { max-width: 76ch; margin: 22px 0 32px; color: #becbde; font-size: 20px; line-height: 1.55; }
.emcomm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.emcomm-grid article { min-width: 0; padding: 28px; border: 1px solid #355a83; border-top: 2px solid var(--brand-accent); border-radius: 8px; background: linear-gradient(135deg, #13243c, var(--panel)); }
.emcomm-grid svg { width: 40px; height: 40px; margin-bottom: 20px; fill: none; stroke: var(--brand-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.emcomm-grid h3 { font-size: 22px; margin-bottom: 12px; }
.emcomm-grid p { color: #becbde; margin-bottom: 20px; line-height: 1.6; }
.emcomm-grid a { color: #9dcaff; font-size: 15px; }
.emcomm-note { max-width: 95ch; margin: 26px 0 0; padding-left: 18px; border-left: 2px solid #355a83; color: var(--muted); font-size: 15px; line-height: 1.65; }
@media (max-width: 700px) { .emcomm-grid { grid-template-columns: 1fr; } .emcomm-grid article { padding: 24px; } .emcomm-intro { font-size: 19px; } }

/* ---------- inner pages ---------- */
.radio-connections { border-top: 1px solid var(--line); }
.connection-intro { margin: 18px 0 28px; color: #becbde; }
.connection-path { padding: 22px 24px; margin-bottom: 18px; border: 1px solid #2a405e; border-radius: 8px; background: var(--panel); }
.connection-path h3 { font-size: 18px; margin-bottom: 22px; color: var(--brand-accent); }
.connection-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; list-style: none; margin: 0; padding: 0; }
.connection-flow li { position: relative; margin: 0; }
.connection-flow li + li::before { content: '→'; position: absolute; left: -36px; top: 35px; color: var(--brand-accent); font-size: 26px; }
.equipment { width: 180px; height: 100px; margin-bottom: 16px; fill: #142a43; stroke: var(--brand-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.equipment .equipment-detail { fill: none; stroke: #94c6ff; stroke-width: 1.5; }
.connection-flow strong, .connection-flow span { display: block; }
.connection-flow span { margin-top: 6px; color: #becbde; font-size: 15px; }
.connection-path .fine { margin: 20px 0 0; }
.connection-cat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; padding: 18px 24px; border: 1px dashed #355a83; border-radius: 8px; }
.connection-cat > strong { color: var(--brand-accent); }
.connection-cat p { flex-basis: 100%; margin: 0; color: #becbde; font-size: 15px; }
.radio-connections > .fine { max-width: 100ch; margin-bottom: 0; }
@media (max-width: 600px) {
  .connection-flow { grid-template-columns: 1fr; gap: 36px; }
  .connection-flow li + li::before { content: '↓'; left: 80px; top: -36px; }
}

.page-head { padding: 48px var(--gutter) 28px; max-width: var(--max); margin: 0 auto; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 18px; }
.page-head .lede { max-width: 40ch; }

article.sec { display: grid; grid-template-columns: 300px 1fr; gap: 24px 40px; padding: 40px var(--gutter); max-width: var(--max); margin: 0 auto; border-bottom: 1px solid var(--line); }
article.sec > header h2 { font-size: 30px; margin-bottom: 10px; }
article.sec#author { border-top: 1px solid var(--line); margin-top: 24px; }
article.sec > header p { color: var(--muted); font-size: 15px; }
article.sec .body { max-width: 68ch; }
article.sec .body h3 { font-size: 20px; margin: 26px 0 10px; }
article.sec .body figure { max-width: none; margin-top: 8px; }
article.sec .body p { margin-bottom: 14px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 2px; }
dl.facts dt { color: var(--muted); font-size: 15px; }
dl.facts dd { margin: 0; }

.callouts { counter-reset: c; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.callouts li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.callouts li::before {
  counter-increment: c; content: counter(c);
  width: 26px; height: 26px; border: 1px solid var(--muted); border-radius: 50%;
  display: grid; place-items: center; font: 700 14px/1 var(--body); color: var(--ink);
}

.note { border-left: 2px solid var(--line); padding: 4px 0 4px 18px; color: var(--muted); margin: 0 0 18px; }

/* download */
.dl { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding: 40px var(--gutter); max-width: var(--max); margin: 0 auto; }
.dl .box { border: 1px solid var(--line); background: var(--panel); padding: 22px 24px; border-radius: 2px; }
.dl .box h3 { margin-bottom: 12px; }
.dl dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--muted); font-size: 15px; }
.dl dd { margin: 0; }
.licence { font-size: 16px; }
.licence b { font-weight: 700; }

/* specs index */
.speclist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.speclist li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px 24px; align-items: baseline; padding: 18px 20px; border: 1px solid var(--line); background: var(--panel); border-radius: 2px; }
.speclist h3 { font-size: 20px; }
.speclist p { margin: 6px 0 0; color: var(--muted); font-size: 15px; grid-column: 1 / -1; }
.speclist .meta { font: 14px/1.6 var(--mono); color: var(--muted); }
.speclist li > * { min-width: 0; }
@media (max-width: 760px) { .speclist li { grid-template-columns: minmax(0, 1fr); } }
.speclist .links { grid-column: 1 / -1; font-size: 15px; display: flex; gap: 18px; }

/* ---------- rendered documents (/docs/*.html) ---------- */

.doc { max-width: 880px; margin: 0 auto; padding: 36px var(--gutter) 80px; }
.doc .docmeta { font-size: 15px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 28px; }
.doc h1 { font-weight: 700; font-size: clamp(30px, 4vw, 44px); margin: 0 0 6px; }
.doc h2 { font-weight: 700; font-size: 26px; margin: 44px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 20px; margin: 30px 0 8px; }
.doc h4 { font: 700 17px/1.3 var(--body); margin: 22px 0 6px; }
.doc h5, .doc h6 { font: 700 16px/1.3 var(--body); margin: 18px 0 6px; }
.doc :is(h1,h2,h3,h4) a.anchor { text-decoration: none; color: var(--muted); font-weight: 400; margin-left: 8px; opacity: 0; }
.doc :is(h1,h2,h3,h4):hover a.anchor, .doc :is(h1,h2,h3,h4) a.anchor:focus-visible { opacity: 1; }
.doc :target { scroll-margin-top: 20px; }
.doc :target::before { content: ""; display: inline-block; width: 6px; height: 1em; background: var(--muted); vertical-align: -.15em; margin-right: 10px; }
.doc p, .doc li { max-width: 74ch; }
.doc pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: 2px;
  padding: 14px 16px; overflow-x: auto; font: 14px/1.5 var(--mono); margin: 0 0 18px;
}
.doc code { background: rgba(230,237,246,.07); padding: 1px 5px; border-radius: 2px; }
.doc pre code { background: none; padding: 0; }
.doc blockquote { margin: 0 0 18px; padding: 4px 0 4px 18px; border-left: 2px solid var(--muted); color: var(--muted); }
.doc blockquote p { margin: 0 0 8px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.doc .tbl { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 2px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--panel); font-weight: 700; }
.doc td.num, .doc th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc ul.ol { list-style: none; padding-left: 0; }
.doc ul.ol > li { display: grid; grid-template-columns: max-content 1fr; gap: 10px; }
.doc ul.ol > li .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.doc .toc { border: 1px solid var(--line); background: var(--panel); padding: 16px 20px; margin: 0 0 32px; border-radius: 2px; }
.doc .toc summary { cursor: pointer; font-weight: 700; }
.doc .toc ol { margin: 12px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 15px; }
.doc .toc li { break-inside: avoid; margin: 0 0 4px; }
.doc .toc a { text-decoration: none; color: var(--muted); }
.doc .toc a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .feat { grid-template-columns: repeat(3, 1fr); }
  .feat > div { border-bottom: 1px solid var(--line); }
  .feat > div:nth-child(3n) { border-right: 0; }
  .feat > div:first-child { padding-left: 24px; }
  .feat > div:last-child { padding-right: 24px; }
  article.sec { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --gutter: 20px; }
  .bar { gap: 16px; }
  .bar nav { gap: 16px; }
  .sub, .split, .split.wide-text, .dl, .cta { grid-template-columns: 1fr; }
  .feat { grid-template-columns: repeat(2, 1fr); }
  .feat > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .feat > div:nth-child(2n) { border-right: 0; }
  footer.site .in { grid-template-columns: 1fr; }
  .hero-panels { grid-template-columns: 1fr; gap: 16px; }
  .wf-view canvas { height: clamp(180px, 26vw, 240px); }
  .doc .toc ol { columns: 1; }
  dl.facts, .dl dl { grid-template-columns: 1fr; gap: 2px 0; }
  dl.facts dd, .dl dd { margin-bottom: 8px; }
}

@media (max-width: 520px) {
  .feat { grid-template-columns: 1fr; }
  .feat > div { border-right: 0; }
  .bar { flex-wrap: wrap; }
  .bar nav { margin-left: 0; width: 100%; }
}

@media print {
  body { background: #fff; color: #000; }
  .hero, .bar nav, .btn { display: none; }
}

/* ---------- additions for the inner pages ---------- */

/* layer diagram: the SVG never shrinks below the width at which its 14 px labels
   stay 14 px; on narrow screens the wrapper scrolls instead. */
.diagram-wrap { overflow-x: auto; }
.diagram { width: 100%; min-width: 640px; height: auto; }
.diagram-wrap.big { margin: 0 0 24px; }
.diagram-wrap.big .diagram { min-width: 680px; }

/* data tables outside rendered documents */
.tbl { overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl caption { text-align: left; padding: 12px 14px 6px; font-weight: 700; caption-side: top; }
.tbl th, .tbl td { text-align: left; padding: 8px 14px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.tbl th { white-space: normal; }
article.sec .body.wide { max-width: none; }
article.sec .body.wide > p, article.sec .body.wide dl.facts { max-width: 68ch; }
.tbl th { font-weight: 500; color: var(--muted); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 14px; }
.tbl td:first-child { font-weight: 700; }

article.sec .body .note { margin-top: 4px; }
dl.facts dd code, .body code, .feat code, .callouts code { font-size: 14px; }
.page-head .fine { max-width: 60ch; }
.callouts li > span { display: block; }
.dl h3 { font-size: 22px; }


/* Introduction and screenshot readability. Keep the source image proportions. */
img { height: auto; }
.hero-head h1 { max-width: 21ch; }
.hero-head .kicker { color: var(--ink); }
.hero-note { margin: 16px 0 0; font-size: clamp(17px, 2vw, 23px); color: var(--ink); }
.sub h2 { margin-bottom: 18px; }
.sub.app-introduction { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.sub.app-introduction .lede { max-width: 65ch; }
.app-introduction .fine { max-width: 85ch; }
.app-callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; list-style: none; padding: 0; margin: 0; }
.app-callouts li { margin: 0; padding: 16px 0 0; border-top: 2px solid #355a83; }
.app-callouts strong { display: block; margin-bottom: 8px; font-weight: 700; color: var(--brand-accent); }
.app-callouts span { display: block; color: #becbde; line-height: 1.5; }
@media (max-width: 700px) { .app-callouts { grid-template-columns: 1fr; gap: 18px; } }
.sub .lede { max-width: 42ch; font-size: 20px; }
.mode { grid-template-columns: 125px minmax(0, 1fr); padding: 22px; }
.mode .n { letter-spacing: 0; }
.mode .d { font-size: 17px; }
.mode .d b { display: block; margin-bottom: 7px; font-weight: 700; }
.modes > .fine { margin: 4px 0 0; }
.showcase-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: end; margin-bottom: 24px; }
.showcase-intro p { max-width: 48ch; }
.product-showcase figure { max-width: 1100px; }
.screenshot-link { display: block; cursor: zoom-in; }
.screenshot-link:hover { outline: 1px solid var(--muted); outline-offset: 3px; }
.image-hint { display: block; margin-top: 6px; }
.app-tour article.sec { grid-template-columns: 210px minmax(0, 1fr); }
.app-tour article.sec .body { max-width: none; min-width: 0; }
.jump-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 4px; }
.jump-links a { padding: 8px 0; }
.sec { scroll-margin-top: 24px; }
.sub > *, .split > *, .dl > *, article.sec > * { min-width: 0; }
@media (max-width: 1000px) { .app-tour article.sec { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .showcase-intro { grid-template-columns: 1fr; gap: 16px; }
  .bar .logo small { display: none; }
  /* The byline stays on a narrow screen, under the logo rather than beside it. */
  .bar .logo small.byline { display: block; margin: 6px 0 0; font-size: 12px; }
}
@media (max-width: 520px) {
  .mode { grid-template-columns: 1fr; gap: 10px; padding: 20px; }
  .hero-head h1 { font-size: clamp(32px, 8.5vw, 44px); }
  .hero-head .kicker { font-size: 12px; line-height: 1.4; }
  .hero-note { max-width: 28ch; }
  .hero .scale li:nth-child(even) { display: none; }
}

.technical-details { margin-top: 24px; }
.technical-details summary { padding: 14px 0; cursor: pointer; font-weight: 700; }
.technical-details[open] summary { margin-bottom: 12px; }

/* A readable setup sequence, with every step available without scripting. */
.first-contact { scroll-margin-top: 24px; }
.contact-steps { counter-reset: contact; list-style: none; padding: 0; margin: 30px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.contact-steps li { counter-increment: contact; border-top: 1px solid var(--line); padding: 20px 0 0; min-width: 0; }
.contact-steps h3 { display: flex; align-items: baseline; gap: 14px; font-size: 23px; margin: 0 0 12px; }
.contact-steps h3::before { content: "0" counter(contact); color: var(--muted); font: 15px var(--mono); }
.contact-steps p { max-width: 49ch; }
.contact-steps a { display: inline-block; padding: 6px 0; }
@media (max-width: 700px) { .contact-steps { grid-template-columns: 1fr; gap: 20px; } }

/* Forms are a separate capability beside the delivery guarantees. */
.transport-benefits .forms-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 5px 10px; border: 1px solid #426b93; border-radius: 5px; color: #d2e8ff; background: #132d48; font-size: 13px; font-weight: 700; }
.forms-badge svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.ax-waterfall { height: clamp(180px, 17vw, 250px); background: #06192b url("/assets/img/ax25-waterfall-2.jpg") repeat-y 0 0 / 100% auto; animation: ax-waterfall-scroll 36s linear infinite; }
@keyframes ax-waterfall-scroll { to { background-position-y: 64.357143cqw; } }
@media (max-width: 820px) { .transport-benefits .forms-badge { margin-left: 0; } .ax-waterfall { height: clamp(180px, 26vw, 240px); } }
@media (prefers-reduced-motion: reduce) { .ax-waterfall { animation: none; } }

.wf-view { container-type: inline-size; }

.emcomm-forms { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 22px; padding: 20px 24px; margin: 20px 0; border-left: 3px solid var(--brand-accent); background: #13243c; }
.emcomm-forms strong { color: var(--brand-accent); }
.emcomm-forms span { flex: 1 1 320px; }

/* Keep inline wordmarks intact inside component labels. */
.brand-letters.brand-letters { display: inline; color: var(--brand-accent); font: inherit; margin: 0; }
