/* Case study article page. Scoped under .case-study so its own h1/h2/h3/section/p
   rules and renamed .cs-hero/.cs-eyebrow classes can't leak onto nav/footer/cookie
   banner or collide with the homepage's .hero/.eyebrow components, which use the
   same class names for a completely different layout. Reuses tokens and the
   [data-reveal] scroll-reveal mechanism already defined in style.css; no need to
   redeclare either here. */

.case-study {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px 140px;
}

.case-study .prose {
  max-width: 700px;
  margin: 0 auto;
}

.case-study .wide {
  max-width: 920px;
  margin: 0 auto;
}

/* ---- Hero ---- */
.case-study .cs-hero {
  padding: clamp(64px, 12vw, 120px) 0 64px;
}

.case-study .cs-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}

.case-study h1 {
  font-size: clamp(38px, 5.6vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  text-wrap: balance;
  max-width: 18ch;
}

.case-study .cs-hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 48px;
}

/* ---- Transform strip (chat -> ledger) ---- */
.case-study .transform {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.case-study .transform-arrow {
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

.case-study .bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.case-study .ledger {
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.case-study .ledger .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.case-study .ledger .k { color: var(--text-faint); }
.case-study .ledger .accent-value { color: var(--accent); font-weight: 600; }

@media (max-width: 640px) {
  .case-study .transform { grid-template-columns: 1fr; }
  .case-study .transform-arrow { transform: rotate(90deg); justify-self: center; }
}

/* ---- Summary callout ---- */
.case-study .summary-block {
  max-width: 700px;
  margin: 0 auto 8px;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.case-study .summary-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.case-study .summary-text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  max-width: none;
  margin-bottom: 0;
}

/* ---- Sections ---- */
.case-study section {
  padding: clamp(48px, 8vw, 100px) 0;
  border-top: 1px solid var(--border);
}

.case-study .cs-hero + section { border-top: none; padding-top: 0; }

.case-study h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 24px;
}

.case-study h3 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  text-wrap: balance;
}

.case-study h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.case-study p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 66ch;
  margin: 0 0 16px;
}

.case-study strong { color: var(--text); font-weight: 600; }

/* ---- Snapshot facts ---- */
.case-study .facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 28px 0 0;
}

.case-study .fact {
  background: var(--bg-alt);
  padding: 20px 22px;
}

.case-study .fact .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.case-study .fact .value {
  font-size: 15.5px;
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 640px) {
  .case-study .facts { grid-template-columns: 1fr; }
}

/* ---- Chapter blocks (the two workflows) ---- */
.case-study .chapter {
  margin-top: 32px;
  padding: 32px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.case-study .chapter-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(52, 80, 255, 0.14);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.case-study .chapter ul {
  margin: 20px 0 4px;
  padding: 0;
  list-style: none;
}

.case-study .chapter li {
  font-size: 15px;
  color: var(--text-muted);
  padding: 12px 0 12px 24px;
  border-top: 1px solid var(--border);
  position: relative;
  line-height: 1.55;
}

.case-study .chapter li:first-of-type { border-top: none; padding-top: 0; }

.case-study .chapter li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--accent);
  font-weight: 700;
}

.case-study .chapter li:first-of-type::before { top: 0; }

.case-study .chapter li strong { color: var(--text); }

/* ---- Q&A list (Data & Security) ---- */
.case-study .qa-list { margin-top: 4px; }

.case-study .qa-item {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.case-study .qa-item:first-child { border-top: none; padding-top: 0; }

.case-study .qa-item h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  text-wrap: initial;
  margin: 0 0 6px;
}

.case-study .qa-item p { margin-bottom: 0; }

.case-study .qa-item a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.case-study .qa-item a:hover { text-decoration-color: var(--accent); }

/* ---- Value grid ---- */
.case-study .grid3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .case-study .grid3 { grid-template-columns: 1fr; }
}

.case-study .value-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}

.case-study .value-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
}
.case-study .value-card p { font-size: 14.5px; margin-bottom: 0; }

/* ---- Impact list ---- */
.case-study .impact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.case-study .impact-list li {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 18px 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
}

.case-study .impact-list li:first-child { border-top: none; padding-top: 0; }

.case-study .impact-mark {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ---- Diagram ---- */
.case-study .diagram-wrap {
  overflow-x: auto;
  margin: 8px -4px 0;
  padding: 4px;
}

.case-study .diagram-wrap svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.case-study .diagram-wrap .node-label {
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--text);
}

.case-study .diagram-wrap .node-sub {
  font-size: 10.5px;
  fill: var(--text-faint);
}

.case-study .diagram-wrap .lane-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--text-faint);
  font-weight: 600;
}

.case-study .diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-faint);
}

.case-study .diagram-legend span { display: inline-flex; align-items: center; gap: 8px; }

.case-study .legend-mark {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--text-faint);
}

.case-study .legend-mark.dashed { border-top-style: dashed; border-top-color: var(--text-muted); }
.case-study .legend-mark.accent { border-top-color: var(--accent); border-top-width: 2.5px; }

.case-study .diagram-wrap .node-rect {
  fill: var(--bg-alt);
  stroke: var(--border-strong);
  stroke-width: 1;
}

.case-study .diagram-wrap .node-rect.review {
  fill: var(--bg);
  stroke: var(--text-faint);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}

.case-study .diagram-wrap .node-rect.hub {
  fill: var(--accent-dim);
  stroke: var(--accent);
  stroke-width: 1.4;
}

.case-study .diagram-wrap .edge { fill: none; stroke: var(--border-strong); stroke-width: 1.4; }
.case-study .diagram-wrap .edge.review { stroke: var(--text-faint); stroke-dasharray: 4 3; }
.case-study .diagram-wrap .edge.accent { stroke: var(--accent); stroke-width: 1.8; }

.case-study #mk-neutral path { fill: var(--border-strong); }
.case-study #mk-review path { fill: var(--text-faint); }
.case-study #mk-accent path { fill: var(--accent); }

/* ---- Stack strip ---- */
.case-study .stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.case-study .stack span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---- CTA ---- */
.case-study .cs-cta { padding-top: clamp(48px, 8vw, 100px); }

.case-study .cs-cta h3 { font-size: clamp(26px, 3.6vw, 36px); }

.case-study .cs-cta-note {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 28px;
}
