/* =========================================================================
   Case study pages — component library
   Loaded alongside styles.css. Inherits all :root tokens.
   Editorial layout: asymmetric hero, numbered chapters, generous spacing.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Page-level interactions
   - Smooth scroll + scroll-padding so anchored sections don't jam to the top
   - View Transitions API for cross-page fades (Chrome 126+)
   ------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* -------------------------------------------------------------------------
   Reading progress bar — fixed top hairline, fills with scroll
   ------------------------------------------------------------------------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  /* Subtle track so the bar is visible even before scrolling */
  background: rgba(0, 0, 0, 0.05);
  z-index: 100;
  pointer-events: none;
}

.reading-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 80ms linear;
}

/* -------------------------------------------------------------------------
   Figure entry animation — fade-up as figures scroll into view.
   Visible-by-default. JS adds .is-pending-entry to hide them initially,
   then removes it on scroll-in. If JS or IO fails, figures show normally.
   ------------------------------------------------------------------------- */
.case-figure,
.case-before-after,
.case-stats {
  transition: opacity 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.case-figure.is-pending-entry,
.case-before-after.is-pending-entry,
.case-stats.is-pending-entry {
  opacity: 0;
  transform: translateY(24px);
}

@media (prefers-reduced-motion: reduce) {
  .case-figure,
  .case-before-after,
  .case-stats {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   Chapter anchor trigger — click .num to copy deep link
   ------------------------------------------------------------------------- */
.case-body h2 .num.is-anchor-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: color 0.18s var(--ease);
}

.case-body h2 .num.is-anchor-trigger::after {
  content: "#";
  font-size: 0.92em;
  opacity: 0.35;
  transform: translateX(-2px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), color 0.18s var(--ease);
}

.case-body h2 .num.is-anchor-trigger:hover::after,
.case-body h2 .num.is-anchor-trigger:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--ink);
}

.case-body h2 .num.is-anchor-trigger:hover,
.case-body h2 .num.is-anchor-trigger:focus-visible {
  color: var(--ink);
  outline: none;
}

.case-body h2 .num.is-anchor-trigger.is-copied::after {
  content: "Copied";
  opacity: 1;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgb(29, 158, 117);
  transform: translateX(0);
}

/* -------------------------------------------------------------------------
   Reading time pill — sits in the hero meta strip
   ------------------------------------------------------------------------- */
.case-hero-readtime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-top: 12px;
  background: var(--g50);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--g500);
  width: fit-content;
}

.case-hero-readtime::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--g400);
}

/* -------------------------------------------------------------------------
   Image lightbox — click any figure to expand
   ------------------------------------------------------------------------- */
.case-figure {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(22, 21, 19, 0.86);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: min(1400px, 92vw);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.96);
  transition: transform 320ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.is-open .lightbox-content {
  transform: scale(1);
}

.lightbox-content > * {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.lightbox-content img,
.lightbox-content video {
  width: auto;
  height: auto;
  display: block;
  background: var(--bg);
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.18s;
  z-index: 201;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

/* -------------------------------------------------------------------------
   Before/after slider — drag handle to reveal V1 → V2
   Specificity bumped with .case-body > parent because the base
   .case-body > .case-before-after grid rule outranks .is-slider alone.
   ------------------------------------------------------------------------- */
.case-body > .case-before-after.is-slider {
  display: block;
  position: relative;
  width: auto;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  margin: 56px 0;
  padding: 0;
}

.case-body > .case-before-after.is-slider .case-before-after-side {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  display: block;
}

.case-body > .case-before-after.is-slider .case-before-after-side .case-before-after-image {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 0;
  border: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.case-body > .case-before-after.is-slider .case-before-after-label {
  position: absolute;
  top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: white;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 100px;
  margin: 0;
  z-index: 4;
}

.case-body > .case-before-after.is-slider .case-before-after-side:nth-child(1) {
  z-index: 1;
}

.case-body > .case-before-after.is-slider .case-before-after-side:nth-child(1) .case-before-after-label {
  left: 16px;
}

.case-body > .case-before-after.is-slider .case-before-after-side:nth-child(2) {
  z-index: 2;
  clip-path: inset(0 0 0 var(--slider-pos, 50%));
}

.case-body > .case-before-after.is-slider .case-before-after-side:nth-child(2) .case-before-after-label {
  right: 16px;
}

.case-body > .case-before-after.is-slider .case-before-after-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 3;
  pointer-events: none;
}

/* Knob is a sibling of the handle (not nested), positioned at the same
   slider-pos so left:50% works against the slider, not the 2px handle. */
.case-body > .case-before-after.is-slider .case-before-after-slider-knob {
  position: absolute;
  top: 50%;
  left: var(--slider-pos, 50%);
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 4;
  transition: transform 0.15s var(--ease);
}

.case-before-after-slider-knob::before {
  content: "⇆";
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
}

.case-before-after.is-slider:hover .case-before-after-slider-knob {
  transform: scale(1.06);
}

.case-before-after.is-slider.is-dragging .case-before-after-slider-knob {
  transform: scale(1.12);
}

/* -------------------------------------------------------------------------
   Command palette (⌘K)
   ------------------------------------------------------------------------- */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 21, 19, 0.4);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cmdk {
  position: fixed;
  top: 20vh;
  left: 50%;
  width: min(560px, 90vw);
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.98);
  transition: opacity 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cmdk-backdrop.is-open,
.cmdk.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cmdk.is-open {
  transform: translate(-50%, 0) scale(1);
}

.cmdk-input {
  display: block;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  outline: none;
}

.cmdk-input::placeholder {
  color: var(--g400);
}

.cmdk-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
  margin: 0;
  list-style: none;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: background 0.12s;
}

.cmdk-item:hover,
.cmdk-item.is-active {
  background: var(--g50);
}

.cmdk-item-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--g500);
  min-width: 24px;
  font-feature-settings: "tnum";
}

.cmdk-item-title {
  flex: 1;
}

.cmdk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--g500);
}

.cmdk-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--g50);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--ink);
  margin: 0 2px;
}

.cmdk-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--g500);
}

/* Hide cmdk visually but keep accessible to keyboard */
.cmdk[hidden] {
  display: none;
}

/* -------------------------------------------------------------------------
   Floating chapter indicator — bottom-left, appears while scrolling,
   fades out 1.5s after scroll stops. Subtle nav aid.
   ------------------------------------------------------------------------- */
.chapter-indicator {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(22, 21, 19, 0.94);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-width: calc(100vw - 64px);
}

.chapter-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chapter-indicator-num {
  font-feature-settings: "tnum";
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
}

.chapter-indicator-title {
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

@media (max-width: 768px) {
  .chapter-indicator {
    bottom: 20px;
    left: 20px;
  }
  .chapter-indicator-title {
    max-width: 200px;
  }
}


:root {
  /* Type — case study scale (reading + editorial moments) */
  --case-h1: 96px;        /* the BIG-NUMBER hero, not the title */
  --case-title: 28px;
  --case-h2: 20px;
  --case-h3: 16px;
  --case-body: 17px;
  --case-lede: 18px;
  --case-meta-label: 10px;
  --case-meta-value: 13px;
  --case-caption: 12px;
  --case-quote: 24px;
  --case-stat: 40px;

  --reading-w: 680px;
  --case-pad-x: 40px;
  --case-page-max: 1200px;
}

/* -------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------- */
.case-page {
  background: var(--bg);
  color: var(--ink);
  /* Case studies use Google Sans Flex (loaded via Google Fonts in <head>).
     Falls back to system fonts if the network fails. Landing keeps system
     fonts intentionally — separate registers for separate jobs. */
  font-family: "Google Sans Flex", -apple-system, BlinkMacSystemFont, "system-ui", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding: 0 var(--case-pad-x) 120px;
}

.case-shell {
  max-width: var(--case-page-max);
  margin: 0 auto;
}

/* -------------------------------------------------------------------------
   Top strip — magazine-header treatment
   Case index on left, project name on right, hairline below
   ------------------------------------------------------------------------- */
.case-topstrip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 24px;
  border-bottom: var(--hairline);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
  font-feature-settings: "tnum";
}

.case-topstrip a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.case-topstrip a:hover {
  color: var(--ink);
}

.case-topstrip-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.case-topstrip-arrow {
  display: inline-block;
  transition: transform 0.18s var(--ease);
}

.case-topstrip a:hover .case-topstrip-arrow {
  transform: translateX(-2px);
}

.case-topstrip-divider {
  color: var(--g400);
}

/* -------------------------------------------------------------------------
   Hero — asymmetric, full content width.
   Text-stage on the left (max 680). Vertical meta strip on the right.
   This is the pattern we follow for the body too: text-left, full-width.
   ------------------------------------------------------------------------- */
.case-hero {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 64px;
  padding: 96px 0 72px;
  align-items: end;
}

.case-hero-stage {
  max-width: var(--reading-w);
}

.case-hero-overline {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
}

.case-hero-bignum {
  margin: 0 0 12px;
  font-size: var(--case-h1);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-feature-settings: "tnum";
}

.case-hero-bignum-suffix {
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--g500);
  margin-left: 6px;
  vertical-align: 0.1em;
}

.case-hero-subline {
  margin: 0 0 56px;
  font-size: var(--case-lede);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--g500);
  max-width: 520px;
}

.case-hero-title {
  margin: 0 0 16px;
  font-size: var(--case-title);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.case-hero-lede {
  margin: 0;
  font-size: var(--case-lede);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--g500);
  max-width: 520px;
}

/* Right column — vertical metadata strip */
.case-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 8px;
}

.case-hero-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-hero-meta-label {
  font-size: var(--case-meta-label);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
}

.case-hero-meta-value {
  font-size: var(--case-meta-value);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.3;
}

/* -------------------------------------------------------------------------
   Body — CSS Grid with named columns for breakout figures.
   Reading column stays narrow (680px) for prose. Figures opt-into wider
   columns explicitly: wide (~960px) or full (1200px / case-page-max).
   The grid is the parent's full available width; columns let children
   choose how much room they need.
   ------------------------------------------------------------------------- */
/* Body: text-left, figures full-width.
   Two grid columns — text-content anchored LEFT (640), then 1fr to the right.
   Default children sit in the text column. Figures span the full grid. */
.case-body {
  display: grid;
  grid-template-columns:
    [content-start] min(var(--reading-w), 100%) [content-end]
    minmax(0, 1fr) [full-end];
  padding-top: 56px;
  border-top: var(--hairline);
}

.case-body > * {
  grid-column: content-start / content-end;
}

.case-body > * + * {
  margin-top: 24px;
}

/* Numbered chapter section heads — number above title, editorial */
.case-body h2 {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 96px 0 32px;
  padding: 0;
}

.case-body h2 .num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g500);
  font-feature-settings: "tnum";
}

.case-body h2 .title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--ink);
}

.case-body h2:first-child {
  margin-top: 0;
}

.case-body h3 {
  margin: 40px 0 12px;
  font-size: var(--case-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.case-body p,
.case-body li {
  font-size: var(--case-body);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.case-body p {
  margin: 0;
}

.case-body strong {
  font-weight: 600;
}

.case-body em {
  font-style: italic;
  font-weight: 500;
}

.case-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-body ul li {
  position: relative;
  padding-left: 22px;
}

.case-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--g400);
}

.case-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--g400);
  text-underline-offset: 3px;
}

.case-body a:hover {
  text-decoration-color: var(--ink);
}

/* -------------------------------------------------------------------------
   Callout — for "Design implication —", "Key Insight —", etc.
   ------------------------------------------------------------------------- */
.case-callout {
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--ink);
}

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

.case-callout-body {
  margin: 0;
  font-size: var(--case-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
}

/* -------------------------------------------------------------------------
   Pull quote — used sparingly, max one per page
   Distinctive treatment: italic, oversized, generous whitespace
   ------------------------------------------------------------------------- */
.case-quote {
  max-width: var(--reading-w);
  margin: 64px 0;
  padding: 0;
  font-size: var(--case-quote);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink);
  border: 0;
}

/* Closing pull quote — when .case-quote is the last element inside a
   .case-body, treat it as the closer. Centered + larger + slightly
   heavier creates visual contrast against left-aligned body copy
   so the reader's eye stops on it. A short ink-color rule above
   replaces the heavy <hr class="case-rule" /> that used to sit
   before the closer — same structural signal, no surrounding void.

   Spans content-start / full-end so the centering happens against
   the full page width, not the reading column. */
.case-body > .case-quote:last-child {
  grid-column: content-start / full-end;
  text-align: center;
  max-width: 32ch;
  margin: 96px auto 0;
  padding-top: 40px;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.3;
  letter-spacing: -0.018em;
  position: relative;
}

.case-body > .case-quote:last-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--ink);
}

/* -------------------------------------------------------------------------
   Decision log — vertical stack of strategic calls (Stopped / Deferred /
   Gap, or any custom status). Each entry has a large status marker on the
   left and content on the right. Stopped titles get a strikethrough so
   the typography embodies the status. Reads like a documented record,
   not three card boxes.

   Used in: Flights Seats Vision (§05 tradeoffs), Scenra (§04 decline list).
   ------------------------------------------------------------------------- */
.case-body > .case-decisions {
  grid-column: content-start / full-end;
  display: flex;
  flex-direction: column;
  margin: 32px 0;
  border-top: var(--hairline);
}

.case-decision {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: start;
  padding: 32px 0;
  border-bottom: var(--hairline);
}

.case-decision-marker {
  font-size: 48px;
  line-height: 1;
  color: var(--ink);
  font-weight: 300;
  text-align: center;
  user-select: none;
  /* No margin-top: the 48px marker is taller than status+gap+title
     combined, so with align-items: start the symbol glyph's visual
     centre naturally sits in the gap between the status label and
     the title — exactly the "between the texts" position. */
}

.case-decision--stopped .case-decision-marker {
  color: var(--g400);
}

.case-decision--gap .case-decision-marker {
  color: var(--g400);
  font-weight: 200;
}

.case-decision-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-decision-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g500);
  font-feature-settings: "tnum";
}

.case-decision-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

/* Stopped: title is literally struck through.
   The typography embodies the status. */
.case-decision--stopped .case-decision-title {
  text-decoration: line-through;
  text-decoration-color: var(--g500);
  text-decoration-thickness: 2px;
  text-underline-offset: 0;
  color: var(--g500);
}

.case-decision-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  margin: 4px 0 0;
  max-width: 60ch;
}

@media (max-width: 720px) {
  .case-decision {
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  .case-decision-marker {
    font-size: 32px;
  }
  .case-decision-title {
    font-size: 19px;
  }
}

/* -------------------------------------------------------------------------
   Tables — hairline horizontals only, tabular numerals, editorial
   ------------------------------------------------------------------------- */
.case-table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  font-size: 14px;
  font-feature-settings: "tnum";
}

.case-table th,
.case-table td {
  padding: 14px 16px 14px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: var(--hairline);
  line-height: 1.5;
}

.case-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g500);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.case-table tr:last-child td {
  border-bottom: 0;
}

.case-table .num {
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Stat blocks — width-to-width data moment.
   Spans the same full content width as figures. Big numbers, generous
   horizontal breathing room. Reads as an infographic, not a footnote.
   ------------------------------------------------------------------------- */
.case-body > .case-stats {
  grid-column: content-start / full-end;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px 64px;
  margin: 56px 0;
  padding: 40px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.case-stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-stat-num {
  font-size: 72px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
  font-feature-settings: "tnum";
}

.case-stat-num.is-negative {
  color: var(--g500);
}

.case-stat-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
}

@media (max-width: 768px) {
  .case-stat-num {
    font-size: 48px;
  }
  .case-stats {
    gap: 32px;
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------
   Figures — three sizes: reading, --wide, --full
   ------------------------------------------------------------------------- */
.case-figure {
  margin: 40px 0;
}

.case-figure img,
.case-figure video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: var(--surface-card);
}

.case-figure-placeholder {
  position: relative;
  width: 100%;
  /* 16:10 — MacBook Pro native ratio. All web screenshots captured at
     1200×750 to fit this frame consistently across the case study. */
  aspect-ratio: 16 / 10;
  background: var(--surface-card);
  border: var(--hairline);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g400);
}

.case-figure img,
.case-figure video {
  /* When real assets drop in, they keep the same 16:10 frame */
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* -------------------------------------------------------------------------
   Natural-aspect figure — for diagrams, flowcharts, and other images that
   shouldn't be cropped to 16:10. Preserves the image's intrinsic ratio.
   ------------------------------------------------------------------------- */
.case-figure--natural img,
.case-figure--natural video {
  aspect-ratio: auto;
  object-fit: contain;
  height: auto;
}

.case-figure--natural .case-figure-placeholder {
  aspect-ratio: auto;
  min-height: 240px;
}

.case-figure figcaption {
  margin-top: 12px;
  font-size: var(--case-caption);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--g500);
  line-height: 1.5;
  max-width: var(--reading-w);
}

/* All figures inside .case-body go width-to-width: from the text column's
   left edge to the full content area's right edge. No more "small" or
   "medium" figures — text on the left, figures full-width. */
.case-body > .case-figure,
.case-body > .case-figure--wide,
.case-body > .case-figure--full {
  grid-column: content-start / full-end;
  position: static;
  left: auto;
  transform: none;
  width: auto;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

/* Hero figure (sibling of .case-body) — full content width */
.case-shell > .case-figure--full {
  position: relative;
  width: 100%;
  max-width: var(--case-page-max);
}

/* Image-spec annotation inside placeholders during build */
.case-figure-placeholder .ph-spec {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g500);
  margin-top: 6px;
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}

/* -------------------------------------------------------------------------
   Before / After — V1 vs V2 split frame, single divider
   ------------------------------------------------------------------------- */
.case-body > .case-before-after,
.case-before-after {
  grid-column: content-start / full-end;
  position: static;
  left: auto;
  transform: none;
  width: auto;
  margin: 56px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 0;
}

.case-before-after-side {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
}

.case-before-after-side:first-child {
  padding-left: 0;
  border-right: var(--hairline);
}

.case-before-after-side:last-child {
  padding-right: 0;
}

.case-before-after-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g500);
  margin: 0 0 14px;
}

.case-before-after-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-card);
  border: var(--hairline);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--g400);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  text-align: center;
  padding: 16px;
}

.case-before-after-caption {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--g500);
}

@media (max-width: 768px) {
  .case-before-after {
    grid-template-columns: 1fr;
    gap: 32px;
    width: auto;
    left: auto;
    transform: none;
  }

  .case-before-after-side {
    padding: 0;
  }

  .case-before-after-side:first-child {
    border-right: 0;
    border-bottom: var(--hairline);
    padding-bottom: 32px;
  }
}

/* -------------------------------------------------------------------------
   case-next — the bottom-of-page card
   Editorial treatment: large, single-column, generous
   ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------
   Bottom strip — mirrors the top strip exactly. Page is bookended.
   ------------------------------------------------------------------------- */
.case-bottomstrip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 120px;
  padding: 24px 0 28px;
  border-top: var(--hairline);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
  font-feature-settings: "tnum";
}

.case-bottomstrip-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.case-bottomstrip-link:hover {
  color: var(--ink);
}

.case-bottomstrip-arrow {
  display: inline-block;
  transition: transform 0.18s var(--ease);
}

.case-bottomstrip-back:hover .case-bottomstrip-arrow {
  transform: translateX(-2px);
}

.case-bottomstrip-next:hover .case-bottomstrip-arrow {
  transform: translateX(2px);
}

/* Legacy case-next styles preserved for any other pages still using them */
.case-next {
  margin: 120px 0 0;
  padding: 56px 0 0;
  border-top: var(--hairline);
  max-width: var(--reading-w);
}

.case-next-card {
  display: block;
  text-decoration: none;
}

.case-next-eyebrow {
  display: block;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
  transition: color 0.18s var(--ease);
}

.case-next-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.case-next-arrow {
  display: inline-block;
  font-weight: 400;
  color: var(--g500);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.case-next-card:hover .case-next-arrow {
  transform: translateX(6px);
  color: var(--ink);
}

.case-next-card:hover .case-next-eyebrow {
  color: var(--ink);
}

.case-next-sub {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--g500);
  max-width: 520px;
}

/* -------------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --case-h1: 64px;
    --case-title: 24px;
    --case-stat: 32px;
  }

  .case-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 56px 0 40px;
  }

  .case-hero-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px 32px;
    padding-top: 24px;
    border-top: var(--hairline);
  }
}

@media (max-width: 768px) {
  .case-page {
    padding: 0 20px 80px;
  }

  .case-body h2 {
    margin: 64px 0 16px;
  }

  .case-figure--full {
    width: auto;
    left: auto;
    transform: none;
  }
}

/* -------------------------------------------------------------------------
   Quote list — used inside chapters for real participant words from research.
   Each item reads as a quoted line with a hairline left border.
   ------------------------------------------------------------------------- */
.case-quote-list {
  max-width: var(--reading-w);
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-quote-list li {
  position: relative;
  margin: 0;
  padding: 4px 0 4px 20px;
  font-size: var(--case-body);
  font-weight: 400;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
  border-left: 1px solid var(--hairline);
}

/* -------------------------------------------------------------------------
   Stat sub-label — used for secondary qualifier inside .case-stat-label
   (e.g. "Current horizon" / "Long-term, 2026–2028")
   ------------------------------------------------------------------------- */
.case-stat-sub {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g400);
}

/* -------------------------------------------------------------------------
   Hero meta sub — used for secondary qualifier inside .case-hero-meta-value
   (e.g. "vision phase" under a duration value)
   ------------------------------------------------------------------------- */
.case-hero-meta-sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--g500);
  text-transform: none;
}

/* -------------------------------------------------------------------------
   Case rule — thematic divider between distinct beats inside a chapter.
   Centered hairline with generous vertical breathing room.
   ------------------------------------------------------------------------- */
.case-rule {
  max-width: var(--reading-w);
  margin: 80px auto;
  border: 0;
  border-top: 1px solid var(--hairline);
  height: 0;
}

/* -------------------------------------------------------------------------
   Case figure canvas — Figma-canvas-style frame for flagship architectural
   diagrams. Dotted background mimics a Figma working canvas. Subtle hairline,
   layered shadows, generous padding so the artifact breathes. Used for the
   E2E flowchart and similar system-level diagrams.
   ------------------------------------------------------------------------- */
.case-figure-canvas {
  background-color: #fafaf7;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.07) 1px,
    transparent 1.5px
  );
  background-size: 24px 24px;
  background-position: 12px 12px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 56px 40px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
  transition: transform 480ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
              box-shadow 480ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.case-figure-canvas:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.06);
}

.case-figure-canvas img {
  display: block;
  width: 100%;
  height: auto;
  /* Override the parent .case-figure img rule which forces 16:10 with cover.
     Canvas-wrapped images render at natural aspect (no crop). */
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.04));
}

/* -------------------------------------------------------------------------
   E2E Flow — interactive flowchart with time-horizon toggle + pan/zoom.
   Used in Post Book Ancillaries Vision case study, Figure 7.
   ------------------------------------------------------------------------- */

/* Toggle bar above the figure */
.e2e-flow-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  width: fit-content;
}

.e2e-flow-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--g500);
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.e2e-flow-toggle button:hover {
  color: var(--ink);
}

.e2e-flow-toggle button[aria-pressed="true"] {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.e2e-flow-reset {
  appearance: none;
  border: 1px solid var(--hairline);
  background: white;
  /* Match toggle container outer height: toggle has 4px padding + buttons with 8px vertical = 40px.
     Reset uses 9px+1px-border = 10px*2 + 13px line-height = 40px. */
  padding: 9px 16px;
  margin-left: auto;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--g500);
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
}

.e2e-flow-reset:hover {
  color: var(--ink);
  border-color: var(--g300, #ccc);
}

/* Toolbar row — toggle on left, reset on right.
   Uses align-items: stretch so children fill the row height. */
.e2e-flow-toolbar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Hint text inline with the toolbar — aligns with segment-control baseline */
.e2e-flow-hint {
  margin: 0 0 0 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g400);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* The slot that hosts the inlined SVG.
   Sits inside the case-figure-canvas wrapper. Uses the SVG's intrinsic
   aspect ratio (4016/2948 ≈ 1.362) so the slot has a determined height
   before the SVG loads — required for svg-pan-zoom to measure correctly. */
.e2e-flow-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 4016 / 2948;
  max-height: clamp(420px, 70vh, 720px);
  display: block;
  overflow: hidden;
  border-radius: 6px;
}

.e2e-flow-slot svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  user-select: none;
}

.e2e-flow-slot svg:active {
  cursor: grabbing;
}

/* Loading state — subtle pulse before SVG arrives */
.e2e-flow-slot:not(.is-loaded)::before {
  content: "Loading interactive flowchart…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--g400);
  animation: e2eFlowPulse 1.6s ease-in-out infinite;
}

@keyframes e2eFlowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.e2e-flow-error {
  font-size: 13px;
  color: var(--g500);
  text-align: center;
  padding: 24px;
}

/* Layer visibility — driven by data-state on the SVG root.
   Anchor layer (page sections) is ALWAYS visible.
   Smooth opacity transitions tie state changes to the case study's
   "three time horizons drawn on one canvas" thesis. */
.e2e-flow-slot svg [data-layer] {
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* "Today" — only existing flow + page anchors */
.e2e-flow-slot svg[data-state="today"] [data-layer="green"],
.e2e-flow-slot svg[data-state="today"] [data-layer="orange"] {
  opacity: 0.08;
  pointer-events: none;
}

/* "2025/26 focus" — existing + new entry points + page anchors */
.e2e-flow-slot svg[data-state="2025"] [data-layer="orange"] {
  opacity: 0.08;
  pointer-events: none;
}

/* "2028" — everything (default) */


/* On smaller viewports, give the slot more height */
@media (max-width: 768px) {
  .e2e-flow-slot {
    min-height: 360px;
  }
  .e2e-flow-toolbar {
    gap: 8px;
  }
  .e2e-flow-reset {
    margin-left: 0;
  }
}

/* Subtle file-name pill in the top-left corner — reads as "this is a real artifact" */
.case-figure-canvas-label {
  position: absolute;
  top: 16px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--g600, #555);
  z-index: 2;
}

.case-figure-canvas-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde0c8, #f5b890);
}

@media (max-width: 768px) {
  .case-figure-canvas {
    padding: 24px 12px;
    border-radius: 12px;
  }
  .case-figure-canvas-label {
    top: 10px;
    left: 12px;
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* -------------------------------------------------------------------------
   Case mark — marker-pen highlight for scannable keywords.
   Warm peach/cream with a slight angle so it reads like a real highlighter pass.
   Wraps cleanly across line breaks via box-decoration-break: clone.
   Color chosen for editorial warmth (cream-paper feel) over default yellow.
   ------------------------------------------------------------------------- */
mark.case-mark,
.case-mark {
  background: linear-gradient(
    105deg,
    rgba(253, 224, 200, 0) 0.5%,
    rgba(253, 224, 200, 0.75) 1.5%,
    rgba(253, 224, 200, 0.75) 98.5%,
    rgba(253, 224, 200, 0) 99.5%
  );
  color: var(--ink);
  padding: 0 2px;
  margin: 0 -1px;
  font-weight: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
