/* Case 01 — opposing interface reels and the pinned-to-page handoff. */
.mp-showcase-transition {
  --mp-showcase-scene-height: max(100vh, 560px);
  --mp-showcase-scene-height: max(100svh, 560px);
  position: relative;
  isolation: isolate;
  background: #061923;
}

.mp-showcase-stage {
  position: relative;
  z-index: 0;
  height: calc(var(--mp-showcase-scene-height) + var(--mp-showcase-scene-height));
  min-height: 0;
  color: #f2ffff;
}

.mp-showcase-pin {
  position: sticky;
  top: 0;
  z-index: 0;
  display: flex;
  height: var(--mp-showcase-scene-height);
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  contain: paint;
  background:
    radial-gradient(circle at 20% 14%, rgba(81, 224, 235, .2), transparent 31%),
    radial-gradient(circle at 86% 72%, rgba(38, 146, 190, .24), transparent 37%),
    linear-gradient(136deg, #0b5870 0%, #07364b 43%, #061d2a 76%, #04131d 100%);
}

/* JavaScript changes the scene between three geometrically identical states.
   This avoids the iOS overflow/sticky failure while keeping both boundaries
   seamless: absolute at the start, fixed during the cover, absolute at end. */
.js .mp-showcase-stage .mp-showcase-pin {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  width: 100%;
}

.js .mp-showcase-stage.is-pinned .mp-showcase-pin {
  position: fixed;
  top: 0;
  left: var(--mp-showcase-pin-left, 0px);
  width: var(--mp-showcase-pin-width, 100%);
}

.js .mp-showcase-stage.is-past .mp-showcase-pin {
  top: auto;
  bottom: 0;
}

.mp-showcase-pin::before,
.mp-showcase-pin::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mp-showcase-pin::before {
  opacity: .2;
  background-image:
    linear-gradient(rgba(215, 255, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 255, 255, .12) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .84), transparent 88%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .84), transparent 88%);
}

.mp-showcase-pin::after {
  background:
    linear-gradient(90deg, rgba(3, 18, 28, .58), transparent 9%, transparent 91%, rgba(3, 18, 28, .58)),
    linear-gradient(180deg, rgba(3, 17, 26, .5), transparent 18%, transparent 74%, rgba(3, 16, 25, .52));
}

.mp-showcase-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.mp-showcase-atmosphere span {
  position: absolute;
  border: 1px solid rgba(179, 250, 250, .15);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(93, 228, 234, .08) inset;
}

.mp-showcase-atmosphere span:first-child {
  top: -38vw;
  left: -22vw;
  width: 92vw;
  aspect-ratio: 1;
}

.mp-showcase-atmosphere span:nth-child(2) {
  right: -26vw;
  bottom: -47vw;
  width: 88vw;
  aspect-ratio: 1;
}

.mp-showcase-atmosphere span:last-child {
  top: 15%;
  right: 18%;
  width: 10px;
  height: 10px;
  border: 0;
  background: #a8ffff;
  box-shadow: 0 0 0 7px rgba(168, 255, 255, .05), 0 0 24px rgba(168, 255, 255, .62);
}

.mp-showcase-status,
.mp-showcase-coordinate {
  position: absolute;
  z-index: 3;
  right: clamp(1rem, 4vw, 4.5rem);
  left: clamp(1rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(224, 253, 253, .64);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(.56rem, .72vw, .7rem);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mp-showcase-status {
  top: calc(clamp(6rem, 9vw, 8rem) + env(safe-area-inset-top, 0px));
}

.mp-showcase-status span:last-child { text-align: right; }

.mp-showcase-index {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  color: rgba(203, 255, 254, .045);
  font-family: "IBM Plex Mono", monospace;
  font-size: min(42vw, 38rem);
  font-weight: 500;
  line-height: .7;
  letter-spacing: -.13em;
  transform: translate(-53%, -52%);
  pointer-events: none;
}

.mp-showcase-reels {
  --mp-screen-height: clamp(240px, 32svh, 300px);
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 16px;
  padding-block: clamp(4rem, 8svh, 6rem) clamp(2rem, 4svh, 3.5rem);
}

.mp-showcase-row {
  width: 100%;
  overflow: hidden;
}

.mp-showcase-row--right {
  width: calc(100% + clamp(4rem, 10vw, 10rem));
  margin-left: clamp(-10rem, -10vw, -4rem);
}

.mp-showcase-track {
  display: flex;
  width: max-content;
  max-width: none;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.mp-showcase-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  padding-right: 16px;
}

.mp-screen {
  position: relative;
  flex: 0 0 auto;
  height: var(--mp-screen-height);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(223, 255, 255, .24);
  border-radius: clamp(10px, 1vw, 16px);
  background: #eff8f8;
  box-shadow:
    0 22px 60px rgba(1, 12, 19, .28),
    0 3px 12px rgba(1, 12, 19, .24);
  transform: translateZ(0);
}

.mp-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset;
  pointer-events: none;
}

.mp-screen--desktop { aspect-ratio: 3 / 2; }
.mp-screen--mobile { aspect-ratio: 585 / 1266; }

.mp-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: saturate(.98) contrast(1.015);
}

.mp-showcase.is-ready .mp-showcase-row--left .mp-showcase-track {
  animation: mp-showcase-left 130s linear infinite;
  animation-play-state: paused;
}

.mp-showcase.is-ready .mp-showcase-row--right .mp-showcase-track {
  animation: mp-showcase-right 140s linear infinite;
  animation-play-state: paused;
}

.mp-showcase.is-visible:not(.is-page-hidden) .mp-showcase-track {
  animation-play-state: running;
  will-change: transform;
}

.mp-showcase-coordinate {
  bottom: calc(clamp(1.5rem, 3vw, 2.8rem) + env(safe-area-inset-bottom, 0px));
  justify-content: flex-start;
}

.mp-showcase-coordinate i {
  display: block;
  width: clamp(38px, 5vw, 72px);
  height: 1px;
  background: rgba(187, 252, 251, .58);
}

.mp-showcase-cover {
  position: relative;
  z-index: 4;
  min-height: 100svh;
  margin-top: calc(0px - var(--mp-showcase-scene-height));
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  overflow: hidden;
  border-radius: clamp(30px, 4vw, 58px) clamp(30px, 4vw, 58px) 0 0;
  box-shadow: 0 -30px 70px rgba(1, 14, 22, .25);
}

.mp-showcase-cover::before {
  content: '';
  position: absolute;
  top: 0;
  right: clamp(1.5rem, 5vw, 5rem);
  left: clamp(1.5rem, 5vw, 5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6, 67, 85, .2), transparent);
}

@keyframes mp-showcase-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes mp-showcase-right {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (max-width: 720px) {
  .mp-showcase-transition {
    --mp-showcase-scene-height: max(100vh, 480px);
    --mp-showcase-scene-height: max(100svh, 480px);
  }

  .mp-showcase-status {
    top: calc(5.8rem + env(safe-area-inset-top, 0px));
    align-items: flex-start;
    font-size: .54rem;
    letter-spacing: .1em;
  }

  .mp-showcase-status span { max-width: 15ch; }

  .mp-showcase-reels {
    --mp-screen-height: clamp(168px, 26svh, 220px);
    gap: 12px;
    padding-block: 5.6rem 3.4rem;
  }

  .mp-showcase-group {
    gap: 12px;
    padding-right: 12px;
  }

  .mp-showcase-row--right {
    width: calc(100% + 72px);
    margin-left: -72px;
  }

  .mp-screen {
    border-radius: 10px;
    box-shadow: 0 14px 38px rgba(1, 12, 19, .3), 0 2px 8px rgba(1, 12, 19, .22);
  }

  .mp-showcase-index {
    top: 49%;
    font-size: min(68vw, 18rem);
  }

  .mp-showcase-coordinate {
    bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    font-size: .52rem;
  }

  .mp-showcase-cover {
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -22px 54px rgba(1, 14, 22, .28);
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .mp-showcase-reels {
    --mp-screen-height: clamp(148px, 31svh, 190px);
    flex-direction: row;
    gap: 12px;
  }

  .mp-showcase-row { width: 50%; }
  .mp-showcase-row--right { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mp-showcase-stage {
    height: auto;
    min-height: 0;
  }

  .mp-showcase-pin,
  .js .mp-showcase-stage .mp-showcase-pin,
  .js .mp-showcase-stage.is-pinned .mp-showcase-pin,
  .js .mp-showcase-stage.is-past .mp-showcase-pin {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 100svh;
  }

  .mp-showcase-track {
    animation: none !important;
    transform: translate3d(0, 0, 0) !important;
  }

  .mp-showcase-cover {
    min-height: auto;
    margin-top: 0;
  }
}
