/* K-2 — Blueprint / Technical Drawing aesthetic */
:root {
  --ink: #0d0d0d;
  --ink-soft: #2a2a2a;
  --paper: #f5f3ec; /* warm drafting-paper off-white */
  --paper-pure: #ffffff;
  --line: #0d0d0d;
  --line-soft: rgba(13, 13, 13, 0.2);
  --line-faint: rgba(13, 13, 13, 0.08);
  --signal: #1e5a96; /* brand blue */
  --signal-ink: #16456f;
  --blueprint: #0a2040;
  --grid-line: rgba(13, 13, 13, 0.06);

  --font-display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;

  --pad-x: clamp(24px, 4vw, 64px);
  --density: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body {
  overflow-x: hidden;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* Type */
.mono { font-family: var(--font-mono); }
.mono-xs { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.mono-sm { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; font-weight: 500; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; }

.h-display {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 144px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-transform: uppercase;
}
.h-1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-transform: uppercase;
}
.h-2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-transform: uppercase;
}
.h-3 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 700;
  text-transform: uppercase;
}
.lede {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.005em;
  font-weight: 400;
  font-style: italic;
}
.body { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.body-lg { font-size: 17px; line-height: 1.55; color: var(--ink-soft); }

/* Layout containers */
.container {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.section { padding: calc(96px * var(--density)) 0; }

/* Title block — like a drawing title block */
.titleblock {
  border: 1.5px solid var(--line);
  background: var(--paper-pure);
  display: grid;
}
.titleblock-row {
  display: grid;
  border-bottom: 1px solid var(--line);
}
.titleblock-row:last-child { border-bottom: none; }
.titleblock-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 54px;
  justify-content: center;
}
.titleblock-cell:last-child { border-right: none; }
.titleblock-key {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
}
.titleblock-val {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  min-height: 96px;
}
.nav-logo {
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x);
  border-right: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}
.nav-logo-img {
  height: 88px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  list-style: none;
  align-items: stretch;
}
.nav-links li {
  border-right: 1px solid var(--line-faint);
  display: flex;
}
.nav-links li:first-child { border-left: none; }
.nav-links a {
  padding: 0 28px;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-links a:hover { background: var(--ink); color: var(--paper); }
.nav-links a.active { background: var(--signal); color: var(--ink); }
.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border-left: 1.5px solid var(--line);
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--ink); color: var(--signal); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1.5px solid var(--line);
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--signal);
  color: var(--ink);
}
.btn-primary:hover { background: var(--ink); color: var(--signal); }
.btn-secondary { background: var(--paper); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--signal); color: var(--ink); border-color: var(--ink); }

/* Dimension callout — like blueprint dimension lines */
.dim {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-ink);
}
.dim::before, .dim::after {
  content: '';
  width: 16px;
  height: 1px;
  background: currentColor;
}

/* Placeholder image — blueprint style */
.bp {
  position: relative;
  background: var(--blueprint);
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  border: 1.5px solid var(--line);
  font-family: var(--font-mono);
}
.bp::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}
.bp-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: var(--signal);
  color: var(--ink);
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.bp-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  text-align: center;
  padding: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bp-corners::before, .bp-corners::after,
.bp-corners > span::before, .bp-corners > span::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  z-index: 3;
}
.bp-corners::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.bp-corners::after { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.bp-corners > span::before { bottom: 8px; left: 8px; border-right: none; border-top: none; position: absolute; }
.bp-corners > span::after { bottom: 8px; right: 8px; border-left: none; border-top: none; position: absolute; }

/* Light paper placeholder */
.ph {
  position: relative;
  background: var(--paper-pure);
  color: var(--ink);
  border: 1.5px solid var(--line);
  overflow: hidden;
  font-family: var(--font-mono);
}
.ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg, transparent 0 14px, rgba(13, 13, 13, 0.06) 14px 15px
  );
}
.ph-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ph-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  text-align: center;
  padding: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Revision stamp */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1.5px solid var(--signal);
  color: var(--signal-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  transform: rotate(-2deg);
  background: var(--paper);
}

/* Footer */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 0 0;
  border-top: 1.5px solid var(--line);
}
.footer .grid-bg { background: var(--ink); }

/* Form */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.field input, .field textarea, .field select {
  padding: 14px 16px;
  background: var(--paper-pure);
  border: 1.5px solid var(--line);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--font-sans);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  background: var(--signal);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-error { color: var(--signal-ink); font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.tag-signal { background: var(--signal); border-color: var(--ink); }

/* Marching ticker */
@keyframes march { to { transform: translateX(-50%); } }

/* Phone/tablet menu button (hidden on desktop) */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-left: 1.5px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.nav-toggle:focus-visible { outline: 2px solid var(--signal); outline-offset: -4px; }

@media (max-width: 900px) {
  .nav-inner { grid-template-columns: auto 1fr auto auto; min-height: 72px; }
  .nav-logo-img { width: 110px !important; height: 72px !important; }
  .nav-toggle { display: flex; grid-column: 3; justify-content: center; }
  .nav-cta { grid-column: 4; }
  .nav-links { display: none; }
  .nav-links.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-top: 1.5px solid var(--line);
    border-bottom: 1.5px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }
  .nav-links.is-open li { border-right: none; border-bottom: 1px solid var(--line-faint); }
  .nav-links.is-open a { padding: 18px var(--pad-x); width: 100%; }
}
@media (max-width: 560px) {
  .nav-cta { display: none; }
  .nav-toggle { grid-column: 4; }
}

/* ============ ASK K-2 ASSISTANT ============ */
.k2bot-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--signal);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.k2bot-launch:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--signal); }
.k2bot-launch:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--signal); }
.k2bot-launch:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.k2bot-dot {
  width: 7px; height: 7px; background: var(--signal); border-radius: 50%;
  animation: k2pulse 2.4s ease-in-out infinite;
}
@keyframes k2pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.k2bot-panel {
  position: fixed; right: 20px; bottom: 74px; z-index: 901;
  width: min(400px, calc(100vw - 40px));
  max-height: min(620px, calc(100vh - 120px));
  display: none; flex-direction: column;
  background: var(--paper-pure);
  border: 1.5px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.12);
}
.k2bot-panel.is-open { display: flex; }

.k2bot-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 18px; background: var(--ink); color: var(--paper);
}
.k2bot-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 800;
  letter-spacing: 0.02em; line-height: 1;
}
.k2bot-sub {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--signal); margin-top: 6px;
}
.k2bot-x {
  background: none; border: none; color: var(--paper);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.k2bot-x:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.k2bot-log {
  flex: 1 1 auto; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.k2bot-msg { display: flex; flex-direction: column; gap: 5px; }
.k2bot-you { align-items: flex-end; }
.k2bot-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--signal-ink);
}
.k2bot-bubble {
  max-width: 92%; padding: 12px 14px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: 13.5px; line-height: 1.55;
}
.k2bot-you .k2bot-bubble {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.k2bot-bubble p { margin: 0; }
.k2bot-bubble p + p { margin-top: 8px; }
.k2bot-also {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-soft); border-top: 1px solid var(--line-faint);
  padding-top: 8px;
}

.k2bot-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 14px; border-top: 1.5px solid var(--line);
  background: var(--paper);
}
.k2bot-chip {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em;
  padding: 6px 9px; border: 1px solid var(--line); background: var(--paper-pure);
  color: var(--ink-soft); cursor: pointer; text-align: left;
}
.k2bot-chip:hover { border-color: var(--signal); color: var(--signal-ink); }
.k2bot-chip:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }

.k2bot-form { display: flex; border-top: 1.5px solid var(--line); }
.k2bot-input {
  flex: 1 1 auto; min-width: 0; padding: 13px 14px;
  border: none; background: var(--paper-pure); color: var(--ink);
  font-family: var(--font-sans); font-size: 13.5px;
}
.k2bot-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--signal); }
.k2bot-send {
  flex: 0 0 auto; padding: 0 18px;
  background: var(--signal); color: var(--paper);
  border: none; cursor: pointer; font-size: 16px;
}
.k2bot-send:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }

.k2bot-foot {
  padding: 10px 14px; border-top: 1px solid var(--line-faint);
  background: var(--paper);
  font-family: var(--font-mono); font-size: 9px; line-height: 1.5;
  letter-spacing: 0.04em; color: var(--ink-soft);
}

@media (max-width: 560px) {
  .k2bot-panel { right: 10px; left: 10px; width: auto; bottom: 68px; }
  .k2bot-launch { right: 10px; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .k2bot-dot { animation: none; }
  .k2bot-launch { transition: none; }
}

/* ============ LEADERSHIP GRID ============ */
.bp-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border: 1.5px solid var(--line);
  border-right: none;
  background: var(--paper-pure);
}
.bp-team-card {
  display: flex; flex-direction: column;
  border-right: 1.5px solid var(--line);
  min-width: 0;
}
.bp-team-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.bp-team-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.bp-team-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 16px 16px;
}
.bp-team-fallback .mono-xs { color: var(--signal); font-size: 9px; }
.bp-team-initials {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--paper);
}
.bp-team-idx {
  position: absolute; top: 0; left: 0;
  padding: 5px 8px;
  background: var(--ink); color: var(--signal);
  font-size: 9px; letter-spacing: 0.12em;
}
.bp-team-body {
  padding: 18px 18px 22px;
  display: flex; flex-direction: column; gap: 7px;
  flex: 1 1 auto;
}
.bp-team-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  line-height: 1.15; margin: 0;
}
.bp-team-role {
  color: var(--signal-ink);
  font-size: 9.5px; letter-spacing: 0.11em;
  text-transform: uppercase;
}
.bp-team-blurb {
  font-size: 13px; line-height: 1.55; color: var(--ink-soft);
  margin: 0; margin-top: 3px;
}
@media (max-width: 700px) {
  .bp-team-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .bp-team-body { padding: 14px 14px 18px; }
}

/* photo filling a blueprint figure frame */
.bp-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; z-index: 1;
  /* unified figure grade: mixed stock/white-bg sources read as one set */
  filter: grayscale(0.35) contrast(1.06) brightness(0.96) saturate(0.9);
  background: var(--ink);
}
.bp-corners .bp-img::after { content: none; }
.bp .bp-img + .bp-label { z-index: 3; }
.bp:has(.bp-img)::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,22,40,0.08) 0%, rgba(10,22,40,0) 40%, rgba(10,22,40,0.22) 100%);
  mix-blend-mode: multiply;
}

/* ============ LOOPING VIDEO PANEL ============ */
.bp-video {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  min-width: 0;
}
.bp-video-sizer { width: 100%; }
.bp-video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; z-index: 1;
  /* unified figure grade: mixed stock/white-bg sources read as one set */
  filter: grayscale(0.35) contrast(1.06) brightness(0.96) saturate(0.9);
  background: var(--ink);
}
.bp-corners .bp-img::after { content: none; }
.bp .bp-img + .bp-label { z-index: 3; }
.bp:has(.bp-img)::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,22,40,0.08) 0%, rgba(10,22,40,0) 40%, rgba(10,22,40,0.22) 100%);
  mix-blend-mode: multiply;
}

/* capabilities page rows */
.cap-row { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "num body specs" "num fig fig"; }
.cap-num { grid-area: num; } .cap-body { grid-area: body; } .cap-specs { grid-area: specs; }
.cap-row .bp { grid-area: fig; }
@media (min-width: 1100px) {
  .cap-row { grid-template-columns: 64px minmax(240px, 1.1fr) minmax(220px, 0.9fr) minmax(200px, 300px); grid-template-areas: "num body specs fig"; }
}
@media (max-width: 700px) {
  .cap-row { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "num body" "num specs" "num fig"; }
}

.bp-video video { inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); }

/* contact page facility map */
.contact-map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: stretch; }
.bp-map { min-width: 0; height: 420px; }
.bp-map iframe {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; border: 0; display: block;
  filter: grayscale(1) contrast(1.05);
}
/* top-right, clear of Google's address card in the top-left */
.bp-map .bp-label { z-index: 3; left: auto; right: 10px; }
.contact-map-info { display: flex; flex-direction: column; gap: 16px; }
.contact-map-info .titleblock { flex: 1 1 auto; }
.contact-map-info .btn { justify-content: space-between; }
@media (max-width: 960px) {
  .contact-map-grid { grid-template-columns: minmax(0, 1fr); }
  .bp-map { height: 340px; }
}

/* ============ PHONE & TABLET LAYOUT ============
   Page grids set their desktop columns inline (style={{gridTemplateColumns}}),
   so these overrides need !important to win on smaller screens.
   rg-head      section header: label column + heading
   rg-split     two-column content split
   rg-cols      3–5 card grid
   rg-stats     4 stat tiles / option buttons (stay 2-up on phones)
   rg-pair      2x2 tile grid (stacks on phones)
   rg-stack-sm  two columns that only stack on phones
   rg-footer    footer link columns */
@media (max-width: 900px) {
  .rg-head, .rg-split { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .rg-cols, .rg-stats, .rg-footer { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .rg-footer { gap: 32px !important; }
  .rg-footer > :first-child { grid-column: 1 / -1; }
  .rg-split > * { min-width: 0; }
  /* a pinned side column would ride over the stacked content below it */
  .rg-split > [style*="sticky"] { position: static !important; }

  /* card/tile dividers: drawn by each tile, so re-balance them for 2 columns */
  .rg-cols > *, .rg-stats > * { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; }
  .rg-cols > :nth-child(2n), .rg-stats > :nth-child(2n) { border-right: none !important; }
  .rg-cols > *, .rg-stats > * { min-height: 0 !important; }
  .rg-stats > * { min-height: 180px !important; }

  /* home: process timeline rail only makes sense in one row */
  .process-rail { display: none; }
  .rg-cols > * { padding-bottom: 24px !important; }

  /* home: capability list rows */
  .cap-line {
    grid-template-columns: 64px minmax(0, 1fr) 24px !important;
    grid-template-areas: "num title arrow" "num desc arrow" "num spec arrow";
    gap: 6px 16px !important;
    padding: 22px 20px !important;
  }
  .cap-line > :nth-child(1) { grid-area: num; align-self: start; }
  .cap-line > :nth-child(2) { grid-area: title; }
  .cap-line > :nth-child(3) { grid-area: desc; }
  .cap-line > :nth-child(4) { grid-area: spec; }
  .cap-line > :nth-child(5) { grid-area: arrow; }
}
@media (max-width: 560px) {
  .rg-cols, .rg-pair, .rg-stack-sm, .rg-footer { grid-template-columns: minmax(0, 1fr) !important; }
  .rg-stack-sm { gap: 16px !important; }
  .rg-cols > * { border-right: none !important; }
  .cap-line { grid-template-columns: 52px minmax(0, 1fr) 20px !important; padding: 18px 14px !important; }
  .cap-line h3 { font-size: 20px !important; }
  .cap-line svg { display: none; }
  .titleblock-row:has(> :nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .titleblock-row:has(> :nth-child(3)) > :nth-child(2n) { border-right: none; }
  .titleblock-row:has(> :nth-child(3)) > :nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .titleblock-cell { min-width: 0; overflow-wrap: anywhere; }
  .h-display { font-size: clamp(40px, 13vw, 56px); }
  .btn { padding: 14px 18px; }
}

/* in-page link targets land below the sticky nav */
section[id] { scroll-margin-top: 110px; }
@media (max-width: 900px) { section[id] { scroll-margin-top: 84px; } }

/* numbered document (purchasing terms, privacy policy) */
.terms-doc ol { counter-reset: item; list-style: none; padding: 0; }
.terms-doc ol > li { counter-increment: item; padding: 18px 0 18px 56px; border-bottom: 1px solid var(--line-faint); position: relative; line-height: 1.6; font-size: 14px; }
.terms-doc ol > li::before { content: counter(item, decimal-leading-zero); position: absolute; left: 0; top: 18px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--signal-ink); letter-spacing: 0.08em; }
.terms-doc ul { margin: 10px 0 0 20px; font-size: 13.5px; color: var(--ink-soft); }
.terms-doc a { color: var(--signal-ink); text-decoration: underline; }
@media (max-width: 560px) {
  .terms-doc { padding: 20px 18px !important; }
  .terms-doc ol > li { padding-left: 40px; }
}


/* =========================================================
   K-2 MOBILE LAYOUT REFINEMENTS
   Keeps desktop styling unchanged.
   Fixes homepage specification tiles and capability headings.
   ========================================================= */

@media (max-width: 560px) {
  /* Homepage: use full-width specification cards on narrow phones.
     This prevents long values such as CUT→SHIP from crossing dividers. */
  .rg-stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .rg-stats > * {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 20px 18px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .rg-stats > *:last-child {
    border-bottom: none !important;
  }

  .rg-stats > * > div:nth-child(2) {
    min-width: 0 !important;
  }

  .rg-stats > * > div:nth-child(2) > div:first-child {
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.04em !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* Capability lists: give the heading the available width.
     Hide the decorative icon and remove its leftover flex gap. */
  .cap-line {
    grid-template-columns: 48px minmax(0, 1fr) 18px !important;
    grid-template-areas:
      "num title arrow"
      "num desc arrow"
      "num spec arrow" !important;
    column-gap: 12px !important;
    row-gap: 8px !important;
    padding: 20px 14px !important;
    align-items: start !important;
  }

  .cap-line > :nth-child(2) {
    min-width: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .cap-line > :nth-child(2) svg {
    display: none !important;
  }

  .cap-line > :nth-child(2) h3 {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(16px, 4.6vw, 19px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  .cap-line > :nth-child(3),
  .cap-line > :nth-child(4) {
    min-width: 0 !important;
    overflow-wrap: break-word;
  }

  .cap-line > :nth-child(5) {
    align-self: start !important;
  }
}


/* K-2 CAPABILITY HEADING WORD-WRAP FIX */
@media (max-width: 700px) {
  /* Keep complete words together in capability headings.
     Allow natural wrapping only between words. */
  .cap-row .cap-body > div:first-child {
    min-width: 0 !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }

  .cap-row .cap-body > div:first-child > svg {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
  }

  .cap-row .cap-body > div:first-child h3 {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    font-size: clamp(18px, 5vw, 22px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-wrap: initial !important;
  }
}


/* K-2 MOBILE CAPABILITY ROW WIDTH FIX */
@media (max-width: 700px) {
  /* Give each capability heading the full card width.
     The previous 64px number column was leaving too little room
     for long words such as MANUFACTURING and MACHINING. */
  .cap-row {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "num"
      "body"
      "specs"
      "fig" !important;
    gap: 14px !important;
    padding: 22px 18px !important;
  }

  .cap-row .cap-num {
    grid-area: num !important;
  }

  .cap-row .cap-body {
    grid-area: body !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .cap-row .cap-body > div:first-child {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 14px !important;
  }

  .cap-row .cap-body > div:first-child > svg {
    display: none !important;
  }

  .cap-row .cap-body > div:first-child h3 {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(22px, 6.5vw, 28px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-wrap: initial !important;
  }

  .cap-row .cap-body p {
    max-width: none !important;
  }

  .cap-row .cap-specs {
    grid-area: specs !important;
    width: 100% !important;
  }

  .cap-row .bp {
    grid-area: fig !important;
    width: 100% !important;
  }
}


/* K-2 MOBILE CAPABILITY HEADING — CONFIRMED FIX
   Matches the rendered DOM: .cap-body > div:first-child contains
   the SVG icon followed by the h3 heading. */
@media (max-width: 700px) {
  .cap-row .cap-body > div:first-child {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .cap-row .cap-body > div:first-child > svg,
  .cap-row .cap-body > div:first-child > img {
    display: none !important;
  }

  .cap-row .cap-body > div:first-child > h3 {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-wrap: wrap !important;
  }
}
