/* Cases uses the same shared footer bar as every inner page. Only the
   page-specific CTA is omitted; the footer contacts/social/legal sections
   remain available and consistent across routes. */
.is-cases-page .mi-footer__cta {
  display: none;
}

body.mi-case-open { overflow: hidden; }

.mi-cases-page.mi-case-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 24px;
  background: rgba(17, 35, 49, 0.78);
  color: var(--mi-color-surface-dark);
}

.mi-cases-page.mi-case-modal[hidden] { display: none; }

.mi-cases-page {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--mi-page-width);
  min-height: calc(876px * var(--mi-s));
  margin-inline: auto;
  padding: calc(38px * var(--mi-s)) var(--mi-gutter) calc(58px * var(--mi-s));
  background: var(--mi-color-surface-dark);
  color: var(--mi-color-surface-dark);
}

.mi-case-dialog {
  position: relative;
  display: grid;
  grid-template-columns: calc(680px * var(--mi-s)) calc(820px * var(--mi-s));
  gap: calc(60px * var(--mi-s));
  /* Figma 47:121 / 47:710: the popup is a fixed 1720px composition.
     Keeping it viewport-wide leaves unused space after the 820px right pane. */
  width: calc(1720px * var(--mi-s));
  max-width: 100%;
  height: calc(780px * var(--mi-s));
  padding: calc(80px * var(--mi-s));
  border-radius: var(--mi-radius-card);
  background: var(--mi-color-surface-soft);
  overflow: hidden;
}

.mi-case-dialog__close {
  position: absolute;
  z-index: 5;
  top: calc(40px * var(--mi-s));
  right: calc(40px * var(--mi-s));
  width: calc(36px * var(--mi-s));
  height: calc(36px * var(--mi-s));
  transition: transform var(--mi-duration) var(--mi-ease), opacity var(--mi-duration) var(--mi-ease);
}

.mi-case-dialog__close:hover {
  transform: rotate(90deg);
  opacity: 0.72;
}

.mi-case-dialog__close img {
  width: 100%;
  height: 100%;
}

.mi-case-dialog__close-icon--mobile,
.mi-case-dialog__dots--mobile,
.mi-case-results__wreath--mobile {
  display: none;
}

.mi-case-dialog__media {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(20px * var(--mi-s));
  width: calc(680px * var(--mi-s));
}

.mi-case-dialog__cover {
  position: relative;
  width: calc(680px * var(--mi-s));
  height: calc(400px * var(--mi-s));
  border-radius: calc(20px * var(--mi-s));
  overflow: hidden;
}

.mi-case-dialog__cover img {
  position: absolute;
  left: -5.82%;
  top: -0.03%;
  width: 111.35%;
  height: 120.03%;
  max-width: none;
}

.mi-case-dialog__dots {
  width: calc(80px * var(--mi-s));
  height: calc(8px * var(--mi-s));
  max-width: none;
}

.mi-case-dialog__content {
  width: calc(820px * var(--mi-s));
  height: calc(620px * var(--mi-s));
  padding-right: calc(38px * var(--mi-s));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #4385bb rgba(67, 133, 187, 0.18);
  scrollbar-width: thin;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.mi-case-dialog__content::-webkit-scrollbar {
  width: calc(6px * var(--mi-s));
}

.mi-case-dialog__content::-webkit-scrollbar-track {
  border-radius: 100px;
  background: rgba(67, 133, 187, 0.18);
}

.mi-case-dialog__content::-webkit-scrollbar-thumb {
  border-radius: 100px;
  background: #4385bb;
}

.mi-case-dialog__header {
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--mi-s));
  padding-right: calc(46px * var(--mi-s));
}

.mi-case-dialog__brand {
  color: #4385bb;
  font-size: var(--mi-fs-24);
  font-weight: 500;
  line-height: 1.3;
}

.mi-case-dialog__header h1 {
  font-size: var(--mi-fs-40);
  font-weight: 500;
  line-height: 1.2;
}

.mi-case-section {
  margin-top: calc(32px * var(--mi-s));
}

.mi-case-section h2 {
  margin-bottom: calc(16px * var(--mi-s));
  font-size: var(--mi-fs-24);
  font-weight: 500;
  line-height: 1.3;
}

.mi-case-section p,
.mi-case-bullets li {
  font-size: var(--mi-fs-20);
  font-weight: 300;
  line-height: 1.5;
}

.mi-case-flow {
  display: flex;
  flex-wrap: wrap;
  gap: calc(10px * var(--mi-s)) calc(42px * var(--mi-s));
}

.mi-case-flow li {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: calc(46px * var(--mi-s));
  padding: calc(8px * var(--mi-s)) calc(20px * var(--mi-s));
  border-radius: var(--mi-radius-pill);
  background: #fff;
  font-size: var(--mi-fs-20);
  font-weight: 300;
  line-height: 1.5;
  white-space: nowrap;
}

.mi-case-flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  left: calc(100% + (6px * var(--mi-s)));
  top: 50%;
  display: grid;
  place-items: center;
  width: calc(36px * var(--mi-s));
  height: calc(36px * var(--mi-s));
  border-radius: 50%;
  background: rgba(67, 133, 187, 0.2);
  color: #264a65;
  transform: translateY(-50%);
}

.mi-case-bullets {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--mi-s));
  margin-top: calc(12px * var(--mi-s));
}

.mi-case-bullets li::before {
  content: "• ";
}

.mi-case-section--presentation p + p {
  margin-top: calc(12px * var(--mi-s));
}

.mi-case-results {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--mi-s));
  counter-reset: mi-case-result;
}

.mi-case-results li {
  display: grid;
  grid-template-columns: calc(84px * var(--mi-s)) 1fr;
  align-items: center;
  gap: calc(12px * var(--mi-s));
  counter-increment: mi-case-result;
}

.mi-case-results li > span:last-child {
  display: flex;
  flex-direction: column;
  gap: calc(4px * var(--mi-s));
}

.mi-case-results strong,
.mi-case-results small {
  font-size: var(--mi-fs-20);
  line-height: 1.4;
}

.mi-case-results strong { font-weight: 500; }
.mi-case-results small { font-weight: 300; }

.mi-case-results__number {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: calc(84px * var(--mi-s));
  color: #112331;
}

.mi-case-results__number img {
  width: calc(24px * var(--mi-s));
  height: calc(45px * var(--mi-s));
}

.mi-case-results__number img:last-child {
  justify-self: end;
  transform: rotateY(180deg);
}

.mi-case-results__wreath--right {
  justify-self: end;
  transform: rotateY(180deg);
}

.mi-case-results__number b {
  font-size: var(--mi-fs-32);
  font-weight: 300;
  line-height: 1;
}

.mi-case-results__number b::before {
  content: counter(mi-case-result);
}

.mi-case-cta {
  position: relative;
  display: flex;
  min-height: calc(395px * var(--mi-s));
  margin-top: calc(32px * var(--mi-s));
  border-radius: calc(30px * var(--mi-s));
  background:
    radial-gradient(circle at 88% 80%, rgba(67, 133, 187, 0.35), transparent 32%),
    #112331;
  color: #fff;
  overflow: hidden;
}

.mi-case-cta__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: calc(610px * var(--mi-s));
  padding: calc(40px * var(--mi-s));
}

.mi-case-cta h2 {
  margin: 0;
  font-size: var(--mi-fs-40);
  font-weight: 500;
  line-height: 1.2;
}

.mi-case-cta p {
  margin-top: calc(24px * var(--mi-s));
  font-size: var(--mi-fs-20);
  font-weight: 300;
  line-height: 1.5;
}

.mi-case-cta .mi-btn {
  width: calc(474px * var(--mi-s));
  margin-top: auto;
  padding-inline: calc(24px * var(--mi-s));
}

.mi-case-cta > img {
  position: absolute;
  right: calc(127px * var(--mi-s));
  bottom: 0;
  width: calc(201px * var(--mi-s));
  height: calc(395px * var(--mi-s));
  max-width: none;
  object-fit: cover;
  /* `head.png` has a transparent canvas around the bust. This crop selects
     its face (rather than the transparent far-right edge) before mirroring. */
  object-position: 58% center;
  /* Figma 47:715 mirrors the statue so its face enters the CTA from the
     right edge. */
  transform: scaleX(-1);
  transform-origin: right center;
}

@media (max-width: 991px) {
  .mi-cases-page {
    min-height: calc(100svh - var(--mi-header-height));
    padding: 10px;
  }

  .mi-cases-page.mi-case-modal { align-items: flex-start; padding: 60px 10px 10px; background: rgba(17, 35, 49, 0.88); overflow: hidden; }

  .mi-case-dialog {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: min(680px, calc(100svh - var(--mi-header-height) - 20px));
    min-height: 0;
    padding: 10px;
    border-radius: 24px;
    overflow: hidden;
  }

  .mi-case-dialog__close {
    top: 10px;
    right: 20px;
    width: 32px;
    height: 32px;
  }

  .mi-case-dialog__close-icon--desktop,
  .mi-case-dialog__dots--desktop,
  .mi-case-results__wreath--desktop {
    display: none;
  }

  .mi-case-dialog__close-icon--mobile,
  .mi-case-dialog__dots--mobile,
  .mi-case-results__wreath--mobile {
    display: block;
  }

  .mi-case-dialog__media {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    gap: 10px;
  }

  .mi-case-dialog__cover {
    width: 100%;
    height: calc(58.823529vw - 23.529412px);
    aspect-ratio: auto;
    border-radius: 16px;
  }

  .mi-case-dialog__dots {
    width: 70px;
    height: 6px;
  }

  .mi-case-dialog__content {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0 6px 6px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: #4385bb rgba(67, 133, 187, 0.18);
    scrollbar-width: thin;
  }

  .mi-case-dialog__content::-webkit-scrollbar { width: 3px; }

  .mi-case-dialog__header { gap: 8px; padding: 0; }
  .mi-case-dialog__brand { font-size: 18px; line-height: 1.3; }
  .mi-case-dialog__header h1 { font-size: 24px; line-height: 1.2; }

  .mi-case-section { margin-top: 16px; }
  .mi-case-section h2 { margin-bottom: 10px; font-size: 18px; line-height: 1.3; }
  .mi-case-section p,
  .mi-case-bullets li { font-size: 14px; line-height: 1.5; }

  .mi-case-flow {
    align-items: center;
    gap: 10px 0;
  }

  .mi-case-flow li {
    min-height: 0;
    max-width: calc(100% - 30px);
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
  }

  .mi-case-flow li:not(:last-child) { margin-right: 30px; }

  .mi-case-flow li:not(:last-child)::after {
    content: "";
    top: 50%;
    left: calc(100% + 4px);
    width: 26px;
    height: 26px;
    border-radius: 0;
    background: url("../../images/pages/cases/flow-arrow-mobile.svg") center / 26px 26px no-repeat;
    transform: translateY(-50%);
  }

  .mi-case-results li {
    grid-template-columns: 53px 1fr;
    align-items: center;
    gap: 10px;
  }

  .mi-case-results strong,
  .mi-case-results small { font-size: 14px; line-height: 1.4; }

  .mi-case-results__number { width: 53px; }
  .mi-case-results__number img { width: auto; height: auto; }
  .mi-case-results__number .mi-case-results__wreath--mobile { width: 19px; height: 36px; }
  .mi-case-results__number .mi-case-results__wreath--mobile.mi-case-results__wreath--right { width: 20px; height: 37.5px; justify-self: end; transform: rotateY(180deg); }
  .mi-case-results__number b { font-size: 24px; line-height: 1.2; }

  .mi-case-cta {
    min-height: 282px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 20px;
  }

  .mi-case-cta__copy {
    width: 100%;
    padding: 0;
  }

  .mi-case-cta h2 { font-size: 24px; line-height: 1.2; }
  .mi-case-cta p { margin-top: 10px; font-size: 14px; line-height: 1.5; }
  .mi-case-cta .mi-btn { width: 100%; min-height: 53px; margin-top: auto; padding: 16px 32px; font-size: 14px; line-height: 1.5; white-space: normal; text-align: center; }
  .mi-case-cta > img { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mi-case-dialog__close {
    transition: none;
  }

  .mi-case-dialog__close:hover {
    transform: none;
  }
}
