/* ============================================================
   secfai.xyz design system
   Color tokens live in the first :root block and are mirrored
   in the dark block below — scripts/site_contract_check.py
   enforces the parity. Shadows carry color, so they live there
   too. Non-color tokens (type, radius, motion, layout) live in
   the second :root block and are scheme-independent.
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg: #fcfcfd;
  --surface: #f4f5f8;
  --card: #ffffff;
  --fg: #14161d;
  --muted: #5b616e;
  --accent: #3b4fa0;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(59, 79, 160, 0.08);
  --accent-soft-strong: rgba(59, 79, 160, 0.17);
  --danger: #c0392b;
  --border: #e5e7ee;
  --ring: rgba(59, 79, 160, 0.28);
  --header-bg: rgba(252, 252, 253, 0.82);

  /* Elevation. Stacked layers so light falls off the way it does
     on a real object; a single shadow reads as a sticker. */
  --shadow-sm:
    0 1px 2px rgba(10, 12, 20, 0.04),
    0 1px 1px rgba(10, 12, 20, 0.03);
  --shadow-md:
    0 1px 2px rgba(10, 12, 20, 0.04),
    0 4px 8px -2px rgba(10, 12, 20, 0.06),
    0 12px 24px -6px rgba(10, 12, 20, 0.10);
  --shadow-lg:
    0 1px 2px rgba(10, 12, 20, 0.04),
    0 8px 16px -4px rgba(10, 12, 20, 0.08),
    0 24px 48px -12px rgba(10, 12, 20, 0.14);
  /* Top rim light. Invisible on white; does the elevation work in dark. */
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 999px;

  /* Motion. Nielsen Norman Group puts the usable range at 100-400ms
     and finds 500ms+ reads as a drag, so nothing here exceeds 340ms.
     --ease-out is an expo curve: near-instant departure, long settle. */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 260ms;
  --dur-reveal: 340ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 72rem;
  --container-narrow: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d12;
    --surface: #111219;
    --card: #15161f;
    --fg: #e9eaf0;
    --muted: #9aa0ad;
    --accent: #93a6e8;
    --accent-contrast: #0c0d12;
    --accent-soft: rgba(147, 166, 232, 0.09);
    --accent-soft-strong: rgba(147, 166, 232, 0.24);
    --danger: #ff6b6b;
    --border: #262935;
    --ring: rgba(147, 166, 232, 0.32);
    --header-bg: rgba(12, 13, 18, 0.82);

    /* Shadows barely read on a dark ground, so they recede and the
       rim light carries elevation instead. Surface lightness does
       the rest (--bg -> --surface -> --card). */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow-md:
      0 2px 4px rgba(0, 0, 0, 0.40),
      0 8px 20px -6px rgba(0, 0, 0, 0.50);
    --shadow-lg:
      0 2px 4px rgba(0, 0, 0, 0.40),
      0 16px 40px -10px rgba(0, 0, 0, 0.60);
    --rim: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ring);
  border-radius: 3px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

nav a {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out);
}

nav a:hover,
nav a:focus-visible {
  color: var(--fg);
}

nav .nav-cta {
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  font-weight: 600;
  transition: opacity var(--dur-fast) var(--ease-out);
}

nav .nav-cta:hover,
nav .nav-cta:focus-visible {
  color: var(--accent-contrast);
  opacity: 0.88;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
  scroll-margin-top: 4.5rem;
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: var(--container-narrow);
  margin-bottom: 2.75rem;
}

.eyebrow {
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

h1 {
  font-size: clamp(2.375rem, 5.5vw, 3.625rem);
  line-height: 1.08;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.625rem, 3vw, 2.125rem);
  line-height: 1.18;
  font-weight: 600;
}

h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* Typographic finish. Both text-wrap values fall back to `auto` where
   unsupported, so this is free. `balance` is kept to short display text:
   Chromium only balances 6 lines or fewer, Firefox 10, Safari unlimited. */
h1, h2, h3, .stat-value {
  text-wrap: balance;
}

p,
.stat-label {
  text-wrap: pretty;
}

/* Figures align. The voice is numerate; the numerals should look it. */
.stat-value,
.bp-cell--metric .bp-items li {
  font-variant-numeric: tabular-nums;
}

.body-text {
  font-size: 1.0625rem;
  color: var(--fg);
  max-width: 42rem;
  margin: 0 0 1rem;
}

.body-text:last-child {
  margin-bottom: 0;
}

.text-muted {
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: 2rem;
}

.button-primary,
.button-secondary {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  padding: 0.8rem 1.6rem;
  text-decoration: none;
  transition:
    opacity var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.button-primary {
  color: var(--accent-contrast);
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

.button-primary:hover,
.button-primary:focus-visible {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--fg);
  border: 1px solid var(--border);
  background: var(--card);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(5rem, 11vw, 8.5rem) clamp(4rem, 8vw, 6rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(42rem 26rem at 82% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(34rem 22rem at -8% 108%, var(--accent-soft), transparent 62%);
}

.hero > .container {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  max-width: 52rem;
}

.headline-dim {
  color: var(--muted);
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--fg);
  max-width: 42rem;
  margin: 0;
}

.ref-strip {
  margin-top: 3.5rem;
}

.ref-strip-label {
  margin: 0 0 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ref-strip-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ref-strip-names li {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* ---------- Stat grid (proof band) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.125rem;
  margin: 0 0 2rem;
}

.stat-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm), var(--rim);
  transition:
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

a.stat-card:hover,
a.stat-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--rim);
  /* Snap in, drift out. */
  transition-duration: var(--dur-fast);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.625rem;
}

.stat-label {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.stat-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.proof-basis {
  font-size: 1rem;
  max-width: var(--container-narrow);
  margin: 0 0 0.75rem;
}

.proof-boundary {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: var(--container-narrow);
  margin: 0;
}

/* ---------- Split layouts + form card ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm), var(--rim);
}

.check-list {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
}

.check-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Card grid (case studies) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem;
}

.case-study-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm), var(--rim);
  transition:
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.case-study-card:hover,
.case-study-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--rim);
  /* Snap in, drift out. */
  transition-duration: var(--dur-fast);
}

.case-study-card h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 0 0 0.625rem;
}

.case-study-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.case-study-card-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Team / fact card ---------- */

.fact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm), var(--rim);
}

.fact-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.fact-list li:last-child {
  border-bottom: none;
}

.fact-list .fact-value {
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}

.fact-list .fact-key {
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
}

/* ---------- Build log ---------- */

.updates-intro {
  margin-bottom: 2rem;
}

.updates-list {
  max-width: var(--container-narrow);
}

.update-entry {
  border-left: 2px solid var(--border);
  padding-left: 1.75rem;
}

.update-entry .update-date {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.update-entry h2 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0 0 1rem;
}

.update-entry .body-text {
  margin: 0 0 1rem;
}

.update-entry .body-text:last-child {
  margin-bottom: 0;
}

/* ---------- Design partners ---------- */

.dp-subhead {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.dp-criteria {
  max-width: 42rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.dp-criteria li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
}

.dp-criteria li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Forms ---------- */

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  margin: 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-row label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.field-row input,
.field-row textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.875rem;
  resize: vertical;
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.field-row input:focus,
.field-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.lead-form button {
  font: inherit;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.lead-form button:hover,
.lead-form button:focus-visible {
  opacity: 0.9;
}

.lead-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  font-size: 0.9375rem;
  margin: 1rem 0 0;
}

.form-status-success {
  color: var(--accent);
}

.form-status-error {
  color: var(--danger);
}

/* ---------- Footer ---------- */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: clamp(3.5rem, 6vw, 5rem) 2rem;
  scroll-margin-top: 4.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr minmax(0, 24rem);
  gap: clamp(2rem, 5vw, 4rem);
  margin-bottom: 3rem;
}

.footer-brand .wordmark {
  display: inline-block;
  margin-bottom: 0.875rem;
}

.footer-brand p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 24rem;
}

.footer-links h2,
.footer-form h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--fg);
}

footer .contact {
  font-size: 0.9375rem;
  margin: 0;
}

footer .contact a {
  color: var(--accent);
  text-decoration: none;
}

footer .contact a:hover,
footer .contact a:focus-visible {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.copyright {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ---------- Case-study pages ---------- */

.case-study-back {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
}

.case-study-back a {
  color: var(--muted);
  text-decoration: none;
}

.case-study-back a:hover,
.case-study-back a:focus-visible {
  color: var(--fg);
}

.case-study-dek {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 2rem;
}

.case-study-diagram {
  max-width: 42rem;
  margin: 0 0 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.case-study-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--font-body);
}

.case-study-page h2 {
  font-size: 1.375rem;
  margin: 2.25rem 0 0.75rem;
}

.case-study-page h2:first-of-type {
  margin-top: 0;
}

.case-study-basis {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.case-study-note {
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 1.5rem 0 0;
}

.case-study-note a {
  color: var(--accent);
}

.case-study-cta {
  margin-top: 2rem;
}

.case-study-cta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.case-study-cta a:hover,
.case-study-cta a:focus-visible {
  text-decoration: underline;
}

.case-study-offer {
  margin-top: 3rem;
}

.case-study-offer .eyebrow {
  margin-bottom: 0.5rem;
}

.case-study-offer h2 {
  margin-top: 0;
  font-size: clamp(1.375rem, 2.4vw, 1.625rem);
}

.case-study-offer .body-text {
  margin-bottom: 1.5rem;
}

.footer-links a,
footer .contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

nav .nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1rem;
}

/* ---------- Value-chain blueprint ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#how-we-work {
  position: relative;
  overflow: hidden;
}

#how-we-work::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(64rem 34rem at 50% 42%, #000 18%, transparent 74%);
  mask-image: radial-gradient(64rem 34rem at 50% 42%, #000 18%, transparent 74%);
}

#how-we-work > .container {
  position: relative;
}

.blueprint-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-lg);
}

.blueprint-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.blueprint {
  border-collapse: separate;
  border-spacing: 0.5rem;
  width: 100%;
  min-width: 68rem;
  table-layout: fixed;
}

.bp-corner {
  width: 11rem;
}

/* Stage chips */
.bp-phase {
  padding: 0;
  position: relative;
}

.bp-phase-chip {
  display: block;
  padding: 0.6rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-chip-fg, var(--accent));
  background: var(--bp-chip-bg, var(--accent-soft));
  border: 1px solid var(--bp-line, var(--border));
  border-radius: var(--radius);
  text-align: center;
  transition:
    background var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

/* Marching-ants connector between stages */
.bp-phase::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.5rem;
  width: 0.5rem;
  height: 2px;
  transform: translateY(-50%);
  background-image: linear-gradient(90deg, var(--muted) 50%, transparent 50%);
  background-size: 4px 2px;
  opacity: 0.55;
}

.bp-phase:last-child::after {
  display: none;
}

@keyframes bp-dash {
  to { background-position: 4px 0; }
}

.blueprint:hover .bp-phase::after,
.blueprint:focus-within .bp-phase::after {
  background-image: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
  opacity: 1;
  animation: bp-dash 0.5s linear infinite;
}

/* Handoff strip */
.bp-handoff {
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--bp-handoff-fg, var(--muted));
  text-align: center;
  text-wrap: balance;
  padding: 0.4rem 0.5rem;
  background: var(--bp-fill, transparent);
  border: 1px dashed var(--bp-line, var(--border));
  border-radius: var(--radius);
  transition:
    color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

/* Demand receives the loop back from Operate, so it is the one handoff
   drawn as a closed edge rather than a pending one. */
.bp-handoff--loop {
  color: var(--bp-handoff-fg, var(--accent));
  border-color: var(--bp-line, var(--accent));
  border-style: solid;
  background: var(--bp-fill-strong, var(--accent-soft));
  font-weight: 600;
}

/* Sticky row labels survive horizontal scroll */
.bp-rowlabel {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 11rem;
  text-align: right;
  vertical-align: middle;
  padding: 0 0.75rem 0 0;
  background: var(--bg);
}

.bp-rowlabel span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--muted);
}

.bp-rowlabel--sub span {
  font-size: 0.6875rem;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.bp-row--agents .bp-rowlabel span,
.bp-row--metric .bp-rowlabel span {
  color: var(--accent);
}

/* Cells */
.bp-cell {
  background: var(--bp-fill, var(--card));
  border: 1px solid var(--bp-line, var(--border));
  border-radius: var(--radius);
  padding: 0.875rem 0.7rem;
  vertical-align: middle;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.bp-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bp-items li {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--fg);
  text-align: center;
  text-wrap: balance;
}

.bp-cell--humans .bp-items li,
.bp-cell--evidence .bp-items li {
  color: var(--muted);
}

.bp-cell--evidence {
  background: var(--bp-fill, transparent);
  border-style: dashed;
}

/* The metric each stage owns */
.bp-cell--metric {
  background: var(--bp-fill-strong, var(--accent-soft));
  border-color: var(--bp-line, var(--accent));
}

.bp-cell--metric .bp-items li {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* Column trace. Hovering any cell in a stage column — the chip, the handoff,
   or any row below it — sets the hot tokens on every cell of that column, so
   the trace runs unbroken from Demand's chip down to the number it owns.
   :is(th, td):nth-child(n) is the whole column and nothing else: child 1 is
   always the row label or the corner, never a stage. */
.blueprint:has(:is(th, td):nth-child(2):is(:hover, :focus-within)) :is(th, td):nth-child(2),
.blueprint:has(:is(th, td):nth-child(3):is(:hover, :focus-within)) :is(th, td):nth-child(3),
.blueprint:has(:is(th, td):nth-child(4):is(:hover, :focus-within)) :is(th, td):nth-child(4),
.blueprint:has(:is(th, td):nth-child(5):is(:hover, :focus-within)) :is(th, td):nth-child(5),
.blueprint:has(:is(th, td):nth-child(6):is(:hover, :focus-within)) :is(th, td):nth-child(6),
.blueprint:has(:is(th, td):nth-child(7):is(:hover, :focus-within)) :is(th, td):nth-child(7) {
  --bp-chip-bg: var(--accent);
  --bp-chip-fg: var(--accent-contrast);
  --bp-handoff-fg: var(--accent);
  --bp-line: var(--accent);
  --bp-fill: var(--accent-soft);
  --bp-fill-strong: var(--accent-soft-strong);
}

@media (prefers-reduced-motion: reduce) {
  .blueprint:hover .bp-phase::after,
  .blueprint:focus-within .bp-phase::after {
    animation: none;
  }

  .bp-phase-chip,
  .bp-cell,
  .bp-handoff {
    transition: none;
  }

  /* Hover travel is animation from interaction (WCAG 2.3.3). Colour and
     elevation feedback stays; the movement goes. */
  .stat-card,
  .case-study-card,
  .button-primary,
  .button-secondary {
    transition: none;
  }

  a.stat-card:hover,
  a.stat-card:focus-visible,
  .case-study-card:hover,
  .case-study-card:focus-visible,
  .button-primary:hover,
  .button-primary:focus-visible {
    transform: none;
  }
}

.flow-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* The chain fits without scrolling here, but the trace is still there to
   find, so only the scroll clause goes. */
@media (min-width: 72rem) {
  .flow-hint-scroll {
    display: none;
  }
}

/* ---------- Reveal (progressive, added by site.js) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity var(--dur-reveal) var(--ease-out),
      transform var(--dur-reveal) var(--ease-out);
  }

  .reveal.in-view {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 64rem) {
  .split {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 48rem) {
  nav {
    gap: 0.5rem 1rem;
  }

  nav a:not(.nav-cta) {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 30rem) {
  .container {
    padding-inline: 1.25rem;
  }

  .header-inner {
    padding: 0.75rem 1.25rem;
  }

  .hero {
    padding-block: 2.5rem 3rem;
  }

  .hero-badge {
    margin-bottom: 1rem;
  }

  .hero-ctas {
    margin-top: 1.5rem;
  }

  .ref-strip {
    margin-top: 2.5rem;
  }

  .hero-ctas {
    width: 100%;
  }

  .hero-ctas .button-primary,
  .hero-ctas .button-secondary {
    width: 100%;
    text-align: center;
  }

  .ref-strip-names {
    gap: 0.5rem 1.5rem;
  }

  .ref-strip-names li {
    font-size: 0.9375rem;
  }
}

.tech-stack {
  margin-top: 0.5rem;
}
