/* ============================================================
   AIM — Design System v4 · Editorial Warmth
   ============================================================ */

/* === BD6.1 DESIGN TOKENS ====================================
   Foundation layer consumed by ALL BD6.x sub-tasks.
   Do not hard-code font-size or spacing values that conflict
   with this scale — extend the scale instead.

   Type scale (8 steps, fluid via clamp where useful):
     --text-xs     ~12px     captions, source citations, micro-labels
     --text-sm     ~14px     small body, nav, pill labels, card meta
     --text-base   ~16px     body paragraphs
     --text-md     ~18-20px  lede / subhead
     --text-lg     ~24-28px  H3 / card headings
     --text-xl     ~36-44px  H2 / section headings
     --text-2xl    ~56-72px  H1 / page hero
     --text-display clamp(72,9vw,110)  hero display — replaces
                                       legacy clamp(64,12vw,200)
   Leading: --leading-tight 1.05 (heads), --leading-snug 1.3,
            --leading-normal 1.5, --leading-relaxed 1.6 (body)
   Tracking: --tracking-tight -0.02em (heads),
             --tracking-normal 0 (body),
             --tracking-wide 0.18em (eyebrows / mono labels)

   Spacing scale (base unit 4px / 0.25rem):
     1=4  2=8  3=12  4=16  5=20  6=24  8=32 10=40 12=48
     16=64 20=80 24=96

   Color palette (kept; surgical contrast fix only):
     --ink     #1A1715  body — ~17:1 on --bg          AA AAA pass
     --ink-2   #5A5048  secondary body — ~7.6:1       AA pass
     --ink-3   #665A4B  TIGHTENED from #8A7F70 to hit
                        WCAG AA on readable text uses
                        (.shift__stat .src etc.) — now ~5:1
                        on both --bg and --bg-2.
                        Chosen path: darken --ink-3 in place
                        (vs. adding a new token) because
                        .shift__stat .src already references
                        --ink-3 and the eyebrow/mono labels
                        also benefit from the contrast bump.
     --ink-4   rgba(26,23,21,0.30)  KEPT as decorative-only:
                        agent-status dots, use__time arrows,
                        compare-list markers, form placeholders.
                        Do NOT use --ink-4 on readable text.
   ============================================================ */

/* Typeface — Inter (single family, 400/500/600/700/800).
   NOTE: each *.html head still ships a Google Fonts <link>
   for Bricolage Grotesque — that is the BD6.2 cleanup pass.
   The @import below makes Inter authoritative regardless. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Single typeface — Inter, 400/500/600/700/800 */
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale — fluid where the step is large enough to matter */
  --text-xs:      12px;
  --text-sm:      14px;
  --text-base:    16px;
  --text-md:      clamp(17px, 1.3vw, 19px);
  --text-lg:      clamp(20px, 1.8vw, 24px);
  --text-xl:      clamp(24px, 2.4vw, 32px);   /* card titles, sub-heads */
  --text-2xl:     clamp(30px, 4vw, 44px);     /* section headings (h2)   */
  --text-display: clamp(36px, 5.5vw, 60px);   /* hero only: 36px → 60px  */

  /* Line-heights */
  --leading-tight:   1.05;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.6;

  /* Letter-spacing */
  --tracking-tighter: -0.035em;
  --tracking-tight:   -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.18em;

  /* Spacing scale — 4px base */
  --space-1:  0.25rem;  /* 4px  */
  --space-2:  0.5rem;   /* 8px  */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Surfaces — warm cream/paper palette */
  --bg:        #EFE9DB;
  --bg-2:      #E6DFCD;
  --bg-3:      #DDD4BE;
  --panel:     #EAE3D3;
  --panel-2:   #E2DACA;

  /* Text — warm near-black, never pure black.
     --ink-3 darkened from #8A7F70 to #665A4B for WCAG AA on
     readable text (~5:1 on --bg). Decorative-only uses should
     reference --ink-4 (placeholders, dots, list markers). */
  --ink:       #1A1715;
  --ink-2:     #5A5048;
  --ink-3:     #665A4B;
  --ink-4:     rgba(26,23,21,0.30);
  --ink-5:     rgba(26,23,21,0.10);

  /* Lines */
  --line:      rgba(26,23,21,0.08);
  --line-2:    rgba(26,23,21,0.18);

  /* Accent — deep terracotta / burnt sienna */
  --accent:        #C44128;
  --accent-2:      #A8331D;
  --accent-ink:    #FBF6EC;
  --accent-soft:   rgba(196,65,40,0.07);
  --accent-line:   rgba(196,65,40,0.30);
  --accent-glow:   rgba(196,65,40,0.16);

  /* Spatial */
  --density: 1;
  --section-y: calc(120px * var(--density));
  --wrap-px:   clamp(24px, 5vw, 72px);
  --r-sm: 2px; --r-md: 4px; --r-lg: 8px; --r-xl: 14px; --r-2xl: 22px;

  /* Logo — enlarged for the stacked lockup (mark on top, wordmark
     below). Mark bumped to 50px so it stands out as the primary
     brand element; wordmark sits beneath at 19px with "AIM" tinted
     in the mark colour. */
  --logo-mark-size: 50px;
  --logo-wordmark-size: 19px;
  --logo-wordmark-weight: 700;
  --logo-wordmark-spacing: -0.02em;
  --logo-wordmark-color: var(--ink);
  --logo-wordmark-transform: none;
  --logo-sub-size: 10px;
  --logo-sub-display: block;
  --logo-mark-color: var(--accent);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "ss03";
}

/* Global horizontal-overflow safety net. `clip` (not `hidden`) so it does
   NOT create a scroll container — keeping the sticky header working.
   NB: body must NOT have overflow-x:hidden, or it becomes the scroll
   container and the sticky header scrolls away with it. */
html { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ─── Layout ─────────────────────────────────────── */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--wrap-px);
  padding-right: var(--wrap-px);
}
.section { padding: var(--section-y) 0; position: relative; }
.section--tight { padding: calc(var(--section-y) * 0.5) 0; }

/* Dot-grid background — subtle dark dots on cream */
.bg-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(26,23,21,0.13) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 80% at center, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at center, black 30%, transparent 100%);
}

/* ─── Typography ─────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}

/* Utility heading classes — kept on their existing fluid scales
   so BD6.1 does not visually re-size any component. BD6.3 / 6.5 /
   6.6 / 6.9 may migrate these to --text-* tokens after audit. */
.h-display {
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
}
.h-section {
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
  line-height: 1.04;
  font-weight: 600;
}
.h-card {
  font-size: var(--text-xl);
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-weight: 600;
}

/* Accent emphasis — no font-family switch, just accent colour + slight weight */
.italic, .serif, .spotlight-italic {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.025em;
}
em, i {
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
}

.lede {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--ink-2);
  max-width: 52ch;
  font-weight: 400;
  margin: 0;
}
.mono, .eyebrow, .label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
  cursor: pointer;
}
.btn .arr { transition: transform .22s; }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn--inverse {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--inverse:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--sm { padding: 10px 16px; font-size: 13px; }

/* ─── Tags / pills ───────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.tag .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}
.tag--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tag--dark   { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ─── Section divider ────────────────────────────── */
.divider {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 18px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line-2);
  gap: 16px;
  flex-wrap: wrap;
}
.divider span:first-child { color: var(--ink-2); font-weight: 600; }

/* ─── Header / nav ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(239,233,219,0.86);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line-2);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
/* Stacked brand lockup: enlarged mark on top, wordmark beneath.
   "AIM" is tinted with the mark colour (--accent) so the wordmark
   ties back to the logo. */
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.logo__mark {
  width: var(--logo-mark-size);
  height: var(--logo-mark-size);
  color: var(--logo-mark-color);
  flex-shrink: 0;
}
.logo__mark .lm-orbit { animation: orbit 8s linear infinite; transform-origin: 16px 16px; }
@keyframes orbit { to { transform: rotate(360deg); } }
.logo__stack { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1; text-align: center; }
.logo__word {
  font-family: var(--sans);
  font-size: var(--logo-wordmark-size);
  font-weight: var(--logo-wordmark-weight);
  letter-spacing: var(--logo-wordmark-spacing);
  color: var(--logo-wordmark-color);
  text-transform: var(--logo-wordmark-transform);
}
.logo__aim { color: var(--logo-mark-color); }
.logo__sub {
  font-family: var(--mono);
  font-size: var(--logo-sub-size);
  letter-spacing: 0.08em;
  color: var(--ink-3);
  display: var(--logo-sub-display);
  margin-top: 5px;
  margin-left: 15px;
  text-transform: uppercase;
}

/* Nav — horizontal rule style, no pills */
.nav { display: flex; align-items: stretch; gap: 0; }
.nav a {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-right: 1px solid var(--line-2);
  transition: color .18s, background .18s;
  position: relative;
  display: flex; align-items: center;
  letter-spacing: 0.01em;
}
.nav a:first-of-type { border-left: 1px solid var(--line-2); }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a.is-active { color: var(--ink); background: var(--panel); }
.nav a.is-active::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
}
.nav-cta {
  margin-left: 20px !important;
  padding: 10px 18px !important;
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border: 2px solid var(--accent) !important;
  border-radius: var(--r-sm) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  align-self: center;
}
.nav-cta:hover { background: var(--ink) !important; color: var(--bg) !important; border-color: var(--ink) !important; }
.nav-cta::after { display: none !important; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  color: var(--ink);
}
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav a:not(.nav-cta), .nav-cta { display: none; }
  .logo__sub { display: none !important; }
}

/* ─── Page hero (sub-pages) ──────────────────────── */
.page-hero {
  position: relative;
  padding: clamp(72px, 10vw, 160px) 0 clamp(56px, 7vw, 96px);
  border-bottom: 2px solid var(--line-2);
  overflow: hidden;
}
.page-hero .h-display { max-width: 16ch; }
.page-hero .lede { margin-top: 28px; }
.page-hero .eyebrow { margin-bottom: 24px; display: inline-flex; align-items: center; gap: 10px; }
.page-hero .eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--bg);
  color: var(--ink);
  padding: clamp(72px, 9vw, 128px) 0 32px;
  position: relative;
  border-top: 2px solid var(--line-2);
}
.site-footer .logo__mark { color: var(--accent); }
.footer-cta {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 72px;
  margin-bottom: 72px;
  border-bottom: 1px solid var(--line-2);
}
.footer-cta h2 {
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--ink);
  font-weight: 700;
}
.footer-cta h2 em { font-family: var(--sans); font-style: normal; font-weight: 500; color: var(--accent); letter-spacing: -0.025em; }
.footer-cta p { color: var(--ink-2); max-width: 36ch; margin-bottom: 28px; font-size: 16px; }
@media (max-width: 880px) { .footer-cta { grid-template-columns: 1fr; gap: 32px; padding-bottom: 48px; margin-bottom: 48px; } }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer-col h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 20px;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--ink-2); font-size: 14px; transition: color .18s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ─── Reveal animation ───────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .75s cubic-bezier(.16,1,.3,1), transform .75s cubic-bezier(.16,1,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ─── Cards ───────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 32px;
}
.card--bare { background: transparent; }

/* ─── Marquee ─────────────────────────────────────── */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 24px 0;
  background: var(--bg);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

/* ─── Utilities ───────────────────────────────────── */
.spotlight { color: var(--accent); font-weight: 500; }
.dim { color: var(--ink-3); }
.center { text-align: center; }
.flex-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.no-scroll { overflow: hidden; }
.full-w { width: 100%; }

/* ─── Mobile nav drawer ──────────────────────────── */
.mobile-drawer {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  padding: 24px var(--wrap-px);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer .head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 24px; border-bottom: 1px solid var(--line-2);
}
.mobile-drawer ul { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.mobile-drawer a {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.mobile-drawer .close {
  background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 18px;
}

/* ============================================================
   DARK-THEME COMPONENT OVERRIDES
   ============================================================ */

.numbers,
.values,
.example,
.side__card.dark {
  background: var(--bg-2) !important;
  color: var(--ink) !important;
  border-top: 1px solid var(--line-2) !important;
  border-bottom: 1px solid var(--line-2) !important;
}

.numbers__cell { border-color: var(--line-2) !important; }
.numbers__v, .numbers__head h2 { color: var(--ink) !important; }
.numbers__l { color: var(--ink-2) !important; }
.numbers .divider { color: var(--ink-3) !important; border-color: var(--line-2) !important; }
.numbers .divider span:first-child { color: var(--ink) !important; }
.numbers .lede { color: var(--ink-2) !important; }

.values .divider { color: var(--ink-3) !important; border-color: var(--line-2) !important; }
.values .divider span:first-child { color: var(--ink) !important; }
.values h2 { color: var(--ink) !important; }
.values__list { background: var(--line-2) !important; border-color: var(--line-2) !important; gap: 1px !important; }
.val { background: var(--bg-2) !important; border-radius: 0 !important; }
.val h4 { color: var(--ink) !important; }
.val p { color: var(--ink-2) !important; }

/* End-CTA — terracotta editorial treatment */
.end-cta {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-top: none !important;
  border-bottom: none !important;
}
.end-cta h2 { color: var(--accent-ink) !important; font-weight: 600 !important; }
.end-cta h2 em { color: var(--accent-ink) !important; opacity: 0.78; font-style: normal; font-weight: 500; }
.end-cta p { color: rgba(251,246,236,0.82) !important; }
.end-cta .btn {
  background: var(--accent-ink) !important;
  color: var(--accent) !important;
  border-color: var(--accent-ink) !important;
}
.end-cta .btn:hover {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--accent-ink) !important;
}

/* Worked example block */
.example { background: var(--panel) !important; border: 1px solid var(--line-2) !important; }
.example h3 { color: var(--ink) !important; }
.example__head { color: var(--ink-3) !important; }
.example__body { color: var(--ink-2) !important; }
.example__metrics { border-color: var(--line-2) !important; }
.example__metrics .v { color: var(--ink) !important; font-weight: 700 !important; }
.example__metrics .l { color: var(--ink-3) !important; }
.example__head .pill { border-radius: var(--r-sm) !important; }

/* Engagement model — Run stage gets terracotta highlight */
.eng:nth-child(3) {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-color: transparent !important;
}
.eng:nth-child(3) .eng__num { color: rgba(251,246,236,0.6) !important; }
.eng:nth-child(3) .eng__h { color: var(--accent-ink) !important; font-weight: 600 !important; }
.eng:nth-child(3) .eng__h em { color: var(--accent-ink) !important; opacity: 0.78; font-style: normal; font-weight: 500; }
.eng:nth-child(3) .eng__dur { color: rgba(251,246,236,0.7) !important; }
.eng:nth-child(3) .eng__body { color: rgba(251,246,236,0.78) !important; }

.side__card.dark { background: var(--panel-2) !important; color: var(--ink) !important; }
.side__card.dark h4 { color: var(--ink-3) !important; }
.side__card.dark p { color: var(--ink-2) !important; }

/* Footer */
.site-footer .logo__word { color: var(--ink); }
.site-footer .logo__sub { color: var(--ink-3); }
.site-footer .footer-col a { color: var(--ink-2); }
.site-footer .footer-col a:hover { color: var(--accent); }
.site-footer .footer-bottom { color: var(--ink-3); border-color: var(--line); }
.site-footer .footer-cta p { color: var(--ink-2); }
.site-footer .footer-cta { border-color: var(--line-2); }
.site-footer .footer-col h5 { color: var(--ink-3); }

/* Forms */
.form-row input, .form-row textarea, .form-row select {
  background: var(--bg-2) !important;
  border-color: var(--line-2) !important;
  color: var(--ink) !important;
  border-radius: var(--r-sm) !important;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--ink-4); }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--accent) !important;
  background: var(--panel) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
}
.form-option { background: var(--bg-2) !important; border-color: var(--line-2) !important; }
.form-option .box { border-color: var(--line-2) !important; }
.form-option:has(input:checked) { background: var(--accent-soft) !important; border-color: var(--accent) !important; }

/* Compare */
.compare__col { background: var(--bg-2) !important; border-color: var(--line-2) !important; border-radius: var(--r-lg) !important; }
.compare__col.is-aim { background: var(--panel) !important; border-color: var(--accent-line) !important; border-top: 2px solid var(--accent) !important; }
.compare__col li { color: var(--ink-2) !important; }
.compare__col li::before { color: var(--ink-4) !important; }
.compare__col.is-aim li { color: var(--ink) !important; }

/* FAQ */
.faq, .faq__item { border-color: var(--line-2) !important; }

/* Anatomy */
.anatomy { background: var(--panel) !important; border-color: var(--line-2) !important; }
.anatomy__node { background: var(--bg-2) !important; border-color: var(--line-2) !important; border-radius: var(--r-sm) !important; }
.anatomy__node h6 { color: var(--ink-3) !important; }
.anatomy__node .name { color: var(--ink) !important; }
.anatomy__node .sub { color: var(--ink-3) !important; }
.anatomy__node.is-core { background: var(--accent-soft) !important; border-color: var(--accent) !important; }
.anatomy__node.is-core .name { color: var(--accent) !important; }

/* Steps */
.step__body .deliv { background: var(--panel) !important; border-color: var(--line-2) !important; }
.step__body .deliv li { color: var(--ink) !important; }

/* Principles */
.principle { background: var(--bg) !important; border-color: var(--line-2) !important; }
.principle:hover { background: var(--panel) !important; }
.principle p { color: var(--ink-2) !important; }
.principles { border-color: var(--line-2) !important; }

/* Uses grid */
.use {
  background: transparent !important;
  border-color: var(--line-2) !important;
  transition: background .18s;
}
.use:hover { background: var(--bg-2) !important; }
.uses-grid { border-color: var(--line-2) !important; }

/* Facts */
.facts { border-color: var(--line-2) !important; }
.fact { background: var(--bg) !important; border-color: var(--line-2) !important; }
.fact .v { color: var(--ink) !important; }
.fact .l { color: var(--ink-3) !important; }

/* Service cards */
.svc { background: var(--panel) !important; border-color: var(--line-2) !important; border-radius: var(--r-lg) !important; border-top: 2px solid var(--accent) !important; }
.svc__detail { border-color: var(--line-2) !important; }
.svc__detail h4 { color: var(--ink-3) !important; }
.svc__detail li { color: var(--ink) !important; }
.stack__chip { background: var(--bg-2) !important; border-color: var(--line-2) !important; color: var(--ink-2) !important; border-radius: var(--r-sm) !important; }

/* Engagement cards */
.eng { background: var(--bg-2) !important; border-color: var(--line-2) !important; }

/* Capability cards */
.cap {
  background: var(--panel) !important;
  border-color: var(--line-2) !important;
  border-radius: var(--r-lg) !important;
  border-top: 2px solid var(--accent) !important;
}
.cap__viz { background: var(--bg) !important; border-color: var(--line-2) !important; border-radius: var(--r-md) !important; }

/* System view */
.system-view {
  background: var(--panel) !important;
  border-color: var(--line-2) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: 0 2px 0 rgba(255,255,255,0.04) inset, 0 40px 80px rgba(0,0,0,0.5) !important;
}
.system-view__hairlines {
  background-image: linear-gradient(to right, rgba(245,242,235,0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(245,242,235,0.04) 1px, transparent 1px) !important;
}
.system-view__log { background: var(--bg-2) !important; border-color: var(--line-2) !important; color: var(--ink-2) !important; }
.agent { background: var(--bg-2) !important; border-color: var(--line-2) !important; border-radius: var(--r-md) !important; }
.agent.is-active {
  background: var(--bg-3) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 16px 36px rgba(0,0,0,0.5) !important;
}
.agent__avatar { background: var(--bg-3) !important; border-radius: var(--r-sm) !important; }
.agent__name { color: var(--ink) !important; }
.agent__role { color: var(--ink-3) !important; }
.workspace {
  background: var(--bg-3) !important;
  border-color: var(--line-2) !important;
  border-radius: var(--r-md) !important;
  box-shadow: 0 2px 0 rgba(255,255,255,0.04) inset, 0 8px 28px rgba(0,0,0,0.4) !important;
}
.workspace__title { color: var(--ink) !important; }
.workspace__lines .line { background: var(--line-2) !important; }
.workspace__lines .line.done { background: var(--accent) !important; }
.agents-svg .ring { stroke: rgba(245,242,235,0.05) !important; }
.agents-svg .spoke { stroke: rgba(245,242,235,0.10) !important; }

/* Shift section */
.shift__stats { background: var(--line-2) !important; border-color: var(--line-2) !important; border-radius: var(--r-xl) !important; }
.shift__stat { background: var(--bg-2) !important; }
.shift__stat .v { color: var(--ink) !important; }
.shift__stat .l { color: var(--ink-2) !important; }
.shift__stat .src { color: var(--ink-3) !important; }
.shift__ticker { background: var(--accent) !important; color: var(--accent-ink) !important; border-radius: var(--r-sm) !important; }
.shift__ticker .live { color: var(--accent-ink) !important; }
.shift__ticker .live::before { background: var(--accent-ink) !important; }
.shift__ticker .msg { color: var(--accent-ink) !important; }
.shift__ticker .msg b { color: var(--accent-ink) !important; font-weight: 700; }
.shift__ticker .stamp { color: rgba(10,10,9,0.5) !important; }

/* Member cards */
.member { background: var(--bg) !important; }
.member:hover { background: var(--bg-2) !important; }
.member__bio { color: var(--ink-2) !important; }
.team-grid { background: var(--line-2) !important; border-color: var(--line-2) !important; border-radius: var(--r-xl) !important; overflow: hidden !important; }

/* Form card */
.form-card { background: var(--panel) !important; border-color: var(--line-2) !important; }
.confirm p { color: var(--ink-2) !important; }

/* Marquee */
.home-marquee { background: var(--accent) !important; border-color: var(--accent) !important; }
.home-marquee__track .item { color: var(--accent-ink) !important; font-weight: 700 !important; }
.home-marquee__track .item.italic { color: var(--accent-ink) !important; font-style: normal; }
.home-marquee__track .sep { background: rgba(0,0,0,0.25) !important; }

/* ============================================================
   === BD6.10 — interactions + a11y ===
   Restrained-corporate motion: subtle, fast, no bounce.
   - All timings and easing reference the tokens defined below.
   - Hover targets are the most-touched interactive elements only.
   - The end-block disables every transition added here when
     prefers-reduced-motion: reduce is set (overriding !important
     in DARK-THEME OVERRIDES via the universal `* !important` block).
   - The `.js .reveal { opacity: 0 }` rule on L507 is already
     gated against the no-JS state — verified, no patch needed.
   ============================================================ */

:root {
  /* Motion timing tokens — referenced by every BD6.10 transition */
  --motion-fast:  160ms;
  --motion-base:  240ms;
  --motion-slow:  600ms;
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Buttons: arrow translate + background shade shift --------- */
/* Note: .btn already has a transition declared (L268); we extend
   it with transform + a fractionally larger arrow nudge using
   the motion tokens. These rules cascade over the L268 declaration
   so the timings stay consistent across all .btn variants. */
.btn {
  transition: background-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn .arr { transition: transform var(--motion-fast) var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

/* --- Nav links: underline draw + ink-1 colour shift ------------ */
/* The existing .nav a hover (L398) sets color + background. We
   add an underline-draw using a pseudo so the affordance is more
   editorial. Skips .nav-cta (which is a button, styled separately). */
.nav a:not(.nav-cta) {
  transition: color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}
.nav a:not(.nav-cta)::before {
  content: "";
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-2);
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--motion-base) var(--ease-out);
  pointer-events: none;
}
.nav a:not(.nav-cta):hover::before { transform: scaleX(1); }
.nav a.is-active::before { transform: scaleX(0); } /* active uses ::after bar */

/* --- Work / project teaser cards (BD6.3 will author the base) --- */
.work,
.work--teaser {
  transition: transform var(--motion-base) var(--ease-out),
              border-color var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
.work:hover,
.work--teaser:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 var(--space-4) var(--space-8) rgba(26,23,21,0.08);
}

/* --- Capability cards: same family as .work -------------------- */
.cap__card {
  transition: transform var(--motion-base) var(--ease-out),
              border-color var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
.cap__card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 var(--space-4) var(--space-8) rgba(26,23,21,0.08);
}

/* --- Team member cards: border-color shift only, no lift ------- */
/* .member already has a background hover on L788. We add a border
   accent only — cards are short/dense post-BD6.9, lift would feel
   twitchy. */
.member {
  transition: background-color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out);
}
.member:hover { border-color: var(--ink-2) !important; }

/* --- Subsidiary tile (BD6.4 owns base): defensive non-override - */
/* If BD6.4 already declared a .subsidiary:hover we don't override
   it — we only add a transition timing baseline if none exists. */
.subsidiary {
  transition: transform var(--motion-base) var(--ease-out),
              border-color var(--motion-base) var(--ease-out);
}

/* --- Parallax opt-in helpers ----------------------------------- */
/* The JS half lives in main.js. These are tiny CSS guards so an
   author-added .parallax-* class doesn't introduce layout jank. */
.parallax-slow,
.parallax-medium {
  will-change: transform;
  /* Prevent parallax elements from triggering horizontal scroll */
  backface-visibility: hidden;
}
@media (max-width: 767.98px) {
  /* Below 768px we kill the inline transform applied by JS. JS
     also short-circuits — this is defence-in-depth in case the
     viewport resizes after load. */
  .parallax-slow,
  .parallax-medium { transform: none !important; }
}

/* --- Stagger-reveal hook (JS adds .is-visible per child) ------- */
.js .reveal--stagger > * {
  opacity: 0;
  transform: translateY(var(--space-2));
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
}
.reveal--stagger > .is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   prefers-reduced-motion — kills every transition added above.
   MUST stay at the END of the BD6.10 section.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn .arr,
  .nav a:not(.nav-cta),
  .nav a:not(.nav-cta)::before,
  .work,
  .work--teaser,
  .cap__card,
  .member,
  .subsidiary,
  .parallax-slow,
  .parallax-medium,
  .js .reveal--stagger > * {
    transition: none !important;
    transform: none !important;
  }
  .btn:hover,
  .btn:hover .arr,
  .work:hover,
  .work--teaser:hover,
  .cap__card:hover {
    transform: none !important;
  }
}
/* === end BD6.10 === */

/* ============================================================
   === BD6.11 — mobile pass ====================================
   Mobile responsiveness pass across all five pages.
   Mandated breakpoints: 320 / 375 / 414 / 768 / 1024+.
   This section is append-only; it overrides earlier rules via
   source-order specificity (and !important where DARK-THEME
   OVERRIDES on L573+ would otherwise win).

   Scope:
     A. Restructure index.html `.system-view` below 768px —
        the absolutely-positioned pentagon overflows narrow
        viewports. Cards stack, SVG hides, height auto.
     B. Touch-target audit — all clickable elements get a
        44x44 min hit area on mobile (WCAG 2.5.5 / Apple HIG).
     C. Type-scale floor — sub-12px text bumped to --text-xs
        below 480px so nothing falls under the BD6.1 floor.
     D. Section padding — fluid `clamp()` overrides for the
        top hard-coded section-level paddings.
     E. Mobile drawer scroll-lock via `:has()`.
     F. Per-page targeted fixes for the worst layout breaks.

   Do NOT inline-style any element to bypass these rules.
   Do NOT modify rules in earlier sections.
   ============================================================ */

/* ── D. Section spacing — fluid baseline ────────────────────
   `--section-y` was hard 120px (L127). Re-declare with a
   clamp so narrow viewports breathe without padding-cliff.
   Lower bound 48px (320px viewport), upper 120px (desktop). */
:root {
  --section-y: clamp(48px, 9vw, 120px);
}

/* ── A. Home — `.system-view` restructure under 768px ──────
   Below 768px the pentagon layout is unusable: absolutely
   positioned cards using percentage top/left overflow the
   480px-ish container width. Strategy:
     - Drop fixed clamp(440px, 54vw, 580px) height; let
       content drive height.
     - Static positioning + single-column grid for agents.
     - Workspace becomes the first item, agents stack below.
     - Hide the decorative pentagon SVG and the .system-view
       __hairlines background entirely.
   Specificity: !important is used because earlier rules
   (index.html inline <style>, lines 91–319) set
   position: absolute on .agent and .workspace. */
@media (max-width: 767.98px) {
  .system-view {
    height: auto !important;
    min-height: 0 !important;
    padding: clamp(56px, 14vw, 72px) var(--space-4) var(--space-16) !important;
    overflow: visible !important;
  }
  .system-view__hairlines,
  .agents-svg {
    display: none !important;
  }
  .system-view__chrome {
    position: static !important;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-xs) !important;
  }
  .workspace {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 320px;
    margin: 0 auto var(--space-6);
  }
  .system-view {
    display: flex;
    flex-direction: column;
  }
  /* Stack all five agent cards in a 1-column grid below
     the workspace. Override absolute positioning + the
     translate(-50%,-50%) baked into the desktop rule. */
  .system-view .agent {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 320px;
    margin: 0 auto var(--space-3) !important;
    padding: var(--space-3) var(--space-4) !important;
    grid-template-columns: 32px 1fr !important;
    gap: var(--space-3) !important;
  }
  .system-view .agent:last-of-type { margin-bottom: 0 !important; }
  .system-view .agent.is-active {
    transform: none !important;
  }
  .system-view .agent__avatar { width: 32px !important; height: 32px !important; }
  .system-view .agent__avatar svg { width: 16px !important; height: 16px !important; }
  /* Bump type back to the floor — desktop set 9–11px which
     fails the readability bar on a phone. */
  .system-view .agent__name { font-size: var(--text-xs) !important; }
  .system-view .agent__role { font-size: var(--text-xs) !important; }
  .system-view .agent__status { font-size: var(--text-xs) !important; }
  .system-view .workspace__head,
  .system-view .workspace__foot { font-size: var(--text-xs) !important; }
  .system-view .workspace__title { font-size: var(--text-sm) !important; }

  /* Log bar — was absolute bottom; let it flow at the end. */
  .system-view__log {
    position: static !important;
    margin-top: var(--space-4);
    font-size: var(--text-xs) !important;
    height: auto !important;
    min-height: 36px;
  }
}

/* Under 480px tighten further — single-column stays, but
   ensure long words/titles wrap rather than overflow. */
@media (max-width: 480px) {
  .system-view .agent,
  .system-view .workspace { max-width: 100% !important; }
  .system-view .agent__name,
  .system-view .agent__role,
  .system-view .workspace__title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .system-view__chrome > span { min-width: 0; word-break: break-word; }
}

/* ── B. Touch-target audit ─────────────────────────────────
   WCAG 2.5.5 (AAA) + Apple HIG = 44x44 css px minimum hit
   area for any interactive element on touch viewports.
   Approach: apply only at touch-likely widths (<=1023.98px)
   so desktop layouts are untouched. Use min-* dimensions +
   inline-flex + padding so visual layout doesn't shift —
   the extra hit area becomes invisible padding. */
@media (max-width: 1023.98px) {
  /* Primary buttons already meet 44px (padding 14 + ~14 + 14)
     but enforce a min-height floor explicitly. */
  .btn {
    min-height: 44px;
  }
  .btn--sm { min-height: 44px; }

  /* Header nav-toggle was 38x38 — bump to 44x44. Visual
     border-box stays compact via padding inside. */
  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  /* Footer column links — were 14px text with no padding;
     hit area was ~20px tall. Wrap each in an inline-flex
     with min-height: 44px, preserving the dense list
     visually because the ul gap already provides air. */
  .footer-col a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2) 0;
  }
  .footer-col ul { gap: 0; }

  /* Footer bottom row (privacy/imprint links if present). */
  .footer-bottom a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2) 0;
  }

  /* Subsidiary tiles — full clickable cards; ensure even
     the placeholder tiles have a generous floor. */
  .subsidiary {
    min-height: 132px;
  }

  /* Work / work--teaser cards — already large blocks but
     ensure cap__card / svc / fact / cap have a min hit
     area when they're clickable. (Defensive — these are
     not always anchors.) */
  a.cap, a.svc, a.work, a.work--teaser {
    min-height: 44px;
  }

  /* Member cards — bio takes them above 44px, but the
     compact post-BD6.9 form means we set a floor. */
  a.member { min-height: 44px; }

  /* Demo Run pipeline + Reset buttons — they're <button>
     elements styled via .demo-rfp__btn. Ensure hit area. */
  .demo-rfp__btn {
    min-height: 44px;
  }

  /* "See all built work" text link in works__more. */
  .works__more a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
  }

  /* Form options on contact.html — labels around radios. */
  .form-option {
    min-height: 44px;
  }

  /* Form inputs — already 12px padding + 1.4 line-height
     gets close. Enforce 44px min-height across the board. */
  .form-row input,
  .form-row select {
    min-height: 44px;
  }
}

/* Drawer-specific tap targets — the drawer is only visible
   at mobile widths anyway, so no media query needed. */
.mobile-drawer .close {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
}
.mobile-drawer a {
  display: inline-flex;
  align-items: center;
  min-height: 56px; /* generous per spec */
  padding: var(--space-3) 0;
}

/* ── E. Drawer scroll-lock via :has() ──────────────────────
   main.js (BD6.10 owned, not in scope) only toggles
   .is-open on the .mobile-drawer node; it doesn't add a
   body class. Use the :has() pseudo to lock the underlying
   page scroll while the drawer is open. Modern browsers
   (Chrome 105+, Safari 15.4+, Firefox 121+) all support
   this — graceful degradation is acceptable for the few
   stragglers (drawer still works, just scrolls behind). */
body:has(.mobile-drawer.is-open) {
  overflow: hidden;
}

/* ── C. Type-scale floor — bump sub-12px under 480px ───────
   The BD6.1 floor is --text-xs (12px). On a 320–414px
   viewport, the eyebrow/meta type baked into the home page
   inline <style> drops to 9–11px which falls below WCAG
   readability and the BD6.1 contract. Override the worst
   offenders on small viewports — they remain compact on
   desktop where the surrounding density justifies them. */
@media (max-width: 480px) {
  /* Home — work card meta */
  .work__num,
  .work__industry,
  .work__metrics .m .l,
  .work__status {
    font-size: var(--text-xs) !important;
  }
  /* Home — shift section eyebrow + source citations */
  .shift__stat .n,
  .shift__stat .src,
  .shift__ticker .live,
  .shift__ticker .stamp {
    font-size: var(--text-xs) !important;
  }
  /* Home — use__num / use__time */
  .use__num,
  .use__time {
    font-size: var(--text-xs) !important;
  }
  /* Tag / divider — bump from 10px to 12px floor */
  .tag,
  .divider,
  .footer-col h5,
  .footer-bottom,
  .logo__sub {
    font-size: var(--text-xs) !important;
  }
  /* Contact — form labels + meta */
  .form-row .lbl,
  .form-submit .meta {
    font-size: var(--text-xs) !important;
  }
}

/* ── F. Per-page layout fixes ──────────────────────────────
   Targeted overrides for the worst remaining mobile defects
   found in the wave-5 state of each page. */

/* index.html — Home */
@media (max-width: 767.98px) {
  /* Hero grid was 2-col on the screenshot ref; force 1-col
     so the .system-view doesn't get squeezed. (Most likely
     already handled by BD6.6 but defensive.) */
  .home-hero__grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-8) !important;
  }
  /* CTA row — wrap and full-width so buttons don't overflow. */
  .home-hero__ctas {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  .home-hero__ctas .btn { width: 100%; justify-content: center; }
  /* Footer-cta H2 was clamp(48,7vw,112) — lower bound is
     fine but the heading sits on max-width: 100% which on
     320px can still overshoot if the word "automation"
     hyphenates. Force balance + safe wrap. */
  .footer-cta h2 {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 480px) {
  /* Work-teaser metrics — 3-col grid forced by inline
     <style> on L1728. Stack at 480px so the values stay
     legible. */
  .works--teaser .work__metrics {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
  }
  /* Shift ticker — flex-wrap already set; reduce padding. */
  .shift__ticker { padding: var(--space-4) !important; }
}

/* how-it-works.html */
@media (max-width: 767.98px) {
  /* Subsidiary grid uses auto-fit minmax(180px,1fr); on
     a 320px viewport that's still 1 col. Just ensure tiles
     have breathing room and tap-target floor. */
  .subsidiaries__grid {
    gap: var(--space-3) !important;
  }
  /* Step rows — were 80px / 1.2fr / 1.8fr; stacks to 1fr
     below 880px (L111 of the file). Ensure the step number
     glyph doesn't dominate. */
  .step { padding-block: var(--space-8) !important; }
  /* Anatomy row stacks below 900px — verify centre column
     doesn't keep min-width. */
  .anatomy__row > * { min-width: 0; }
}

/* services.html */
@media (max-width: 767.98px) {
  /* Engagement cards — 3-col, stacks at 880px. Ensure
     padding doesn't dominate the column at 320px. */
  .eng {
    padding: var(--space-6) !important;
  }
  /* Compare cols — stacks to 1fr below 760px (already
     handled). Ensure list bullets don't break to 2 lines. */
  .compare__col li { overflow-wrap: anywhere; }
}

/* team.html */
@media (max-width: 767.98px) {
  /* Team grid stacks to 1fr below 760px already; ensure
     the inner padding stays modest at 320px. */
  .member {
    padding: var(--space-6) !important;
  }
  /* Values strip on the team page — its h2 uses
     --text-xl which is fine; just ensure max-width
     doesn't push the content off-screen. */
  .values h2 { max-width: 100%; overflow-wrap: anywhere; }
  /* Facts strip on team page stacks 4→2 already at 760px
     and stays 1fr 1fr below. Reduce padding for 320px. */
  .fact { padding: var(--space-6) !important; }
}

/* contact.html */
@media (max-width: 767.98px) {
  /* contact-grid stacks at 980px already. Ensure sticky
     side panel doesn't fight the form. */
  .side {
    position: static !important;
    top: auto !important;
  }
  /* Form-submit row — flex-wrap is set; ensure the submit
     button is full-width on narrow screens. */
  .form-submit { gap: var(--space-4) !important; }
  .form-submit .btn { width: 100%; justify-content: center; }
  /* Confirmation block — ensure padding stays generous. */
  .form-card { padding: var(--space-6) !important; }
}
@media (max-width: 480px) {
  /* Form-row input padding tightens but keep 44px min from
     section B. */
  .form-row input,
  .form-row select,
  .form-row textarea {
    padding: var(--space-3) var(--space-3) !important;
  }
}

/* ── Global safety net — no horizontal overflow ────────────
   Defence-in-depth: in case any unknown descendant ships
   a fixed-width inline child that's wider than the viewport,
   prevent it from forcing the page wide. body already has
   overflow-x: hidden (L162) — this keeps the section-level
   boxes clean too. */
@media (max-width: 767.98px) {
  .wrap { max-width: 100%; }
  img, svg, video, iframe { max-width: 100%; height: auto; }
}

/* ── prefers-reduced-motion respect ────────────────────────
   No new motion was added in BD6.11. Nothing to disable. */
/* === end BD6.11 === */
