/* Slide 05 — vertical scroll: headline + bars, then zig-zag stat bubbles (Figma 318:95) */

.story-slide-05__scroller {
  background: #000;
  overflow-x: hidden;
}

/* Bar steps: reveal in place; wheel advances bars without scrolling the panel */
.story-slide-05--bars-pinned .story-slide-05__scroller {
  overflow-y: hidden;
}

/* All bars revealed — inner scroller may move to interstitial / bubbles */
.story-slide-05--bars-complete .story-slide-05__scroller {
  overflow-y: auto;
}

.story-slide-05__scroll-doc {
  min-height: 100%;
}

.story-slide-05__content {
  position: relative;
  width: 100%;
  max-width: 120rem;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  box-sizing: border-box;
  isolation: isolate;
  overflow: visible;
}

.story-slide-05__intro {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.5rem, 5vh, 4rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin-bottom: 0;
  padding-top: var(--site-header-block-size);
  padding-bottom: clamp(1.5rem, 3vh, 2.5rem);
  box-sizing: border-box;
}

.story-slide-05__intro-head {
  position: relative;
  z-index: 1;
}

.story-slide-05__title-orb {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  width: min(62.5rem, 52vw);
  aspect-ratio: 1;
  transform: translate(40%, 10%);
  transform-origin: right bottom;
  pointer-events: none;
}

.story-slide-05__title-orb-image {
  position: absolute;
  right: -5%;
  bottom: -8%;
  display: block;
  width: 132%;
  height: 132%;
  max-width: none;
  transform-origin: right bottom;
}

.story-slide--05 .story-slide-05__title {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 72rem;
  font-family: var(--muse-font-family-default);
  font-size: clamp(2.75rem, 5.2vw, 5rem);
  font-weight: 400;
  line-height: 1;
  color: #fff;
  opacity: 0;
  filter: blur(24px);
  transform: translate3d(0, 12px, 0);
  text-align: left;
  transition:
    opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-slide-05__title.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.story-slide-05__bars {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4.5vh, 3.75rem);
  width: 100%;
}
@media (max-width: 62.125rem) {
  .story-slide-05__intro,
  .story-slide-05__bars {
    gap: 0;
  }
  
  .story-nav {
    right: 0;
  }
}
@media (max-height: 800px) {
  .story-slide-05__bars {
    gap: clamp(1.25rem, 1.5vh, 2rem);
  }
}
.story-slide-05__bar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.4s;
}

.story-slide-05__bar.is-bar-revealed {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

/* Hidden until slide is active (avoids filled bars flashing on re-entry during GSAP transition) */
.story-slide--05:not(.is-story-active) .story-slide-05__bar,
.story-slide--05:not(.is-story-active) .story-slide-05__bar-caption,
.story-slide--05:not(.is-story-active) .story-slide-05__bar-canvas-wrap {
  opacity: 0 !important;
  visibility: hidden;
  transition: none;
}

.story-slide-05__bar-caption {
  margin: 0;
  font-family: var(--muse-font-family-default);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (max-width: 62.125rem) {
  .story-slide-05__bar-caption {
    margin-top: -0.5em;
  }
}

.story-slide-05__bar-caption.is-caption-visible {
  opacity: 1;
  transform: none;
}

.story-slide-05__bar-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(4.5rem, 9vh, 6.5rem);
  background: #000;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-slide-05__bar-canvas-wrap.is-bar-visible {
  opacity: 1;
}

.story-slide-05__bar-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.story-slide-05__bar-caption strong {
  font-weight: 700;
}

/* Solid stack above bubbles — blocks upward stat-glow bleed (same pattern as slide 06) */
.story-slide--05 #story-slide-05-interstitial {
  position: relative;
  z-index: 3;
  isolation: isolate;
  background: #000;
}

/* Stat groups — full column width; bubbles on edges, glows bleed out (Figma 398:483–486) */
.story-slide-05__bubbles {
  --story-slide-05-bubble-size: clamp(36rem, 56vw, 56rem);

  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4.5rem);
  width: 100%;
  
  padding-top: min(max(2rem, var(--site-header-block-size)), 7rem);
  padding-bottom: clamp(4rem, 12vh, 10rem);
  overflow: visible;
}

/* Glows only — stat groups still fade in via intersection; hides upward bleed into interstitial */
.story-slide--05:not(.story-slide-05--bubbles-active) .story-slide-05__stat-glow {
  visibility: hidden;
  opacity: 0;
}

.story-slide-05__stat-group {
  position: relative;
  width: 100%;
  overflow: visible;
  opacity: 0;
  transform: translate3d(0, 2.5rem, 0);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-slide-05__stat-group.is-visible {
  opacity: 1;
  transform: none;
}

/* Keep layout stable while fading out so intersection ratio does not oscillate. */
.story-slide-05__stat-group.is-visible--revealed {
  transform: none;
}

.story-slide-05__stat-group.is-visible--revealed:not(.is-visible) {
  opacity: 0;
  transform: none;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-slide-05__stat-group--1 {
  /* Tighter join to bars; glow still bleeds up/left */
  min-height: calc(var(--story-slide-05-bubble-size) * 620 / 560);
  z-index: 10;
}

.story-slide-05__stat-group--2 {
  min-height: calc(var(--story-slide-05-bubble-size) * 1027 / 560);
  margin-top: -66rem;
}

.story-slide-05__stat-group--3 {
  min-height: calc(var(--story-slide-05-bubble-size) * 698 / 560);
  margin-top: -25rem;
}

.story-slide-05__stat-group--4 {
  min-height: calc(var(--story-slide-05-bubble-size) * 1000 / 560);
  margin-top: -40rem;
}

.story-slide-05__stat-glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.story-slide--05.story-slide-05--bubbles-active .story-slide-05__stat-glow.story-magnetic {
  pointer-events: none;
}

.story-slide-05__stat-glow.story-magnetic .story-magnetic__motion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-slide-05__bubble.story-magnetic.story-magnetic--fill > .story-magnetic__motion {
  width: 100%;
  height: 100%;
}

.story-slide-05__stat-glow-image {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: none;
  transform: translate(-50%, -50%);
}

.story-slide-05__stat-glow-image--orange {
  width: 164%;
  height: 164%;
}

.story-slide-05__stat-glow-image--pink {
  width: 140%;
  height: 140%;
}

.story-slide-05__stat-glow-image--19 {
  width: 125.6%;
  height: 125.6%;
}

.story-slide-05__stat-glow-image--bottom {
  width: 132%;
  height: 132%;
}

/* Stat 1 — bubble left edge; orange glow bleeds left (Figma 398:483) */
.story-slide-05__stat-group--1 .story-slide-05__bubble {
  left: 0;
  top: 0;
  width: var(--story-slide-05-bubble-size);
}

.story-slide-05__stat-group--1 .story-slide-05__stat-glow {
  left: calc(var(--story-slide-05-bubble-size) * -500 / 560);
  top: 0;
  width: calc(var(--story-slide-05-bubble-size) * 500 / 560);
  transform: translateY(-50%);
  aspect-ratio: 1;
}

/* Stat 2 — bubble right edge; glow offset from bubble (Figma 398:484) */
.story-slide-05__stat-group--2 .story-slide-05__bubble {
  right: 0;
  left: auto;
  top: 45.472249%;
  width: var(--story-slide-05-bubble-size);
}

.story-slide-05__stat-group--2 .story-slide-05__stat-glow {
  left: calc(100% - var(--story-slide-05-bubble-size) * 446 / 560);
  top: 0;
  width: calc(var(--story-slide-05-bubble-size) * 800 / 560);
  aspect-ratio: 1;
}

/* Stat 3 — bubble left edge; 19% glow bleeds left (Figma 398:486) */
.story-slide-05__stat-group--3 .story-slide-05__bubble {
  left: 0;
  top: 19.770773%;
  width: var(--story-slide-05-bubble-size);
}

.story-slide-05__stat-group--3 .story-slide-05__stat-glow {
  left: calc(var(--story-slide-05-bubble-size) * -309 / 560);
  top: 0;
  width: calc(var(--story-slide-05-bubble-size) * 500 / 560);
  aspect-ratio: 1;
}

/* Stat 4 — bubble right edge; glow offset from bubble (Figma 398:485) */
.story-slide-05__stat-group--4 .story-slide-05__bubble {
  right: 0;
  left: auto;
  top: 28.4%;
  width: var(--story-slide-05-bubble-size);
}

.story-slide-05__stat-group--4 .story-slide-05__stat-glow {
  left: calc(100% - var(--story-slide-05-bubble-size) * 380 / 560);
  top: 0;
  width: calc(var(--story-slide-05-bubble-size) * 1000 / 560);
  aspect-ratio: 1;
}

.story-slide-05__bubble {
  position: absolute;
  z-index: 1;
  margin: 0;
  aspect-ratio: 1;
}

.story-slide-05__bubble.story-magnetic,
.story-slide-05__bubble.story-magnetic .story-magnetic__motion,
.story-slide-05__bubble-face,
.story-slide-04__bubble-face {
  pointer-events: auto;
}

.story-slide-05__stat-glow.story-magnetic {
  pointer-events: none;
}

.story-slide-05__bubble-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  height: 100%;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.story-slide-05__bubble-face .story-stat__value {
  margin: 0;
  font-family: var(--muse-font-family-default);
  font-size: clamp(3rem, 8vw, 10rem);
  font-weight: 300;
  line-height: 1;
}

.story-slide-05__bubble-face .story-stat__description {
  margin: 0;
  font-family: var(--muse-font-family-default);
  font-size: clamp(2rem, 2.2vw, 4rem);
  font-weight: 400;
  line-height: 1.2;
}

/* Narrow viewports: Z-layout stacks tighter — halve overlap pulls; clear fixed nav for first glow */
@media (max-width: 62.125rem) {
  .story-slide-05__bubbles {
    padding-top: clamp(1.25rem, 3vh, 2rem);
  }

  .story-slide-05__stat-group--1 {
    margin-top: clamp(1.5rem, 4vh, 2.75rem);
  }

  .story-slide-05__stat-group--1 .story-slide-05__stat-glow {
    top: clamp(2rem, 5vh, 3.25rem);
  }

  .story-slide-05__stat-group--2 {
    margin-top: -37rem;
  }

  .story-slide-05__stat-group--3 {
    margin-top: -11rem;
  }

  .story-slide-05__stat-group--4 {
    margin-top: -21rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-slide--05:not(.story-slide-05--bubbles-active) .story-slide-05__stat-glow {
    visibility: visible;
    opacity: 1;
  }

  .story-slide--05 .story-slide-05__title {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  .story-slide-05__bar,
  .story-slide-05__bar-caption,
  .story-slide-05__bar-canvas-wrap {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .story-slide-05__stat-group {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .story-slide-05__intro {
    min-height: 0;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .story-slide--05 .story-slide-05__title {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 2.6rem;
  }

  .story-slide-05__bar {
    gap: 0.5rem;
  }

  .story-slide-05__bar-caption {
    font-size: 1.6rem;
    margin-top: 0;
  }

  .story-slide-05__bar-canvas-wrap {
    height: clamp(2.25rem, 4.5vh, 3.25rem);
  }

  .story-slide-05__bars {
    gap: 0.5rem;
  }

  .story-slide-05__bubble-face .story-stat__description {
    font-size: 1.6rem;
  }
  .story-slide-05__bubbles  {
    --story-slide-05-bubble-size: 32rem;
  }
  .story-slide-05__bubble-face .story-stat__value {
    font-size: 5rem;
  }
  .story-slide-05__stat-group--1 {
    margin-top: 6rem;
  }
  .story-slide-05__stat-group--2 {
    margin-top: -48rem;
  }
  .story-slide-05__stat-group--3 {
    margin-top: -23rem;
  }
  .story-slide-05__stat-group--4 {
    margin-top: -27rem;
  }
}