/* ════════════════════════════════════════════════════════════
   case-study.css — shared scrollytelling layout for the two
   case-study pages (case-study-community-health.html,
   case-study-cpa-acquisition.html). Additive only: nothing in
   here is consumed by other pages, and nothing in vw-system.css
   is redeclared. Signature element: "the thread" — a vertical
   progress line that draws itself down the chapter rail as the
   reader scrolls, connecting numbered chapter markers.
   ════════════════════════════════════════════════════════════ */

/* ── Base + grain (matches site pages) ─────────────────────── */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Buttons come from css/buttons.css (canonical .btn-primary / .btn-ghost),
   linked by both case-study pages before this file. */

.footer-link {
  color: rgba(168,200,240,0.55);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover { color: rgba(168,200,240,0.9); }

/* ── HERO ──────────────────────────────────────────────────── */
.cs-hero {
  background: #0A1628;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.cs-hero-glow-1 { position: absolute; width: 900px; height: 900px; border-radius: 50%; background: radial-gradient(circle, rgba(26,58,107,0.55) 0%, transparent 65%); top: -260px; right: -200px; pointer-events: none; }
.cs-hero-glow-2 { position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(45,125,210,0.12) 0%, transparent 65%); bottom: -200px; left: -100px; pointer-events: none; }
.cs-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.35) 25%, rgba(0,0,0,0.35) 75%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.35) 25%, rgba(0,0,0,0.35) 75%, transparent);
  pointer-events: none;
}

.cs-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #A8C8F0;
}
.cs-eyebrow::before {
  content: '';
  width: 26px; height: 1px;
  background: linear-gradient(90deg, #2D7DD2, rgba(45,125,210,0));
}

.cs-client {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: rgba(255,255,255,0.85);
}
.cs-client .sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: rgba(168,200,240,0.4); vertical-align: middle; margin: 0 8px 2px; }
.cs-client .loc { color: rgba(168,200,240,0.62); font-weight: 400; }

.cs-h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 4.8vw, 3.7rem);
  line-height: 1.07;
  letter-spacing: -0.025em;
  color: #fff;
  font-weight: 400;
}
.cs-h1 em { font-style: italic; color: #A8C8F0; }

/* Hero stat row */
.cs-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0;
  border-top: 1px solid rgba(168,200,240,0.16);
}
.cs-hero-stat {
  padding: 26px 28px 4px 0;
}
.cs-hero-stat + .cs-hero-stat { padding-left: 28px; border-left: 1px solid rgba(168,200,240,0.14); }
.cs-hero-stat .num {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.cs-hero-stat .num .accent { color: #A8C8F0; font-style: italic; }
.cs-hero-stat .label {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: rgba(168,200,240,0.66);
  line-height: 1.55;
}
@media (max-width: 720px) {
  .cs-hero-stats { grid-template-columns: 1fr; }
  .cs-hero-stat { padding: 18px 0 4px; }
  .cs-hero-stat + .cs-hero-stat { padding-left: 0; border-left: none; border-top: 1px solid rgba(168,200,240,0.14); }
}

/* ── THE THREAD — chapter rail ─────────────────────────────── */
.cs-story {
  background: #F7F8FA;
  position: relative;
}
/* Symmetric centered container. The numbered rail + scroll line were
   removed on all breakpoints (2026-07-31): full-bleed band breakouts in
   the pages' inline styles are a plain calc(50% - 50vw) - a returning
   side rail means giving every breakout half its width back as a
   negative offset. */
.cs-chapters {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.cs-chapter {
  position: relative;
  padding: 84px 0 96px;
}
.cs-chapter + .cs-chapter { border-top: 1px solid rgba(10,22,40,0.05); }

.cs-kicker {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2D7DD2;
  margin-bottom: 18px;
}
.cs-h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: #0A1628;
  font-weight: 400;
  max-width: 620px;
}
.cs-h2 em { font-style: italic; color: #2D7DD2; }
.cs-lede {
  margin-top: 22px;
  font-size: 1.0625rem;
  color: #5A6A82;
  line-height: 1.78;
  max-width: 560px;
}
.cs-lede strong { color: #0A1628; font-weight: 600; }

/* Two-up chapter body (text + visual). */
.cs-split {
  display: grid;
  grid-template-columns: minmax(0,0.92fr) minmax(0,1.08fr);
  gap: 56px;
  align-items: center;
}
@media (max-width: 980px) {
  .cs-split { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 720px) {
  .cs-chapter { padding: 56px 0 64px; }
}

/* ── Dark stage panel (The Turn, quotes, security) ─────────── */
.cs-stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, #102347 0%, #0E1F3F 55%, #0C1B37 100%);
  box-shadow:
    inset 0 1px 0 rgba(168,200,240,0.10),
    0 2px 4px rgba(10,22,40,0.10),
    0 28px 64px rgba(10,22,40,0.22);
  padding: clamp(40px, 6vw, 72px);
  color: #fff;
}
.cs-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 460px at 14% 8%, rgba(45,125,210,0.16), transparent 55%),
    radial-gradient(620px 480px at 90% 100%, rgba(168,200,240,0.07), transparent 60%);
}
.cs-stage > * { position: relative; z-index: 1; }
.cs-stage .cs-kicker { color: #A8C8F0; }
.cs-stage .cs-h2 { color: #fff; }
.cs-stage .cs-h2 em { color: #A8C8F0; }
.cs-stage .cs-lede { color: rgba(255,255,255,0.72); }
.cs-stage .cs-lede strong { color: #fff; }

/* ── Big serif stat blocks (count-up targets) ──────────────── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 20px;
}
@media (max-width: 860px) { .cs-stats { grid-template-columns: 1fr; } }
.cs-stat {
  position: relative;
  border-radius: 18px;
  padding: 30px 26px 26px;
  background: linear-gradient(180deg, #FAF7F0 0%, #F4F1EA 100%);
  border: 1px solid rgba(10,22,40,0.07);
  box-shadow:
    0 1px 2px rgba(10,22,40,0.04),
    0 12px 30px rgba(10,22,40,0.09);
  overflow: hidden;
}
.cs-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 2px;
  background: linear-gradient(90deg, #2D7DD2, transparent);
  opacity: 0.85;
}
.cs-stat .num {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.4rem, 4.4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #0A1628;
}
.cs-stat .num .unit { color: #2D7DD2; font-size: 0.55em; margin-left: 8px; }
.cs-stat .num.is-struck { position: relative; color: #8A97AB; }
.cs-stat .num.is-struck::after {
  content: '';
  position: absolute;
  left: -2%; right: 30%;
  top: 54%;
  height: 3px;
  border-radius: 2px;
  background: #2D7DD2;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.55s;
}
.cs-stat.visible .num.is-struck::after,
.cs-stats.visible .num.is-struck::after,
.no-js .cs-stat .num.is-struck::after { transform: scaleX(1); }
.cs-stat .label { margin-top: 12px; font-size: 0.9375rem; font-weight: 600; color: #0A1628; }
.cs-stat .sub { margin-top: 5px; font-size: 0.8125rem; color: #5A6A82; line-height: 1.6; }

/* Dark variant when stats sit on a stage. */
.cs-stage .cs-stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.015) 100%);
  border-color: rgba(255,255,255,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px rgba(0,0,0,0.30);
}
.cs-stage .cs-stat .num { color: #fff; }
.cs-stage .cs-stat .num .unit { color: #A8C8F0; }
.cs-stage .cs-stat .label { color: #fff; }
.cs-stage .cs-stat .sub { color: rgba(168,200,240,0.72); }

/* ── Pull quote ────────────────────────────────────────────── */
.cs-quote {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(1.45rem, 2.9vw, 2.05rem);
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: #fff;
  max-width: 780px;
}
.cs-quote .mark {
  display: block;
  font-size: 3.2rem;
  line-height: 0.6;
  color: #2D7DD2;
  margin-bottom: 18px;
  font-style: normal;
}
.cs-quote-attr {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.875rem;
  color: rgba(168,200,240,0.85);
}
.cs-quote-attr::before {
  content: '';
  width: 30px; height: 1px;
  background: rgba(168,200,240,0.5);
}
.cs-quote-attr strong { color: #fff; font-weight: 600; }

/* ── Screenshot frame (browser chrome) ─────────────────────── */
.cs-shot {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0E1F3F;
  border: 1px solid rgba(10,22,40,0.10);
  box-shadow:
    0 2px 4px rgba(10,22,40,0.06),
    0 24px 56px rgba(10,22,40,0.16),
    0 0 0 1px rgba(45,125,210,0.05);
}
.cs-shot-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #16294A 0%, #101F3C 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-shot-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(168,200,240,0.22); }
.cs-shot-bar .addr {
  margin-left: 10px;
  flex: 1;
  max-width: 320px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  color: rgba(168,200,240,0.55);
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-shot img { display: block; width: 100%; height: auto; }
.cs-shot-caption {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  color: #8A97AB;
  line-height: 1.55;
}
.cs-shot-caption .pip {
  flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: #2D7DD2;
  opacity: 0.55;
  transform: translateY(-1px);
}

/* Feature tour rows */
.cs-feature {
  display: grid;
  grid-template-columns: minmax(0,0.78fr) minmax(0,1.22fr);
  gap: 52px;
  align-items: center;
}
.cs-feature + .cs-feature { margin-top: 84px; }
.cs-feature.is-flipped .cs-feature-text { order: 2; }
.cs-feature.is-flipped .cs-feature-visual { order: 1; }
@media (max-width: 980px) {
  .cs-feature { grid-template-columns: 1fr; gap: 28px; }
  .cs-feature.is-flipped .cs-feature-text { order: 1; }
  .cs-feature.is-flipped .cs-feature-visual { order: 2; }
}
.cs-feature-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: #0A1628;
  font-weight: 400;
}
.cs-feature-body {
  margin-top: 14px;
  font-size: 0.9375rem;
  color: #5A6A82;
  line-height: 1.75;
}
.cs-feature-body strong { color: #0A1628; font-weight: 600; }
.cs-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6563rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2D7DD2;
  background: rgba(45,125,210,0.10);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
.cs-feature-tag .pip { width: 5px; height: 5px; border-radius: 50%; background: #2D7DD2; }

/* ── Video placeholder ─────────────────────────────────────── */
.cs-video {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0A1628;
  border: 1px solid rgba(10,22,40,0.12);
  box-shadow:
    0 2px 4px rgba(10,22,40,0.08),
    0 30px 70px rgba(10,22,40,0.24);
  aspect-ratio: 16 / 9;
}
.cs-video-poster {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: top center;
  filter: saturate(0.85);
  opacity: 0.45;
}
.cs-video-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 90% at 50% 50%, rgba(10,22,40,0.10) 0%, rgba(10,22,40,0.78) 100%),
    linear-gradient(to top, rgba(10,22,40,0.85), transparent 45%);
}
.cs-video-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.cs-video-play {
  width: 84px; height: 84px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(168,200,240,0.35);
  box-shadow: 0 0 0 12px rgba(45,125,210,0.10), 0 12px 34px rgba(0,0,0,0.4);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cs-video-play svg { margin-left: 5px; }
.cs-video-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  color: #fff;
}
.cs-video-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(168,200,240,0.75);
}

/* ── The chain (man-hours → revenue) ───────────────────────── */
.cs-chain {
  counter-reset: chain;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 18px;
}
@media (max-width: 980px) { .cs-chain { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cs-chain { grid-template-columns: 1fr; } }
.cs-chain-step {
  counter-increment: chain;
  position: relative;
  border-radius: 18px;
  padding: 26px 22px 24px;
  background: #fff;
  border: 1px solid rgba(10,22,40,0.07);
  box-shadow: 0 1px 2px rgba(10,22,40,0.04), 0 10px 26px rgba(10,22,40,0.07);
}
.cs-chain-step::before {
  content: counter(chain, decimal-leading-zero);
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: #2D7DD2;
  margin-bottom: 14px;
}
.cs-chain-step::after {
  content: '';
  position: absolute;
  top: 26px; right: -14px;
  width: 10px; height: 10px;
  border-top: 2px solid rgba(45,125,210,0.5);
  border-right: 2px solid rgba(45,125,210,0.5);
  transform: rotate(45deg);
  z-index: 2;
}
.cs-chain-step:last-child::after { display: none; }
@media (max-width: 980px) { .cs-chain-step::after { display: none; } }
.cs-chain-step .t {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  color: #0A1628;
  line-height: 1.2;
}
.cs-chain-step .d {
  margin-top: 9px;
  font-size: 0.8438rem;
  color: #5A6A82;
  line-height: 1.65;
}

/* ── Page 01: the paper-era collage (built in code) ────────── */
.cs-before {
  position: relative;
  min-height: 420px;
  border-radius: 20px;
  background:
    radial-gradient(520px 320px at 78% 18%, rgba(120,132,152,0.10), transparent 60%),
    linear-gradient(180deg, #EDEFF3 0%, #E4E7EC 100%);
  border: 1px solid rgba(10,22,40,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 18px 44px rgba(10,22,40,0.10);
  overflow: hidden;
}
.cs-paper {
  position: absolute;
  background: #FDFDFB;
  border: 1px solid rgba(10,22,40,0.09);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(10,22,40,0.06), 0 14px 30px rgba(10,22,40,0.10);
  padding: 16px 16px 18px;
}
.cs-paper .ttl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.5938rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8A97AB;
  margin-bottom: 10px;
}
.cs-paper .ln { height: 6px; border-radius: 3px; background: rgba(10,22,40,0.09); margin-bottom: 6px; }
.cs-paper .ln.w80 { width: 80%; } .cs-paper .ln.w65 { width: 65%; } .cs-paper .ln.w50 { width: 50%; } .cs-paper .ln.w90 { width: 90%; }
.cs-sheet {
  position: absolute;
  background: #FBFBF9;
  border: 1px solid rgba(10,22,40,0.10);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(10,22,40,0.06), 0 16px 36px rgba(10,22,40,0.12);
  overflow: hidden;
}
.cs-sheet .row { display: flex; border-bottom: 1px solid rgba(10,22,40,0.07); }
.cs-sheet .cell {
  flex: 1;
  height: 18px;
  border-right: 1px solid rgba(10,22,40,0.07);
}
.cs-sheet .cell:last-child { border-right: none; }
.cs-sheet .row.hd .cell { background: rgba(10,22,40,0.05); height: 20px; }
.cs-sheet .cell.f { background: rgba(138,151,171,0.14); }
.cs-sticky {
  position: absolute;
  width: 120px;
  padding: 12px 12px 16px;
  background: #F4EBC8;
  border-radius: 3px;
  box-shadow: 0 6px 16px rgba(10,22,40,0.14);
  font-size: 0.6875rem;
  line-height: 1.5;
  color: #6B6248;
  font-weight: 500;
}
.cs-before-caption {
  position: absolute;
  left: 22px; bottom: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #8A97AB;
}

/* ── Page 02: on-premises flow diagram ─────────────────────── */
.cs-flow {
  position: relative;
  border-radius: 20px;
  padding: 40px 30px 30px;
  background: linear-gradient(160deg, #102347 0%, #0E1F3F 55%, #0C1B37 100%);
  border: 1px solid rgba(45,125,210,0.28);
  box-shadow:
    inset 0 1px 0 rgba(168,200,240,0.10),
    0 24px 56px rgba(10,22,40,0.24);
  overflow: hidden;
}
.cs-flow-boundary {
  position: absolute;
  top: 12px; left: 12px; right: 12px; bottom: 12px;
  border: 1.5px dashed rgba(168,200,240,0.28);
  border-radius: 14px;
  pointer-events: none;
}
.cs-flow-boundary-label {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #A8C8F0;
  background: rgba(16,35,71,0.92);
  padding: 3px 12px;
  white-space: nowrap;
}
.cs-flow-lane {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  padding: 0 8px;
}
.cs-flow-node {
  position: relative;
  border-radius: 14px;
  padding: 20px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(168,200,240,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 26px rgba(0,0,0,0.28);
  text-align: center;
}
.cs-flow-node .nm {
  font-size: 0.9063rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.005em;
}
.cs-flow-node .rl {
  margin-top: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.5938rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(168,200,240,0.62);
}
.cs-flow-pipe {
  position: relative;
  width: clamp(90px, 14vw, 190px);
  height: 46px;
}
.cs-flow-pipe .rail {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(90deg, rgba(168,200,240,0.4) 0 8px, transparent 8px 16px);
}
.cs-flow-pipe .chip {
  position: absolute;
  top: 50%;
  left: 0;
  width: 26px; height: 18px;
  margin-top: -9px;
  border-radius: 4px;
  background: linear-gradient(180deg, #3F92E6 0%, #2D7DD2 100%);
  box-shadow: 0 0 0 3px rgba(45,125,210,0.18), 0 4px 10px rgba(0,0,0,0.35);
  opacity: 0;
}
.cs-flow.is-live .chip { animation: cs-chip-travel 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.cs-flow.is-live .chip.c2 { animation-delay: 1.05s; }
.cs-flow.is-live .chip.c3 { animation-delay: 2.1s; }
@keyframes cs-chip-travel {
  0%   { transform: translateX(0); opacity: 0; }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  96%  { transform: translateX(calc(clamp(90px, 14vw, 190px) - 26px)); opacity: 0; }
  100% { transform: translateX(calc(clamp(90px, 14vw, 190px) - 26px)); opacity: 0; }
}
.cs-flow-caption {
  position: relative;
  margin-top: 30px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(168,200,240,0.72);
  line-height: 1.6;
}
.cs-flow-caption strong { color: #fff; font-weight: 600; }
@media (max-width: 760px) {
  .cs-flow-lane { grid-template-columns: 1fr; gap: 10px; }
  .cs-flow-pipe { width: 46px; height: 56px; margin: 0 auto; }
  .cs-flow-pipe .rail {
    left: 50%; top: 0; bottom: 0; right: auto;
    width: 2px; height: auto; margin-top: 0; margin-left: -1px;
    background: repeating-linear-gradient(180deg, rgba(168,200,240,0.4) 0 8px, transparent 8px 16px);
  }
  .cs-flow-pipe .chip { left: 50%; top: 0; margin-left: -13px; margin-top: 0; }
  .cs-flow.is-live .chip { animation-name: cs-chip-travel-v; }
  @keyframes cs-chip-travel-v {
    0%   { transform: translateY(0); opacity: 0; }
    12%  { opacity: 1; }
    82%  { opacity: 1; }
    96%  { transform: translateY(38px); opacity: 0; }
    100% { transform: translateY(38px); opacity: 0; }
  }
}

/* ── Checklist rows (security chapter, what's-next) ────────── */
.cs-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.cs-list li { display: flex; gap: 14px; font-size: 0.9375rem; line-height: 1.7; color: #5A6A82; }
.cs-list li strong { color: #0A1628; font-weight: 600; }
.cs-list .mk {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 7px;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,125,210,0.12);
  color: #2D7DD2;
}
.cs-stage .cs-list li { color: rgba(255,255,255,0.78); }
.cs-stage .cs-list li strong { color: #fff; }
.cs-stage .cs-list .mk { background: rgba(45,125,210,0.24); color: #A8C8F0; }

/* In-build pill for the honest "what's next" framing. */
.cs-inbuild {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(45,125,210,0.10);
  border: 1px solid rgba(45,125,210,0.24);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6563rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #2D7DD2;
}
.cs-inbuild .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2D7DD2;
  box-shadow: 0 0 0 4px rgba(45,125,210,0.18);
}
.cs-stage .cs-inbuild { background: rgba(45,125,210,0.16); border-color: rgba(168,200,240,0.30); color: #A8C8F0; }
.cs-stage .cs-inbuild .pulse { background: #A8C8F0; box-shadow: 0 0 0 4px rgba(168,200,240,0.16); }

/* ── CTA ───────────────────────────────────────────────────── */
.cs-cta {
  background: linear-gradient(135deg, #0A1628 0%, #1A3A6B 100%);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.cs-cta-glow {
  position: absolute;
  width: 900px; height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,125,210,0.20) 0%, transparent 65%);
  top: -300px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cs-flow.is-live .chip { animation: none !important; opacity: 0.9; left: 50%; margin-left: -13px; }
  .cs-stat .num.is-struck::after { transform: scaleX(1) !important; transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   CS-SIM — Mira workflow simulation (case-study ch.01 visual)
   Reversible block: delete from this banner to EOF banner to revert.
   ════════════════════════════════════════════════════════════════ */

.cs-sim {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, #102347 0%, #0E1F3F 55%, #0C1B37 100%);
  box-shadow:
    inset 0 1px 0 rgba(168,200,240,0.10),
    0 2px 4px rgba(10,22,40,0.10),
    0 28px 64px rgba(10,22,40,0.22);
}
.cs-sim::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 460px at 12% 0%, rgba(45,125,210,0.15), transparent 55%),
    radial-gradient(620px 480px at 92% 100%, rgba(168,200,240,0.06), transparent 60%);
}
.cs-sim > * { position: relative; z-index: 1; }

/* Header bar */
.cs-sim-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid rgba(168,200,240,0.12);
}
.cs-sim-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cs-sim-brand .wv { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.cs-sim-brand .wv i {
  width: 3px; border-radius: 2px; background: #2D7DD2; display: block;
  height: 100%; transform-origin: 50% 100%;
}
.cs-sim-brand .wv i:nth-child(1) { transform: scaleY(0.45); }
.cs-sim-brand .wv i:nth-child(2) { transform: scaleY(0.95); }
.cs-sim-brand .wv i:nth-child(3) { transform: scaleY(0.62); }
.cs-sim-brand .wv i:nth-child(4) { transform: scaleY(0.30); }
.cs-sim.is-running .cs-sim-brand .wv i { animation: cs-sim-wv 0.9s ease-in-out infinite alternate; }
.cs-sim.is-running .cs-sim-brand .wv i:nth-child(2) { animation-delay: 0.12s; }
.cs-sim.is-running .cs-sim-brand .wv i:nth-child(3) { animation-delay: 0.24s; }
.cs-sim.is-running .cs-sim-brand .wv i:nth-child(4) { animation-delay: 0.36s; }
@keyframes cs-sim-wv {
  from { transform: scaleY(0.25); }
  to   { transform: scaleY(1); }
}
.cs-sim-brand .nm { font-weight: 600; color: #fff; font-size: 0.9375rem; letter-spacing: -0.01em; }
.cs-sim-brand .nm span { color: rgba(168,200,240,0.62); font-weight: 500; }
.cs-sim-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(168,200,240,0.75);
  white-space: nowrap;
}
.cs-sim-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5A6A82;
}
.cs-sim.is-running .cs-sim-status .dot { background: #59C08B; animation: cs-sim-pulse 1.1s ease-in-out infinite; }
.cs-sim.is-done .cs-sim-status .dot { background: #59C08B; animation: none; }
@keyframes cs-sim-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

/* Body: scenario menu + chat */
.cs-sim-body { display: grid; grid-template-columns: 296px minmax(0, 1fr); }
.cs-sim-menu {
  padding: 20px 16px 22px 20px;
  border-right: 1px solid rgba(168,200,240,0.12);
  display: flex; flex-direction: column; gap: 8px;
  align-items: stretch;
}
.cs-sim-menu-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(168,200,240,0.55);
  margin: 0 0 10px 4px;
}
.cs-sim-tab {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-sim-tab:hover { background: rgba(168,200,240,0.07); }
.cs-sim-tab:active { transform: scale(0.985); }
.cs-sim-tab:focus-visible { outline: 2px solid #A8C8F0; outline-offset: 2px; }
.cs-sim-tab.is-active {
  background: rgba(45,125,210,0.16);
  border-color: rgba(168,200,240,0.22);
}
.cs-sim-tab .ic {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(168,200,240,0.10);
  color: #A8C8F0;
}
.cs-sim-tab.is-active .ic { background: linear-gradient(180deg, #3D8CDE 0%, #2D7DD2 100%); color: #fff; }
.cs-sim-tab > span:last-child { display: block; min-width: 0; }
.cs-sim-tab .t { display: block; font-size: 0.875rem; font-weight: 600; color: #fff; line-height: 1.25; }
.cs-sim-tab .d { display: block; font-size: 0.75rem; color: rgba(168,200,240,0.60); margin-top: 2px; line-height: 1.35; }

/* Chat panel.
   The chat is absolutely positioned inside the stage so its transcript can
   never inflate the grid row. That leaves the rail free to set the shell's
   height (eight workflows, none hidden below a scroll) while the chat fills
   whatever height it lands in and scrolls its own overflow. The min-height
   is the floor for when the rail is the shorter column. */
.cs-sim-stage {
  position: relative;
  min-width: 0;
  min-height: clamp(430px, 58vh, 560px);
}
.cs-sim-chat {
  position: absolute;
  inset: 14px;
  background: linear-gradient(180deg, #FDFCFA 0%, #F7F5F0 100%);
  border-radius: 14px;
  overflow-y: auto;
  padding: 22px 22px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(10,22,40,0.22) transparent;
}

/* Idle state: the run is user-triggered, so the panel opens on a resting
   Mira mark and a single call to action instead of auto-playing.
   The glow is a centred radial that reaches zero well inside the panel,
   so the overlay never shows a rectangular edge against the chat surface. */
.sim-idle {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
  border-radius: 14px;
  background: radial-gradient(460px 320px at 50% 46%, rgba(45,125,210,0.11), rgba(45,125,210,0) 62%);
  z-index: 3;
}
.cs-sim.is-idle .sim-idle { display: flex; }
.sim-idle .mk {
  position: relative;
  width: 62px; height: 62px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #3D8CDE 0%, #2D7DD2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    0 2px 6px rgba(45,125,210,0.22),
    0 14px 34px rgba(45,125,210,0.26);
}
/* Resting halo: reads as "listening" without spending motion on it. */
.sim-idle .mk::after {
  content: ''; position: absolute; inset: -10px;
  border-radius: 26px;
  border: 1px solid rgba(45,125,210,0.22);
  animation: cs-sim-halo 2.8s ease-in-out infinite;
}
@keyframes cs-sim-halo {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 0.25; transform: scale(1.06); }
}
.sim-idle .mk .wv { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.sim-idle .mk .wv i {
  width: 3.5px; border-radius: 2px; background: #fff; display: block;
  height: 100%; transform-origin: 50% 100%;
  animation: cs-sim-wv 1.5s ease-in-out infinite alternate;
}
/* Staggered heights as well as delays, so the silhouette reads as a
   waveform at every frame instead of collapsing into a solid block. */
.sim-idle .mk .wv i:nth-child(1) { height: 52%; animation-delay: 0s; }
.sim-idle .mk .wv i:nth-child(2) { height: 100%; animation-delay: 0.22s; }
.sim-idle .mk .wv i:nth-child(3) { height: 70%; animation-delay: 0.44s; }
.sim-idle .mk .wv i:nth-child(4) { height: 38%; animation-delay: 0.66s; }
.sim-idle .hd {
  margin-top: 20px;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.015em; color: #0A1628;
}
.sim-idle .sb { margin-top: 5px; font-size: 0.85rem; color: #5A6A82; }
.sim-start {
  margin-top: 20px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #3D8CDE 0%, #2D7DD2 100%);
  color: #fff; font-size: 0.875rem; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.26),
    0 2px 5px rgba(45,125,210,0.24),
    0 12px 26px rgba(45,125,210,0.28);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
}
.sim-start:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 3px 7px rgba(45,125,210,0.26),
    0 18px 34px rgba(45,125,210,0.32);
}
.sim-start:active { transform: translateY(0) scale(0.985); }
.sim-start:focus-visible { outline: 2px solid #2D7DD2; outline-offset: 3px; }
.sim-start svg { display: block; }

/* Threads: only the active one is visible (JS drives) */
.cs-sim-thread { display: none; }
.cs-sim-thread.is-active { display: block; }

/* One message row. Unshown items take NO layout space — otherwise the
   chat's scroll height includes the whole future transcript and the
   auto-scroll runs past the visible messages into blank space. */
.sim-item { margin-bottom: 18px; }
html:not(.no-js) .sim-item:not(.is-shown) { display: none; }
html:not(.no-js) .sim-item.is-shown {
  animation: cs-sim-item-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cs-sim-item-in {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

.sim-m { display: flex; gap: 12px; }
.sim-m .av {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #FAF7F0 0%, #EFEAE0 100%);
  border: 1px solid rgba(10,22,40,0.10);
  color: #1A3A6B;
}
.sim-m.is-mira .av {
  background: linear-gradient(180deg, #3D8CDE 0%, #2D7DD2 100%);
  border-color: rgba(45,125,210,0.4);
  color: #fff;
}
.sim-m .av .wv { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sim-m .av .wv i { width: 2.5px; border-radius: 2px; background: #fff; display: block; height: 100%; transform-origin: 50% 100%; }
.sim-m .av .wv i:nth-child(1) { transform: scaleY(0.4); }
.sim-m .av .wv i:nth-child(2) { transform: scaleY(0.9); }
.sim-m .av .wv i:nth-child(3) { transform: scaleY(0.55); }
.sim-m.is-speaking .av .wv i { animation: cs-sim-wv 0.7s ease-in-out infinite alternate; }
.sim-m.is-speaking .av .wv i:nth-child(2) { animation-delay: 0.1s; }
.sim-m.is-speaking .av .wv i:nth-child(3) { animation-delay: 0.2s; }
.sim-m .bd { min-width: 0; flex: 1 1 auto; }
.sim-m .meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sim-m .who { font-size: 0.8125rem; font-weight: 700; color: #0A1628; }
.sim-m .role { font-size: 0.71875rem; color: #5A6A82; }
.sim-m .tm {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem; color: #8A97AB;
}
.sim-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #1A3A6B;
  background: rgba(45,125,210,0.10);
  border: 1px solid rgba(45,125,210,0.20);
  border-radius: 999px;
  padding: 2px 9px;
}
.sim-m .txt { margin-top: 5px; font-size: 0.9rem; line-height: 1.6; color: #22314A; }
.sim-m .txt strong { color: #0A1628; }
/* Spoken lists are line breaks, never bullets — this is a speech stream. */
.sim-m .txt--lines { line-height: 1.75; }

/* Exception row: a fact that didn't reconcile, not a failure. */
.sim-card li.is-flag .ck { background: rgba(196,138,44,0.18); color: #9A6B1C; }
.sim-card li.is-flag { color: #6B5B39; }


/* Task card inside a Mira message */
.sim-card {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(10,22,40,0.09);
  background: #fff;
  box-shadow: 0 1px 2px rgba(10,22,40,0.04), 0 10px 24px rgba(10,22,40,0.06);
  padding: 12px 14px;
}
.sim-card .hd {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #5A6A82;
}
.sim-card .st {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 2px 9px;
  font-size: 0.625rem; letter-spacing: 0.08em;
  background: rgba(45,125,210,0.10); color: #1A3A6B;
}
.sim-card .st::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: #2D7DD2;
}
.sim-card.is-done .st { background: rgba(89,192,139,0.14); color: #1D6B45; }
.sim-card.is-done .st::before { background: #2E9E66; }
.sim-card.is-done .st .st-run, .sim-card .st .st-ok { display: none; }
.sim-card.is-done .st .st-ok { display: inline; }
/* A card whose finished state is a blocking fact, not a success. Same geometry
   as the green done pill, amber so "Conflict" can't read as "OK". Must sit
   after .sim-card.is-done .st — equal specificity, so source order decides. */
.sim-card--warn.is-done .st { background: rgba(196,138,44,0.16); color: #9A6B1C; }
.sim-card--warn.is-done .st::before { background: #C48A2C; }
.sim-card ul { list-style: none; margin: 10px 0 2px; padding: 0; }
.sim-card li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 0.8125rem; color: #22314A; line-height: 1.5;
  padding: 4px 0;
}
html:not(.no-js) .sim-card li:not(.is-on) { display: none; }
html:not(.no-js) .sim-card li.is-on {
  animation: cs-sim-item-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sim-card li .ck {
  flex: 0 0 auto;
  width: 15px; height: 15px; border-radius: 50%;
  margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(89,192,139,0.15);
  color: #2E9E66;
}
.sim-card li .ck svg { display: block; }

/* Approval gate card */
.sim-gate {
  margin-top: 10px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(196,138,44,0.28);
  background: linear-gradient(180deg, #FDF8EE 0%, #FBF3E2 100%);
}
.sim-gate .hd {
  display: flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #9A6B1C;
}
.sim-gate .hd .g-wait, .sim-gate .hd .g-ok { display: inline-flex; align-items: center; gap: 7px; }
.sim-gate .hd .g-ok { display: none; }
.sim-gate.is-ok { border-color: rgba(89,192,139,0.35); background: linear-gradient(180deg, #F1FAF4 0%, #E8F6EE 100%); }
.sim-gate.is-ok .hd .g-wait { display: none; }
.sim-gate.is-ok .hd .g-ok { display: inline-flex; color: #1D6B45; }
.sim-gate .g-txt { margin-top: 6px; font-size: 0.8125rem; color: #6B5B39; line-height: 1.55; }
.sim-gate.is-ok .g-txt { color: #2C5A41; }

/* Section divider */
.sim-div {
  display: flex; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #8A97AB;
  margin: 22px 0;
}
.sim-div::before, .sim-div::after {
  content: ''; height: 1px; flex: 1 1 auto;
  background: rgba(10,22,40,0.09);
}

/* Typing indicator */
.sim-typing { display: none; align-items: center; gap: 12px; margin-bottom: 18px; }
.sim-typing.is-on { display: flex; }
.sim-typing .dots { display: inline-flex; gap: 4px; padding: 10px 0 0 46px; }
.sim-typing .dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8A97AB; display: block;
  animation: cs-sim-typing 1s ease-in-out infinite;
}
.sim-typing .dots i:nth-child(2) { animation-delay: 0.15s; }
.sim-typing .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cs-sim-typing {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* Replay row (appears when a run completes) */
.sim-replay {
  display: none;
  align-items: center; gap: 10px;
  margin: 6px 0 2px 46px;
}
.sim-replay.is-on { display: flex; }
.sim-replay button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(10,22,40,0.14);
  background: #fff;
  color: #1A3A6B;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78125rem; font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.sim-replay button:hover { background: #F2F6FC; border-color: rgba(45,125,210,0.35); }
.sim-replay button:active { transform: scale(0.97); }
.sim-replay button:focus-visible { outline: 2px solid #2D7DD2; outline-offset: 2px; }
.sim-replay .hint { font-size: 0.75rem; color: #8A97AB; }

/* Caption below the shell */
.cs-sim-caption {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px;
  font-size: 0.78125rem; color: #5A6A82; line-height: 1.6;
}
.cs-sim-caption .pip {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: #2D7DD2; margin-top: 6px;
}

/* Stacked layout: menu becomes a horizontal chip rail above the chat.
   Only the .cs-sim--stack variant (sim lives in a split column, so the
   sidebar never fits). Small viewports use the 3x2 tile grid in the
   900px media block below instead - deliberately NOT in sync: the
   scroll rail hid options on touch. */
.cs-sim--stack .cs-sim-body { grid-template-columns: 1fr; }
.cs-sim--stack .cs-sim-menu {
  flex-direction: row;
  border-right: 0;
  border-bottom: 1px solid rgba(168,200,240,0.12);
  overflow-x: auto;
  /* Horizontal rail: drop the vertical cap the sidebar layout sets. */
  max-height: none;
  padding: 14px 16px 16px;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.cs-sim--stack .cs-sim-menu-label { display: none; }
.cs-sim--stack .cs-sim-tab { flex: 0 0 auto; width: auto; padding: 10px 12px; }
.cs-sim--stack .cs-sim-tab .d { display: none; }
/* Stacked: the rail is horizontal, so the chat goes back into normal flow
   and sets its own height again. The stage stays RELATIVE (not static):
   it is the containing block for the absolute .sim-idle overlay - static
   would let the overlay stretch over the whole sim and swallow every tap
   on the menu until a run starts. */
.cs-sim--stack .cs-sim-stage { position: relative; min-height: 0; padding: 14px; }
.cs-sim--stack .cs-sim-chat {
  position: static; inset: auto;
  height: clamp(430px, 58vh, 560px);
  padding: 18px 16px 14px;
}
.cs-sim--stack .sim-replay { margin-left: 0; flex-wrap: wrap; }

@media (max-width: 900px) {
  .cs-sim-body { grid-template-columns: 1fr; }
  /* Small viewports: a 3x2 tile grid, not a horizontal scroll rail -
     every workflow visible and tappable at once, no hidden overflow. */
  .cs-sim-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(168,200,240,0.12);
    max-height: none;
    padding: 14px 14px 16px;
  }
  .cs-sim-menu-label { grid-column: 1 / -1; margin: 0 0 2px 2px; }
  .cs-sim-tab {
    width: auto;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 11px 6px 10px;
    text-align: center;
    border-color: rgba(168,200,240,0.10);
    background: rgba(168,200,240,0.04);
  }
  .cs-sim-tab .ic { width: 30px; height: 30px; }
  .cs-sim-tab .t { font-size: 0.72rem; line-height: 1.3; }
  .cs-sim-tab .d { display: none; }
  /* RELATIVE, not static: the stage is the containing block for the
     absolute .sim-idle overlay - static lets the overlay stretch over
     the whole sim and swallow every tap on the menu until a run starts. */
  .cs-sim-stage { position: relative; min-height: 0; padding: 14px; }
  .cs-sim-chat {
    position: static; inset: auto;
    height: clamp(400px, 68vh, 520px);
    padding: 18px 16px 14px;
  }
  .sim-replay { margin-left: 0; flex-wrap: wrap; }
}

/* JS-off: show the first thread as a finished, readable transcript */
html.no-js .cs-sim-menu, html.no-js .cs-sim-status,
html.no-js .sim-typing, html.no-js .sim-replay { display: none; }
html.no-js .cs-sim-body { grid-template-columns: 1fr; }
html.no-js .cs-sim-thread:first-of-type { display: block; }
html.no-js .cs-sim-stage { position: static; min-height: 0; padding: 14px; }
html.no-js .cs-sim-chat { position: static; inset: auto; height: auto; min-height: 0; max-height: none; }
html.no-js .sim-card .st .st-run { display: none; }
html.no-js .sim-card .st .st-ok { display: inline; }
html.no-js .sim-gate .hd .g-wait { display: none; }
html.no-js .sim-gate .hd .g-ok { display: inline-flex; color: #1D6B45; }

/* Reduced motion: no pulses, no waveform bounce; JS shows transcripts instantly */
@media (prefers-reduced-motion: reduce) {
  .cs-sim.is-running .cs-sim-brand .wv i,
  .sim-m.is-speaking .av .wv i,
  .cs-sim.is-running .cs-sim-status .dot,
  .sim-typing .dots i,
  .sim-item.is-shown, .sim-card li.is-on { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   END CS-SIM reversible block
   ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   CS-HERO-VIDEO — walkthrough video in the page-01 hero
   Reversible block: delete to EOF banner to revert.
   ════════════════════════════════════════════════════════════════ */

/* Full-bleed cinematic hero: video runs edge to edge under the nav, masked
   into the dark at its bottom edge, with a brand-blue spill glow beneath.
   Same treatment as the home/healthcare hero, minus the browser chrome. */
.cs-hero--video { padding-bottom: 0; }

/* Desktop: the video is a framed surface inside the site container, matching
   the rounded, rim-lit panels used everywhere else on the site. The frame
   keeps the footage at its native 16:9, so nothing is cropped or zoomed. */
.cs-hero-video-wrap {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 104px auto 0;
  padding: 0 24px;
}

.cs-hero-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0A1628;
  border-radius: 20px;
  border: 1px solid rgba(168,200,240,0.14);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.30),
    0 18px 48px rgba(0,0,0,0.42),
    0 48px 110px rgba(0,0,0,0.40),
    inset 0 1px 0 rgba(255,255,255,0.07);
}
.cs-hero-video-frame mux-player { width: 100%; height: 100%; aspect-ratio: auto; }

/* Soft halo hugging the frame, so it sits in the light rather than on top
   of the background. */
.cs-hero-video-wrap::before {
  content: '';
  position: absolute;
  left: 24px; right: 24px; top: -1px; bottom: -1px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(45,125,210,0.30) 0%, rgba(26,58,107,0.16) 60%, transparent 100%);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}
.cs-hero-video-frame { z-index: 1; }

/* Brand-blue spill glow beneath the frame, casting light onto the
   attribution below and carrying the eye into the page.
   The gradient MUST be centred inside its box and reach transparent before
   every edge. Anchoring it to an edge (at 50% 0%) clips the falloff there,
   and the box then reads as a faint rectangle wherever the video does not
   cover it — which is every desktop/tablet width, since the frame is
   narrower than the viewport. */
.cs-hero-video-wrap::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -190px;
  width: 92%;
  max-width: 1060px;
  height: 480px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 52% 50% at 50% 50%,
      rgba(45,125,210,0.30) 0%,
      rgba(45,125,210,0.11) 38%,
      rgba(168,200,240,0.04) 58%,
      transparent 76%);
  filter: blur(26px);
  pointer-events: none;
  z-index: 0;
}

/* Mobile + tablet: full-bleed, chrome dropped, footage masked into the dark.
   The mask runs long and starts late so its edge never reads as a seam. */
@media (max-width: 1023px) {
  .cs-hero-video-wrap { margin-top: 74px; padding: 0; max-width: none; }
  .cs-hero-video-wrap::before { display: none; }
  .cs-hero-video-frame {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0,0,0,0.72) 80%, rgba(0,0,0,0.28) 93%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 62%, rgba(0,0,0,0.72) 80%, rgba(0,0,0,0.28) 93%, transparent 100%);
  }
  .cs-hero-video-wrap::after { bottom: -230px; width: 108%; max-width: none; }
}

/* Attribution sits below the footage, inside the fade. */
.cs-hero-meta {
  position: relative;
  z-index: 3;
  padding-top: 26px;
  padding-bottom: 64px;
}
.cs-hero-meta .cs-client { margin-top: 14px; font-size: 1.0625rem; }

@media (max-width: 720px) {
  .cs-hero-meta { padding-bottom: 44px; }
  .cs-hero-meta .cs-client { font-size: 0.9375rem; }
}

/* ── Mux player theming (scoped to the case-study pages) ──────── */
mux-player {
  --media-object-fit: cover;
  --controls-backdrop-color: rgba(10, 22, 40, 0.55);
  --media-background-color: #0A1628;
  --media-range-track-background-color: rgba(255, 255, 255, 0.12);
  --media-range-bar-color: #2D7DD2;
  --media-range-thumb-background: #A8C8F0;
  --media-button-icon-color: rgba(255, 255, 255, 0.95);
  --media-button-hover-background: rgba(45, 125, 210, 0.18);
  --media-loading-indicator-color: #2D7DD2;
  --media-play-button-icon-color: rgba(168, 200, 240, 0.95);
  --media-secondary-color: rgba(168, 200, 240, 0.65);
  --media-primary-color: rgba(255, 255, 255, 0.95);
  --media-text-color: rgba(255, 255, 255, 0.95);
  --media-font-family: 'Inter', system-ui, sans-serif;
  --media-menu-background: rgba(10, 22, 40, 0.96);
  --media-menu-text-content-color: rgba(255, 255, 255, 0.92);
  --media-menu-icon-color: rgba(168, 200, 240, 0.92);
  --media-menu-item-hover-background: rgba(45, 125, 210, 0.22);
  --media-menu-border: 1px solid rgba(255, 255, 255, 0.1);
  --media-menu-border-radius: 12px;
  width: 100%;
  height: 100%;
  display: block;
}

/* Silent looping preview: every control chrome-off. */
.hero-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  --controls: none;
  --media-control-bar-display: none;
  --center-controls: none;
  --play-button: none;
  --seek-backward-button: none;
  --seek-forward-button: none;
  --mute-button: none;
  --captions-button: none;
  --fullscreen-button: none;
  --pip-button: none;
  --cast-button: none;
  --airplay-button: none;
  --time-display: none;
  --time-range: none;
  --volume-range: none;
  --rendition-selectmenu: none;
  --loading-indicator: none;
  --media-loading-indicator-display: none;
}
/* Lighter than the small framed preview this is borrowed from: at hero scale
   the original bottom-weighted wash dimmed the subject instead of grading it. */
.hero-video-tint {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 22, 40, 0.10) 0%, rgba(10, 22, 40, 0.34) 100%),
    linear-gradient(135deg, rgba(45, 125, 210, 0.16) 0%, rgba(10, 22, 40, 0) 65%);
  mix-blend-mode: multiply;
}
.hero-video-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.65'/></svg>");
  background-size: 180px 180px;
}
.hero-video-opener {
  position: absolute; inset: 0; z-index: 4;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: pointer; appearance: none; -webkit-appearance: none;
}
.hero-video-opener:focus-visible { outline: 2px solid #A8C8F0; outline-offset: -4px; border-radius: 8px; }

.hero-video-play-cue {
  position: absolute;
  /* Sibling of the frame now, so offsets are wrap-relative: the wrap's
     24px side padding + the old 16px frame inset. */
  top: 16px; right: 40px;
  z-index: 5;
  pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  background: rgba(10, 22, 40, 0.62);
  border: 1px solid rgba(168, 200, 240, 0.32);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transform-origin: top right;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 200ms ease,
    border-color 200ms ease;
}
.hero-video-play-cue__icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0A1628;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.hero-video-play-cue__icon svg { width: 9px; height: 9px; transform: translateX(0.5px); }
.hero-video-play-cue__label {
  font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
}
.cs-hero-video-wrap:has(.hero-video-opener:hover) .hero-video-play-cue,
.cs-hero-video-wrap:has(.hero-video-opener:focus-visible) .hero-video-play-cue {
  transform: scale(0.9) translateY(-1px);
  background: rgba(45, 125, 210, 0.72);
  border-color: rgba(168, 200, 240, 0.7);
}
/* Vertical / full-bleed range (matches the frame's full-bleed treatment
   above): top-right floats awkwardly over the tall crop, so the cue docks
   bottom-centre instead - below the footage's burned-in disclaimer, above
   the attribution. Smaller to match. */
@media (max-width: 1023px) {
  /* Bottom gap on the wrap: the cue docks here, BELOW the footage's
     burned-in disclaimer, and pushes the attribution block down with it.
     The opener spans the wrap, so the gap is part of the tap target. */
  .cs-hero-video-wrap { padding-bottom: 50px; }
  .hero-video-play-cue {
    top: auto; right: auto;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) scale(0.82);
    transform-origin: center bottom;
    padding: 6px 10px 6px 8px;
  }
  .hero-video-play-cue__label { font-size: 0.625rem; letter-spacing: 0.1em; }
  .cs-hero-video-wrap:has(.hero-video-opener:hover) .hero-video-play-cue,
  .cs-hero-video-wrap:has(.hero-video-opener:focus-visible) .hero-video-play-cue {
    transform: translateX(-50%) scale(0.82);
  }
}

/* ── Video lightbox (watch with sound) ───────────────────────── */
.video-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 280ms;
}
.video-lightbox.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
.video-lightbox__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(10, 22, 40, 0.86) 0%, rgba(4, 10, 22, 0.94) 70%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.video-lightbox__panel {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16/9;
  max-height: calc(100vh - 96px);
  border-radius: 18px;
  overflow: hidden;
  background: #0A1628;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 48px 120px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease-out;
}
.video-lightbox.is-open .video-lightbox__panel { transform: scale(1) translateY(0); opacity: 1; }
.video-lightbox__panel mux-player {
  width: 100%; height: 100%;
  --media-gesture-receiver-background: transparent;
  --media-button-hover-background: transparent;
  --media-loading-indicator-icon-background: transparent;
  --controls-background: transparent;
  --controls-backdrop-color: transparent;
}
.video-lightbox__close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(10, 22, 40, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms ease, border-color 200ms ease;
}
.video-lightbox__close:hover {
  background: rgba(45, 125, 210, 0.45);
  border-color: rgba(168, 200, 240, 0.55);
  transform: scale(1.08) rotate(90deg);
}
.video-lightbox__close:focus-visible { outline: 2px solid #A8C8F0; outline-offset: 3px; }
.video-lightbox__close svg { display: block; }
@media (min-width: 768px) {
  .video-lightbox__close { top: 28px; right: 28px; width: 48px; height: 48px; }
}
body.video-lightbox-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .video-lightbox, .video-lightbox__panel, .video-lightbox__close { transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   END CS-HERO-VIDEO reversible block
   ════════════════════════════════════════════════════════════════ */
