/**
 * Structured case-study detail — mobile first.
 */
.case-detail {
  --case-color: var(--cyan);
  background: var(--cloud);
  color: var(--charcoal);
}
.case-detail.engine-performance { --case-color: var(--amber); }
.case-detail.engine-automate { --case-color: var(--violet); }
.case-detail-hero {
  padding: 24px 0 36px;
  background:
    radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--case-color) 13%, transparent), transparent 36%),
    var(--navy);
  color: var(--cloud);
}
.case-back {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--text-2);
  font-size: 0.8rem;
}
.case-back:hover { color: var(--case-color); }
.case-detail-hero-grid {
  display: grid;
  gap: 22px;
  align-items: start;
}
.case-detail-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.case-client-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(200px, 52vw);
  padding: 7px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(7, 27, 51, 0.08);
}
.case-client-logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 36px;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.case-detail-labels .case-capability,
.case-detail-labels .case-industry,
.case-detail-labels .case-kind {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.case-detail-labels a.case-capability:hover,
.case-detail-labels a.case-industry:hover {
  filter: brightness(1.12);
}
.case-detail-labels .case-capability {
  background: var(--case-color);
  color: var(--navy);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.case-detail.engine-automate .case-detail-labels .case-capability { color: #fff; }
.case-detail-labels .case-industry {
  color: var(--cloud);
  background: color-mix(in srgb, var(--cloud) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--cloud) 28%, transparent);
  letter-spacing: 0;
}
.case-detail-labels a.case-industry:hover {
  background: color-mix(in srgb, var(--cloud) 24%, transparent);
}
.case-detail-labels .case-kind {
  color: var(--text-3);
  background: transparent;
  padding-inline: 0;
  font-size: 0.72rem;
  font-weight: 600;
}
.case-detail-hero h1 {
  margin: 0 0 13px;
  font-size: clamp(1.7rem, 7vw, 2.85rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.case-detail-hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: var(--text-2);
  line-height: 1.75;
}
.case-detail-hero .case-visual {
  min-height: 0;
  border-radius: 12px;
  background: #f3f6f9;
  overflow: hidden;
}
.case-detail-hero .case-visual--detail::after {
  display: none;
}
.case-visual-caption {
  margin: 10px 0 0;
  color: var(--text-3);
  font-size: 0.78rem;
  line-height: 1.55;
}
.case-detail-hero .case-visual-caption {
  color: color-mix(in srgb, var(--cloud) 72%, transparent);
}
.case-work-lead,
.case-outcome-lead {
  margin: 0 0 12px;
  color: inherit;
  font-size: 1rem;
  line-height: 1.55;
}
.case-detail-hero .case-visual img,
.case-detail-hero .case-visual-img--detail {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  object-fit: unset;
  object-position: center top;
  background: #f3f6f9;
}
.case-detail-hero .case-visual video,
.case-detail-hero .case-visual .case-video-embed {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: contain;
  background: var(--navy);
}
.case-video-embed {
  aspect-ratio: 16 / 9;
  min-height: 12rem;
  overflow: hidden;
  border-radius: inherit;
  background: #000;
}
.case-video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.case-scroll-viewer {
  display: grid;
  gap: 8px;
}
.case-scroll-frame {
  overflow: auto;
  max-height: min(58vh, 460px);
  border-radius: 12px;
  background: #eef2f6;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.case-scroll-viewer.is-expanded .case-scroll-frame {
  max-height: min(82vh, 860px);
}
.case-scroll-frame:focus-visible {
  outline: 2px solid var(--case-color, var(--cyan));
  outline-offset: 2px;
}
.case-visual-img--scroll {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: unset !important;
}
.case-scroll-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}
.case-scroll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-scroll-hint {
  margin: 0;
  color: color-mix(in srgb, var(--cloud) 70%, transparent);
  font-size: 0.78rem;
}
.case-scroll-expand {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--cloud) 28%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--cloud);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.case-scroll-expand:hover,
.case-scroll-expand:focus-visible {
  border-color: var(--cloud);
  outline: none;
}
.case-visual-img--scroll {
  cursor: zoom-in;
}
.case-proof-frame--zoomable {
  position: relative;
}
.case-proof-zoom {
  position: absolute;
  inset-inline-start: 10px;
  inset-block-end: 10px;
  background: color-mix(in srgb, var(--navy) 82%, transparent);
  color: var(--cloud);
  border-color: color-mix(in srgb, var(--cloud) 35%, transparent);
}
.case-image-lightbox {
  width: min(96vw, 1200px);
  max-width: 96vw;
  height: min(92vh, 900px);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #0b1220;
  color: var(--cloud);
  overflow: hidden;
}
.case-image-lightbox::backdrop {
  background: color-mix(in srgb, #020617 72%, transparent);
}
.case-image-lightbox__bar {
  display: flex;
  justify-content: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--cloud) 16%, transparent);
}
.case-image-lightbox__close {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--cloud) 28%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--cloud);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.case-image-lightbox__stage {
  height: calc(100% - 48px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f7fafc;
}
.case-image-lightbox__img {
  display: block;
  width: auto;
  max-width: none;
  min-width: 100%;
  height: auto;
  margin: 0 auto;
}
.case-detail-metrics {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff;
  color: var(--charcoal);
  box-shadow: 0 18px 45px -32px rgba(7, 27, 51, 0.9);
}
.case-detail-metrics div {
  padding: 16px 8px;
  text-align: center;
}
.case-detail-metrics div + div { border-inline-start: 1px solid #e2e8ee; }
.case-detail-metrics strong {
  display: block;
  color: var(--navy);
  font: 800 clamp(1rem, 4vw, 1.5rem) var(--font-display);
  direction: ltr;
}
.case-detail-metrics span,
.case-detail-metrics small {
  display: block;
  color: #637181;
  font-size: 0.62rem;
}
.case-proof-gallery {
  padding-top: 38px;
}
.case-proof-html {
  padding: 28px 0 8px;
  background: var(--cloud);
}
.case-proof-html-head {
  max-width: 720px;
  margin: 0 0 18px;
}
.case-proof-html-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.45rem, 5vw, 2rem);
}
.case-proof-html-frame {
  display: block;
  width: 100%;
  min-height: 78vh;
  height: 900px;
  border: 1px solid #dce4eb;
  border-radius: 12px;
  background: #f7f8fb;
}
.case-proof-jump {
  display: inline-flex;
  margin-top: 18px;
  color: var(--case-color);
  font-weight: 700;
  font-size: 0.92rem;
}
.case-detail-hero-grid--proof {
  grid-template-columns: 1fr;
  max-width: 720px;
}
.case-proof-gallery header {
  max-width: 940px;
  margin: 0 auto 18px;
}
.case-proof-gallery h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.5rem, 6vw, 2.1rem);
}
.case-proof-gallery-grid {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin-inline: auto;
}
.case-proof-gallery figure {
  margin: 0;
}
.case-proof-gallery img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border: 0;
  background: transparent;
}
.case-proof-gallery figcaption {
  padding-top: 8px;
  color: #657383;
  font-size: 0.76rem;
}
.case-proof-frame {
  overflow: hidden;
  border: 1px solid #dce4eb;
  border-radius: 12px;
  background: #f7fafc;
}
.case-proof-figure--tall .case-scroll-viewer {
  border: 1px solid #dce4eb;
  border-radius: 12px;
  background: #f7fafc;
}
.case-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.case-detail-body {
  padding-top: 40px;
  padding-bottom: 54px;
}
.case-story-block {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  max-width: 940px;
  margin-inline: auto;
  padding: 30px 0;
  border-bottom: 1px solid #dde5ec;
}
.case-story-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--case-color);
}
.case-story-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.case-story-kicker {
  margin: 0 0 4px !important;
  color: #8b650f !important;
  font-size: 0.7rem !important;
  font-weight: 700;
}
.case-story-block h2,
.case-process h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(1.5rem, 6vw, 2.1rem);
}
.case-story-block p {
  margin: 0;
  color: #536174;
  line-height: 1.75;
}
.case-check-list {
  display: grid;
  gap: 8px;
}
.case-check-list li {
  position: relative;
  padding-inline-start: 22px;
  color: #536174;
  line-height: 1.65;
}
.case-check-list li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: #008bbd;
  font-weight: 800;
}
.case-inline-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}
.case-inline-metrics span {
  padding: 10px 6px;
  border-block: 1px solid #dce4eb;
  color: #637181;
  font-size: 0.65rem;
  text-align: center;
}
.case-inline-metrics strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  direction: ltr;
}
.case-process {
  max-width: 940px;
  margin-inline: auto;
  padding: 38px 0;
  border-bottom: 1px solid #dde5ec;
}
.case-process > header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.case-process > header p { margin: 0; }
.case-process ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.case-process li {
  position: relative;
  padding: 17px 58px 17px 14px;
  border: 1px solid #dce4eb;
  border-radius: 8px;
  background: #fff;
}
.case-process li > span {
  position: absolute;
  inset: 17px 15px auto auto;
  color: var(--case-color);
  font: 800 0.78rem var(--font-display);
}
.case-process h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1rem;
}
.case-process li p {
  margin: 0;
  color: #657383;
  font-size: 0.82rem;
}
.case-editor-content {
  max-width: 780px;
  margin: 32px auto 0;
  color: #536174;
}
.case-related {
  padding: 52px 0 64px;
  background: #edf2f6;
}
.case-related h2 {
  margin: 0 0 22px;
  color: var(--navy);
  font-size: clamp(1.8rem, 7vw, 2.8rem);
}
.case-related-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .case-detail-hero { padding: 38px 0 48px; }
  .case-detail-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 36px;
  }
  .case-detail-hero .case-visual {
    min-height: 0;
    border-radius: 14px;
    box-shadow: 0 22px 50px -36px rgba(0, 0, 0, 0.55);
  }
  .case-detail-hero .case-visual img,
  .case-detail-hero .case-visual-img--detail {
    min-height: 0;
    max-height: none;
  }
  .case-scroll-frame {
    max-height: min(64vh, 560px);
  }
  .case-scroll-viewer.is-expanded .case-scroll-frame {
    max-height: min(84vh, 920px);
  }
  .case-detail-metrics {
    width: min(780px, 88%);
    margin: -1px auto 0;
    transform: translateY(42%);
    border-radius: 10px;
  }
  .case-detail-metrics div { padding: 20px 12px; }
  .case-proof-gallery { padding-top: 74px; }
  .case-proof-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .case-proof-gallery-grid figure:only-child {
    grid-column: 1 / -1;
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
  }
  .case-detail-body { padding-top: 90px; }
  .case-detail:not(:has(.case-detail-metrics)) .case-detail-body { padding-top: 58px; }
  .case-story-block {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 28px;
    padding: 42px 0;
  }
  .case-story-icon {
    width: 82px;
    height: 82px;
  }
  .case-story-icon svg { width: 40px; height: 40px; }
  .case-process > header {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 28px;
  }
  .case-process ol {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
  }
  .case-process li {
    min-height: 155px;
    padding: 50px 16px 20px;
    border-radius: 0;
  }
  .case-process li:first-child { border-radius: 0 8px 8px 0; }
  .case-process li:last-child { border-radius: 8px 0 0 8px; }
  .case-process li + li { border-inline-start: 0; }
  .case-process li > span { inset: 17px 16px auto auto; }
  .case-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  .case-card--related {
    display: flex;
    flex-direction: column;
  }
  .case-card--related .case-visual {
    min-height: 180px;
    aspect-ratio: 16 / 9;
  }
  .case-card--related .case-card-body { flex: 1; }
}
