/* Case template – Figma "03a Case · muli Cycles" (258:907), mobile 543:11180.
   Project colors come from the panel as --project-surface / --project-text / --project-mix. */

.case {
  --project-surface: var(--color-surface-raised);
  --project-text: var(--color-text-primary);
  --project-mix: var(--color-text-tertiary);
}

/* ---------- 01 Hero · stage (1440 × 900 desktop) ---------- */

.case-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  background: var(--project-surface);
}

.case-hero__stage {
  position: absolute;
  inset: 0;
  container-type: size;
}

.case-hero__cutout {
  /* each slot has a center (--cx/--cy) and a base size (--w0); the frame takes the image's
     ratio (--ar, --s = √ratio, set inline) so every image keeps a similar visual weight */
  --w: calc(var(--w0) * var(--s, 1) * 1cqw);
  position: absolute;
  left: calc(var(--cx) * 1cqw - var(--w) / 2);
  top: calc(var(--cy) * 1cqh - var(--w) / var(--ar, 1.5) / 2);
  width: var(--w);
  aspect-ratio: var(--ar, 1.5);
  overflow: hidden;
  border-radius: var(--radius-24);
  box-shadow: 0 24px 48px 0 rgb(0 0 0 / 0.16);
}

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

/* slot centers and base sizes, from the 1440 × 900 stage */
.case-hero__cutout:nth-child(1) { --cx: 5.3;  --cy: 39.7; --w0: 24.5; }
.case-hero__cutout:nth-child(2) { --cx: 39.6; --cy: 15.9; --w0: 17; }
.case-hero__cutout:nth-child(3) { --cx: 36.1; --cy: 92.2; --w0: 21.6; }
.case-hero__cutout:nth-child(4) { --cx: 76.3; --cy: 83.9; --w0: 17.7; }
.case-hero__cutout:nth-child(5) { --cx: 88.7; --cy: 34.7; --w0: 17.5; }

/* portrait screenshot = phone frame */
.case-hero__cutout--phone {
  padding: 6px;
  border-radius: var(--radius-32);
  background: var(--color-core-device-bezel);
}

.case-hero__cutout--phone img {
  border-radius: var(--radius-24);
}

.case-hero__title {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  padding: var(--header-height) var(--layout-margin) var(--space-96);
  color: var(--project-text);
  text-align: center;
}

.case-hero__title .text-lead {
  max-width: 640px;
}

/* ---------- 02 Intro ---------- */

.case-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.case-intro .text-h1 {
  margin-bottom: var(--space-16);
}

.case-intro mark {
  background: none;
  color: var(--project-text);
}

/* ---------- 02b Facts stack (840 × 460, mobile scaled) ---------- */

.case-facts {
  display: flex;
  justify-content: center;
  background: var(--project-surface);
}

/* ---------- 04 Developments ---------- */

.case-developments {
  display: flex;
  flex-direction: column;
  gap: var(--space-96);
  background: var(--color-surface-raised);
}

.developments {
  display: flex;
  flex-direction: column;
  gap: var(--space-96);
}

.development {
  display: flex;
  flex-direction: column;
  padding-top: var(--space-48);
}

.development__media {
  width: min(1000px, 83.333%);
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: var(--radius-16);
  background: var(--color-surface-base);
  box-shadow: 0 12px 24px 0 rgb(0 0 0 / 0.16);
}

.development__media video,
.development__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.development__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  align-items: flex-start;
  width: 460px;
  /* overlap scales with the video (160px at the 1200 stage = 32% of its height; was 44%, covered too much) */
  margin-top: max(-160px, -13.333%);
  padding: var(--space-48);
  border-radius: var(--radius-24);
  background: var(--color-fixed-light);
  color: var(--color-fixed-dark);
  box-shadow: 0 16px 40px 0 rgb(0 0 0 / 0.12);
}

.development__number {
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-24);
  background: var(--color-fixed-dark);
  color: var(--color-fixed-light);
}

.development--left .development__card {
  align-self: flex-end;
}

.development--right .development__media {
  align-self: flex-end;
}

/* ---------- 05 Website in detail: page stack (1200 × 540) ---------- */

.case-page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-96);
  background: var(--project-surface);
}

/* Each position has a width (--cw, % of the stack) and a ratio (--ar). The back cards are centred
   vertically on the front card, and the corner radius scales with the card (24px on a 700px card),
   so the small card at the back is less round. --cw1/--ar1 = the front card, sets the stack height. */
/* the wrap is the size container, so the stack's own height can use cqw of its width too */
.page-stack-wrap {
  container-type: inline-size;
}

.page-stack {
  --cw1: 58.33;
  --ar1: 1.3462;
  position: relative;
  width: 100%;
  height: calc(var(--cw1) / var(--ar1) * 1cqw);
}

.page-stack__card {
  position: absolute;
  top: calc((var(--cw1) / var(--ar1) - var(--cw) / var(--ar)) * 0.5cqw);
  width: calc(var(--cw) * 1%);
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: max(4px, var(--cw) * 0.0343cqw);
  box-shadow: 0 20px 40px 0 rgb(0 0 0 / 0.16);
  container-type: inline-size;
  transition:
    left 0.8s var(--ease-calm),
    top 0.8s var(--ease-calm),
    width 0.8s var(--ease-calm),
    border-radius 0.8s var(--ease-calm),
    translate 0.6s var(--ease-calm),
    box-shadow 0.6s var(--ease-calm),
    background-color 0.8s ease;
}

/* click to bring a back card forward: the whole card is the button */
.page-stack__select {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center end;
  padding-inline-end: 14%; /* the visible strip of a back card is its right side */
  border-radius: inherit;
  cursor: pointer;
}

.page-stack__card[data-pos="1"] .page-stack__select {
  display: none;
}

.page-stack__select:focus-visible {
  outline: 3px solid var(--color-interactive-primary);
  outline-offset: -3px;
}

.page-stack__chip {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--color-fixed-dark);
  color: var(--color-fixed-light);
  box-shadow: var(--shadow-float);
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.4s ease, scale 0.6s var(--ease-calm);
}

.page-stack__chip .icon {
  width: 18px;
  height: 11px;
}

/* chevron-down turned to point right */
.page-stack__chevron {
  rotate: -90deg;
}

/* back cards announce they can be clicked: lift, deeper shadow, chip */
@media (hover: hover) {
  .page-stack__card:not([data-pos="1"]):hover {
    translate: 0 -16px;
    box-shadow: 0 32px 64px -8px rgb(0 0 0 / 0.28);
  }
}

.page-stack__card:not([data-pos="1"]):hover .page-stack__chip,
.page-stack__select:focus-visible .page-stack__chip {
  opacity: 1;
  scale: 1;
}

/* touch screens have no hover: the next card always shows its arrow, swiping changes pages,
   dots below show which page is in front */
.page-stack__dots {
  display: none;
}

@media (hover: none) {
  .page-stack {
    touch-action: pan-y;
  }

  .page-stack__card[data-pos="2"] .page-stack__chip {
    opacity: 1;
    scale: 1;
  }

  .page-stack__dots {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
    margin-top: var(--space-24);
  }

  .page-stack__dots span {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: currentColor;
    opacity: 0.25;
    transition: width 0.4s var(--ease-calm), opacity 0.4s ease;
  }

  .page-stack__dots .is-active {
    width: 24px;
    opacity: 1;
  }
}

/* phones: smaller arrow, centred in the visible strip of the card behind */
@media (max-width: 600px) {
  .page-stack__select {
    place-items: center;
    padding-inline: 48% 0;
  }

  .page-stack__chip {
    width: 32px;
    height: 32px;
  }

  .page-stack__chip .icon {
    width: 14px;
    height: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-stack__card,
  .page-stack__chip,
  .page-stack__dots span {
    transition: none;
  }
}

.page-stack__card[data-pos="1"] { --cw: var(--cw1); --ar: var(--ar1); z-index: 3; left: 0; background: var(--color-fixed-light); }
.page-stack__card[data-pos="2"] { --cw: 40;    --ar: 1.0909; z-index: 2; left: 44.17%; background: var(--color-core-tone-chalk); }
.page-stack__card[data-pos="3"] { --cw: 28.33; --ar: 0.8947; z-index: 1; left: 71.67%; background: var(--color-core-tone-fog); }

/* smaller screens: the front page grows, the two back cards tuck further behind it (only a strip shows) */
@media (max-width: 1279px) {
  .page-stack { --cw1: 72; }
  .page-stack__card[data-pos="2"] { --cw: 32; left: 58%; }
  .page-stack__card[data-pos="3"] { --cw: 20; left: 80%; }
}

@media (max-width: 600px) {
  .page-stack { --cw1: 80; }
  .page-stack__card[data-pos="2"] { --cw: 25; left: 68%; }
  .page-stack__card[data-pos="3"] { --cw: 14; left: 86%; }
}

.page-stack__label {
  position: absolute;
  top: 5.5cqw;
  left: 4.6cqw;
  color: var(--color-fixed-dark);
  font-size: 4.6cqw;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
}

.page-stack__card[data-pos="3"] .page-stack__label {
  font-size: max(12px, 4.4cqw);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-small);
}

.page-stack__desktop {
  position: absolute;
  top: 16.7cqw;
  left: 4.6cqw;
  width: 80cqw;
  aspect-ratio: 7 / 4;
  overflow: hidden;
  border-radius: 2.3cqw;
}

.page-stack__phone {
  position: absolute;
  top: 12.9cqw;
  left: 69.7cqw;
  width: 26.9cqw;
  aspect-ratio: 188 / 373;
  padding: 0.86cqw;
  border-radius: 4.6cqw;
  background: var(--color-fixed-dark);
}

.page-stack__phone img,
.page-stack__phone video {
  width: 100%;
  height: 100%;
  border-radius: 3.4cqw;
  object-fit: cover;
  object-position: top;
}

.page-stack__desktop img,
.page-stack__desktop video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ---------- 03 Key message ---------- */

.case-key-message {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.case-key-message__label {
  color: var(--project-text);
}

.case-key-message__text {
  max-width: 1100px;
  color: var(--project-text);
}

.case-key-message__text mark {
  background: none;
  color: var(--color-text-tertiary);
}

/* ---------- 06 System behind: gradient project surface → project text ---------- */

.case-system {
  padding: var(--layout-section) 0;
  background: linear-gradient(180deg, var(--project-surface) 0%, var(--project-text) 100%);
}

.case-system__title {
  padding-inline: max(var(--layout-margin), (100% - var(--layout-content)) / 2);
  color: var(--color-fixed-dark);
}

/* Phones and tablets: one column, cards alternate left/right (offset like the desktop stage) */
.system-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  max-width: 1200px;
  margin: var(--space-64) auto 0;
  padding-inline: var(--layout-margin);
  box-sizing: content-box;
}

.system-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  width: min(484px, 88%);
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--color-fixed-light);
  color: var(--color-core-tone-graphite);
  filter: drop-shadow(0 16px 20px rgb(0 0 0 / 0.12));
  box-sizing: border-box;
}

.system-card:nth-child(even) { align-self: flex-end; }

@media (min-width: 601px) and (max-width: 1199px) {
  .system-cards { max-width: 880px; }
}

/* Desktop: Figma stage (1200 wide: cards at x 0 / 716 / 328, card 2 drops 121).
   Columns follow those edges in fr, so the stage scales without cards running into each other;
   card 3 sits below the taller of the first two. */
@media (min-width: 1200px) {
  .system-cards {
    display: grid;
    grid-template-columns: 328fr 156fr 232fr 96fr 388fr;
    gap: var(--space-128) 0;
    max-width: min(1200px, 100% - 2 * var(--layout-margin));
  }

  .system-card { width: auto; align-self: start; }
  .system-card:nth-child(3n + 1) { grid-column: 1 / 3; }
  .system-card:nth-child(3n + 2) { grid-column: 4 / 6; margin-top: 121px; }
  .system-card:nth-child(3n) { grid-column: 2 / 5; }
}

.system-card__visual img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-8);
}

.system-card .toggle-card__title {
  color: var(--color-core-tone-graphite);
}

.system-card {
  --toggle-bg: var(--color-core-tone-graphite);
}

/* ---------- 07 Result: quote + chapter cards over a full-width image ---------- */

.case-result {
  padding-bottom: var(--layout-section);
}

.case-result__quote {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  align-items: center;
  padding: var(--layout-section) var(--layout-margin);
  text-align: center;
}

.case-result__quote blockquote {
  max-width: 960px;
}

.case-result__quote figcaption {
  color: var(--color-text-secondary);
}

/* clip, not hidden: hidden would make the stage a scroll container and break the sticky image */
.case-result__stage {
  position: relative;
  overflow: clip;
}

.case-result__image {
  position: absolute;
  inset: 0;
}

/* the image is one screen tall and stays put while the cards scroll over it; it no longer
   stretches with the stage, so opening a card doesn't rescale (shift) it */
.case-result__image img {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  object-fit: cover;
}

.chapter-cards {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-128);
  max-width: 1440px;
  margin-inline: auto;
}

/* distance to the image edge as in Figma (beats the ul[role=list] reset) */
.case-result .chapter-cards {
  padding: var(--space-96) 0 var(--space-128);
}

/* Chapter Card (Figma 263:979): odd on project surface, even on project text */
.chapter-card {
  --card-bg: var(--project-surface);
  --card-strong: var(--project-text);
  --card-label: var(--project-text);
  --toggle-bg: var(--project-text);
  --toggle-fg: var(--color-fixed-light);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  width: 440px;
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--card-bg);
  color: var(--project-mix);
}

.chapter-card:nth-child(even) {
  --card-bg: var(--project-text);
  --card-strong: var(--project-surface);
  --card-label: var(--project-mix);
  --toggle-bg: var(--project-mix);
}

.chapter-card:nth-child(1) { margin-left: 5.56%; }
.chapter-card:nth-child(2) { margin-left: min(61.11%, 100% - 440px - 5.56%); }
.chapter-card:nth-child(3) { margin-left: 11.11%; }
.chapter-card:nth-child(4) { margin-left: min(58.33%, 100% - 440px - 5.56%); }

/* wide screens: left and right cards sit side by side, so each next card can start
   a bit above the end of the previous one (saves height, Leoš: stage was too tall) */
@media (min-width: 1280px) {
  .case-result .chapter-cards {
    gap: 0;
    padding: var(--space-64) 0 var(--space-96);
  }

  .chapter-card + .chapter-card {
    margin-top: calc(-1 * var(--space-96));
  }
}

.chapter-card__text {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
}

.chapter-card__text mark {
  background: none;
  color: var(--card-strong);
}

.chapter-card .toggle-card__title {
  color: var(--card-label);
}

.chapter-card .toggle-card__button {
  width: 48px;
  height: 48px;
}

.chapter-card .toggle-card__text {
  color: var(--card-strong);
}

/* ---------- 08 Credits ---------- */

.case-credits {
  padding: 0 max(var(--layout-margin), (100% - var(--layout-content)) / 2) var(--layout-section);
}

.case-credits__bar {
  display: flex;
  gap: var(--space-24);
  padding-top: var(--space-48);
  border-top: 1px solid var(--color-border-subtle);
}

.case-credits__bar > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.case-credits dt {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-small);
  letter-spacing: var(--letter-spacing-small);
}

.case-credits dd {
  margin: 0;
  font-size: var(--font-size-lead);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-lead);
  letter-spacing: var(--letter-spacing-lead);
}

.case-credits a {
  display: inline-flex;
  gap: var(--space-4);
  align-items: center;
}

.case-credits a .icon {
  width: 20px;
  height: 20px;
}

/* ---------- 10 More projects ---------- */

.more-projects {
  position: relative;
  display: flex;
  overflow-x: clip;
  flex-direction: column;
  gap: var(--space-48);
  padding: var(--layout-section) max(var(--layout-margin), (100% - var(--layout-content)) / 2) 0;
  /* fully dark (Leoš): flows into the footer, no split band that breaks when the stack scales */
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.more-projects__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
}

/* ---------- Mobile (≤ 600px, Figma 543:11180) ---------- */

@media (max-width: 1023px) {
  .case-hero__cutout:nth-child(5) {
    display: none;
  }

  /* tablet: video full width, the card only tucks under its edge so the video stays visible */
  .development__media {
    width: 100%;
  }

  .development__card {
    width: min(460px, 80%);
    margin-top: calc(-1 * var(--space-16));
    padding: var(--space-32);
  }

  .development--left .development__card {
    margin-right: var(--space-32);
  }

  .development--right .development__card {
    margin-left: var(--space-32);
  }

  .case-result .chapter-cards {
    gap: var(--space-16);
    padding: var(--space-64) var(--layout-margin);
  }

  .chapter-card,
  .chapter-card:nth-child(n) {
    width: min(440px, 88%);
    margin: 0;
    padding: var(--space-24);
    gap: var(--space-16);
  }

  .chapter-card:nth-child(even) {
    align-self: flex-end;
  }
}

@media (max-width: 600px) {
  /* phones: the title block is tall (title, lead, pills), so the images get their own zones above
     and below it instead of sitting at fixed heights where the lead runs over them.
     Top images end at the top zone's lower edge, bottom images start at the bottom zone. */
  .case-hero {
    --zone-top: calc(var(--header-height) + 34vw);
    --zone-bottom: 34vw;
  }

  .case-hero__title {
    padding-top: calc(var(--zone-top) + var(--space-24));
    padding-bottom: calc(var(--zone-bottom) + var(--space-24));
  }

  .case-hero__cutout:nth-child(1) { --cx: 7;  --w0: 46;   --lift: 0vw; }
  .case-hero__cutout:nth-child(2) { --cx: 83; --w0: 40.8; --lift: 6vw; }
  .case-hero__cutout:nth-child(3) { --cx: 22; --w0: 42.4; --drop: 4vw; }
  .case-hero__cutout:nth-child(4) { --cx: 86; --w0: 36.7; --drop: 0vw; }

  .case-hero__cutout:nth-child(-n + 2) {
    top: calc(var(--zone-top) - var(--lift) - var(--w) / var(--ar, 1.5));
  }

  .case-hero__cutout:nth-child(n + 3) {
    top: calc(100cqh - var(--zone-bottom) + var(--drop));
  }

  .development__media {
    width: 100%;
  }

  .development__card,
  .development--left .development__card {
    align-self: stretch;
    width: auto;
    margin: calc(-1 * var(--space-16)) var(--space-16) 0;
    padding: var(--space-32);
  }

  .case-credits__bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: var(--space-32);
  }


  .more-projects__head {
    flex-direction: column;
    gap: var(--space-16);
  }
}

/* ---------- Compact hero (Figma 485:1016) ---------- */

.case-hero-compact {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: var(--space-64);
  align-items: center;
  min-height: 100svh;
  padding: var(--header-height) max(var(--layout-margin), (100% - var(--layout-content)) / 2) var(--space-96);
  background: var(--project-surface);
  color: var(--project-text);
}

.case-hero-compact__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  align-items: flex-start;
}

.case-hero-compact__text .text-h1 {
  max-width: 600px;
}

.case-hero-compact__text .text-lead {
  max-width: 560px;
}

.case-hero-compact__image {
  overflow: hidden;
  aspect-ratio: 520 / 660;
  border-radius: var(--radius-24);
  box-shadow: 0 24px 48px 0 rgb(0 0 0 / 0.16);
  rotate: 2deg;
}

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

/* ---------- Chapter compact (Figma 485:1031) ---------- */

.case-chapter {
  display: flex;
  gap: var(--space-96);
  align-items: flex-start;
  padding-block: var(--layout-block);
}

.case-chapter__head {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: var(--space-16);
  width: 520px;
}

.case-chapter__label {
  color: var(--project-text);
}

.case-chapter__text {
  flex: 1;
  color: var(--color-text-secondary);
}

/* ---------- Image strip (Figma 476:1033), positions from the 1200 content grid ---------- */

.image-strip {
  padding: var(--space-64) max(var(--layout-margin), (100% - var(--layout-content)) / 2);
}

.image-strip--bg-project {
  background: var(--project-surface);
}

.image-strip__grid {
  display: grid;
  align-items: start;
}

.image-strip__item {
  overflow: hidden;
  border-radius: var(--radius-24); /* Figma 476:1033: every image 24 */
  background: var(--color-surface-raised);
}

@media (max-width: 600px) {
  .image-strip__item {
    border-radius: var(--radius-16);
  }
}

.image-strip__item img,
.image-strip__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-strip--large .image-strip__item { aspect-ratio: 1200 / 750; }
.image-strip--wide .image-strip__item  { aspect-ratio: 2 / 1; }

/* 700 × 875 + 420 × 560, second one 240px lower */
.image-strip--offset .image-strip__grid {
  grid-template-columns: 700fr 80fr 420fr;
}

.image-strip--offset .image-strip__item:nth-child(1) { grid-column: 1; aspect-ratio: 700 / 875; }
.image-strip--offset .image-strip__item:nth-child(2) { grid-column: 3; aspect-ratio: 420 / 560; margin-top: 20%; }

/* 760 × 950 left, two 380 × 460 stacked right */
.image-strip--mosaic .image-strip__grid {
  grid-template-columns: 760fr 380fr;
  column-gap: 5%;
  row-gap: 30px;
}

.image-strip--mosaic .image-strip__item:nth-child(1) { grid-row: span 2; aspect-ratio: 760 / 950; }
.image-strip--mosaic .image-strip__item:nth-child(n + 2) { aspect-ratio: 380 / 460; }

/* four 285 × 380, even ones 60px lower */
.image-strip--row .image-strip__grid {
  grid-template-columns: repeat(4, 1fr);
  column-gap: 20px;
  padding-bottom: 60px;
}

.image-strip--row .image-strip__item { aspect-ratio: 285 / 380; }
.image-strip--row .image-strip__item:nth-child(even) { translate: 0 60px; }

/* 560 × 640 centred on a 1200 × 800 project-coloured stage */
.image-strip--stage .image-strip__grid {
  place-items: center;
  aspect-ratio: 1200 / 800;
  background: var(--project-surface);
}

.image-strip--stage .image-strip__item {
  width: 46.67%;
  aspect-ratio: 560 / 640;
}

/* ---------- Grid items: Level row / Badge grid (Figma 712:13121) ---------- */

.case-grid {
  padding: 0 max(var(--layout-margin), (100% - var(--layout-content)) / 2) var(--layout-block);
}

.case-grid__list {
  display: grid;
}

.case-grid--level .case-grid__list {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-24);
  align-items: start;
}

.case-grid--level .grid-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-24);
  border-radius: var(--radius-24);
  background: var(--project-surface);
  color: var(--project-text);
}

.case-grid--level .grid-item__image {
  height: 220px;
}

.case-grid--level .grid-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.case-grid--level .grid-item__title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
}

.case-grid--badge .case-grid__list {
  grid-template-columns: repeat(5, minmax(0, 186px));
  gap: var(--space-32) var(--space-24);
  justify-content: center;
  padding: var(--space-64) 0;
  border-radius: var(--radius-24);
  background: var(--project-surface);
}

.case-grid--badge .grid-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  align-items: center;
  color: var(--project-text);
  text-align: center;
}

.case-grid--badge .grid-item__image {
  width: min(220px, 118%);
  aspect-ratio: 220 / 159;
  overflow: hidden; /* lets aspect-ratio win over the image's own height */
}

.case-grid--badge .grid-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-grid--badge .grid-item__title {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-small);
}

@media (max-width: 1023px) {
  .case-hero-compact {
    grid-template-columns: 1fr;
    padding-top: calc(var(--header-height) + var(--space-48));
  }

  .case-hero-compact__image {
    max-width: 420px;
  }

  .case-chapter {
    flex-direction: column;
    gap: var(--space-24);
  }

  .case-chapter__head {
    width: auto;
  }

  .case-grid--badge .case-grid__list {
    grid-template-columns: repeat(3, minmax(0, 186px));
  }

  .case-grid--badge .grid-item__image {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .image-strip {
    padding-block: var(--space-32);
  }

  .image-strip--row .image-strip__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-16);
    padding-bottom: var(--space-24);
  }

  .image-strip--row .image-strip__item:nth-child(even) {
    translate: 0 var(--space-24);
  }

  .case-grid--level .case-grid__list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-16);
  }

  .case-grid--level .grid-item {
    padding: var(--space-16);
  }

  .case-grid--level .grid-item__image {
    height: 120px;
  }

  .case-grid--badge .case-grid__list {
    gap: var(--space-24) var(--space-16);
    padding: var(--space-32) var(--space-16);
  }
}
