/**
 * Shared case study body styles — used by standalone pages (.case)
 * and the carousel (.case-rich inside .cz-page--rich).
 * Typography uses cqi; parents need container-type: inline-size.
 */
:root {
  --case-maxw: 1320px;
  --case-measure: 920px;
  --case-section-y: clamp(20px, 2.6vw, 24px);   /* sections pad top+bottom, so adjacent gap = 2x → ~48px on desktop */
}

@media (max-width: 760px) {
  :root { --gut: 20px; }
}

.case,
.case-rich {
  container-type: inline-size;
}

.case-rich .wrap,
.case .wrap {
  max-width: var(--case-maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
  position: relative;
  z-index: 1;
}

.case-rich .wrap.measure,
.case .wrap.measure {
  max-width: var(--case-measure);
}

.case-rich section,
.case section {
  padding: var(--case-section-y) 0;
  position: relative;
}

/* header */
.case-rich .eyebrow-c,
.case .eyebrow-c {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: block;
  margin-bottom: 8px;
}

.case-rich .meta-strip,
.case .meta-strip {
  margin: 0 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-faint);
}

.case-rich .meta-strip span,
.case .meta-strip span {
  display: inline-flex;
  align-items: center;
}

.case-rich .meta-strip span:not(:last-child)::after,
.case .meta-strip span:not(:last-child)::after {
  content: "·";
  margin: 0 12px;
  color: var(--line);
}

.case-rich .case-h1,
.case .case-h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(33px, 5.6cqi, 66px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 17ch;
  text-wrap: balance;
}

.case-rich .case-h1 em,
.case .case-h1 em {
  font-style: italic;
  color: var(--accent);
}

.case-rich .subtitle,
.case .subtitle {
  font-size: clamp(17px, 2cqi, 21px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.case-rich .subtitle strong,
.case .subtitle strong {
  color: var(--ink);
  font-weight: 500;
}

.case-rich .case-lead,
.case .case-lead {
  margin-top: 26px;
  max-width: 58ch;
}

.case-rich .case-lead .subtitle,
.case .case-lead .subtitle {
  margin-top: 0;
  max-width: none;
}

.case-rich .case-tags,
.case .case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.case-rich .case-tags .tag,
.case .case-tags .tag {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
}

/* figures */
.case-rich .figure,
.case .figure {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg2);
  display: block;
}

.case-rich .figure img,
.case .figure img {
  width: 100%;
  height: auto;
  display: block;
}

.case-rich .figure.placeholder,
.case .figure.placeholder {
  border-style: dashed;
  background: color-mix(in srgb, var(--bg2) 50%, transparent);
  min-height: clamp(220px, 34cqi, 400px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 40px;
}

.case-rich .figure.placeholder .ph-kicker,
.case .figure.placeholder .ph-kicker {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.case-rich .figure.placeholder .ph-note,
.case .figure.placeholder .ph-note {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 42ch;
  line-height: 1.5;
}

/* stat band */
.case-rich .stat-band,
.case .stat-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 760px) {
  .case-rich .stat-band,
  .case .stat-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* phones: the 4-up grid of separate cards stopped reading as one band. Collapse it into a SINGLE
   bordered unit with the four items as divided rows. */
@media (max-width: 560px) {
  .case-rich .stat-band,
  .case .stat-band {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg2) 55%, transparent);
    overflow: hidden;
  }
  /* .stat-band ancestor in the selector so these beat the base .stat rule regardless of source order */
  .case-rich .stat-band .stat,
  .case .stat-band .stat {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 16px 18px;
    gap: 5px;
  }
  .case-rich .stat-band .stat:first-child,
  .case .stat-band .stat:first-child { border-top: 0; }
  .case .stat-band .stat:hover { transform: none; background: transparent; border-color: transparent; }   /* no per-row lift inside the unit */
}

.case-rich .stat,
.case .stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(20px, 2.4cqi, 30px);
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.3s var(--ease-out, ease), background 0.3s ease, transform 0.3s ease;
}

.case .stat:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  transform: translateY(-3px);
}

.case-rich .stat .num,
.case .stat .num {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: clamp(40px, 5.4cqi, 66px);
}

.case-rich .stat .num.text,
.case .stat .num.text {
  font-size: clamp(22px, 2.6cqi, 38px);
  line-height: 1.05;
}

@media (max-width: 760px) {
  .case-rich .stat .num.text,
  .case .stat .num.text {
    font-size: 23px;
  }
}

.case-rich .stat .num em,
.case .stat .num em {
  font-style: italic;
  color: var(--accent);
}

.case-rich .stat .lab,
.case .stat .lab {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.case-rich .stat .lab b,
.case .stat .lab b {
  color: var(--ink);
  font-weight: 500;
}

/* prose */
.case-rich .kicker,
.case .kicker {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.case-rich .case-h2,
.case .case-h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 3.4cqi, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-top: 12px;
  max-width: 20ch;
  text-wrap: balance;
}

.case-rich .prose,
.case .prose {
  margin-top: 20px;
  max-width: 64ch;
}

.case-rich .prose p,
.case .prose p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.case-rich .prose p + p,
.case .prose p + p {
  margin-top: 18px;
}

.case-rich .prose strong,
.case .prose strong {
  color: var(--ink);
  font-weight: 600;
}

/* layers */
.case-rich .layers,
.case .layers {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-rich .layer,
.case .layer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 2.2cqi, 28px);
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 2.2cqi, 26px);
  background: color-mix(in srgb, var(--bg2) 50%, transparent);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.case .layer:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--bg2) 85%, transparent);
}

.case-rich .layer .idx,
.case .layer .idx {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-text);
  padding-top: 5px;
}

.case-rich .layer .l-name,
.case .layer .l-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 2.2cqi, 24px);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.case-rich .layer .l-desc,
.case .layer .l-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 6px;
  max-width: 54ch;
}

/* diagrams */
.case-rich .diagram,
.case .diagram {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 3.4cqi, 40px);
  background: color-mix(in srgb, var(--bg2) 40%, transparent);
}

.case-rich .diagram-scroll svg,
.case .diagram-scroll svg {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
  color: var(--ink-soft);
}

.case-rich .dg-tall svg,
.case .dg-tall svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 360px;
  margin-inline: auto;
  color: var(--ink-soft);
}

/* light: diagrams stack opacity on ink-soft and wash out on cream — use full ink + a solid panel */
[data-theme="light"] .case-rich .diagram,
[data-theme="light"] .case .diagram {
  background: var(--bg2);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
}

[data-theme="light"] .case-rich .diagram-scroll svg,
[data-theme="light"] .case .diagram-scroll svg,
[data-theme="light"] .case-rich .dg-tall svg,
[data-theme="light"] .case .dg-tall svg {
  color: var(--ink);
}

[data-theme="light"] .case-rich .diagram-cap,
[data-theme="light"] .case .diagram-cap {
  color: var(--ink-soft);
}

.case-rich .diagram-scroll,
.case .diagram-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.case-rich .diagram-cap,
.case .diagram-cap {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 16px;
}

/* Accent-coloured SVG label text is small, so it needs the text-safe accent (>=4.5:1).
   Author CSS beats the inline presentation attribute, so this redirects only <text>;
   accent strokes and chip fills keep the brighter --accent (graphics only need 3:1). */
.case-rich .diagram svg text[fill="var(--accent)"],
.case .diagram svg text[fill="var(--accent)"] {
  fill: var(--accent-text);
}

/* skip-to-content link: off-screen until focused (keyboard users) */
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

/* mobile: swap the landscape diagram for a stacked portrait variant (no horizontal scroll).
   Both layouts are inline SVG with the same classes, so the flow-arrow animation applies to both. */
.case-rich .dg-tall,
.case .dg-tall { display: none; }
@media (max-width: 680px) {
  .case-rich .dg-wide,
  .case .dg-wide { display: none; }
  .case-rich .dg-tall,
  .case .dg-tall { display: block; }
  /* portrait diagram fits the width — no horizontal scroll, so no ↔ hint */
}

/* ── Process: one panel where the steps drive the diagram ──────────────
   Numbered steps sit on a connector rail above the flow diagram. Hover or
   focus a step (desktop) or tap it (mobile) to spotlight that phase below.
   No JS: nothing is dimmed, every phase stays legible. */
.case-rich .proc,
:is(.case-rich, .case) .proc {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 3.4cqi, 40px);
  background: color-mix(in srgb, var(--bg2) 40%, transparent);
}

:is(.case-rich, .case) .proc-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 2cqi, 22px);
}
/* the rail that connects the three number badges */
:is(.case-rich, .case) .proc-steps::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 16.66%;
  right: 16.66%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

:is(.case-rich, .case) .proc-step {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0 6px;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.25s ease;
}
:is(.case-rich, .case) .proc-num {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-text);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
:is(.case-rich, .case) .proc-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
:is(.case-rich, .case) .proc-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 2.1cqi, 23px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
:is(.case-rich, .case) .proc-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30ch;
  margin-inline: auto;
}

/* engaged step: fill the badge and lift it off the rail */
:is(.case-rich, .case) .proc-step:hover .proc-num,
:is(.case-rich, .case) .proc-step:focus-visible .proc-num,
:is(.case-rich, .case) .proc-step[aria-pressed="true"] .proc-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}
:is(.case-rich, .case) .proc-step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}
/* when one phase leads, the others recede */
:is(.case-rich, .case) .proc[data-active] .proc-step:not([aria-pressed="true"]):not(:hover) {
  opacity: 0.5;
}

/* the diagram zone shares the panel — drop its own frame, keep a divider */
:is(.case-rich, .case) .proc-diagram {
  margin-top: clamp(20px, 3cqi, 30px);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  padding: clamp(20px, 3cqi, 30px) 0 0;
}

/* phase spotlight: fade the phases that aren't engaged */
:is(.case-rich, .case) .proc-diagram [data-phase] {
  transition: opacity 0.3s ease;
}
:is(.case-rich, .case) .proc[data-active="1"] .proc-diagram [data-phase]:not([data-phase="1"]),
:is(.case-rich, .case) .proc[data-active="2"] .proc-diagram [data-phase]:not([data-phase="2"]),
:is(.case-rich, .case) .proc[data-active="3"] .proc-diagram [data-phase]:not([data-phase="3"]) {
  opacity: 0.18;
}
/* the dashed foundation group sits quiet at rest, lifts when phase 2 leads */
:is(.case-rich, .case) .proc[data-active="2"] .proc-diagram .dg-group {
  opacity: 0.85;
}

/* light: the panel carries the solid surface so the SVG ink doesn't wash out */
[data-theme="light"] .case-rich .proc,
[data-theme="light"] :is(.case-rich, .case) .proc {
  background: var(--bg2);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
}
[data-theme="light"] :is(.case-rich, .case) .proc-diagram {
  background: none;
  border-top-color: color-mix(in srgb, var(--ink) 12%, transparent);
}
[data-theme="light"] :is(.case-rich, .case) .proc-num {
  background: var(--bg2);
}

/* the readout (active step's description) only exists in the mobile tab layout */
:is(.case-rich, .case) .proc-readout { display: none; }

/* mobile, no JS: steps fall back to a stacked left-rail timeline, diagram below */
@media (max-width: 680px) {
  :is(.case-rich, .case) .proc-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }
  :is(.case-rich, .case) .proc-steps::before {
    top: 30px;
    bottom: 30px;
    left: 17px;
    right: auto;
    width: 2px;
    height: auto;
  }
  :is(.case-rich, .case) .proc-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    padding: 12px 0;
  }
  :is(.case-rich, .case) .proc-num { width: 36px; height: 36px; }
  :is(.case-rich, .case) .proc-desc { max-width: none; margin-inline: 0; }

  /* mobile, JS on: compact tab row + one readout, so the panel fits a screen
     and tapping a tab visibly lights up the diagram right below it */
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-steps::before { display: none; }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 12px 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.25s ease, background 0.25s ease;
  }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-step[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, transparent);
  }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-num { width: 30px; height: 30px; }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-name { font-size: 15px; }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-desc { display: none; }
  :is(.case-rich, .case) .proc[data-proc-ready] .proc-readout {
    display: block;
    margin: 14px 0 0;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-soft);
    min-height: 2.6em;   /* hold height steady as the text swaps between tabs */
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.case-rich, .case) .proc-num,
  :is(.case-rich, .case) .proc-step,
  :is(.case-rich, .case) .proc-diagram [data-phase] { transition: none; }
}

/* faq */
.case-rich .faq,
.case .faq {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.case-rich .faq-item,
.case .faq-item {
  border-bottom: 1px solid var(--line);
}

/* accordion: native <details>/<summary>. Collapsed by default; click to open. */
.case-rich .faq-q,
.case .faq-q {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 2.3cqi, 25px);
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
  list-style: none;            /* drop the default disclosure triangle */
  cursor: pointer;
  padding: 22px 40px 22px 0;   /* room on the right for the +/- marker */
  position: relative;
  transition: color 0.2s var(--ease-out, ease);
}
.case-rich .faq-q::-webkit-details-marker,
.case .faq-q::-webkit-details-marker { display: none; }
.case-rich .faq-q:hover,
.case .faq-q:hover { color: var(--accent-text); }
/* +/- marker (rotates the vertical bar away on open) */
.case-rich .faq-q::before,
.case .faq-q::before {
  content: "";
  position: absolute; right: 4px; top: 50%; width: 13px; height: 1.5px; margin-top: -0.75px;
  background: var(--ink-soft); transition: background 0.2s ease;
}
.case-rich .faq-q::after,
.case .faq-q::after {
  content: "";
  position: absolute; right: 10px; top: 50%; width: 1.5px; height: 13px; margin-top: -6.5px;
  background: var(--ink-soft); transition: transform 0.3s var(--ease-out, ease), background 0.2s ease;
  transform-origin: center;
}
.case-rich .faq-item[open] .faq-q::after,
.case .faq-item[open] .faq-q::after { transform: rotate(90deg); }   /* + spins smoothly to - on open */
.case-rich .faq-item[open] .faq-q,
.case .faq-item[open] .faq-q { color: var(--accent-text); }
.case-rich .faq-item[open] .faq-q::before,
.case-rich .faq-item[open] .faq-q::after,
.case .faq-item[open] .faq-q::before,
.case .faq-item[open] .faq-q::after { background: var(--accent); }

/* smooth expand/collapse. The homepage's grid-rows (0fr→1fr) trick needs an indefinite-height
   context, which the native <details> content slot doesn't provide (1fr resolves to 0 inside it),
   so we animate max-height instead — it sizes to content and works inside <details>. The answer
   also fades up on open for the same soft feel as the client list. */
.case-rich .faq-a-wrap,
.case .faq-a-wrap {
  display: block;        /* override the <details> UA display:none-when-closed so max-height can animate */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out, cubic-bezier(.22,1,.36,1));
}
/* JS sets max-height to the exact content height on toggle (perfect easing both ways). This rule is
   the no-JS fallback so the answer still opens without scripting. */
.case-rich .faq-item[open] .faq-a-wrap,
.case .faq-item[open] .faq-a-wrap { max-height: 1000px; }

.case-rich .faq-a,
.case .faq-a {
  margin: 0;
  padding-bottom: 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 66ch;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s 0.06s var(--ease-out, ease), transform 0.45s 0.06s var(--ease-out, ease);
}
.case-rich .faq-item[open] .faq-a,
.case .faq-item[open] .faq-a { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .case-rich .faq-a-wrap, .case .faq-a-wrap,
  .case-rich .faq-a, .case .faq-a { transition: none; }
}

/* cta */
.case-rich .cta-block,
.case .cta-block {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(30px, 5cqi, 60px);
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
}

.case-rich .cta-block h2,
.case .cta-block h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 3.6cqi, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-wrap: balance;
}

.case-rich .cta-block p,
.case .cta-block p {
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-soft);
}

.case-rich .cta,
.case .cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  margin-top: 26px;
  color: var(--bg);
  background: var(--accent);
  padding: 14px 22px;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.case .cta:hover {
  transform: translateY(-3px);
}

.case .cta svg {
  transition: transform 0.35s var(--spring, ease);
}

.case .cta:hover svg {
  transform: translateX(4px);
}

/*
 * Carousel (.cz-page--rich): use --card for type scale instead of cqi.
 * domToCanvas does not resolve container queries the same way as live DOM,
 * which caused headline/body text to look larger during warp than after settle.
 */
.cz-page--rich {
  --u: calc(var(--card, var(--case-maxw)) / 100);
  /* in the carousel, pull the wide blocks (hero, stat band, diagrams, craft proof) in from the card
     edge so they don't stick out as wide — gives each case more breathing room / a bigger visual gap.
     Text stays at --case-measure. Only affects the carousel, not the standalone pages. */
  --case-maxw: 1100px;
}
.cz-page--rich .cp-hero { max-width: 1100px; margin-inline: auto; }

.cz-page--rich .case-rich {
  container-type: normal;
}

/* gap between carousel hero image and case header (was on .tags before header refactor) */
.cz-page--rich .case-rich > .wrap:first-child .eyebrow-c {
  margin-top: clamp(24px, calc(0.03 * var(--card, 1100px)), 40px);
}

.cz-page--rich .case-h1 { font-size: clamp(33px, calc(5.6 * var(--u)), 66px); }
.cz-page--rich .subtitle { font-size: clamp(17px, calc(2 * var(--u)), 21px); }
.cz-page--rich .figure.placeholder { min-height: clamp(220px, calc(34 * var(--u)), 400px); }
.cz-page--rich .stat { padding: clamp(20px, calc(2.4 * var(--u)), 30px); }
.cz-page--rich .stat .num { font-size: clamp(40px, calc(5.4 * var(--u)), 66px); }
.cz-page--rich .stat .num.text { font-size: clamp(22px, calc(2.6 * var(--u)), 38px); }
.cz-page--rich .case-h2 { font-size: clamp(26px, calc(3.4 * var(--u)), 40px); }
.cz-page--rich .layers { gap: clamp(16px, calc(2.2 * var(--u)), 28px); }
.cz-page--rich .layer { padding: clamp(18px, calc(2.2 * var(--u)), 26px); }
.cz-page--rich .layer .l-name { font-size: clamp(19px, calc(2.2 * var(--u)), 24px); }
.cz-page--rich .diagram { padding: clamp(22px, calc(3.4 * var(--u)), 40px); }
.cz-page--rich .faq-q { font-size: clamp(19px, calc(2.3 * var(--u)), 25px); }
.cz-page--rich .cta-block { padding: clamp(30px, calc(5 * var(--u)), 60px); }
.cz-page--rich .cta-block h2 { font-size: clamp(26px, calc(3.6 * var(--u)), 42px); }

/* diagram flow: march the solution-diagram connectors (the ones with arrowheads) toward their arrow,
   so the token pipeline reads as a live flow. The "before" diagram has no marker-end connectors, so it
   stays static (dead) — the contrast tells the story. Reduced-motion users get the static solid lines. */
@media (prefers-reduced-motion: no-preference) {
  .diagram svg path[marker-end],
  .diagram svg line[marker-end] {
    stroke-dasharray: 5 6;
    animation: cz-diagram-flow 1.3s linear infinite;
  }
  @keyframes cz-diagram-flow {
    from { stroke-dashoffset: 11; }
    to   { stroke-dashoffset: 0; }
  }
}
