/**
 * Greg Brock — portfolio styles
 *
 * Source order matches the original single-file page (cascade-sensitive).
 *
 * 1. Fonts & tokens — @font-face, :root (Graphik Trial + Cond + XCond; preload critical .otf in HTML)
 * 2. Base — reset, html, body
 * 3. Layout — .page, hero, structural blocks
 * 4. Components — logo farm, work, about, experience, footer
 * 5. Case studies — .case-page--study, .case-* layout primitives (grouped mid-file after home layout)
 * 6. Responsive — @media (1024 / 768 / 480), prefers-reduced-motion
 * 7. Header & mobile nav — .header, overlay menu, toggles
 */

/* Graphik Trial — body / UI (short swap period, then optional fallback) */
@font-face {
  font-family: 'Graphik Trial';
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: url('assets/global/fonts/GraphikTrial-Regular.otf.otf') format('opentype');
}
@font-face {
  font-family: 'Graphik Trial';
  font-style: normal;
  font-weight: 500;
  font-display: fallback;
  src: url('assets/global/fonts/GraphikTrial-Medium.otf') format('opentype');
}
@font-face {
  font-family: 'Graphik Trial';
  font-style: normal;
  font-weight: 600;
  font-display: fallback;
  src: url('assets/global/fonts/GraphikTrial-Semibold.otf') format('opentype');
}
@font-face {
  font-family: 'Graphik Trial';
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src: url('assets/global/fonts/GraphikTrial-Bold.otf') format('opentype');
}

/* Graphik XCond Trial — hero + primary display (block reduces weight swap flash) */
@font-face {
  font-family: 'Graphik XCond Trial';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/global/fonts/GraphikXCondTrial-Semibold.otf') format('opentype');
}
@font-face {
  font-family: 'Graphik XCond Trial';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/global/fonts/GraphikXCondTrial-Bold.otf') format('opentype');
}

/* Graphik Cond Trial — narrower condensed (e.g. gate hero, some case labels) */
@font-face {
  font-family: 'Graphik Cond Trial';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/global/fonts/GraphikCondTrial-Semibold.otf') format('opentype');
}
@font-face {
  font-family: 'Graphik Cond Trial';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/global/fonts/GraphikCondTrial-Bold.otf') format('opentype');
}

:root {
  --page-max: 1280px;
  --page-gutter: 80px;
  --page-gutter-tablet: 40px;
  --page-gutter-mobile: 16px;
  --page-gutter-mobile-sm: 16px;
  --color-text: #30323b;
  --color-muted: #8f92a3;
  --color-bg-light: #f1f1f4;
  --color-border: #dedede;
  --color-footer-muted: #b9bbc6;
  --color-dark: #30323b;
  --color-overlay: #ffffff;
  /* Shared stacks — use var(--font-body) / var(--font-display) in new rules; aliases preserve cascade */
  --font-body: 'Graphik Trial', system-ui, sans-serif;
  --font-display: 'Graphik XCond Trial', system-ui, sans-serif;
  --font-display-narrow: 'Graphik Cond Trial', 'Graphik XCond Trial', system-ui, sans-serif;
  --font-sans: var(--font-body);
  --font-condensed: var(--font-display);
  --font-graphik-cond: var(--font-display-narrow);
  --font-work-index: var(--font-display);
  --text-base: 16px;
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.5;
  --header-pad-x-desktop: 0px;
  --header-pad-x-tablet: 0px;
  --header-pad-x-mobile: 16px;
  --header-pad-x-mobile-sm: 16px;
  --header-pad-top-desktop: 0px;
  --header-pad-top-tablet: 0px;
  --header-pad-top-mobile: 16px;
  --header-pad-top-mobile-sm: 16px;
  --mobile-header-pad-x: 16px;
  --mobile-header-pad-top: 16px;
  --logo-size: 56px;
  --nav-icon-size: 40px;
  --nav-button-size: 40px;
  --desktop-nav-gap: 24px;
  --mobile-menu-link-size: 20px;

  --nav-frame-width-desktop: min(100% - (var(--page-gutter) * 2), var(--page-max));
  --nav-frame-width-tablet: min(100% - (var(--page-gutter-tablet) * 2), var(--page-max));
  --nav-frame-width-mobile: calc(100% - 32px);
  --nav-frame-width-mobile-sm: calc(100% - 32px);

  --nav-top-desktop: 0px;
  --nav-top-tablet: 0px;
  --nav-top-mobile: 16px;
  --nav-top-mobile-sm: 16px;

  --nav-row-height: 56px;

  /* Motion */
  --motion-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-duration-fast: 180ms;
  --motion-duration-medium: 420ms;
  --motion-duration-slow: 720ms;
  --motion-distance-sm: 10px;
  --motion-distance-md: 18px;
  --motion-distance-lg: 28px;
}

/* =================================
   MOTION — scroll / interaction hooks
   ================================= */

[data-animate] {
  will-change: transform, opacity;
}

/* =================================
   MICRO INTERACTIONS
   ================================= */

.btn-resume,
.nav a,
.footer-nav a,
.footer-contact-list a {
  transition:
    transform var(--motion-duration-fast) var(--motion-ease-standard),
    opacity var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.btn-resume:hover {
  transform: none;
  color: inherit;
  box-shadow: inset 0 -1px 0 currentColor;
}

.btn-resume:active {
  transform: none;
}

.btn-resume {
  position: static;
  overflow: visible;
}

.work-card-media,
.work-card-img,
.work-card-placeholder,
.work-card-stack,
.work-card-footer {
  transition:
    transform 0.55s var(--motion-ease-standard),
    opacity 0.32s var(--motion-ease-soft),
    background-color 0.25s var(--motion-ease-soft);
}

.work-card:hover .work-card-media,
.work-card:focus-visible .work-card-media,
.work-card:focus-within .work-card-media {
  transform: translateY(-8px);
}

.work-card:hover .work-card-img,
.work-card:hover .work-card-placeholder,
.work-card:hover .work-card-stack,
.work-card:focus-visible .work-card-img,
.work-card:focus-visible .work-card-placeholder,
.work-card:focus-visible .work-card-stack,
.work-card:focus-within .work-card-img,
.work-card:focus-within .work-card-placeholder,
.work-card:focus-within .work-card-stack {
  transform: scale(1.025);
}

.hero-gb,
.about-hello,
.work-section-arrow,
.case-hero-accent,
.experience-line-wrap {
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .work-card,
  .hero-cta,
  .btn-resume,
  .nav a,
  .footer-nav a,
  .footer-contact-list a,
  .work-card-media,
  .work-card-img,
  .work-card-placeholder,
  .work-card-stack,
  .work-card-stack-layer--color,
  .work-card-footer,
  .btn-resume::after {
    transition: none !important;
  }

  .work-card-stack-layer--color {
    opacity: 1 !important;
  }

  .hero-cta:hover,
  .hero-cta:active {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* --- Base: reset & global typography --- */
* {
  box-sizing: border-box;
}

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background: #fff;
}

.shell {
  width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  margin-inline: auto;
}

.shell-narrow {
  width: min(100% - (var(--page-gutter) * 2), 960px);
  margin-inline: auto;
}

.bleed {
  width: 100%;
}

/* --- Layout: page shell & hero --- */
/* Center column: max 1280px, no extra horizontal padding (80px is on body) */
.page {
  flex: 1 0 auto;
  padding: 48px 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 64px;
}

/* Hero: CTA pinned to bottom, aligned with bottom of image (Figma 437:74655) */
.hero {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0;
  min-height: 760px;
  padding: 0 0 40px 0;
}

/* Content column: text at top, CTA at bottom aligned with bottom of image */
.hero-content {
  flex: 1 1 0;
  min-width: 0;
  height: 719px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  align-self: flex-start;
  gap: 0px;
  min-height: 0;
}

.hero-content > div {
  flex: 0 0 auto;
  padding-top: 24px;
  margin-bottom: 64px;
}

.hero-title-block {
  margin: 0;
  padding: 0;
  line-height: 0.92;
}

.hero-title-block .hero-title {
  display: block;
  white-space: nowrap;
  margin-bottom: -0.04em;
}

.hero-title-block .hero-title:last-child {
  margin-bottom: 0;
}

.hero-title {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw + 2rem, 120px);
  line-height: inherit;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin: 0;
  text-transform: uppercase;
}

.hero-intro {
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--color-muted);
  max-width: 523px;
  margin: 56px 0 0;
}

.hero-intro strong {
  color: var(--color-text);
  font-weight: 600;
}

/* CTA pinned to bottom of hero — hover matches project case hero CTA (scale + soft fade) */
.hero-cta {
  position: relative;
  isolation: isolate;
  flex: 0 0 80px;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  margin-top: auto;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  line-height: 0;
  overflow: visible;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero-cta:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

.hero-cta:active {
  transform: scale(1);
  opacity: 1;
}

.hero-cta:focus-visible {
  outline: 2px solid #30323b;
  outline-offset: 4px;
}

.hero-cta img {
  position: relative;
  z-index: 0;
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  display: block;
  object-fit: contain;
  opacity: 1;
  visibility: visible;
}

/* Hero accent: GB initials overlapping bottom-left of hero photo (half on, half off) */
.hero-gb {
  position: absolute;
  left: 0;
  bottom: 80px;
  transform: translateX(-50%);
  display: block;
  width: 245px;
  height: auto;
  pointer-events: auto;
  z-index: 1;
  touch-action: manipulation;
}

.hero-gb::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-gb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  object-fit: contain;
  object-position: right bottom;
  transform-origin: 58% 62%;
}

.hero-gb:hover img {
  animation: work-arrow-wiggle 0.9s steps(1, end) infinite;
}
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-visual {
  position: relative;
  width: fit-content;
  height: fit-content;
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hero-photo {
  position: relative;
  width: 368px;
  height: 442px;
  flex-shrink: 0;
  background: transparent;
  border-radius: 0;
}

.hero-photo-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* --- Component: logo farm --- */
/* When section has `hidden`, author .logo-farm display:flex would otherwise win over UA [hidden] */
.logo-farm[hidden],
#logo-farm[hidden] {
  display: none !important;
}

/* Logo farm — single row, excess logos hidden on resize */
.logo-farm {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  min-height: 108px;
}

.logo-cell {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  background: var(--color-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: opacity 0.15s ease;
}

.logo-farm--css-hover .logo-cell {
  transition:
    opacity 0.15s ease,
    transform 0.45s var(--motion-ease-standard, cubic-bezier(0.22, 1, 0.36, 1));
}

.logo-farm--gsap-hover .logo-cell {
  transition: opacity 0.15s ease;
}

.logo-cell--circle {
  border-radius: 50%;
}
.logo-cell--square {
  border-radius: 0;
}
.logo-cell--hidden {
  display: none;
}

/* Muted default; full color on hover (class from JS or CSS fallback) */
.logo-farm .logo-cell img {
  display: block;
  max-width: 56px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  filter: grayscale(0.48) brightness(0.93);
  opacity: 0.84;
  transition:
    filter 0.5s var(--motion-ease-soft, cubic-bezier(0.2, 0.8, 0.2, 1)),
    opacity 0.5s var(--motion-ease-soft, cubic-bezier(0.2, 0.8, 0.2, 1)),
    transform 0.42s var(--motion-ease-standard, cubic-bezier(0.22, 1, 0.36, 1));
}

.logo-farm .logo-cell--hover img {
  filter: grayscale(0) brightness(1);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .logo-farm--css-hover .logo-cell:hover img {
    filter: grayscale(0) brightness(1);
    opacity: 1;
    transform: scale(1.05);
  }

  .logo-farm--css-hover .logo-cell:hover {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-farm .logo-cell img {
    filter: none;
    opacity: 1;
    transition: none;
    transform: none !important;
  }

  .logo-farm--css-hover .logo-cell {
    transition: none;
  }
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: #f1f1f4;
}

/* --- Component: selected work --- */
/* Selected work */
.work-section {
  width: 100%;
  flex: 0 0 auto;
  position: relative;
  padding-bottom: 96px;
}

/* Section head: SELECTED WORK, arrow, 2020-2026 (Figma 462:75972) */
.section-head {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 32px;
  padding-top: 40px;
}

.section-title {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(2rem, 4vw + 1.5rem, 64px);
  letter-spacing: -1.28px;
  line-height: 0.89;
  margin: 0;
  text-transform: uppercase;
  color: var(--color-text);
  white-space: nowrap;
}

.work-section-arrow {
  flex-shrink: 0;
  width: clamp(100px, 11.4vw, 146px);
  height: auto;
  pointer-events: auto;
  display: block;
}

.work-section-arrow img {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 78% 56%;
}

.work-section-arrow:hover img {
  animation: work-arrow-wiggle 0.9s steps(1, end) infinite;
}

@keyframes work-arrow-wiggle {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

.section-subtitle {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text);
  margin: 0;
  text-align: right;
}

.work-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  margin-top: 40px;
}

.work-row {
  display: flex;
  gap: 24px;
  height: 493px;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
}

/* Same fill as Figma stack (#f1f1f4) — avoids a hairline seam vs white card when flex heights round */
.work-card:has(.work-card-media--stack) {
  background: var(--color-bg-light);
}

.work-card-large {
  flex: 1 1 66%;
}

.work-card-small {
  flex: 0 1 412px;
}

.work-card-media {
  position: relative;
  flex: 1 1 0;
  align-self: stretch;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.work-card-media,
.work-card-media--stack {
  background: #f1f1f4;
}

.work-card-img,
.work-card-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.work-card-placeholder {
  background: linear-gradient(135deg, #e5e5ea 0%, #d0d0d8 100%);
}

/* Work grid thumbnails — layered comps from Figma (node 503:153183) */
.work-card-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  transform-origin: center center;
}

.work-card-stack-layer {
  position: absolute;
  display: block;
  max-width: none;
}

/* Thumbnail stacks — BW + color (same geometry per card; color fades in on hover/focus).
 * Hero exports in assets/global/thumbnails/ often truncate soft drop shadows at the file edge, so the
 * bottom reads as a hard seam / “empty” band. object-position top + transform-origin top + a static
 * scale() zooms past that region (overflow on .work-card-stack clips the excess). translateY nudges
 * are per-piece tuning. Long-term: dedicated tighter work-grid exports from Figma (then
 * .work-card-media--work-grid + assets/work-grid/* — see modifier below). */
.work-card-stack-layer--01-bw,
.work-card-stack-layer--01-color,
.work-card-stack-layer--02-bw,
.work-card-stack-layer--02-color,
.work-card-stack-layer--03-bw,
.work-card-stack-layer--03-color,
.work-card-stack-layer--04-bw,
.work-card-stack-layer--04-color {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform-origin: center top;
}

.work-card-stack-layer--01-bw,
.work-card-stack-layer--01-color {
  transform: scale(1.05) translateY(-4%);
}

.work-card-stack-layer--02-bw,
.work-card-stack-layer--02-color {
  transform: scale(1.05) translateY(-2%);
}

.work-card-stack-layer--03-bw,
.work-card-stack-layer--03-color {
  transform: scale(1.05) translateY(-2%);
}

.work-card-stack-layer--04-bw,
.work-card-stack-layer--04-color {
  transform: scale(1.05) translateY(-5%);
}

/* Optional: after swapping thumbnails to tighter assets/work-grid/work-NN-{bw,color}.png, add this
 * class next to .work-card-media--stack on each card’s media wrapper to drop the hero-only nudges. */
.work-card-media--work-grid .work-card-stack-layer--01-bw,
.work-card-media--work-grid .work-card-stack-layer--01-color,
.work-card-media--work-grid .work-card-stack-layer--02-bw,
.work-card-media--work-grid .work-card-stack-layer--02-color,
.work-card-media--work-grid .work-card-stack-layer--03-bw,
.work-card-media--work-grid .work-card-stack-layer--03-color,
.work-card-media--work-grid .work-card-stack-layer--04-bw,
.work-card-media--work-grid .work-card-stack-layer--04-color {
  transform: none;
}

/* ---------------------------------------
   Color hover overlay (opacity only — lift/scale stay on .work-card-stack)
---------------------------------------- */
.work-card-stack-layer--color {
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.35s var(--motion-ease-standard);
  will-change: opacity;
}

.work-card:hover .work-card-stack-layer--color,
.work-card:focus-visible .work-card-stack-layer--color,
.work-card:focus-within .work-card-stack-layer--color {
  opacity: 1;
}

.work-card-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 3;
}

/* Copy column: tight title ↔ description; index column w-48 */
.work-card-footer-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  height: 100%;
  padding: 0;
}

.work-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.6px;
  line-height: 1.2;
  height: fit-content;
  color: var(--color-text);
  margin: 0;
}

.work-card-subtitle {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1.5;
  height: fit-content;
  color: #8f92a3;
  margin: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-card-index {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  font-family: var(--font-work-index);
  font-weight: 600;
  font-size: 64px;
  line-height: 0.89;
  letter-spacing: -1.28px;
  color: #30323b;
  text-align: right;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* Hover / focus states — lift/scale from motion tokens block */
.work-card:hover .work-card-footer,
.work-card:focus-visible .work-card-footer,
.work-card:focus-within .work-card-footer {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.work-card:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

/* Tablet */
@media (max-width: 1024px) {
  .work-row {
    height: 360px;
  }

  /* Definite flex main size + min height when % height chain is weak (Safari, nested flex) */
  .work-card-media {
    min-height: 200px;
  }

  .work-card-footer {
    height: 76px;
  }

  .work-card-index {
    font-size: 56px;
    letter-spacing: -1.12px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .work-row {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .work-card-large,
  .work-card-small {
    flex: 0 0 auto;
    min-height: 280px;
    height: auto;
    max-height: none;
  }

  /* Stack has no in-flow children; without a floor, height:100% collapses to 0 */
  .work-card-media {
    flex: 1 1 auto;
    min-height: min(56vw, 320px);
  }

  .work-card-footer {
    height: 72px;
    padding-left: 8px;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    gap: 12px;
  }

  .work-card-footer-main {
    gap: 3px;
  }

  .work-card-index {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    font-size: 44px;
    letter-spacing: -0.88px;
    line-height: 0.89;
  }

  .work-card:hover .work-card-media,
  .work-card:focus-visible .work-card-media,
  .work-card:focus-within .work-card-media {
    transform: none;
  }

  .work-card:hover .work-card-img,
  .work-card:hover .work-card-placeholder,
  .work-card:hover .work-card-stack,
  .work-card:focus-visible .work-card-img,
  .work-card:focus-visible .work-card-placeholder,
  .work-card:focus-visible .work-card-stack,
  .work-card:focus-within .work-card-img,
  .work-card:focus-within .work-card-placeholder,
  .work-card:focus-within .work-card-stack {
    transform: none;
  }
}

/* --- Component: about --- */
/* About — 12-column grid: image 5, title 2, text 5 */
.about {
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
  padding: 80px 0 128px;
}

.about-image-wrap {
  grid-column: span 5;
  position: relative;
  min-width: 0;
  aspect-ratio: 527 / 295;
  background: var(--color-bg-light);
  border-radius: 0;
  overflow: visible;
}

.about-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.about-hello {
  position: absolute;
  left: 229px;
  top: -98px;
  width: 241px;
  height: 219px;
  pointer-events: auto;
  transform: rotate(-75deg);
}

.about-hello img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left top;
  transform-origin: 52% 58%;
}

.about-hello:hover img {
  animation: work-arrow-wiggle 0.9s steps(1, end) infinite;
}

.about-title {
  grid-column: span 2;
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: 64px;
  letter-spacing: -0.01em;
  line-height: 0.95;
  margin: 0;
  color: var(--color-text);
  text-transform: uppercase;
}

.about-text {
  grid-column: span 5;
  min-width: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-muted);
}

.about-text p {
  margin: 0 0 1em;
}

.about-text p:last-child {
  margin-bottom: 0;
}

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

.about-text strong a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-text) 35%, transparent);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--motion-duration-fast) var(--motion-ease-standard);
}

.about-text strong a:hover {
  text-decoration-color: color-mix(in srgb, var(--color-text) 65%, transparent);
}

.about-text strong a:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Component: experience --- */
/* Experience */
.experience {
  width: 100%;
  flex: 0 0 auto;
  padding-bottom: 80px;
}

.experience-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 48px;
  min-height: 65px;
}

.experience-header-left {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1 1 auto;
  min-width: 0;
}

.experience-title {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(2rem, 4vw + 1.5rem, 64px);
  line-height: var(--leading-tight);
  margin: 0;
  text-transform: uppercase;
  flex-shrink: 0;
}

.experience-line-wrap {
  height: 46px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 752px;
  overflow: hidden;
  line-height: 0;
  position: relative;
}
.experience-line-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: left center;
}

.experience-line-img {
  transform: scaleY(-1);
  transform-origin: center;
  will-change: clip-path;
}

.btn-resume {
  display: inline-block;
  background: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.5;
  padding: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 transparent;
  box-sizing: border-box;
  position: relative;
}

.btn-resume::before {
  content: "";
  position: absolute;
  inset: -10px -12px;
}

.experience-list {
  border-top: 2px solid #f1f1f4;
}

.experience-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 2px solid #f1f1f4;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.experience-role {
  font-weight: 600;
  color: var(--color-text);
  min-width: 180px;
  letter-spacing: -0.5px;
}

.experience-company {
  font-weight: 400;
  color: var(--color-muted);
  flex: 1;
}

.experience-dates {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

/* --- Component: footer --- */
/* Footer — matches Figma 438:96941 */
.footer {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: auto;
  background: var(--color-dark);
  color: #fff;
  padding: 80px var(--page-gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  box-sizing: border-box;
}

.footer-inner {
  width: 100%;
  max-width: var(--page-max);
  display: flex;
  flex-direction: column;
  gap: 64px;
  min-width: 0;
}

.footer-top {
  width: 100%;
  display: flex;
  gap: 216px;
  align-items: flex-start;
}

.footer-headline {
  flex: 0 0 302px;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0;
}

.footer-headline strong {
  font-weight: 600;
  color: #fff;
}

.footer-headline span:not(strong) {
  color: var(--color-footer-muted);
  font-weight: 500;
}

.footer-links {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-width: 0;
}

.footer-social {
  flex: 0 0 327px;
  max-width: 327px;
}

.footer-social-title {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: #fff;
}

.footer-social-desc {
  font-size: 20px;
  line-height: 1.5;
  color: var(--color-footer-muted);
  margin: 0;
}

.footer-contact-list {
  flex: 0 0 193px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.5;
}

.footer-contact-list a {
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.footer-contact-list a:hover,
.footer-nav a:hover,
.footer-cta:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.footer-contact-list a[data-copy-email] {
  position: relative;
}

.footer-contact-list a[data-copy-email].is-copied::after {
  content: "Email copied";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #ffffff;
  white-space: nowrap;
  z-index: 2;
}

.footer-bottom {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 40px;
}

.footer-cta {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(36px, 10vw, 120px);
  line-height: 0.89;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.footer-nav {
  display: flex;
  gap: 16px;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
}

/* --- Responsive: global breakpoint overrides (tablet → small mobile) --- */
/* Responsive: tablet */
@media (max-width: 1024px) {
  .shell {
    width: min(100% - (var(--page-gutter-tablet) * 2), var(--page-max));
  }

  .shell-narrow {
    width: min(100% - (var(--page-gutter-tablet) * 2), 960px);
  }

  .page {
    padding: 40px 0 0;
    gap: 48px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding: 32px 0;
  }

  .hero-content {
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    max-height: 560px;
    justify-content: flex-start;
  }

  .hero-cta {
    margin-top: 24px;
  }

  .hero-gb {
    left: 0;
    bottom: 48px;
    transform: translateX(-50%);
    width: clamp(160px, 20vw, 245px);
    height: auto;
  }

  .work-section-arrow {
    width: clamp(80px, 10vw, 120px);
  }

  .hero-title {
    font-size: clamp(4rem, 12vw, 88px);
  }

  .hero-intro {
    margin-top: 48px;
    line-height: 1.5;
  }

  .hero-visual {
    width: fit-content;
    max-width: 368px;
    margin-left: auto;
    margin-right: 0;
    height: auto;
    aspect-ratio: 368 / 442;
  }

  .hero-photo {
    position: relative;
    width: 368px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 368 / 442;
  }

  .hero-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .section-title {
    font-size: 48px;
  }

  .about {
    gap: 48px;
    padding: 48px 0 96px;
  }

  .about-image-wrap {
    grid-column: span 12;
  }

  .about-title {
    font-size: 48px;
    grid-column: span 12;
    white-space: nowrap;
  }

  .about-title br {
    display: none;
  }

  .about-text {
    grid-column: span 12;
  }

  .experience-title {
    font-size: 48px;
  }

  .footer {
    padding: 60px var(--page-gutter-tablet) 32px;
  }

  .footer-top {
    flex-direction: column;
    gap: 40px;
  }

  .footer-headline {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
  }

  .footer-social {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .footer-contact-list {
    align-self: flex-start;
    align-items: flex-start;
    flex: 1 1 auto;
  }

  .footer-cta {
    font-size: 72px;
  }
}

/* Responsive: mobile */
@media (max-width: 768px) {
  .shell {
    width: min(100% - (var(--page-gutter-mobile) * 2), var(--page-max));
  }

  .shell-narrow {
    width: min(100% - (var(--page-gutter-mobile) * 2), 960px);
  }

  .page {
    padding: 0;
    gap: 40px;
  }

  .nav {
    gap: 16px;
    font-size: 16px;
  }

  .hero {
    padding: 40px 0 32px;
    gap: 32px;
    align-items: flex-start;
  }

  .hero-content {
    width: 100%;
    max-width: 356px;
    max-height: 392px;
    min-height: 0;
    justify-content: space-between;
    gap: 0;
  }

  .hero-content > div {
    margin-bottom: 0;
    padding-top: 0;
  }

  .hero-title {
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -1.68px;
  }

  .hero-intro {
    width: 100%;
    max-width: none;
    font-size: 16px;
    line-height: 1.5;
    margin-top: 30px;
    margin-bottom: 24px;
  }

  .hero-cta {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    margin-top: auto;
  }

  .hero-cta img {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
  }

  .hero-visual {
    width: 100%;
    max-width: 356px;
    margin-right: auto;
    margin-left: 0;
    aspect-ratio: 356 / 339;
    height: auto;
  }

  .hero-photo {
    width: 100%;
    height: 100%;
    aspect-ratio: 356 / 339;
  }

  .hero-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .logo-farm {
    justify-content: flex-start;
    gap: 12px;
    min-height: 72px;
  }

  .logo-cell {
    width: 72px;
    height: 72px;
  }

  .logo-cell img,
  .logo-farm .logo-cell img {
    max-width: 40px;
    max-height: 40px;
  }

  /* Mobile: pin GB initial to top-right of hero image (Figma 470-79742), offset up 100px and left 100px; +100px horizontal nudge */
  .hero-gb {
    left: auto;
    right: 100px;
    top: -50px;
    bottom: auto;
    transform: translateX(calc(50% + 100px));
    width: 140px;
    height: auto;
  }

  .hero-gb img {
    object-position: right top;
  }

  /* Selected work header — Figma 475:92712: title + dates stacked left, arrow right */
  .work-section-arrow {
    width: 114px;
    flex-shrink: 0;
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
  }

  .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 24px;
    row-gap: 16px;
    padding-top: 24px;
  }

  .section-title {
    font-size: 40px;
    letter-spacing: -0.8px;
    grid-column: 1;
    grid-row: 1;
    white-space: normal;
  }

  .section-subtitle {
    grid-column: 1;
    grid-row: 2;
    flex: unset;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: left;
    margin: 0;
  }

  .about {
    gap: 24px;
    padding: 40px 0 88px;
  }

  .about-image-wrap {
    aspect-ratio: auto;
    height: 200px;
  }

  .about-hello {
    width: 140px;
    height: auto;
    left: 152px;
    top: -84px;
  }

  .about-title {
    font-size: 40px;
    white-space: nowrap;
  }

  .about-title br {
    display: none;
  }

  .experience {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .experience-header {
    display: contents;
  }

  .experience-header-left {
    width: 100%;
    order: 1;
  }

  .experience-line-wrap {
    max-width: none;
    height: 36px;
  }

  .experience-title {
    font-size: 40px;
  }

  .experience-list {
    order: 2;
  }

  .btn-resume {
    order: 3;
    width: auto;
    margin-top: 24px;
  }

  .experience-item {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 18px;
  }

  .experience-role {
    min-width: 100%;
  }

  .experience-dates {
    font-size: 1.375rem;
  }

  .footer {
    padding: 48px var(--page-gutter-mobile) 24px;
  }

  .footer-inner {
    gap: 48px;
  }

  .footer-top {
    gap: 32px;
  }

  .footer-headline {
    font-size: 24px;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .footer-cta {
    font-size: 48px;
  }

  /* When stacked on mobile, switch contact links to a horizontal row */
  .footer-contact-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
    text-align: left;
    justify-content: flex-start;
    align-self: flex-start;
  }

  .footer-contact-list a {
    white-space: nowrap;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 24px;
    padding-bottom: 24px;
  }
}

/* Responsive: small mobile */
@media (max-width: 480px) {
  .shell {
    width: min(100% - (var(--page-gutter-mobile-sm) * 2), var(--page-max));
  }

  .shell-narrow {
    width: min(100% - (var(--page-gutter-mobile-sm) * 2), 960px);
  }

  .page {
    padding: 0;
    gap: 32px;
  }

  .hero-content {
    max-height: 300px;
  }

  .nav {
    gap: 12px;
    font-size: 14px;
  }

  .hero-title {
    font-size: 44px;
  }

  .hero-intro {
    margin-top: 32px;
    line-height: 1.5;
  }

  .section-title {
    font-size: 32px;
  }

  .about-title,
  .experience-title {
    font-size: 32px;
  }

  .footer-cta {
    font-size: 36px;
  }
}

/* =================================
   HEADER + MOBILE NAV — UNIFIED FIX
   ================================= */

.header,
.nav-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 56px;
  min-height: 56px;
  width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  margin-inline: auto;
  background: transparent;
  /* transform/opacity: driven by GSAP (main.js); avoid CSS transitions here — they fight the tween */
  isolation: isolate;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0);
  z-index: -1;
  transition:
    background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.is-hidden {
  transform: translateY(calc(-100% - 2px));
  opacity: 0;
}

.header.is-floating {
  transform: translateY(0);
  opacity: 1;
}

.header.is-floating::before,
body.nav-menu-open .header::before {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.logo {
  flex: 0 0 var(--logo-size);
  width: var(--logo-size);
  height: var(--logo-size);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--desktop-nav-gap);
  min-height: var(--nav-row-height);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.nav a {
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 transparent;
  transition: box-shadow 0.2s ease;
}

.nav a:hover {
  box-shadow: inset 0 -1px 0 currentColor;
}

.nav-toggle,
.nav-close {
  display: none;
  flex: 0 0 var(--nav-button-size);
  width: var(--nav-button-size);
  height: var(--nav-button-size);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-dark);
  cursor: pointer;
  appearance: none;
  position: relative;
  z-index: 2;
}

.nav-toggle img,
.nav-close img {
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  display: block;
}

.nav-menu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
}

.nav-menu.is-open,
.nav-menu.is-closing {
  visibility: visible;
}

.nav-menu.is-open {
  pointer-events: auto;
}

.nav-menu.is-closing {
  pointer-events: none;
}

.nav-menu-curtain {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.42s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

.nav-menu.is-open .nav-menu-curtain {
  transform: scaleY(1);
}

.nav-menu.is-closing .nav-menu-curtain {
  transform: scaleY(0);
}

.nav-menu-content {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.nav-menu-header {
  position: relative;
  z-index: 2;
}

.nav-menu-links {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.2s ease 0.12s;
  pointer-events: none;
}

.nav-menu.is-open .nav-menu-links {
  opacity: 1;
  pointer-events: auto;
}

.nav-menu.is-closing .nav-menu-links {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.nav-menu-links a {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 24px 20px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--mobile-menu-link-size);
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

/* Inverse: highlight = body text color, label = white */
.nav-menu-links a:active {
  background: var(--color-text);
  color: #fff;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .nav-menu-links a:hover {
    background: var(--color-text);
    color: #fff;
    box-shadow: none;
  }
}

.nav-menu-links a:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
  background: var(--color-text);
  color: #fff;
}

.nav-menu-links a:focus-visible:active {
  background: var(--color-text);
  color: #fff;
  outline-color: #fff;
}

body.nav-menu-open {
  overflow: hidden;
}

/* tablet */
@media (max-width: 1024px) {
  .header {
    width: min(100% - (var(--page-gutter-tablet) * 2), var(--page-max));
  }
}

/* mobile */
@media (max-width: 768px) {
  .header,
  .nav-menu-header {
    position: fixed;
    left: 16px;
    right: 16px;
    width: auto;
    margin: 0;
    height: 56px;
    min-height: 56px;
    padding: 0;
    align-items: center;
    justify-content: space-between;
  }

  .header {
    top: 0;
  }

  .nav-menu-header {
    top: 0;
  }

  /* 56px bar + 16px breathing room below (replaces previous top:16 + 88px stack) */
  .nav-menu-content {
    padding-top: 72px;
  }

  .nav.nav-links {
    display: none;
  }

  .nav-toggle,
  .nav-close {
    display: flex;
  }

  body.nav-menu-open .header {
    opacity: 0;
    pointer-events: none;
  }

  body.nav-menu-open .nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .page {
    padding-top: 72px;
  }
}

/* small mobile */
@media (max-width: 480px) {
  .header,
  .nav-menu-header {
    left: 16px;
    right: 16px;
    top: 0;
  }

  .page {
    padding-top: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header,
  .nav-menu-curtain,
  .nav-menu-links,
  .nav-menu-links a {
    transition: none !important;
  }
}

/* --- Case study pages: shared layout (see Project_template_content.html) --- */
.case-page {
  width: 100%;
  overflow-x: hidden;
  background: #efefef;
  color: #141414;
  --case-study-accent: #8a72ff;
  /* Typography: body on white / on tint / on dark band (override per case study if needed) */
  --case-body-on-white: #8f92a3;
  --case-body-on-tint: #30323b;
  --case-band-dark-bg: #30323b;
  --case-band-dark-text: #ffffff;
}

/* Shared polished case study layout + typography (use with any project modifier for accent) */
.case-page--study {
  background: #ffffff;
}

main.case-page.case-page--study {
  background: #ffffff !important;
  background-image: none;
}

/* Per-project accent + surfaces (layout lives in reusable .case-* components below) */
.project-1-page {
  --case-study-accent: #8491fb;
}

.project-2-page {
  --case-study-accent: #52c9e0;
  /* Legacy aliases — prefer --case-surface-* on new work */
  --case-cove-tint: #cef5fd;
  --case-cove-panel: #f5fdff;
  --case-surface-tint: #cef5fd;
  --case-surface-panel: #f5fdff;
  /* Hero title scale/spacing: use .case-page.case-page--study tokens (same as P1) */
  --case-hero-subtitle-color: #8f92a3;
  --case-hero-subtitle-letter-spacing: 0.025em;
  --case-hero-media-bg: var(--case-surface-tint);
  --case-hero-scribble-slot-w: 140px;
  --case-hero-scribble-slot-h: 480px;
  --case-tldr-context-bg: var(--case-surface-tint);
  --case-tldr-context-color: #30323b;
  --case-tldr-context-font-size: 16px;
  --case-tldr-context-line-height: 1.5;
  --case-tldr-context-letter-spacing: 0.025em;
  --case-tldr-context-strong-color: #30323b;
  --case-tldr-context-strong-weight: 700;
  --case-tldr-title-font-size: 48px;
  --case-tldr-title-letter-spacing: 0.02em;
  --case-point-copy-muted: #757575;
  --case-prose-wide-max: 953px;
  --case-outcomes-tint-bg: var(--case-surface-panel);
  --case-outcomes-metric-label-color: #8f92a3;
  --case-outcomes-metric-label-size: 20px;
  --case-outcomes-metric-value-size: 64px;
}

/* Gardyn shop — Figma Portfolio-2026 node 504-197550 */
/* Triple class so TLDR context tokens beat .case-page.case-page--study defaults (same pattern as .project-2-page). */
.case-page.case-page--study.project-3-page {
  --case-study-accent: #52e070;
  --case-surface-tint: #cefdd8;
  --case-surface-panel: #f5fff7;
  --case-gardyn-mint-band: #f0f9f4;
  --case-hero-subtitle-color: #8f92a3;
  --case-hero-media-bg: #f4f6f4;
  --case-hero-scribble-slot-w: 180px;
  --case-hero-scribble-slot-h: 608px;
  --case-tldr-context-bg: #cefdd8;
  --case-tldr-context-color: #30323b;
  --case-tldr-context-font-size: 16px;
  --case-tldr-context-line-height: 1.5;
  --case-tldr-context-letter-spacing: 0.03em;
  --case-tldr-context-strong-color: #30323b;
  --case-tldr-context-strong-weight: 700;
  --case-tldr-title-font-size: 48px;
  --case-tldr-title-letter-spacing: 0.02em;
  --case-point-copy-muted: #757575;
  --case-prose-wide-max: 960px;
  --case-outcomes-tint-bg: var(--case-surface-panel);
  --case-outcomes-metric-label-color: #8f92a3;
  --case-outcomes-metric-label-size: 20px;
  --case-outcomes-metric-value-size: 64px;
}

body.case-body .case-page--study.project-3-page .case-hero-accent.case-hero-accent--scribble {
  margin-left: clamp(12px, 2.5vw, 40px);
}

.project-3-page .case-hero-accent.case-hero-accent--scribble .case-hero-accent-img {
  left: -48%;
  bottom: 0;
  height: auto;
  max-height: 120px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  object-position: right bottom;
  transform: translateX(18px) rotate(-48deg);
  transform-origin: 72% 55%;
}

/* Gardyn home widgets — Figma Portfolio-2026 node 503-173218 */
.case-page.case-page--study.project-4-page {
  --case-study-accent: #ff7a59;
  --case-surface-tint: #fde8e0;
  --case-surface-panel: #fff5f0;
  --case-band-dark-bg: #30323b;
  --case-hero-subtitle-color: #8f92a3;
  /* Hero panel tint: blend Sun_accent.svg fill (#FFA280) with warm off-white */
  --case-hero-media-bg: color-mix(in srgb, #ffa280 16%, #fff6f2);
  --case-hero-scribble-slot-w: 200px;
  --case-hero-scribble-slot-h: 480px;
  --case-tldr-context-bg: #fde8e0;
  --case-tldr-context-color: #30323b;
  --case-tldr-context-font-size: 16px;
  --case-tldr-context-line-height: 1.5;
  --case-tldr-context-letter-spacing: 0.03em;
  --case-tldr-context-strong-color: #30323b;
  --case-tldr-context-strong-weight: 700;
  --case-tldr-title-font-size: 48px;
  --case-tldr-title-letter-spacing: 0.02em;
  --case-point-copy-muted: #757575;
  --case-prose-wide-max: 960px;
  --case-outcomes-tint-bg: var(--case-surface-panel);
  --case-outcomes-metric-label-color: #8f92a3;
  --case-outcomes-metric-label-size: 20px;
  --case-outcomes-metric-value-size: 64px;
}

body.case-body .case-page--study.project-4-page .case-hero-accent.case-hero-accent--scribble.case-hero-accent--p4-sun {
  margin-left: clamp(16px, 3.5vw, 48px);
}

.project-4-page .case-hero-accent.case-hero-accent--scribble.case-hero-accent--p4-sun .case-hero-accent-img {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  width: min(100%, 240px);
  height: auto;
  max-height: 226px;
  object-fit: contain;
  /* Down-right from prior placement + 200px toward the right */
  transform: translate(calc(-18% + 200px), -34%) rotate(-6deg);
  transform-origin: center;
}

body.case-body .case-hero.case-hero--project .case-hero-media.case-hero-media--device-hero {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

body.case-body .case-hero.case-hero--project .case-hero-layer--contain.case-hero-layer--full {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 88%;
  min-height: 0;
  max-height: 92%;
  object-fit: contain;
  object-position: center bottom;
}

.project-4-page.case-page--study .case-section--outcomes-p4 .case-metric strong {
  color: var(--case-study-accent);
}

/* Gardyn controls band — match P2 gallery bleed; tint from design */
.project-4-page .case-gallery-bleed {
  --case-gallery-bleed-bg: #fff8f5;
}

.case-page--study .case-callout--warm {
  border: 1px solid color-mix(in srgb, var(--case-study-accent) 35%, transparent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.case-media-card--device {
  min-height: 0;
  padding: clamp(16px, 3vw, 32px);
  place-items: center;
}

.case-media-card--device img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
}

/* Numbered grid: optional accent indices (e.g. JTBD) */
.case-page--study .case-point-grid--accent .case-point-grid__index {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--case-study-accent);
}

/* Diagram + narrative split (media start, copy end) */
.case-diagram-split {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.68fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.case-diagram-split__copy .case-title {
  margin-bottom: clamp(20px, 3vw, 32px);
}

@media (max-width: 960px) {
  .case-diagram-split {
    grid-template-columns: 1fr;
  }

  .case-diagram-split__copy {
    order: -1;
  }
}

/* Single exported diagram / annotated board (lightbox) */
.case-flow-board {
  margin: 0;
}

.case-flow-board__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: clamp(12px, 2vw, 20px);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease);
}

.case-flow-board__trigger:hover {
  transform: translateY(-2px);
}

.case-flow-board__trigger:focus-visible {
  outline: 2px solid var(--case-study-accent);
  outline-offset: 4px;
}

.case-flow-board__image {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Intro row: long-form copy + paired UI specimens */
.case-specimen-intro {
  display: grid;
  grid-template-columns: minmax(0, 578px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
}

.case-specimen-intro__copy .case-title {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.case-specimen-pair {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.5vw, 28px);
  justify-content: flex-end;
}

.case-specimen-card {
  margin: 0;
  flex: 1 1 220px;
  max-width: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.case-specimen-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .case-specimen-intro {
    grid-template-columns: 1fr;
  }

  .case-specimen-pair {
    justify-content: flex-start;
  }
}

/* Full-width wash behind dense media grids */
.case-section--media-wash {
  position: relative;
  padding-top: clamp(72px, 10vw, 120px);
  padding-bottom: clamp(72px, 10vw, 120px);
}

.case-section--media-wash::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100vw;
  height: 88%;
  max-height: 920px;
  background: linear-gradient(180deg, #f7f7f8 0%, #fde8e0 48%, #f4f4f6 100%);
  z-index: 0;
  pointer-events: none;
}

.case-section--media-wash .case-shell {
  position: relative;
  z-index: 1;
}

.case-gallery-eyebrow--center {
  text-align: center;
  width: 100%;
  margin-bottom: clamp(28px, 4vw, 48px);
}

/* Tighter tile rhythm for 6×2 phone explorations */
.case-gallery--dense {
  --gallery-gap: clamp(12px, 2vw, 20px);
  --gallery-radius: 12px;
}

.case-gallery--dense .case-gallery__item:hover {
  transform: translateY(-2px);
}

/* Large annotated still (final designs) */
.case-annotated-showcase {
  margin: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 80px);
}

.case-annotated-showcase__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: clamp(12px, 2vw, 24px);
  overflow: hidden;
  transition: transform var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease);
}

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

.case-annotated-showcase__trigger:focus-visible {
  outline: 2px solid var(--case-study-accent);
  outline-offset: 4px;
}

.case-annotated-showcase__image {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* 2×2 keyed callouts aligned to annotated leaders */
.case-key-points {
  margin-top: 0;
}

.case-key-points__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 40px) clamp(32px, 5vw, 64px);
  margin-top: clamp(8px, 2vw, 16px);
}

.case-key-points__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 18px;
  align-items: start;
}

.case-key-points__index {
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  color: var(--case-study-accent);
}

.case-key-points__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--case-body-on-white, #8f92a3);
}

.case-key-points__lead {
  display: block;
  color: #30323b;
  font-weight: 600;
}

.case-head--tight {
  margin-bottom: clamp(28px, 4vw, 40px);
}

.case-metrics.case-metrics--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
}

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

/* Mint band + centered hero media (legacy / before state) */
.case-tint-band {
  background: var(--case-gardyn-mint-band, #f0f9f4);
  padding: clamp(48px, 6vw, 80px) 0 clamp(64px, 8vw, 100px);
  width: 100%;
}

.case-tint-band__shell {
  width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  margin-inline: auto;
}

.case-tint-band__head {
  margin-bottom: clamp(28px, 4vw, 48px);
  text-align: center;
}

.case-tint-band__title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 29px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #30323b;
}

.case-tint-band__figure {
  margin: 0 auto;
  max-width: min(100%, 1024px);
}

.case-tint-band__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}

.case-tint-band__trigger:focus-visible {
  outline: 2px solid var(--case-study-accent);
  outline-offset: 4px;
}

.case-tint-band__image {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Two-column audit: narrative + outlined feature list (Figma 505-208651); align-items via .case-two-col.case-two-col--feature-audit (after base .case-two-col). */
.case-two-col--feature-audit {
  display: grid;
  grid-template-columns: minmax(0, 516px) minmax(0, 618px);
  gap: clamp(48px, 8vw, 137px);
  justify-content: space-between;
}

.case-outline-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 618px;
  padding-top: 24px;
}

.case-outline-list__label {
  margin: 0;
  font-family: var(--font-graphik-cond);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #30323b;
}

.case-outline-list__rows {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-outline-list__row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.case-outline-list__index {
  flex: none;
  margin: 0;
  font-family: var(--font-condensed);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--case-study-accent);
}

.case-outline-list__text {
  margin: 0;
  flex: 1 1 auto;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.006em;
  color: #8F92A3;
}

/* Full-bleed static figure (search flow, etc.) */
.case-wide-figure {
  margin: 0;
  width: 100%;
}

.case-wide-figure__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #f6f6f6;
  cursor: zoom-in;
}

.case-wide-figure__trigger:focus-visible {
  outline: 2px solid var(--case-study-accent);
  outline-offset: 2px;
}

.case-wide-figure__image {
  display: block;
  width: 100%;
  height: auto;
}

.case-section--wide-figure {
  padding-block: 0;
}

.case-section--wide-figure .case-shell {
  padding-bottom: clamp(48px, 6vw, 80px);
}

/* Layered device mockup (Beyond a one scroll) */
.case-beyond-mockup {
  position: relative;
  width: 100%;
  max-width: 697px;
  margin-inline: auto;
  aspect-ratio: 697 / 710;
  border-radius: 0;
  overflow: hidden;
}

.case-beyond-mockup__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.case-beyond-mockup__layer--back {
  z-index: 0;
}

.case-beyond-mockup__layer--front {
  z-index: 1;
  mix-blend-mode: normal;
}

.case-split-bleed--gardyn .case-split-bleed__media {
  background: #fff;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  min-height: 0;
}

.case-split-bleed--gardyn .case-split-bleed__content {
  background: #f5fff7;
}

.case-split-bleed--gardyn .case-split-bleed__content {
  align-items: center;
}

.case-split-bleed--gardyn .case-split-bleed__copy {
  max-width: 583px;
}

/* Add-plants feature + micro interaction strip */
.case-gardyn-split-feature {
  display: grid;
  grid-template-columns: minmax(0, 284px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}

.case-gardyn-split-feature__phone {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.1);
}

.case-gardyn-split-feature__phone img {
  display: block;
  width: 100%;
  height: auto;
}

.case-gardyn-split-feature__aside {
  min-width: 0;
  max-width: 731px;
}

.case-micro-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  margin-top: calc(clamp(32px, 4vw, 48px) + 24px);
}

/* Desktop: aside uses full 1fr next to phone (shell max --page-max); micro-flow spans that width.
   Steps use display:contents so tile | arrow | tile | arrow | tile are one flex row — space-between
   yields even gaps between thumbnails; align-items centers arrows on the tile column. */
@media (min-width: 1025px) {
  .case-gardyn-split-feature__aside {
    max-width: none;
  }

  .case-micro-flow {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
  }
}

.case-micro-flow__step {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
}

.case-micro-flow__cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 171px;
  max-width: 100%;
  box-sizing: border-box;
}

.case-micro-flow__thumb {
  position: relative;
  width: 100%;
  max-width: 171px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e6e6e6;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.case-micro-flow__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.case-micro-flow__caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.042px;
  font-weight: 600;
  color: #8f92a3;
}

.case-micro-flow__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex: none;
}

.case-micro-flow__arrow img {
  width: 17px;
  height: auto;
  display: block;
}

@media (min-width: 1025px) {
  .case-micro-flow__step {
    display: contents;
  }
}

/* Three labeled phone columns (member / non-member / expired) */
.case-phone-label-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 40px);
  align-items: end;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
}

.case-phone-label-row__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.case-phone-label-row__item figure {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.case-phone-label-row__item img {
  display: block;
  width: 100%;
  height: auto;
}

.case-phone-label-row__caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: #8f92a3;
}

/* Gardyn: one-row gallery band (Project 2–style bleed, mint panel) */
.project-3-page .case-section--gardyn-gallery-bleed {
  padding-bottom: 0;
}

.project-3-page .case-section--gardyn-gallery-bleed .case-gallery-bleed {
  --case-gallery-bleed-bg: #f5fff7;
}

/* PDP + device cluster (Figma 504-198075) */
.case-gardyn-pdp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(48px, 6vw, 80px);
}

.case-gardyn-pdp__copy {
  flex: 1 1 280px;
  max-width: 543px;
  min-width: 0;
}

.case-gardyn-pdp__media {
  flex: 1 1 280px;
  max-width: 664px;
  min-width: 0;
}

.case-gardyn-pdp__media img {
  display: block;
  width: 100%;
  height: auto;
}

/* PDP device art: preserve aspect ratio (avoid flex squish / “missing” look) */
.case-gardyn-pdp__media--device {
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-gardyn-pdp__device-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: clamp(420px, 72vw, 820px);
  object-fit: contain;
  object-position: center;
}

/* Order complete: wider art in the two-column PDP row */
.case-gardyn-pdp__media--order-complete {
  flex: 2 1 380px;
  max-width: min(100%, 920px);
  min-height: clamp(380px, 48vw, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Slight zoom so UI detail reads larger; clipped by parent overflow */
.case-gardyn-pdp__order-img {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  max-height: clamp(600px, 72vw, 980px);
  object-fit: contain;
  object-position: center;
  margin-inline: auto;
  transform: scale(1.45);
  transform-origin: center center;
}

@media (max-width: 1024px) {
  .case-gardyn-pdp__order-img {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-gardyn-pdp__order-img {
    transform: none;
  }
}

.project-3-page.case-page--study .case-section--outcomes-gardyn .case-metric strong {
  color: #52e070;
}

@media (max-width: 1024px) {
  .case-two-col--feature-audit {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .case-outline-list {
    max-width: none;
    padding-top: 0;
  }

  .case-gardyn-split-feature {
    grid-template-columns: 1fr;
  }

  .case-gardyn-split-feature__phone {
    max-width: 320px;
    margin-inline: auto;
  }

  .case-micro-flow {
    flex-direction: column;
    align-items: center;
  }

  .case-micro-flow__step {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .case-micro-flow__arrow {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    transform: rotate(90deg);
  }

  .case-phone-label-row {
    grid-template-columns: 1fr;
    max-width: 280px;
  }

  .case-gardyn-pdp {
    flex-direction: column;
    align-items: stretch;
  }

  .case-gardyn-pdp__copy,
  .case-gardyn-pdp__media {
    max-width: none;
  }
}

/* --- Case study design system: theme hooks on .case-page--study (override via .project-*-page or custom theme class) --- */
.case-page.case-page--study {
  --case-hero-title-max-w: 420px;
  --case-hero-title-font-size: clamp(42px, 6.6vw, 92px);
  --case-hero-title-line-height: 0.98;
  --case-hero-subtitle-color: #8f92a3;
  --case-hero-subtitle-font-size: 24px;
  --case-hero-subtitle-line-height: 1.5;
  --case-hero-subtitle-max-w: 420px;
  --case-hero-subtitle-letter-spacing: -0.01em;
  --case-hero-media-bg: #f1f1f4;
  --case-hero-scribble-slot-w: 180px;
  --case-hero-scribble-slot-h: 608px;
  --case-tldr-context-bg: #ced3fd;
  --case-tldr-context-color: #30323b;
  --case-tldr-context-font-size: 20px;
  --case-tldr-context-line-height: 1.5;
  --case-tldr-context-letter-spacing: 0;
  --case-tldr-context-strong-color: #30323b;
  --case-tldr-context-strong-weight: 600;
  --case-tldr-title-font-size: 40px;
  --case-tldr-title-letter-spacing: -1.3px;
  --case-surface-panel: transparent;
  --case-point-grid-columns: 3;
  --case-point-grid-gap: 40px;
  --case-point-grid-gap-mobile: 32px;
  --case-point-index-size: 64px;
  --case-point-copy-size: 20px;
  --case-point-copy-line-height: 1.5;
  --case-point-copy-letter-spacing: 0.025em;
  --case-point-copy-muted: var(--color-muted);
  --case-prose-wide-max: 953px;
  --case-gallery-bleed-bg: var(--case-surface-panel);
  --case-gallery-bleed-pad-y-top: 48px;
  --case-gallery-bleed-pad-y-bottom: 100px;
  --case-feature-tight-pad-y: 80px;
  --case-feature-media-stage-max-tight: 456px;
  --case-feature-media-gap-tight: clamp(40px, 13vw, 167px);
  --case-feature-content-max-tight: 657px;
  --case-narrative-copy-max: 520px;
  --case-narrative-media-max: 920px;
  --case-narrative-media-ratio: 4 / 3;
  --case-narrative-media-radius: 16px;
  --case-outcomes-tint-bg: transparent;
  --case-outcomes-tint-pad-top: clamp(100px, 12vw, 160px);
  --case-outcomes-tint-pad-bottom: clamp(120px, 14vw, 200px);
  --case-outcomes-metric-label-color: var(--case-body-on-tint);
  --case-outcomes-metric-label-size: 20px;
  --case-outcomes-metric-value-size: 64px;
  --case-outcomes-head-margin-bottom: 64px;
}

/* Cove (P2): restore theme — .case-page.case-page--study defaults override .project-2-page on specificity */
.case-page.case-page--study.project-2-page {
  --case-tldr-context-bg: #cef5fd;
  --case-tldr-context-color: #30323b;
  --case-tldr-context-strong-color: #30323b;
  --case-surface-panel: #f5fdff;
  --case-gallery-bleed-bg: var(--case-surface-panel);
  --case-outcomes-tint-bg: var(--case-surface-panel);
  /* Narrative device mockup: larger frame on wide desktop (global cap is 920px) */
  --case-narrative-media-max: 1180px;
}

@media (min-width: 1201px) {
  .project-2-page .case-two-col--narrative-media {
    grid-template-columns: minmax(0, min(var(--case-narrative-copy-max), 46%)) minmax(0, 1fr);
  }

  .project-2-page .case-narrative-media__figure {
    justify-self: stretch;
    max-width: min(1280px, 100%);
    aspect-ratio: 4 / 4.6;
    overflow: hidden;
  }

  .project-2-page .case-narrative-media__image {
    object-position: center;
    transform: scale(clamp(2.35, calc(1.2 + 0.11vw), 3.2));
    transform-origin: center;
  }
}

/* Cove (P2): Results block metric values (200% / 300% / 10%) */
.case-page.case-page--study.project-2-page .case-section--outcomes .case-metric strong {
  color: #52c9e0;
}

/* Ensure gallery band tint resolves on the bleed node (inheritance + var() edge cases) */
.project-2-page .case-gallery-bleed {
  --case-gallery-bleed-bg: #f5fdff;
}

body.case-body .case-page--study .case-hero.case-hero--project .case-hero-title {
  max-width: min(100%, var(--case-hero-title-max-w));
  font-size: var(--case-hero-title-font-size);
  line-height: var(--case-hero-title-line-height);
  /* Keep breaks at word boundaries only — break-word was splitting long words and
     stranding single letters (e.g. “P” from “PROGRAM”) on their own line. */
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: pretty;
  min-width: 0;
}

body.case-body .case-page--study .case-hero.case-hero--project .case-hero-subtitle {
  color: var(--case-hero-subtitle-color, #8f92a3);
  font-size: var(--case-hero-subtitle-font-size, 24px);
  line-height: var(--case-hero-subtitle-line-height, 1.5);
  max-width: min(100%, var(--case-hero-subtitle-max-w));
  letter-spacing: var(--case-hero-subtitle-letter-spacing);
}

.case-page--study .case-tldr .case-context {
  background: var(--case-tldr-context-bg);
  color: var(--case-tldr-context-color);
  font-size: 18px;
  line-height: var(--case-tldr-context-line-height);
  letter-spacing: var(--case-tldr-context-letter-spacing);
}

.case-page--study .case-tldr .case-context strong {
  color: var(--case-tldr-context-strong-color);
  font-weight: var(--case-tldr-context-strong-weight);
}

/* Upper label / eyebrow — reusable across case studies */
.case-page--study .case-label-upper {
  margin: 0 0 40px;
  width: 100%;
  text-align: left;
  font-family: var(--font-graphik-cond);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #30323b;
}

/* Numbered point grid (research trends, takeaways, principles) */
.case-page--study .case-point-grid,
.case-page--study .case-trend-row {
  display: grid;
  grid-template-columns: repeat(var(--case-point-grid-columns), minmax(0, 1fr));
  gap: var(--case-point-grid-gap);
  align-items: start;
}

.case-page--study .case-point-grid__item,
.case-page--study .case-trend-item {
  margin: 0;
}

.case-page--study .case-point-grid__index,
.case-page--study .case-trend-index {
  margin: 0 0 24px;
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: var(--case-point-index-size);
  line-height: 1;
  color: var(--case-study-accent);
}

.case-page--study .case-point-grid__copy,
.case-page--study .case-trend-copy {
  margin: 0;
  font-size: var(--case-point-copy-size);
  line-height: var(--case-point-copy-line-height);
  letter-spacing: var(--case-point-copy-letter-spacing);
  color: var(--case-point-copy-muted);
}

@media (max-width: 640px) {
  .case-page--study .case-point-grid,
  .case-page--study .case-trend-row {
    grid-template-columns: 1fr;
    gap: var(--case-point-grid-gap-mobile);
  }
}

.case-page--study .case-prose-wide,
.case-page--study .case-head.case-prose-wide {
  max-width: min(100%, var(--case-prose-wide-max));
}

/* Wide tinted panel behind a section (set --case-surface-panel on the case page) */
.case-section--tint-panel,
.case-section--tint-cove {
  background: var(--case-surface-panel);
}

/* Split bleed with shared panel surface (image + copy on same tint) */
.case-split-bleed--panel,
.case-split-bleed--cove,
.case-split-bleed--panel .case-split-bleed__media,
.case-split-bleed--panel .case-split-bleed__content,
.case-split-bleed--cove .case-split-bleed__media,
.case-split-bleed--cove .case-split-bleed__content {
  background: var(--case-surface-panel);
}

.case-split-bleed--panel .case-split-bleed__media,
.case-split-bleed--cove .case-split-bleed__media {
  display: block;
  padding: 0;
  margin: 0;
  min-height: 0;
}

.case-split-bleed--panel .case-split-bleed__image,
.case-split-bleed--cove .case-split-bleed__image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: none;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1200px) {
  .case-split-bleed--panel .case-split-bleed__media,
  .case-split-bleed--cove .case-split-bleed__media {
    min-height: 0 !important;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .case-split-bleed--panel .case-split-bleed__image,
  .case-split-bleed--cove .case-split-bleed__image {
    min-height: 0 !important;
    max-height: none !important;
  }
}

.case-split-bleed--panel,
.case-split-bleed--cove {
  min-height: 0;
  /* Stretch both columns to one row height so copy can vertically center in the tint panel */
  align-items: stretch;
}

@media (min-width: 1201px) {
  .case-split-bleed--panel .case-split-bleed__media,
  .case-split-bleed--cove .case-split-bleed__media {
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-self: stretch;
  }

  .case-split-bleed--panel .case-split-bleed__image,
  .case-split-bleed--cove .case-split-bleed__image {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }

  .case-split-bleed--panel .case-split-bleed__content,
  .case-split-bleed--cove .case-split-bleed__content {
    padding-block: 0;
  }
}

/* Feature media — tight vertical rhythm + Figma-tuned stage width (modifier on section) */
.case-section--feature-media-tight.case-section,
.case-section--p2-section10.case-section {
  padding-block: var(--case-feature-tight-pad-y);
}

.case-section--feature-media-tight .case-feature-media,
.case-section--p2-section10 .case-feature-media {
  --case-feature-media-stage-max: var(--case-feature-media-stage-max-tight);
  gap: var(--case-feature-media-gap-tight);
}

.case-section--feature-media-tight .case-feature-media__content,
.case-section--p2-section10 .case-feature-media__content {
  min-width: 0;
  max-width: var(--case-feature-content-max-tight);
}

.case-section--feature-media-tight .case-title,
.case-section--p2-section10 .case-title {
  max-width: 469px;
  line-height: 1.4;
  letter-spacing: 0;
  margin-bottom: 24px;
}

.case-section--feature-media-tight .case-copy,
.case-section--p2-section10 .case-copy {
  line-height: 1.5;
  letter-spacing: 0.00625em;
}

/* Final narrative + framed hero image (asymmetric two-column) */
.case-two-col--narrative-media,
.case-two-col--p2-final {
  grid-template-columns: minmax(0, min(var(--case-narrative-copy-max), 48%)) minmax(0, 1fr);
  gap: clamp(40px, 5vw, 64px);
  align-items: center;
}

.case-narrative-media__copy,
.case-p2-final-copy {
  min-width: 0;
  max-width: var(--case-narrative-copy-max);
}

.case-narrative-media__figure,
.case-p2-final-split__media {
  position: relative;
  justify-self: stretch;
  width: 100%;
  max-width: min(var(--case-narrative-media-max), 100%);
  min-width: 0;
  margin-left: auto;
  aspect-ratio: var(--case-narrative-media-ratio);
  overflow: visible;
  border-radius: var(--case-narrative-media-radius);
  background: transparent;
}

.case-narrative-media__image,
.case-p2-final-split__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Section: intro copy + full-bleed gallery band
   (Shared with .case-gallery grid + #case-lightbox; see “CASE STUDY GALLERY” block below.) */
.case-section--gallery-bleed,
.case-section--exploration {
  padding-bottom: 0;
}

.case-gallery-bleed__intro,
.case-exploration-intro {
  padding-bottom: 60px;
}

.case-gallery-bleed,
.case-exploration-bleed {
  background: var(--case-gallery-bleed-bg);
  padding: var(--case-gallery-bleed-pad-y-top) 0 var(--case-gallery-bleed-pad-y-bottom);
  width: 100%;
}

.case-gallery-bleed__inner,
.case-exploration-bleed-inner {
  width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  margin-inline: auto;
}

/* Horizontal scroll rail for dense galleries (tablet / mobile) */
@media (max-width: 1024px) {
  .case-gallery-bleed,
  .case-exploration-bleed {
    padding-left: 0;
    padding-right: 0;
  }

  .case-gallery-bleed__inner,
  .case-exploration-bleed-inner {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
  }

  .case-gallery-bleed .case-gallery,
  .case-exploration-bleed .case-gallery {
    gap: clamp(20px, 4vw, 32px);
    --gallery-gap: 24px;
  }

  .case-gallery-bleed .case-gallery__intro,
  .case-exploration-bleed .case-gallery__intro {
    padding-inline: clamp(12px, 4vw, 24px);
    max-width: var(--page-max);
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .case-gallery-scroll,
  .case-exploration-gallery-viewport {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-block: 32px 40px;
    padding-inline: 0 clamp(28px, 8vw, 56px);
    padding-left: clamp(12px, 4vw, 24px);
    scroll-padding-inline: clamp(10px, 2vw, 16px) clamp(28px, 8vw, 56px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(48, 50, 59, 0.22) transparent;
  }

  .case-gallery-bleed .case-gallery__grid,
  .case-exploration-bleed .case-gallery__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 24px;
    width: max-content;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .case-gallery-bleed .case-gallery__grid:has(.case-gallery__cell),
  .case-exploration-bleed .case-gallery__grid:has(.case-gallery__cell) {
    align-items: flex-start;
  }

  .case-gallery-scroll::-webkit-scrollbar,
  .case-exploration-gallery-viewport::-webkit-scrollbar {
    height: 5px;
  }

  .case-gallery-scroll::-webkit-scrollbar-track,
  .case-exploration-gallery-viewport::-webkit-scrollbar-track {
    background: transparent;
  }

  .case-gallery-scroll::-webkit-scrollbar-thumb,
  .case-exploration-gallery-viewport::-webkit-scrollbar-thumb {
    background-color: rgba(48, 50, 59, 0.2);
    border-radius: 999px;
  }

  .case-gallery-bleed .case-gallery__item,
  .case-exploration-bleed .case-gallery__item {
    flex: 0 0 auto;
    width: min(68vw, 260px);
    scroll-snap-align: start;
  }

  .case-gallery-bleed .case-gallery__cell,
  .case-exploration-bleed .case-gallery__cell {
    flex: 0 0 auto;
    width: min(68vw, 260px);
    scroll-snap-align: start;
  }

  .case-gallery-bleed .case-gallery__cell .case-gallery__item,
  .case-exploration-bleed .case-gallery__cell .case-gallery__item {
    width: 100%;
    scroll-snap-align: unset;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .case-gallery-bleed .case-gallery__intro,
  .case-exploration-bleed .case-gallery__intro {
    padding-inline: clamp(16px, 4vw, 32px);
  }

  .case-gallery-scroll,
  .case-exploration-gallery-viewport {
    padding-inline: 0 clamp(28px, 8vw, 56px);
    padding-left: clamp(16px, 4vw, 32px);
    scroll-padding-inline: clamp(10px, 2vw, 16px) clamp(28px, 8vw, 56px);
  }
}

@media (max-width: 768px) {
  .case-gallery-scroll,
  .case-exploration-gallery-viewport {
    padding-inline: 0 clamp(24px, 9vw, 48px);
    padding-left: clamp(12px, 4vw, 24px);
    scroll-padding-inline: clamp(10px, 3vw, 14px) clamp(24px, 9vw, 48px);
  }

  .case-gallery-bleed .case-gallery__grid,
  .case-exploration-bleed .case-gallery__grid {
    gap: 24px;
  }

  .case-gallery-bleed .case-gallery__item,
  .case-exploration-bleed .case-gallery__item {
    width: min(70vw, 240px);
  }

  .case-gallery-bleed .case-gallery__cell,
  .case-exploration-bleed .case-gallery__cell {
    width: min(70vw, 240px);
  }
}

@media (max-width: 640px) {
  .case-gallery-bleed .case-gallery__item,
  .case-exploration-bleed .case-gallery__item {
    width: 72vw;
    max-width: 220px;
  }

  .case-gallery-bleed .case-gallery__cell,
  .case-exploration-bleed .case-gallery__cell {
    width: 72vw;
    max-width: 220px;
  }
}

@media (max-width: 390px) {
  .case-gallery-bleed .case-gallery__item,
  .case-exploration-bleed .case-gallery__item {
    width: min(76vw, 210px);
    max-width: none;
  }

  .case-gallery-bleed .case-gallery__cell,
  .case-exploration-bleed .case-gallery__cell {
    width: min(76vw, 210px);
    max-width: none;
  }
}

.case-page--study .case-gallery-eyebrow,
.case-page--study .case-exploration-eyebrow {
  margin: 0 0 32px;
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(22px, 2.5vw, 29px);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #30323b;
}

.case-page--study .case-media-frame,
.case-page--study .case-exploration-frame {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.06);
}

.case-page--study .case-media-frame img,
.case-page--study .case-exploration-frame img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Outcomes on a tinted panel (optional; set --case-outcomes-tint-bg on the case page) */
.case-section--outcomes-tint,
.case-section--outcomes-cove {
  background: var(--case-outcomes-tint-bg);
  padding-top: var(--case-outcomes-tint-pad-top);
  padding-bottom: var(--case-outcomes-tint-pad-bottom);
}

.case-section--outcomes-tint.case-section,
.case-section--outcomes-cove.case-section {
  background: var(--case-outcomes-tint-bg);
}

.case-page--study .case-section--outcomes-tint .case-copy,
.case-page--study .case-section--outcomes-tint .case-metric span,
.case-page--study .case-section--outcomes-cove .case-copy,
.case-page--study .case-section--outcomes-cove .case-metric span {
  color: var(--case-outcomes-metric-label-color);
  font-size: var(--case-outcomes-metric-label-size);
}

.case-page--study .case-section--outcomes-tint .case-metric strong,
.case-page--study .case-section--outcomes-cove .case-metric strong {
  color: var(--case-study-accent);
  font-size: var(--case-outcomes-metric-value-size);
}

.case-section--outcomes-tint .case-metric,
.case-section--outcomes-cove .case-metric {
  border-top: none;
  padding-top: 0;
}

.case-section--outcomes-tint .case-head,
.case-section--outcomes-cove .case-head {
  margin-bottom: var(--case-outcomes-head-margin-bottom);
}

.case-page,
.case-hero,
.case-section {
  background: #fff;
}

.case-page--study .case-context {
  color: #30323b;
  font-size: 18px;
  line-height: 150%;
}

.case-page--study .case-context strong {
  color: #30323b;
  font-weight: 600;
}

.case-page--study .case-tldr-grid p,
.case-page--study .case-copy,
.case-page--study .case-insight p {
  font-size: 18px;
  line-height: 150%;
}

.case-page--study .case-tldr-grid p a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--motion-duration-fast) var(--motion-ease-standard);
}

.case-page--study .case-tldr-grid p a:hover {
  text-decoration-color: color-mix(in srgb, currentColor 65%, transparent);
}

.case-page--study .case-tldr-grid p a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

.case-page--study .case-tldr-grid p.case-tldr-p--lead {
  line-height: 1.5;
  height: fit-content;
}

.case-page--study .case-tldr-grid p.case-tldr-p--lead strong {
  font-weight: 600;
}

.case-page--study .case-section--outcomes .case-copy,
.case-page--study .case-section--outcomes .case-metric span {
  color: var(--case-body-on-tint);
}

.case-page--study .case-section--outcomes .case-copy {
  font-size: 18px;
}

.case-page--study .case-section--outcomes .case-metric strong {
  color: #4759eb;
}

.case-page--study .case-section--outcomes .case-head {
  margin-bottom: 72px;
}

.case-page--study .case-section--outcomes .case-metrics {
  column-gap: 48px;
}

.case-page--study .case-insight {
  background: #f5f6ff;
}

/* =========================
   CASE STUDY HEADER + HERO
   Single source of truth
   ========================= */

/* Project pages: no extra top padding from main wrapper */
body.case-body {
  padding: 0;
  background: #fff;
}

body.case-body .case-page {
  padding-top: 0 !important;
}

/* =========================
   CASE HEADER — MATCH MAIN SYSTEM
   ========================= */

body.case-body .nav-close,
body.case-body .nav-close img {
  opacity: 1 !important;
  filter: none !important;
}

/* Hero layout */
body.case-body .case-hero.case-hero--project {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #fff;
  padding: 0 !important;
  margin: 0;
}

body.case-body .case-page--study .case-hero {
  min-height: 100svh;
  height: auto;
}

body.case-body .case-hero.case-hero--project .case-hero-copy {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 160px;
  padding-bottom: 80px;
  /* Align with .case-shell: centered max 1280px + page gutters */
  padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter)))) / 2);
  padding-right: var(--page-gutter);
  position: relative;
  z-index: 2;
}

body.case-body .case-hero.case-hero--project .case-hero-copy-inner {
  width: min(100%, 600px);
  min-height: auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 24px;
}

body.case-body .case-page--study .case-hero-lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  width: min(100%, 378px);
  min-height: 608px;
  height: 100%;
  flex: 1 1 auto;
  flex-shrink: 0;
  padding-bottom: 40px;
}

body.case-body .case-page--study .case-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

body.case-body .case-page--study .case-hero-text .case-hero-subtitle {
  margin-top: 0;
}

body.case-body .case-page--study .case-hero-cta {
  display: block;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 50%;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-top: auto;
}

body.case-body .case-page--study .case-hero-cta:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

body.case-body .case-page--study .case-hero-cta:focus-visible {
  outline: 2px solid #30323b;
  outline-offset: 4px;
}

body.case-body .case-page--study .case-hero-cta img {
  display: block;
  width: 100%;
  height: 100%;
}

body.case-body .case-hero.case-hero--project .case-hero-media {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  display: block;
  background: var(--case-hero-media-bg, #f1f1f4);
}

body.case-body .case-hero.case-hero--project .case-hero-shot {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: none;
}

/* Project hero — single color composite (assets/global/thumbnails/work-NN-color.png) */
body.case-body .case-hero.case-hero--project .case-hero-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

body.case-body .case-hero.case-hero--project .case-hero-layer {
  position: absolute;
  display: block;
  max-width: none;
}

body.case-body .case-hero.case-hero--project .case-hero-layer.case-hero-layer--full {
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: none;
  z-index: 1;
}

/* Layered hero art (e.g. Gardyn dual export from Figma) */
body.case-body .case-hero.case-hero--project .case-hero-layer--back {
  inset: 0;
  width: 132%;
  max-width: none;
  height: 100%;
  min-height: 100%;
  left: -28%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  filter: saturate(0.92) contrast(1.02);
  pointer-events: none;
}

body.case-body .case-page--study .case-hero-accent.case-hero-accent--scribble {
  display: block;
  position: relative;
  width: var(--case-hero-scribble-slot-w);
  height: var(--case-hero-scribble-slot-h);
  flex-shrink: 0;
  margin-left: 0;
  background: none;
  opacity: 1;
  overflow: visible;
}

body.case-body .case-page--study .case-hero-accent.case-hero-accent--scribble .case-hero-accent-img {
  position: absolute;
  top: 0;
  right: -1.04%;
  bottom: -0.81%;
  left: -132.54%;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
}

@media (max-width: 1200px) {
  body.case-body .case-page--study .case-hero-accent.case-hero-accent--scribble {
    display: none;
  }

  body.case-body .case-page--study .case-hero-lead {
    min-height: auto;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  body.case-body .case-hero.case-hero--project {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body.case-body .case-page--study .case-hero {
    min-height: auto;
  }

  body.case-body .case-hero.case-hero--project .case-hero-copy {
    min-height: auto;
    padding-top: 132px;
    padding-bottom: 32px;
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-tablet)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-tablet)))) / 2);
    justify-content: flex-start;
  }

  body.case-body .case-hero.case-hero--project .case-hero-copy-inner {
    width: 100%;
    min-height: auto;
  }

  body.case-body .case-page--study .case-hero-lead {
    min-height: auto;
    width: 100%;
    gap: 32px;
    height: auto;
    flex: 0 1 auto;
    padding-bottom: 40px;
  }

  body.case-body .case-page--study .case-hero.case-hero--project .case-hero-title {
    font-size: clamp(38px, 6.5vw, 76px);
  }

  body.case-body .case-hero.case-hero--project .case-hero-media {
    min-height: 560px;
    height: 560px;
  }

  body.case-body .case-hero.case-hero--project .case-hero-shot,
  body.case-body .case-hero.case-hero--project .case-hero-layer--full {
    min-height: 560px;
    height: 560px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body.case-body .case-hero.case-hero--project {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 0 !important;
  }

  body.case-body .case-page--study .case-hero.case-hero--project .case-hero-title {
    font-size: clamp(24px, 10.5vw, 52px);
    max-width: 100%;
  }

  body.case-body .case-page--study .case-hero.case-hero--project .case-hero-subtitle,
  p.case-hero-subtitle {
    font-size: 18px;
  }

  body.case-body .case-hero.case-hero--project .case-hero-copy {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 24px;
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile)))) / 2);
  }

  body.case-body .case-hero.case-hero--project .case-hero-copy-inner {
    width: 100%;
    min-height: auto;
    gap: 16px;
  }

  body.case-body .case-page--study .case-hero-lead {
    gap: 28px;
    padding-bottom: 40px;
    min-width: 0;
  }

  body.case-body .case-page--study .case-hero-text {
    min-width: 0;
  }

  body.case-body .case-hero.case-hero--project .case-hero-media {
    min-height: 420px;
    height: 420px;
  }

  body.case-body .case-hero.case-hero--project .case-hero-shot,
  body.case-body .case-hero.case-hero--project .case-hero-layer--full {
    min-height: 420px;
    height: 420px;
  }

  body.case-body .case-page--study .case-hero-cta {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  body.case-body .case-hero.case-hero--project .case-hero-copy {
    padding-top: 112px;
    padding-bottom: 20px;
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile-sm)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile-sm)))) / 2);
  }

  body.case-body .case-hero.case-hero--project .case-hero-media {
    min-height: 360px;
    height: 360px;
  }

  body.case-body .case-hero.case-hero--project .case-hero-shot,
  body.case-body .case-hero.case-hero--project .case-hero-layer--full {
    min-height: 360px;
    height: 360px;
  }
}

@media (hover: none), (pointer: coarse) {
  .work-card:hover .work-card-media {
    transform: none;
  }

  .work-card:hover .work-card-img,
  .work-card:hover .work-card-placeholder,
  .work-card:hover .work-card-stack {
    transform: none;
  }

  body.case-body .case-page--study .case-hero-cta:hover,
  .hero-cta:hover {
    transform: none;
    opacity: 1;
  }
}

.case-shell {
  width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  margin-inline: auto;
}

.case-hero {
  min-height: 828px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #fff;
}

.case-hero-copy {
  min-height: 828px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 140px var(--page-gutter) 80px;
}

.case-hero-copy-inner {
  width: min(100%, 560px);
  min-height: 608px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.case-hero-label {
  margin: 0 0 24px;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #2a2a2a;
}

.case-hero-title {
  margin: 0;
  max-width: 420px;
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: clamp(42px, 6.6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: pretty;
}

.case-hero-subtitle {
  margin: 18px 0 0;
  max-width: 420px;
  color: #8f92a3;
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.case-hero-accent {
  width: 180px;
  height: 608px;
  margin-left: auto;
  opacity: 0.9;
}

/* Scribble heroes use <img class="case-hero-accent-img">; skip global SVG so it never flashes under project art. */
.case-hero-accent:not(.case-hero-accent--scribble) {
  background: url("assets/global/hero-accent.svg") center/contain no-repeat;
}

.case-hero-media {
  min-height: 828px;
  display: flex;
  align-items: center;
  justify-content: stretch;
  overflow: hidden;
}

.case-hero-shot {
  width: 100%;
  height: 100%;
  min-height: 828px;
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.88) contrast(1.02);
}

.case-tldr {
  background: var(--case-band-dark-bg);
  color: var(--case-band-dark-text);
  padding: 80px 0;
}

#case-tldr {
  scroll-margin-top: 96px;
}

.case-context {
  border: 0;
  background: #ced3fd;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1.5;
  margin-bottom: 40px;
}

.case-title {
  margin: 0 0 24px;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-family: var(--font-condensed);
  font-weight: 600;
}

.case-tldr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.case-tldr-grid--single {
  grid-template-columns: 1fr;
  max-width: min(100%, 1280px);
}

.case-tldr-grid p {
  margin: 0;
  color: var(--case-band-dark-text);
  font-size: 20px;
  line-height: 150%;
}

.case-tldr .case-title {
  color: var(--case-band-dark-text);
}

.case-section {
  padding: 100px 0;
}

.case-two-col {
  display: grid;
  grid-template-columns: 519px 1fr;
  gap: 72px;
  align-items: center;
}

/* Same element carries .case-two-col + .case-two-col--feature-audit; base rule above wins cascade unless specificity bumps. */
.case-two-col.case-two-col--feature-audit {
  align-items: start;
}

.case-two-col.case-two-col--feature-audit .case-outline-list {
  padding-top: 0;
}

.case-copy {
  margin: 0;
  color: var(--case-body-on-white, #8f92a3);
  font-size: 18px;
}

@media (min-width: 1025px) {
  .case-page--study .case-copy {
    font-size: 18px;
  }
}

.case-copy--spaced {
  margin-top: 20px;
}

.case-page--study .case-section .case-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.3;
  letter-spacing: -1.3px;
  color: #30323b;
}

.case-page--study .case-tldr .case-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--case-tldr-title-font-size);
  line-height: 1.3;
  letter-spacing: var(--case-tldr-title-letter-spacing);
  color: var(--case-band-dark-text);
}

.case-media-card {
  background: #fff;
  border: none;
  border-radius: 16px;
  min-height: 470px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.case-media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-page--study .case-section--opening .case-media-card {
  min-height: 0;
  height: min(470px, 60vh);
  max-height: 60vh;
}

.case-page--study .case-section--opening .case-media-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

/* Device mock in opening: shrink-wrap card to image (not fixed viewport-tall frame). */
.case-page--study .case-section--opening .case-media-card--device {
  height: auto;
  max-height: none;
  width: fit-content;
  max-width: 100%;
  align-self: start;
  justify-self: start;
}

.case-page--study .case-section--opening .case-media-card--device img {
  width: auto;
  max-width: min(600px, 100%);
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.case-head {
  margin-bottom: 40px;
  max-width: 820px;
}

.case-insight-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.case-insight {
  background: #f5f5f8;
  border: none;
  border-radius: 12px;
  padding: 24px;
}

.case-insight h3 {
  margin: 0 0 16px;
  font-family: var(--font-graphik-cond);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--case-body-on-tint, #30323b);
}

.case-insight p {
  margin: 0;
  color: var(--case-body-on-tint, #30323b);
  font-size: 17px;
}

.case-divider-quote {
  border-top: 1px solid #d9d9dd;
  border-bottom: 1px solid #d9d9dd;
  padding: 40px 0;
  text-align: center;
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #2a2a2a;
}

.case-divider-quote--bleed-dark {
  margin: 0;
  border: 0;
  background: var(--case-band-dark-bg);
  color: var(--case-band-dark-text);
  text-align: left;
  padding: 40px var(--page-gutter);
}

.case-page--study .case-divider-quote--bleed-dark {
  font-size: 32px;
  line-height: 1.5;
}

.case-section--bleed {
  width: 100%;
}

.case-section--bleed > * {
  width: 100%;
}

/* Full-bleed split: no .case-section vertical padding; media bleeds edge-to-edge; copy uses page max + gutters */
.case-section--split-bleed {
  padding: 0;
  width: 100%;
}

.case-split-bleed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 710px;
  width: 100%;
  background: #fff;
}

.case-split-bleed__media {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

.case-split-bleed__image {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.case-split-bleed__content {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  padding-block: clamp(24px, 3vw, 48px);
  padding-left: var(--page-gutter);
  padding-right: max(var(--page-gutter), calc((100vw - var(--page-max)) / 2));
  background: #fff;
}

.case-split-bleed__copy {
  width: 100%;
  max-width: min(100%, 560px);
}

.case-section--system .case-head {
  max-width: 843px;
}

.case-section--system .case-title {
  margin-bottom: 24px;
}

.case-section--system .case-copy {
  color: var(--case-body-on-white);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.005em;
}

/* Safe-scale system diagram (3 rows: labels → connectors → cards) */
.case-section--system .system-diagram {
  --diagram-card-bg: #f5f6ff;
  --diagram-text: #30323b;
  --diagram-muted: #5e6270;
  --diagram-dark-pill: #222;
  --diagram-light-pill: #dbdfff;
  --diagram-blue-text: #000d75;
  --diagram-line: #d9d9d9;
  --diagram-arrow: #dbdbdb;
  --diagram-radius-pill: 999px;
  --diagram-radius-card: 22px;
  /* Vertical rhythm between diagram blocks (desktop + stacked) */
  --diagram-section-gap: 18px;

  margin-top: 64px;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--diagram-text);
}

.case-section--system .diagram-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--diagram-section-gap);
}

.case-section--system .system-diagram .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.case-section--system .diagram-top {
  display: grid;
  grid-template-columns: minmax(0, 465px) minmax(0, 1fr);
  gap: 65px;
  align-items: center;
}

.case-section--system .top-pill {
  min-height: 64px;
  height: 64px;
  border-radius: var(--diagram-radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
}

.case-section--system .top-pill--dark {
  background: var(--diagram-dark-pill);
  color: #fff;
  justify-content: flex-start;
  padding-left: 54px;
  font-family: var(--font-condensed);
}

.case-section--system .top-pill__strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.case-section--system .top-pill__text {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.95;
}

.case-section--system .top-pill--light {
  background: var(--diagram-light-pill);
  color: var(--diagram-blue-text);
}

.case-section--system .top-pill__label {
  font-family: var(--font-condensed);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.case-section--system .diagram-connectors--desktop {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  align-items: center;
  min-height: 72px;
}

.case-section--system .diagram-connectors--stack {
  display: none;
}

.case-section--system .diagram-group--pair,
.case-section--system .diagram-group--trio {
  display: contents;
}

.case-section--system .stack-connector-branch {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1 1 0;
  min-width: 0;
}

.case-section--system .stack-connector-branch--dash {
  align-items: center;
  justify-content: center;
}

.case-section--system .stack-connector-branch--dash::before {
  content: "";
  width: 0;
  height: 52px;
  border-left: 4px dashed var(--diagram-line);
}

.case-section--system .stack-connector-branch--down {
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

/* Arrow_dark.svg — down arrow asset (intrinsic 204×81); scaled to connector row */
.case-section--system .stack-connector-branch--down .stack-flow-arrow-img {
  display: block;
  width: auto;
  height: 48px;
  max-width: min(100%, 160px);
  object-fit: contain;
  object-position: center;
}

.case-section--system .diagram-connectors--stack-op .stack-connector-branch--down {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.case-section--system .connector {
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-section--system .connector--down-1 {
  grid-column: 1;
}

.case-section--system .connector--down-2 {
  grid-column: 3;
}

.case-section--system .connector--dash-3 {
  grid-column: 5;
}

.case-section--system .connector--dash-4 {
  grid-column: 7;
}

.case-section--system .connector--dash-5 {
  grid-column: 9;
}

.case-section--system .down-arrow {
  font-size: 48px;
  line-height: 1;
  color: var(--diagram-text);
  font-weight: 400;
  transform: translateY(2px);
}

.case-section--system .connector--dash {
  position: relative;
  height: 52px;
}

.case-section--system .connector--dash::before {
  content: "";
  width: 0;
  height: 52px;
  border-left: 4px dashed var(--diagram-line);
  display: block;
}

.case-section--system .diagram-row {
  display: grid;
  grid-template-columns: 1fr 52px 1fr 52px 1fr 52px 1fr 52px 1fr;
  gap: 10px;
  align-items: center;
}

.case-section--system .diagram-card {
  min-height: 212px;
  background: var(--diagram-card-bg);
  border-radius: var(--diagram-radius-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.case-section--system .diagram-card__icon {
  width: 33px;
  height: 33px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.case-section--system .diagram-card__icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.case-section--system .diagram-card__title {
  margin: 0 0 10px;
  font-family: var(--font-condensed);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--diagram-text);
}

.case-section--system .diagram-card__body {
  margin: 0;
  max-width: 200px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--diagram-text);
  letter-spacing: 0;
}

.case-section--system .flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-section--system .flow-arrow svg {
  width: 40px;
  height: 40px;
  stroke: var(--diagram-arrow);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.case-metric {
  border-top: 1px solid #d9d9dd;
  padding-top: 20px;
}

.case-metric strong {
  display: block;
  margin-bottom: 8px;
  color: var(--case-study-accent);
  font-size: 80px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-family: var(--font-condensed);
  font-weight: 600;
}

.case-metric span {
  color: #4b4b4b;
  font-size: 18px;
}

.case-project-nav {
  border-top: 1px solid #d9d9dd;
  margin-top: 28px;
  padding: 22px 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #2a2a2a;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.case-project-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.case-project-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .case-hero {
    grid-template-columns: 1fr;
  }

  .case-hero:not(.case-hero--project) .case-hero-copy {
    min-height: auto;
    justify-content: flex-start;
    padding: 92px var(--page-gutter-tablet) 32px;
  }

  .case-hero:not(.case-hero--project) .case-hero-copy-inner {
    width: min(100%, var(--page-max));
    min-height: auto;
  }

  .case-hero-accent {
    display: none;
  }

  .case-hero-media,
  .case-hero-shot {
    min-height: 500px;
  }

  .case-two-col,
  .case-insight-cards,
  .case-metrics,
  .case-tldr-grid {
    grid-template-columns: 1fr;
  }

  .case-metrics.case-metrics--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-section--feature-media-tight.case-section,
  .case-section--p2-section10.case-section {
    padding-block: 64px;
  }

  .case-section--feature-media-tight .case-feature-media__content,
  .case-section--p2-section10 .case-feature-media__content {
    max-width: none;
  }

  .case-section--feature-media-tight .case-title,
  .case-section--p2-section10 .case-title {
    max-width: none;
  }

  .case-two-col--narrative-media,
  .case-two-col--p2-final {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .case-narrative-media__copy,
  .case-p2-final-copy {
    max-width: none;
    width: 100%;
  }

  .case-narrative-media__figure,
  .case-p2-final-split__media {
    justify-self: stretch;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    aspect-ratio: 16 / 10;
    border-radius: 0;
  }

  .case-narrative-media__image,
  .case-p2-final-split__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* Allow wide images (e.g. Capacity.png) to shrink to the column instead of forcing overflow */
  .case-two-col > * {
    min-width: 0;
  }

  .case-title {
    font-size: 44px;
  }

  .case-section--system .system-diagram {
    margin-top: 40px;
    --diagram-section-gap: 28px;
  }

  .case-section--system .diagram-top {
    display: contents;
  }

  .case-section--system .top-pill--dark {
    order: 1;
    justify-content: center;
    padding-left: 28px;
  }

  .case-section--system .diagram-connectors--stack-op {
    display: flex;
    order: 2;
    width: 100%;
    justify-content: center;
    gap: clamp(40px, 16vw, 200px);
    min-height: 56px;
    align-items: stretch;
    margin: 0;
  }

  .case-section--system .diagram-row {
    display: contents;
  }

  .case-section--system .diagram-group--pair {
    display: grid;
    order: 3;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }

  .case-section--system .flow-arrow--between {
    display: none;
  }

  .case-section--system .top-pill--light {
    order: 4;
    width: 100%;
    box-sizing: border-box;
  }

  .case-section--system .diagram-connectors--stack-life {
    display: flex;
    order: 5;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(8px, 8vw, 120px);
    min-height: 52px;
    margin: 0;
  }

  .case-section--system .diagram-group--trio {
    display: grid;
    order: 6;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }

  .case-section--system .diagram-connectors--desktop {
    display: none;
  }

  .case-section--system .flow-arrow {
    transform: none;
  }

  .case-section--system .flow-arrow svg {
    width: 32px;
    height: 32px;
  }

  .case-section--system .diagram-card__body {
    max-width: none;
  }
}

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

  .case-section--system .system-diagram {
    margin-top: 28px;
    --diagram-section-gap: 20px;
  }

  .case-section--system .diagram-group--pair {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 12px;
  }

  .case-section--system .diagram-group--pair .flow-arrow {
    transform: rotate(90deg);
    margin-block: 4px;
  }

  .case-section--system .diagram-group--trio {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 12px;
  }

  .case-section--system .diagram-group--trio .flow-arrow {
    transform: rotate(90deg);
    margin-block: 4px;
  }

  .case-section--system .diagram-connectors--stack-life {
    padding: 0 clamp(4px, 4vw, 48px);
    margin: 0;
  }

  .case-section--system .diagram-connectors--stack-op {
    gap: clamp(24px, 10vw, 100px);
    min-height: 48px;
  }

  .case-section--system .top-pill {
    min-height: unset;
    height: auto;
    padding: 16px 20px;
    text-align: center;
  }

  .case-section--system .top-pill--dark {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .case-section--system .top-pill__strong,
  .case-section--system .top-pill__label,
  .case-section--system .top-pill__text {
    font-size: 20px;
  }

  .case-section--system .diagram-card {
    min-height: unset;
    padding: 18px;
    border-radius: 16px;
  }

  .case-section--system .diagram-card__icon {
    width: 30px;
    height: 30px;
    margin-bottom: 16px;
  }

  .case-section--system .diagram-card__title {
    font-size: 20px;
  }

  .case-section--system .diagram-card__body {
    font-size: 16px;
    line-height: 1.5;
  }
}

/* --- Project 1 page specific layout --- */
.case-media-card--tall {
  min-height: 628px;
  height: 628px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.case-media-card.case-media-card--tall img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  object-fit: cover;
  object-position: center;
}

.case-media-card--phone {
  min-height: 560px;
}

.case-media-card--phone img {
  object-fit: contain;
  object-position: center bottom;
  background: #f5f6ff;
}

/* Optional: wide gallery still inside card rail */
.case-media-card--gallery {
  min-height: 564px;
}

.case-media-card--gallery img {
  object-fit: cover;
  background: #f5f6ff;
}

/* -----------------------------------------
   CASE FLOW — editorial multi-step flow module
------------------------------------------ */

.case-flow {
  --case-flow-bg: #f3f3f9;
  --case-flow-text: #30323b;
  --case-flow-muted: rgba(48, 50, 59, 0.62);
  --case-flow-arrow: rgba(48, 50, 59, 0.18);
  --case-flow-radius: 28px;
  --case-flow-max-width: 100%;
  --case-flow-step-width: 280px;
  --case-flow-mockup-aspect: 644 / 1216;
  --case-flow-gap: 24px;
  --case-flow-panel-pad-x: clamp(16px, 3vw, 40px);
  --case-flow-panel-pad-y: clamp(32px, 5vw, 56px);

  box-sizing: border-box;
  width: 100%;
  padding: var(--case-flow-panel-pad-y) var(--case-flow-panel-pad-x);
  background: var(--case-flow-bg);
  border-radius: var(--case-flow-radius);
  overflow: hidden;
}

.case-flow__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--case-flow-max-width);
  margin: 0 auto;
}

.case-flow__rail {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  column-gap: clamp(12px, 1.8vw, 28px);
  row-gap: 20px;
}

/* Three-step flow (e.g. Gardyn search) */
.case-flow__rail--steps3 {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.case-flow__step {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.case-flow__figure {
  margin: 0;
  width: 100%;
  max-width: var(--case-flow-step-width);
  margin-inline: auto;
  aspect-ratio: var(--case-flow-mockup-aspect);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  line-height: 0;
}

.case-flow__image {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: fit-content;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.case-flow__connector {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: clamp(20px, 2vw, 40px);
  color: var(--case-flow-arrow);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Compact 4-up flow: keeps all four screens fully visible on larger viewports */
.case-flow--compact-4up {
  --case-flow-step-width: clamp(160px, 15vw, 220px);
}

.case-flow--compact-4up .case-flow__rail {
  column-gap: clamp(8px, 1vw, 16px);
}

.case-flow--compact-4up .case-flow__connector {
  width: clamp(12px, 1.2vw, 20px);
  font-size: clamp(16px, 1.4vw, 22px);
}

/* On desktop/tablet, force the 4-up row to fit instead of feeling oversized */
@media (min-width: 1025px) {
  .case-flow--compact-4up .case-flow__rail {
    grid-template-columns:
      minmax(0, 1fr) auto
      minmax(0, 1fr) auto
      minmax(0, 1fr) auto
      minmax(0, 1fr);
  }

  .case-flow--compact-4up .case-flow__figure {
    max-width: var(--case-flow-step-width);
  }
}

/* On medium screens, shrink sooner so the 4th phone stays visible longer */
@media (max-width: 1400px) and (min-width: 1025px) {
  .case-flow--compact-4up {
    --case-flow-step-width: clamp(148px, 14vw, 190px);
  }

  .case-flow--compact-4up .case-flow__rail {
    column-gap: 10px;
  }

  .case-flow--compact-4up .case-flow__connector {
    width: 14px;
    font-size: 18px;
  }
}

.case-flow__meta {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  justify-items: start;
  margin-top: clamp(24px, 3vw, 40px);
}

.case-flow__title {
  margin: 0 0 10px;
  align-self: start;
  justify-self: start;
  font-family: var(--font-condensed);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--case-flow-text);
}

.case-flow__description {
  margin: 0;
  align-self: start;
  justify-self: start;
  max-width: 780px;
  font-family: var(--font-sans);
  color: var(--case-flow-muted);
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.case-flow__link {
  color: var(--case-study-accent, #5b6adb);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.case-flow__link:hover {
  text-decoration-thickness: 2px;
}

/* Tinted band edge-to-edge; padding matches .case-shell gutters per breakpoint */
.case-section--flow-bleed {
  padding-left: 0;
  padding-right: 0;
  padding-top: clamp(36px, 5vw, 56px);
  padding-bottom: clamp(36px, 5vw, 56px);
  background: #f3f3f9;
}

.case-section--flow-bleed--white {
  background: #fff;
}

.case-section--flow-bleed--white .case-flow {
  --case-flow-bg: #fff;
}

/* Gardyn P3: Figma 505-208703 intro + search/sort flow (white band, four steps fit in viewport) */
.case-section--gardyn-search-intro {
  --case-prose-wide-max: 957px;
  padding-top: 80px;
  padding-bottom: clamp(24px, 4vw, 40px);
  background: #fff;
}

.case-section--gardyn-search-intro .case-head {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: min(100%, var(--case-prose-wide-max));
}

.case-section--gardyn-search-intro .case-title {
  margin-bottom: 0;
}

.case-section--gardyn-search-intro .case-copy {
  letter-spacing: 0.00625em;
}

.case-section--gardyn-search-flow.case-section--flow-bleed {
  padding-top: 0;
  background: #fff;
}

.case-section--gardyn-search-flow.case-section--flow-bleed .case-flow {
  --case-flow-bg: #fff;
  --case-flow-mockup-aspect: 556 / 1128;
}

@media (min-width: 1025px) {
  .case-section--gardyn-search-flow.case-section--flow-bleed .case-flow {
    --case-flow-step-width: min(
      236px,
      max(168px, calc((100vw - clamp(80px, 12vw, 200px)) / 4.65))
    );
  }
}

/* Gardyn legacy flow band (mint panel; matches --case-surface-panel on P3) */
.case-section--flow-bleed--gardyn-mint {
  background: #f5fff7;
  padding-top: 8px;
  padding-bottom: 8px;
}

.case-section--flow-bleed--gardyn-mint .case-flow {
  --case-flow-bg: #f5fff7;
}

.case-page--study .case-flow__band-title {
  margin: 0 0 clamp(20px, 2.8vw, 32px);
  max-width: 100%;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--font-graphik-cond);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.06em;
  color: #30323b;
}

/* Gardyn starting-point band: flush title → mockups (override study default margin-bottom). */
.case-page--study .case-section--flow-bleed--gardyn-mint .case-flow__band-title {
  margin-bottom: 0;
}

/* Full-bleed feature: vertical rhythm matches .case-section (100px) */
.case-section--feature-bleed {
  padding-left: 0;
  padding-right: 0;
  padding-top: 100px;
  padding-bottom: 100px;
  background: #f3f3f9;
}

.case-section--feature-bleed--white {
  background: #fff;
}

@media (max-width: 1024px) {
  .case-section--feature-bleed {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

@media (max-width: 768px) {
  .case-section--feature-bleed {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

@media (max-width: 480px) {
  .case-section--feature-bleed {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

.case-flow--bleed {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  padding-left: var(--page-gutter-mobile);
  padding-right: var(--page-gutter-mobile);
}

.case-section--flow-bleed .case-flow--bleed {
  padding-left: clamp(12px, 4vw, 24px);
  padding-right: clamp(12px, 4vw, 24px);
}

.case-flow__viewport {
  position: relative;
}

@media (min-width: 768px) {
  .case-flow--bleed {
    padding-left: var(--page-gutter-tablet);
    padding-right: var(--page-gutter-tablet);
  }

  .case-section--flow-bleed .case-flow--bleed {
    padding-left: clamp(16px, 4vw, 32px);
    padding-right: clamp(16px, 4vw, 32px);
  }
}

@media (min-width: 1025px) {
  .case-flow--bleed {
    padding-left: max(var(--page-gutter), calc((100vw - var(--page-max)) / 2));
    padding-right: max(var(--page-gutter), calc((100vw - var(--page-max)) / 2));
  }

  /* Verification band: slimmer side gutters than shell (no 80px floor) */
  .case-section--flow-bleed .case-flow--bleed {
    padding-left: max(20px, calc((100vw - var(--page-max)) / 2));
    padding-right: max(20px, calc((100vw - var(--page-max)) / 2));
  }
}

@media (max-width: 1200px) {
  .case-flow {
    --case-flow-step-width: 248px;
  }
}

@media (max-width: 1024px) {
  .case-flow__viewport::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 8px;
    width: min(36px, 8vw);
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
      to right,
      color-mix(in srgb, var(--case-flow-bg) 0%, transparent),
      color-mix(in srgb, var(--case-flow-bg) 88%, transparent) 70%,
      var(--case-flow-bg) 100%
    );
  }

  .case-flow__rail {
    display: flex;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    /* End padding clears the last step from the fade overlay and rounded clip */
    padding-inline: 0 clamp(48px, 12vw, 88px);
    scroll-padding-inline: clamp(12px, 2vw, 20px) clamp(48px, 12vw, 88px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(48, 50, 59, 0.22) transparent;
  }

  .case-flow__rail::-webkit-scrollbar {
    height: 5px;
  }

  .case-flow__rail::-webkit-scrollbar-track {
    background: transparent;
  }

  .case-flow__rail::-webkit-scrollbar-thumb {
    background-color: rgba(48, 50, 59, 0.2);
    border-radius: 999px;
  }

  .case-flow__step,
  .case-flow__connector {
    flex: 0 0 auto;
  }

  .case-flow__step {
    width: min(68vw, 260px);
    scroll-snap-align: start;
  }

  .case-flow__connector {
    width: 18px;
    font-size: 22px;
    align-self: center;
  }

  .case-section--flow-bleed .case-flow__rail {
    padding-inline: 0 clamp(28px, 8vw, 56px);
    scroll-padding-inline: clamp(10px, 2vw, 16px) clamp(28px, 8vw, 56px);
  }
}

/* Tablet: keep title + description side-by-side (stack only ≤640px); column gap 32px */
@media (max-width: 1024px) and (min-width: 641px) {
  .case-flow__meta {
    gap: 32px;
  }

  .case-section--flow-bleed .case-flow__meta {
    gap: 18px;
  }
}

@media (max-width: 768px) {
  .case-flow {
    --case-flow-panel-pad-x: clamp(16px, 4vw, 28px);
  }

  .case-flow__rail {
    gap: 16px;
    padding-inline: 0 clamp(40px, 11vw, 72px);
    scroll-padding-inline: clamp(10px, 3vw, 16px) clamp(40px, 11vw, 72px);
  }

  .case-flow__step {
    width: min(70vw, 240px);
  }

  .case-section--flow-bleed .case-flow__rail {
    padding-inline: 0 clamp(24px, 9vw, 48px);
    scroll-padding-inline: clamp(10px, 3vw, 14px) clamp(24px, 9vw, 48px);
  }
}

@media (max-width: 640px) {
  .case-flow {
    --case-flow-radius: 20px;
    --case-flow-panel-pad-x: 16px;
    --case-flow-panel-pad-y: 28px;
  }

  .case-flow__step {
    width: 72vw;
    max-width: 220px;
  }

  .case-flow__connector {
    display: none;
  }

  .case-flow__meta {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .case-flow__title {
    font-size: clamp(26px, 7vw, 32px);
    line-height: 1.12;
  }

  .case-flow__description {
    font-size: 0.98rem;
    line-height: 1.5;
  }
}

@media (max-width: 390px) {
  .case-flow {
    --case-flow-panel-pad-x: 14px;
    --case-flow-panel-pad-y: 24px;
  }

  .case-flow__step {
    width: min(76vw, 210px);
    max-width: none;
  }

  .case-flow__meta {
    gap: 10px;
    margin-top: 20px;
  }
}

/* Tighter vertical footprint for verification flow band */
.case-section--flow-bleed .case-flow {
  --case-flow-panel-pad-y: clamp(16px, 2.4vw, 32px);
  --case-flow-step-width: 236px;
}

.case-section--flow-bleed .case-flow__meta {
  margin-top: clamp(28px, 4vw, 48px);
  gap: 16px;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
}

@media (max-width: 1200px) {
  .case-section--flow-bleed .case-flow {
    --case-flow-step-width: 208px;
  }
}

@media (max-width: 640px) {
  .case-section--flow-bleed .case-flow {
    --case-flow-panel-pad-y: 16px;
  }

  .case-section--flow-bleed .case-flow__meta {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
  }
}

@media (max-width: 390px) {
  .case-section--flow-bleed .case-flow {
    --case-flow-panel-pad-y: 14px;
  }

  .case-section--flow-bleed .case-flow__meta {
    gap: 8px;
    margin-top: 22px;
  }
}

/* Gardyn mint flow: larger frames than default flow-bleed; width is +30% vs former 300px / 272px */
.case-section--flow-bleed--gardyn-mint .case-flow {
  --case-flow-step-width: calc(300px * 1.3);
}

@media (max-width: 1200px) {
  .case-section--flow-bleed--gardyn-mint .case-flow {
    --case-flow-step-width: calc(272px * 1.3);
  }
}

@media (max-width: 1024px) {
  .case-section--flow-bleed--gardyn-mint .case-flow__step {
    width: min(74vw, calc(304px * 1.3));
  }
}

@media (max-width: 768px) {
  .case-section--flow-bleed--gardyn-mint .case-flow__step {
    width: min(76vw, calc(288px * 1.3));
  }
}

@media (max-width: 640px) {
  .case-section--flow-bleed--gardyn-mint .case-flow__step {
    width: min(80vw, calc(268px * 1.3));
    max-width: calc(268px * 1.3);
  }
}

@media (max-width: 390px) {
  .case-section--flow-bleed--gardyn-mint .case-flow__step {
    width: min(82vw, calc(252px * 1.3));
    max-width: none;
  }
}

/* -----------------------------------------
   CASE FLOW TRIGGERS
------------------------------------------ */

.case-flow__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: inherit;
  appearance: none;
}

.case-flow__trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.9);
  outline-offset: 6px;
  border-radius: 18px;
}

.case-flow__trigger .case-flow__figure {
  transition: transform 180ms ease, opacity 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .case-flow__trigger:hover .case-flow__figure {
    transform: translateY(-2px);
  }
}

/* -----------------------------------------
   LIGHTBOX
------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  /* Topbar + dialog margins + content padding + caption (2 lines) + gaps — keeps image under chrome */
  --lightbox-vertical-reserve: 288px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 22, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100% - 32px, 1320px);
  height: min(100dvh - 32px, 920px);
  margin: 16px auto;
  border-radius: 24px;
  background: transparent;
  /* Avoid clipping phone + shadow when intrinsic stack is slightly tall */
  overflow: visible;
}

.lightbox__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}

.lightbox__counter {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  appearance: none;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox__close span {
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox__content {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}

.lightbox__figure {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

.lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 420px);
  max-height: min(
    calc(100dvh - var(--lightbox-vertical-reserve)),
    calc(100% - 6.5rem)
  );
  flex-shrink: 1;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.lightbox__caption {
  flex-shrink: 0;
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.lightbox__nav {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  appearance: none;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.lightbox__nav span {
  font-size: 2.25rem;
  line-height: 1;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox__nav[disabled] {
  opacity: 0.35;
  cursor: default;
}

html.is-lightbox-open,
body.is-lightbox-open {
  overflow: hidden;
}

/* -----------------------------------------
   TABLET
------------------------------------------ */

@media (max-width: 900px) {
  .lightbox__dialog {
    width: min(100% - 20px, 1000px);
    height: min(100dvh - 20px, 860px);
    margin: 10px auto;
    border-radius: 20px;
  }

  .lightbox__content {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    padding: 8px 14px 18px;
  }
}

/* -----------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 640px) {
  .lightbox {
    --lightbox-vertical-reserve: 320px;
  }

  .lightbox__dialog {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .lightbox__topbar {
    padding: 14px 14px 10px;
  }

  .lightbox__content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "figure"
      "controls";
    gap: 14px;
    padding: 8px 14px 18px;
  }

  .lightbox__figure {
    grid-area: figure;
    gap: 14px;
  }

  .lightbox__image {
    max-width: 100%;
  }

  .lightbox__caption {
    font-size: 0.95rem;
  }

  .lightbox__nav {
    width: 52px;
    height: 52px;
  }

  .lightbox__nav--prev,
  .lightbox__nav--next {
    position: fixed;
    bottom: 16px;
    z-index: 2;
  }

  .lightbox__nav--prev {
    left: 16px;
  }

  .lightbox__nav--next {
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-flow__trigger .case-flow__figure,
  .lightbox__close,
  .lightbox__nav,
  .case-lightbox__close,
  .case-lightbox__nav {
    transition: none;
  }
}

/* -----------------------------------------
   CASE FEATURE MEDIA (editorial cluster + copy; shared #case-lightbox)
------------------------------------------ */

.case-feature-media {
  --case-feature-media-radius: 16px;
  --case-feature-media-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  --case-feature-media-shadow-hover: 0 20px 56px rgba(0, 0, 0, 0.1);
  --case-feature-media-stage-max: none;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(48px, 6vw, 64px);
  width: 100%;
}

.case-feature-media__media {
  position: relative;
  isolation: isolate;
  min-height: clamp(520px, 58vw, 760px);
  width: 100%;
  max-width: var(--case-feature-media-stage-max);
  margin-inline: 0;
}

.case-feature-media__asset {
  position: absolute;
  left: var(--asset-left, 0);
  top: var(--asset-top, 0);
  width: var(--asset-width, 240px);
  z-index: var(--asset-z, 1);
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  border-radius: var(--case-feature-media-radius);
  overflow: hidden;
  box-shadow: var(--case-feature-media-shadow);
  transition:
    transform 220ms var(--motion-ease-standard, ease),
    box-shadow 220ms var(--motion-ease-standard, ease);
}

.case-feature-media__asset:hover {
  transform: translateY(-4px);
  box-shadow: var(--case-feature-media-shadow-hover);
}

.case-feature-media__asset:focus {
  outline: none;
}

.case-feature-media__asset:focus-visible {
  transform: translateY(-4px);
  outline: 2px solid var(--case-study-accent, #8a72ff);
  outline-offset: 3px;
  box-shadow: var(--case-feature-media-shadow-hover);
}

.case-feature-media__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--case-feature-media-radius);
  background: #fff;
}

.case-feature-media__content {
  min-width: 0;
  max-width: 640px;
}

.case-feature-media__title {
  margin: 0 0 24px;
}

.case-feature-media__body {
  display: grid;
  gap: 24px;
}

.case-feature-media__body > p {
  margin: 0;
}

/* Primary sets stage height (in-flow); rail is height:100% and splits two assets + gap to match. */
.case-feature-media__media--height-match-rail {
  --case-feature-rail-gap: clamp(10px, 1.8vw, 14px);
  --case-feature-primary-width: 61%;
  --case-feature-rail-width: 29%;
  --case-feature-cluster-h-gap: 5%;
  min-height: 0;
}

.case-feature-media__media--height-match-rail > .case-feature-media__asset--primary {
  position: relative;
  left: auto;
  top: auto;
  width: var(--case-feature-primary-width);
  max-width: var(--case-feature-primary-width);
  z-index: 2;
}

.case-feature-media__media--height-match-rail .case-feature-media__rail {
  position: absolute;
  left: calc(var(--case-feature-primary-width) + var(--case-feature-cluster-h-gap));
  top: 0;
  width: var(--case-feature-rail-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--case-feature-rail-gap);
  z-index: 3;
  box-sizing: border-box;
}

.case-feature-media__media--height-match-rail .case-feature-media__rail .case-feature-media__asset {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-feature-media__media--height-match-rail .case-feature-media__rail .case-feature-media__image {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center top;
}

.case-feature-media__media--height-match-rail
  .case-feature-media__rail
  .case-feature-media__asset:last-child
  .case-feature-media__image {
  object-position: center bottom;
}

@media (max-width: 980px) {
  .case-feature-media {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .case-feature-media__media {
    position: static;
    min-height: auto;
    max-width: none;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 16px;
    align-items: start;
  }

  .case-feature-media__media--height-match-rail .case-feature-media__rail {
    display: contents;
  }

  .case-feature-media__media--height-match-rail > .case-feature-media__asset--primary {
    width: 100%;
    max-width: none;
  }

  .case-feature-media__media--height-match-rail .case-feature-media__rail .case-feature-media__asset {
    flex: unset;
    min-height: 0;
    display: block;
    height: auto;
  }

  .case-feature-media__media--height-match-rail .case-feature-media__rail .case-feature-media__image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: unset;
    object-position: center;
  }

  .case-feature-media__asset {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
  }

  .case-feature-media__asset:hover,
  .case-feature-media__asset:focus-visible {
    transform: none;
  }

  .case-feature-media__asset:first-child {
    grid-row: 1 / span 2;
    align-self: stretch;
  }

  .case-feature-media__asset:first-child .case-feature-media__image {
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .case-feature-media__content {
    max-width: none;
  }
}

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

  .case-feature-media__asset:first-child {
    grid-row: auto;
  }

  .case-feature-media__asset:first-child .case-feature-media__image {
    height: auto;
    object-fit: contain;
    object-position: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-feature-media__asset {
    transition: none;
  }

  .case-feature-media__asset:hover,
  .case-feature-media__asset:focus-visible {
    transform: none;
  }
}

/* =============================================================================
   SHARED: Case study gallery + lightbox
   - Grid / bleed: .case-gallery, .case-gallery-bleed*, .case-gallery__*, .case-gallery-scroll
   - Triggers: ancestor [data-gallery], items [data-gallery-item] with data-full, data-alt, data-caption
   - Optional: .case-gallery__cell wraps item + .case-gallery__label (caption under asset; Figma 505-223773)
   - Overlay: #case-lightbox, .case-lightbox__* (wired by CaseGalleryLightbox in main.js)
   ============================================================================= */

.case-gallery {
  --gallery-columns: 4;
  --gallery-gap: 24px;
  --gallery-radius: 16px;
  display: grid;
  gap: clamp(28px, 4vw, 40px);
  width: 100%;
}

.case-gallery__intro {
  max-width: 860px;
  display: grid;
  gap: 0;
}

.case-gallery__title.case-title {
  margin: 0;
}

.case-page--study .case-gallery .case-gallery__title.case-title {
  font-family: var(--font-graphik-cond);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #30323b;
}

.case-gallery__title--upper {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-gallery__body {
  margin: 0;
}

.case-gallery__grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  gap: var(--gallery-gap);
  align-items: start;
}

/* Tile + caption stack (Figma 505-223773 — label under device) */
.case-gallery__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.case-gallery__grid:has(.case-gallery__cell) {
  align-items: start;
}

.case-gallery__label {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 4px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 150%;
  min-height: 1.6em;
  letter-spacing: 0.01em;
  color: var(--color-muted, #8f92a3);
  text-align: center;
}

@media (max-width: 1024px) {
  .case-gallery__label {
    line-height: 1.5;
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .case-gallery__label {
    line-height: 1.5;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .case-gallery__label {
    line-height: 1.5;
  }
}

/* Per-instance column presets (override inline --gallery-columns when preferred) */
.case-gallery--cols-5 {
  --gallery-columns: 5;
}

.case-gallery--cols-3 {
  --gallery-columns: 3;
}

.case-gallery--cols-2 {
  --gallery-columns: 2;
}

.case-gallery--cols-6 {
  --gallery-columns: 6;
}

@media (max-width: 1100px) {
  .case-gallery--cols-6 {
    --gallery-columns: 3;
  }
}

@media (max-width: 768px) {
  .case-gallery--cols-6 {
    --gallery-columns: 2;
    --gallery-gap: 16px;
  }
}

@media (max-width: 520px) {
  .case-gallery--cols-6 {
    --gallery-columns: 1;
  }
}

.case-gallery__item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  width: 100%;
  border-radius: var(--gallery-radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  transition:
    transform var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease),
    box-shadow var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease),
    opacity var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease);
}

.case-gallery__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.1);
}

.case-gallery__item:focus {
  outline: none;
}

.case-gallery__item:focus-visible {
  transform: translateY(-3px);
  outline: 2px solid var(--case-study-accent, #8a72ff);
  outline-offset: 3px;
}

.case-gallery__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: var(--gallery-radius);
  background: #fff;
}

.case-gallery__item--span-2 {
  grid-column: span 2;
}

.case-gallery__item--row-span-2 {
  grid-row: span 2;
}

.case-gallery__item--row-span-2 .case-gallery__image {
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

@media (max-width: 1100px) {
  .case-gallery {
    --gallery-columns: 3;
  }
}

@media (max-width: 768px) {
  .case-gallery {
    --gallery-columns: 2;
    --gallery-gap: 16px;
  }
}

@media (max-width: 520px) {
  .case-gallery {
    --gallery-columns: 1;
  }

  .case-gallery__item--span-2 {
    grid-column: span 1;
  }

  .case-gallery__item--row-span-2 {
    grid-row: span 1;
  }

  .case-gallery__item--row-span-2 .case-gallery__image {
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-gallery__item {
    transition: none;
  }

  .case-gallery__item:hover,
  .case-gallery__item:focus-visible {
    transform: none;
  }
}

/* Case gallery lightbox (shared #case-lightbox; distinct from flow #lightbox) */
.case-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  --case-lightbox-vertical-reserve: 288px;
}

.case-lightbox[hidden] {
  display: none;
}

.case-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 22, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.case-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100% - 32px, 1320px);
  height: min(100dvh - 32px, 920px);
  margin: 16px auto;
  border-radius: 24px;
  background: transparent;
  overflow: visible;
}

.case-lightbox__dialog:focus {
  outline: none;
}

.case-lightbox__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  gap: 16px;
}

.case-lightbox__counter {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.case-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  appearance: none;
  flex-shrink: 0;
  transition: background 160ms ease, transform 160ms ease;
}

.case-lightbox__close span {
  font-size: 1.75rem;
  line-height: 1;
}

.case-lightbox__close:hover,
.case-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.case-lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.case-lightbox__content {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}

.case-lightbox__figure {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

.case-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 960px);
  max-height: min(
    calc(100dvh - var(--case-lightbox-vertical-reserve)),
    calc(100% - 6.5rem)
  );
  flex-shrink: 1;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.case-lightbox__caption {
  flex-shrink: 0;
  max-width: 720px;
  margin: 0;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.case-lightbox__nav {
  align-self: center;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  place-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  appearance: none;
  line-height: 0;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.case-lightbox__nav span {
  display: grid;
  place-items: center;
  place-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 2.25rem;
  line-height: 1;
  /* Single-glyph chevrons often sit low in the font box; nudge for optical center */
  transform: translateY(-0.06em);
}

.case-lightbox__nav:hover,
.case-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.case-lightbox__nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.case-lightbox__nav[disabled] {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 900px) {
  .case-lightbox__dialog {
    width: min(100% - 20px, 1000px);
    height: min(100dvh - 20px, 860px);
    margin: 10px auto;
    border-radius: 20px;
  }

  .case-lightbox__content {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    padding: 8px 14px 18px;
  }
}

@media (max-width: 640px) {
  .case-lightbox {
    --case-lightbox-vertical-reserve: 320px;
  }

  .case-lightbox__dialog {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .case-lightbox__topbar {
    padding: 14px 14px 10px;
  }

  .case-lightbox__content {
    grid-template-columns: 1fr;
    grid-template-areas:
      'figure'
      'controls';
    gap: 14px;
    padding: 8px 14px 18px;
  }

  .case-lightbox__figure {
    grid-area: figure;
    gap: 14px;
  }

  .case-lightbox__image {
    max-width: 100%;
  }

  .case-lightbox__caption {
    font-size: 0.95rem;
  }

  .case-lightbox__nav {
    width: 52px;
    height: 52px;
  }

  .case-lightbox__nav--prev,
  .case-lightbox__nav--next {
    position: fixed;
    bottom: 16px;
    z-index: 2;
  }

  .case-lightbox__nav--prev {
    left: 16px;
  }

  .case-lightbox__nav--next {
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-lightbox__close,
  .case-lightbox__nav {
    transition: none;
  }
}

/* -----------------------------------------
   CASE FEATURE / EDITORIAL SPLIT MODULE
------------------------------------------ */

.case-feature {
  --case-feature-bg: #f3f3f9;
  --case-feature-text: #23242b;
  --case-feature-muted: rgba(35, 36, 43, 0.58);
  --case-feature-arrow: rgba(35, 36, 43, 0.16);
  --case-feature-radius: 28px;
  --case-feature-max-width: 1440px;
  --case-feature-gap: clamp(32px, 5vw, 72px);
  --case-feature-panel-pad-x: clamp(16px, 3vw, 44px);
  --case-feature-panel-pad-y: clamp(32px, 5vw, 56px);
  --case-feature-title-max: 11ch;
  --case-feature-copy-max: 34rem;
  --case-feature-device-max: 280px;

  box-sizing: border-box;
  width: 100%;
  padding: var(--case-feature-panel-pad-y) var(--case-feature-panel-pad-x);
  background: var(--case-feature-bg);
  border-radius: var(--case-feature-radius);
  overflow: hidden;
}

.case-feature__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--case-feature-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1fr);
  gap: var(--case-feature-gap);
  align-items: center;
}

.case-feature__content {
  min-width: 0;
}

.case-feature__title {
  max-width: var(--case-feature-title-max);
  margin: 0;
  color: var(--case-feature-text);
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}

.case-feature__text {
  max-width: var(--case-feature-copy-max);
  margin-top: clamp(24px, 3vw, 36px);
}

.case-feature__text p {
  margin: 0;
  color: var(--case-feature-muted);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.case-page--study .case-feature__text p {
  font-size: 18px;
}

.case-feature__text p + p {
  margin-top: 1.2em;
}

.case-feature__visual {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.case-feature__device-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  width: 100%;
}

.case-feature__device {
  margin: 0;
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
}

.case-feature__image {
  display: block;
  width: 100%;
  max-width: var(--case-feature-device-max);
  height: auto;
  object-fit: contain;
  border-radius: 24px;
}

.case-feature__connector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--case-feature-arrow);
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Optional emphasis hierarchy */
.case-feature__device--context .case-feature__image {
  opacity: 0.92;
}

.case-feature__device--detail .case-feature__image {
  opacity: 1;
}

/* Modifier */
.case-feature--education {
  --case-feature-bg: #f3f3f9;
}

.case-feature--transparency {
  --case-feature-bg: #fff;
}

.case-feature--device-duo {
  --case-feature-bg: #fff;
}

/* Project 1 Education: full-width tint on section; content aligned to .case-shell; .case-two-col rhythm */
.case-page--study .case-section--feature-bleed .case-shell {
  min-width: 0;
}

.case-page--study .case-section--feature-bleed .case-feature {
  background: transparent;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}

.case-page--study .case-section--feature-bleed .case-feature__inner,
.case-page--study .case-section--feature-bleed .case-feature__visual,
.case-page--study .case-section--feature-bleed .case-feature__device-group {
  overflow: visible;
}

.case-page--study .case-section--feature-bleed .case-feature__device-group {
  min-width: 0;
  max-width: 100%;
}

.case-page--study .case-section--feature-bleed .case-feature__inner {
  max-width: none;
  margin: 0;
  min-width: 0;
  grid-template-columns: minmax(0, 519px) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

/* Desktop: visual column first (left); tablet/mobile keep DOM order — copy then visual */
@media (min-width: 1201px) {
  .case-page--study .case-section--feature-bleed .case-feature--visual-left .case-feature__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 519px);
  }

  .case-page--study .case-section--feature-bleed .case-feature--visual-left .case-feature__visual {
    order: -1;
  }
}

/* Explicit copy-left / visual-right (default grid order; offsets case-feature--visual-left) */
.case-page--study .case-section--feature-bleed .case-feature--visual-right .case-feature__content,
.case-page--study .case-section--feature-bleed .case-feature--visual-right .case-feature__visual {
  order: 0;
}

.case-page--study .case-section--feature-bleed .case-feature--visual-right .case-feature__title.case-title {
  line-height: 130%;
}

/* Narrow copy column + paired device frames (hero case study rhythm) */
.case-page--study .case-section--feature-bleed .case-feature--device-duo {
  --case-feature-device-max: min(277px, calc((100vw - 543px - 148px - 2 * var(--page-gutter)) / 2));
}

.case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__inner {
  grid-template-columns: minmax(0, 543px) minmax(0, 1fr);
  gap: clamp(40px, 10.5vw, 148px);
  align-items: center;
}

.case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__visual {
  justify-content: flex-start;
}

.case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__device-group--duo {
  justify-content: flex-start;
  gap: clamp(20px, 2.4vw, 35px);
}

.case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__device--context .case-feature__image {
  opacity: 1;
}

.case-page--study .case-section--feature-bleed .case-feature__image {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.case-page--study .case-section--feature-bleed .case-feature__content {
  max-width: none;
  min-width: 0;
}

.case-page--study .case-section--feature-bleed .case-feature__visual {
  justify-content: center;
  min-width: 0;
}

/* Match .case-two-col heading stack: margin + weight beat .case-feature__title; line-height matches project-1 .case-title */
.case-page--study .case-section--feature-bleed .case-feature__title.case-title {
  max-width: none;
  margin: 0 0 24px;
  font-weight: 600;
  line-height: 130%;
  height: fit-content;
  text-wrap: balance;
}

.case-page--study .case-section--feature-bleed .case-feature__text {
  margin-top: 0;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.case-page--study .case-section--feature-bleed .case-feature__text p {
  font-size: 18px;
  line-height: 150%;
  letter-spacing: 0;
  color: var(--case-body-on-white, #8f92a3);
  overflow-wrap: break-word;
}

/* Tinted band education block only — full body color for readability */
.case-page--study .case-section--feature-bleed .case-feature--education .case-feature__text p {
  color: #30323b;
}

.case-page--study .case-section--feature-bleed .case-feature__text p + p {
  margin-top: 20px;
}

.case-page--study .case-section--feature-bleed .case-feature--transparency .case-feature__text p {
  line-height: 150%;
}

@media (max-width: 1200px) {
  .case-page--study .case-section--feature-bleed .case-feature__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 72px;
    align-items: start;
  }

  .case-page--study .case-section--feature-bleed .case-feature--visual-left .case-feature__visual {
    order: 0;
  }

  .case-page--study .case-section--feature-bleed .case-feature__visual {
    justify-content: center;
  }

  .case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 72px;
    align-items: start;
  }

  .case-page--study .case-section--feature-bleed .case-feature--device-duo {
    --case-feature-device-max: min(248px, 36vw);
  }

  .case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__visual,
  .case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__device-group--duo {
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .case-page--study .case-section--feature-bleed .case-feature__content {
    max-width: none;
  }

  .case-page--study .case-section--feature-bleed .case-feature__title.case-title {
    max-width: none;
  }

  .case-page--study .case-section--feature-bleed .case-feature__inner {
    gap: 36px;
  }
}

@media (max-width: 640px) {
  .case-page--study .case-section--feature-bleed .case-feature__inner {
    gap: 28px;
  }

  .case-page--study .case-section--feature-bleed .case-feature__title.case-title {
    font-size: 40px;
    line-height: 130%;
  }

  .case-page--study .case-section--feature-bleed .case-feature--device-duo {
    --case-feature-device-max: min(158px, calc(47vw - 18px));
  }

  .case-page--study .case-section--feature-bleed .case-feature--device-duo .case-feature__device-group--duo {
    gap: clamp(12px, 3vw, 20px);
  }
}

/* -----------------------------------------
   LARGE TABLET
------------------------------------------ */

@media (max-width: 1200px) {
  .case-feature {
    --case-feature-device-max: 248px;
  }

  .case-feature__inner {
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1fr);
  }
}

/* -----------------------------------------
   TABLET
------------------------------------------ */

@media (max-width: 980px) {
  .case-feature__inner {
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: start;
  }

  .case-feature__content {
    max-width: 42rem;
  }

  .case-feature__title {
    max-width: 12ch;
  }

  .case-feature__visual {
    justify-content: flex-start;
  }
}

/* -----------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 640px) {
  .case-feature {
    --case-feature-radius: 20px;
    --case-feature-panel-pad-x: 16px;
    --case-feature-panel-pad-y: 28px;
    --case-feature-device-max: 180px;
  }

  .case-feature__inner {
    gap: 28px;
  }

  .case-feature__title {
    font-size: clamp(2rem, 9vw, 2.8rem);
    line-height: 1.03;
  }

  .case-feature__text {
    margin-top: 20px;
  }

  .case-feature__text p {
    font-size: 0.98rem;
    line-height: 1.5;
  }

  .case-feature__device-group {
    gap: 10px;
    justify-content: space-between;
  }

  .case-feature__connector {
    font-size: 20px;
  }
}

/* -----------------------------------------
   SMALL MOBILE
------------------------------------------ */

@media (max-width: 420px) {
  .case-feature {
    --case-feature-device-max: 154px;
  }

  .case-feature__device-group {
    gap: 8px;
  }

  .case-feature__connector {
    display: none;
  }
}

@media (max-width: 390px) {
  .case-feature {
    --case-feature-panel-pad-x: 14px;
    --case-feature-panel-pad-y: 24px;
    --case-feature-device-max: 148px;
  }

  .case-feature__inner {
    gap: 24px;
  }

  .case-feature__device-group {
    gap: 6px;
  }
}

.case-section--outcomes {
  background: #f5f6ff;
}

.case-footer-nav {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(28px, 5vw, 64px);
  min-height: 180px;
  padding: 48px var(--page-gutter);
  background: #30323b;
  color: #fff;
  font-family: var(--font-graphik-cond);
  font-size: clamp(16px, 2.15vw, 34px);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.case-footer-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  justify-self: center;
  max-width: 100%;
  min-height: 64px;
  min-width: 0;
  white-space: nowrap;
  transition:
    color var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease),
    transform var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease),
    text-decoration-color var(--motion-duration-fast, 180ms) var(--motion-ease-standard, ease);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.case-footer-nav a[href="index.html#work"] {
  letter-spacing: 1.3536px;
}

.case-footer-nav a:first-of-type {
  grid-column: 1;
  grid-row: 1;
}

.case-footer-nav a:last-of-type {
  grid-column: 2;
  grid-row: 1;
}

.case-footer-nav__divider {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  background: color-mix(in srgb, #fff 28%, transparent);
  pointer-events: none;
}

@media (max-width: 520px) {
  .case-footer-nav {
    grid-template-columns: 1fr;
    row-gap: clamp(20px, 5vw, 32px);
    min-height: 220px;
  }

  .case-footer-nav a:last-of-type {
    grid-column: 1;
    grid-row: 2;
  }

  .case-footer-nav__divider {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .case-footer-nav a:hover {
    color: #fff;
    transform: translateY(-2px);
    text-decoration-color: color-mix(in srgb, #fff 72%, transparent);
  }

  .case-footer-nav a:active {
    transform: translateY(0);
    text-decoration-color: color-mix(in srgb, #fff 50%, transparent);
  }
}

.case-footer-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 1200px) {
  .case-split-bleed {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .case-split-bleed__media {
    min-height: min(520px, 58vw);
  }

  .case-split-bleed__image {
    min-height: min(520px, 58vw);
    max-height: 65vh;
  }

  .case-split-bleed__content {
    align-items: flex-start;
    padding-block: 64px;
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter)))) / 2);
  }

  .project-2-page .case-split-bleed--panel .case-split-bleed__content,
  .project-2-page .case-split-bleed--cove .case-split-bleed__content {
    padding-block: clamp(72px, 11vw, 112px);
  }

  /* Use full content column width when stacked; desktop keeps hero-matched 560px rail */
  .case-split-bleed__copy {
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 1024px) {
  .case-split-bleed__content {
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-tablet)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-tablet)))) / 2);
  }

  .case-shell {
    width: var(--nav-frame-width-tablet);
  }

  .case-divider-quote--bleed-dark {
    padding-left: var(--page-gutter-tablet);
    padding-right: var(--page-gutter-tablet);
  }

  .case-footer-nav {
    padding: 60px var(--page-gutter-tablet) 32px;
  }
}

@media (max-width: 768px) {
  .case-hero:not(.case-hero--project) .case-hero-copy {
    padding-left: var(--page-gutter-mobile);
    padding-right: var(--page-gutter-mobile);
  }

  .case-shell {
    width: min(100% - (var(--page-gutter-mobile) * 2), var(--page-max));
  }

  /* Tall mockup rail: fill the .case-shell column (grid min-width:0 is set ≤1200px) */
  .case-shell.case-two-col .case-media-card--tall {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .case-shell.case-two-col .case-media-card.case-media-card--tall img {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }

  .case-divider-quote--bleed-dark {
    padding-left: var(--page-gutter-mobile);
    padding-right: var(--page-gutter-mobile);
  }

  .case-footer-nav {
    padding: 48px var(--page-gutter-mobile) 24px;
  }

  .case-split-bleed__content {
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile)))) / 2);
  }

}

@media (max-width: 480px) {
  .case-hero:not(.case-hero--project) .case-hero-copy {
    padding-left: var(--page-gutter-mobile-sm);
    padding-right: var(--page-gutter-mobile-sm);
  }

  .case-shell {
    width: min(100% - (var(--page-gutter-mobile-sm) * 2), var(--page-max));
  }

  .case-divider-quote--bleed-dark {
    padding-left: var(--page-gutter-mobile-sm);
    padding-right: var(--page-gutter-mobile-sm);
  }

  .footer {
    padding-left: var(--page-gutter-mobile-sm);
    padding-right: var(--page-gutter-mobile-sm);
  }

  .case-footer-nav {
    padding-left: var(--page-gutter-mobile-sm);
    padding-right: var(--page-gutter-mobile-sm);
  }

  .case-split-bleed__content {
    padding-left: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile-sm)))) / 2);
    padding-right: calc((100vw - min(var(--page-max), calc(100vw - 2 * var(--page-gutter-mobile-sm)))) / 2);
  }
}

/* =================================
   ACCENT DRAW SYSTEM
   ================================= */

.accent-draw {
  display: inline-block;
  line-height: 0;
  pointer-events: none;
}

.accent-draw__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.accent-draw__path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Optional style variants */
.accent-draw--thin .accent-draw__path {
  stroke-width: 3;
}

.accent-draw--bold .accent-draw__path {
  stroke-width: 5;
}

.accent-draw--purple {
  color: #8b6cff;
}

.accent-draw--green {
  color: #8ed08a;
}

.accent-draw--blue {
  color: #7cc6d9;
}

.accent-draw--orange {
  color: #f1a487;
}
