/* Fonts are loaded from <head> on each page (Bebas Neue + Barlow). */

/* ============================================================
   Combined Arms Battalion: shared styles
   Colours come from CAB's own material: the maroon of the
   recruiting booth, the gold of the rank insignia, black
   uniforms and the white crest.
   ============================================================ */

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

:root {
  --ink-950: #0c0a0a;
  --ink-900: #131010;
  --ink-850: #181414;
  --ink-800: #1e1919;
  --ink-700: #2a2222;

  --maroon:        #6e1616;
  --maroon-bright: #8f2020;
  --maroon-deep:   #3d0c0c;

  --gold:        #e8b860;
  --gold-bright: #f3cf88;
  --gold-dim:    rgba(232, 184, 96, 0.14);

  --text:  #ece6dc;
  --muted: #a1978b;
  --faint: #6f665c;

  /* Detachment tags only. Never used as large fills. */
  --armour: #8a9a62;
  --naval:  #7f9cb8;
  --air:    #a9c3d9;

  --line:      rgba(236, 230, 220, 0.11);
  --line-gold: rgba(232, 184, 96, 0.35);

  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-950);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink-950);
  padding: 0.5rem 1rem; z-index: 200; font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ── Layout ─────────────────────────────────────────────── */

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

main { flex: 1; }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section--tint { background: var(--ink-900); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split--wide-left { grid-template-columns: 1.4fr 1fr; }
.cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }

/* ── Type: three levels ─────────────────────────────────── */

/* 1. Display: page and hero titles */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.display--page { font-size: clamp(2.4rem, 6vw, 4.2rem); }

/* 2. Section headings: plain sentence case, so the big capitals
      stay special (page titles, nav, buttons, numbers). A short gold
      rule under each one does the job the old eyebrow labels did. */
.h-section {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.h-section::after {
  content: ''; display: block;
  width: 2.5rem; height: 3px;
  background: var(--maroon-bright);
  margin-top: 0.7rem;
}
.h-sub {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

/* Coloured word above a card title (detachment, game). No box. */
.kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

/* 3. Small labels: military metadata */
.label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.label--muted { color: var(--muted); }

.lede { font-size: clamp(1.05rem, 1.8vw, 1.2rem); line-height: 1.6; color: var(--text); max-width: 60ch; }
.prose p { max-width: 68ch; margin-bottom: 1rem; color: #d8d1c6; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.inline-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(232, 184, 96, 0.4);
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--text); text-decoration-color: currentColor; }

.code-tag {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.85em;
  background: rgba(236, 230, 220, 0.06);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.08rem 0.4rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
a.code-tag:hover { border-color: var(--line-gold); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.7rem 1.5rem 0.6rem;
  border-radius: 2px;
  border: 1px solid var(--line-gold);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--gold); background: var(--gold-dim); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: var(--ink-950); }
.btn--primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--ink-950); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

.text-link {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.text-link::after { content: ' →'; }
.text-link:hover { color: var(--text); }

/* ── Site header ────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 10, 10, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem var(--gutter);
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 34px; height: auto; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}
.brand-name span { color: var(--text); }

.site-nav { display: flex; align-items: center; gap: 0.1rem; }

.nav-item { position: relative; }
.nav-link {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  white-space: nowrap;
}
.nav-link:hover, .nav-item:focus-within > .nav-link { color: var(--text); }
.nav-link[aria-current="page"], .nav-item.is-current > .nav-link { color: var(--text); }
.nav-item.has-sub > .nav-link::after { content: '▾'; font-size: 0.7em; margin-left: 0.35em; opacity: 0.7; }

.nav-sub {
  position: absolute; top: 100%; left: 0;
  min-width: 220px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  padding: 0.4rem 0;
  display: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.nav-item:hover > .nav-sub, .nav-item:focus-within > .nav-sub { display: block; }
.nav-sub a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
}
.nav-sub a:hover { background: var(--gold-dim); color: var(--text); }
.nav-sub a[aria-current="page"] { color: var(--text); }

.nav-cta { margin-left: 0.7rem; font-size: 1rem; padding: 0.5rem 1.1rem 0.42rem; }

.nav-toggle {
  display: none;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  border-radius: 2px;
  cursor: pointer;
}

/* ── Page header (inner pages) ──────────────────────────── */

.page-head {
  position: relative;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--ink-900);
  overflow: hidden;
}
.page-head--image { min-height: clamp(320px, 46vw, 480px); display: flex; align-items: flex-end; }
.page-head-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.page-head--image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 10, 0.2) 0%, rgba(12, 10, 10, 0.55) 55%, var(--ink-950) 100%);
}
.page-head .wrap { position: relative; z-index: 1; }
.page-head .lede { margin-top: 1rem; color: #d8d1c6; }

.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ── Tags ───────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  line-height: 1.4;
}

/* ── Tables ─────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-align: left;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--line-gold);
}
.data-table td { padding: 0.75rem 0.9rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { color: var(--text); font-weight: 500; }
.data-table .emoji { margin-right: 0.35rem; }

/* ── Leadership roster ──────────────────────────────────── */

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); border-top: 1px solid var(--line); }
.roster-item { padding: 1.3rem 1.2rem 1.3rem 0; border-bottom: 1px solid var(--line); }
.roster-role { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.roster-name { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: 0.02em; line-height: 1.1; margin: 0.25rem 0 0.15rem; }
.roster-note { font-size: 0.85rem; color: var(--muted); }
.roster-item--vacant .roster-name { color: var(--faint); }

/* ── Rank ladder ────────────────────────────────────────── */

.ladder { list-style: none; position: relative; margin: 0.5rem 0 1.5rem; }
.ladder::before {
  content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px;
  width: 1px; background: var(--line-gold);
}
.ladder li { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; align-items: start; padding: 0.55rem 0; position: relative; }
.rung-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative; z-index: 1;
}
.rung-mark img { width: 28px; height: 28px; object-fit: contain; }
.rung-mark--blank::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.rung-name { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.03em; line-height: 1.2; padding-top: 0.55rem; }
.rung-name small { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted); margin-left: 0.4rem; text-transform: none; }
.rung-desc { font-size: 0.92rem; color: #cfc7bb; }
.rung-req { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.rung-req strong { color: var(--text); font-weight: 600; }

.ladder-group { margin-top: 1.8rem; }
.ladder-group:first-child { margin-top: 0; }

/* ── Numbered steps ─────────────────────────────────────── */

.steps { list-style: none; counter-reset: step; display: grid; gap: 0; border-top: 1px solid var(--line); }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 2rem; line-height: 1;
  color: var(--muted);
}
.steps p { color: #d2cabe; }
.steps--row { grid-template-columns: repeat(var(--n, 3), 1fr); border-top: 0; gap: 2rem; }
.steps--row li { grid-template-columns: 1fr; border-bottom: 0; border-top: 2px solid var(--gold); padding-top: 1rem; }

/* ── Checklist ──────────────────────────────────────────── */

.checklist { list-style: none; display: grid; gap: 0.6rem; }
.checklist li { padding-left: 1.8rem; position: relative; color: #d8d1c6; }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: 0.4em;
  width: 0.95rem; height: 0.55rem;
  border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}

/* ── Feature list (what we do etc.) ─────────────────────── */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem 2.5rem; }
.feature { border-top: 1px solid var(--line-gold); padding-top: 1rem; }
.feature p { font-size: 0.95rem; color: #cfc7bb; }

/* ── Callouts ───────────────────────────────────────────── */

.callout {
  border-left: 3px solid var(--gold);
  background: rgba(232, 184, 96, 0.06);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.callout--red { border-left-color: #c2453b; background: rgba(194, 69, 59, 0.08); }
.callout .label { margin-bottom: 0.35rem; }
.callout--red .label { color: var(--muted); }

.quote {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}
.quote-by { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

/* ── CTA band ───────────────────────────────────────────── */

.cta-band { background: var(--ink-900); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band .h-section { margin-bottom: 0.3rem; }
.cta-band p { color: #cfc7bb; }

/* ── Org chart ──────────────────────────────────────────── */

/* Nested <ul> tree. Each <li> draws half of the bar above it, so the
   connectors line up whatever the number or width of the boxes. */
.org { overflow-x: auto; padding-bottom: 0.5rem; }
.org ul { display: flex; justify-content: center; position: relative; padding-top: 1.4rem; list-style: none; }
.org > ul { padding-top: 0; min-width: max-content; margin: 0 auto; }
.org li { position: relative; padding: 1.4rem 0.35rem 0; text-align: center; }
.org > ul > li { padding-top: 0; }
.org li::before, .org li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  width: 50%; height: 1.4rem;
  border-top: 1px solid var(--line-gold);
}
.org li::after { right: auto; left: 50%; border-left: 1px solid var(--line-gold); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 1px solid var(--line-gold); }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 1.4rem; border-left: 1px solid var(--line-gold); }
.org > ul > li > ul { padding-top: 1.4rem; }
.org-branch-gap { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

.org-node {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--ink-850);
  padding: 0.6rem 1rem 0.5rem;
  line-height: 1.1;
}
a.org-node:hover { border-color: var(--gold); color: var(--text); }
.org-node small { display: block; font-family: var(--font-body); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.2rem; }
.org-root { font-size: 1.5rem; border-color: var(--gold); color: var(--text); padding: 0.8rem 1.6rem 0.7rem; }

.org-det { font-size: 1.15rem; }
.org-det.armour { border-top: 2px solid var(--armour); }
.org-det.naval  { border-top: 2px solid var(--naval); }
.org-unit { font-size: 1.05rem; min-width: 92px; }
.org-unit.air { border-top: 2px solid var(--air); }


/* ── Company cards (home + divisions) ───────────────────── */

.unit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.unit-card {
  display: flex; flex-direction: column;
  background: var(--ink-850);
  border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.unit-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.unit-card-img { position: relative; overflow: hidden; }
.unit-card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: 0.75; transition: opacity 0.2s ease; }
.unit-card:hover .unit-card-img img { opacity: 0.95; }
.unit-card-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(24, 20, 20, 0.95)); }
.unit-code {
  position: absolute; left: 1rem; bottom: 0.6rem; z-index: 1;
  font-family: var(--font-display); font-size: 2.8rem; line-height: 1; color: var(--text);
}
.unit-code small { font-size: 0.55em; color: var(--muted); }
.unit-card-body { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.unit-card .tag { align-self: flex-start; }
.unit-name { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.1; margin: 0.6rem 0 0.3rem; }
.unit-card:hover .unit-name { color: var(--text); }
.unit-role { font-size: 0.9rem; color: #cfc7bb; }
.unit-facts { margin-top: auto; padding-top: 0.9rem; display: grid; gap: 0.35rem; font-size: 0.82rem; }
.unit-facts div { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; border-top: 1px solid var(--line); padding-top: 0.35rem; }
.unit-facts dt { color: var(--muted); }
.unit-facts dd { text-align: right; }

/* ── Emoji ──────────────────────────────────────────────── */

.emoji { height: 1.1em; width: 1.1em; vertical-align: -0.2em; display: inline-block; object-fit: contain; }

/* ── Tabs (recruiter handbook) ──────────────────────────── */

.tab-nav { display: flex; gap: 0.2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab-btn {
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 0.55rem 1rem; margin-bottom: -1px; cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Plain lists ────────────────────────────────────────── */

.plain-list { list-style: none; border-top: 1px solid var(--line); }
.plain-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--line); color: #d8d1c6; }
.plain-columns { columns: 3 240px; column-gap: 2.5rem; }
.plain-columns li { break-inside: avoid; }

/* ── Division pages ─────────────────────────────────────── */

.glance { border-top: 1px solid var(--line); }
.glance div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.glance dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.glance dd { color: var(--text); }

.quals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.8rem 2.2rem; margin-top: 1rem; }
.qual { border-top: 1px solid var(--line-gold); padding-top: 0.9rem; }
.qual-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.qual-head .h-sub { margin: 0; }
.pts { font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); white-space: nowrap; }
.qual p { font-size: 0.92rem; color: #cfc7bb; }
.qual p + p { margin-top: 0.4rem; }
.qual .hl { color: var(--muted); font-size: 0.86rem; }
.qual .hl b { color: var(--muted); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 0.3rem; }

.points-bar { display: flex; gap: 4px; margin: 1rem 0 0.4rem; max-width: 420px; }
.points-bar span { flex: 1; height: 10px; background: var(--ink-700); }
.points-bar span.on { background: var(--gold); }
.points-eg { font-size: 0.88rem; color: var(--muted); }

details.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.more summary {
  cursor: pointer; list-style: none;
  padding: 1rem 0;
  font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.03em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: '+'; color: var(--muted); font-size: 1.6rem; line-height: 1; }
details.more[open] summary::after { content: '−'; }
details.more > :not(summary) { margin-bottom: 1.2rem; }

.copy-box { position: relative; background: var(--ink-850); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.copy-box pre {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.88rem; line-height: 1.8; color: var(--text);
  padding: 1rem 1.2rem; white-space: pre-wrap; margin: 0;
}
.copy-btn {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--ink-700); color: var(--text); border: 1px solid var(--line-gold);
  padding: 0.3rem 0.6rem; border-radius: 2px; cursor: pointer;
}
.copy-btn:hover { background: var(--gold-dim); }

.note-box { border: 1px dashed var(--line-gold); padding: 1.2rem; color: var(--muted); font-size: 0.93rem; }

/* ── Site footer ────────────────────────────────────────── */

.site-footer { background: var(--ink-900); border-top: 1px solid var(--line); margin-top: auto; }
.footer-top {
  max-width: var(--wrap); margin: 0 auto;
  padding: 3.5rem var(--gutter) 2.5rem;
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem;
}
.footer-brand img { width: 56px; margin-bottom: 0.9rem; }
.footer-brand .brand-name { font-size: 1.5rem; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; max-width: 30ch; }
.footer-col h2 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-col a { color: #cfc7bb; text-decoration: none; font-size: 0.93rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--wrap); margin: 0 auto;
  padding: 1.2rem var(--gutter) 2rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: space-between;
  font-size: 0.8rem; color: var(--faint);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 960px) {
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-900);
    border-bottom: 1px solid var(--line-gold);
    padding: 0.5rem var(--gutter) 1rem;
    max-height: calc(100vh - 60px); overflow-y: auto;
    display: none;
  }
  .site-nav.open { display: flex; }
  .nav-link { padding: 0.7rem 0; font-size: 1.15rem; }
  .nav-item.has-sub > .nav-link::after { content: none; }
  .nav-sub { position: static; display: block; border: 0; box-shadow: none; background: none; padding: 0 0 0.4rem 0.9rem; min-width: 0; border-left: 1px solid var(--line); }
  .nav-sub a { padding: 0.4rem 0.6rem; color: var(--muted); }
  .nav-cta { margin: 0.8rem 0 0; justify-content: center; }
  .nav-toggle { display: grid; place-items: center; }

  .split, .split--wide-left { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .cols-2 { grid-template-columns: 1fr; }
  .steps--row { grid-template-columns: 1fr; }
  .org-unit { font-size: 0.9rem; min-width: 0; padding: 0.5rem 0.55rem 0.4rem; }
  .org-unit small { display: none; }
  .org-det { font-size: 0.95rem; }
  .org-branch-gap { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .data-table { font-size: 0.88rem; }
}

@media (max-width: 420px) {
  .footer-top { grid-template-columns: 1fr; }
  .brand-name { font-size: 1rem; }
}

/* Divisions page: cards stretch to fill the row. */
.unit-cards--wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.unit-cards--wide .unit-card-img img { aspect-ratio: 16 / 9; }
.unit-facts .tag { white-space: nowrap; }

/* ── Accents without coloured text ──────────────────────────
   Text stays off-white or grey. Gold and the detachment colours
   only appear as lines, borders and dots. */
.nav-link[aria-current="page"], .nav-item.is-current > .nav-link { box-shadow: inset 0 -2px 0 var(--gold); }
.nav-sub a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--gold); }
.text-link:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.inline-link:hover { text-decoration-color: var(--gold); }

.tag { color: var(--text); }
.tag--armour { border-color: var(--armour); }
.tag--naval  { border-color: var(--naval); }
.tag--gold   { border-color: var(--gold); }
.tag--red    { border-color: #c2453b; }

.kicker { color: var(--muted); display: inline-flex; align-items: center; gap: 0.45rem; }
.kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.kicker--armour::before { background: var(--armour); }
.kicker--naval::before  { background: var(--naval); }
.kicker--air::before    { background: var(--air); }
.kicker--gold::before   { background: var(--gold); }

.unit-more { margin-top: 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.unit-card:hover .unit-more { color: var(--text); }
.steps li { align-content: start; }

/* Spacing scale (replaces one-off inline styles) */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: 0.7rem; }
.mt-s { margin-top: 1.2rem; }
.mt-m { margin-top: 2rem; }
.mt-l { margin-top: 2.6rem; }
.mb-m { margin-bottom: 1.8rem; }
.mw-prose { max-width: 68ch; }
.steps--4 { --n: 4; }

/* Detachment command roster, HQ, terms */
.roster--compact { margin-bottom: 2rem; }
.roster--compact .roster-name { font-size: 1.35rem; }
.org-det.hq { border-top: 2px solid var(--gold); }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 2.5rem; border-top: 1px solid var(--line); }
.terms div { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.terms dt { font-weight: 600; margin-bottom: 0.2rem; }
.terms dd { color: #cfc7bb; font-size: 0.95rem; }
