/* CTA — Drolix Join Community
   Full-bleed stage. Start: 3-image cluster.
   Scroll: photos fly to viewport corners around the copy, then hold. */

.next {
  --next-p: 0;
  --next-copy: 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
  margin: 0;
  padding: 0 0 clamp(5.5rem, 14vh, 8.5rem);
  overflow: clip;
  clip-path: inset(0);
  background: var(--white);
  color: var(--ink);
}

.next__track {
  height: 200vh;
}

.next__pin {
  position: sticky;
  top: max(20svh, calc(var(--site-header-h, 8.5rem) + 0.75rem));
  width: 100%;
  height: 26.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next__stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  pointer-events: none;
}

.next__shot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: block;
  overflow: hidden;
  width: var(--w);
  height: auto;
  aspect-ratio: 15 / 16;
  margin: 0;
  border-radius: 0.5rem;
  object-fit: cover;
  opacity: calc(var(--o0) + (var(--o1) - var(--o0)) * var(--next-p));
  box-shadow: 0 16px 36px rgba(21, 17, 62, 0.14);
  transform:
    translate(-50%, -50%)
    translate(
      calc(var(--dx0) + (var(--dx1) - var(--dx0)) * var(--next-p)),
      calc(var(--dy0) + (var(--dy1) - var(--dy0)) * var(--next-p))
    );
  will-change: transform, opacity;
}

/* Large left — opening cluster, then mid-left */
.next__shot--1 {
  --w: min(21.125rem, 23.5vw);
  --o0: 1;
  --o1: 1;
  --dx0: -28%;
  --dy0: 12%;
  --dx1: -210%;
  --dy1: 50%;
  z-index: 6;
}

/* Small top-left — arrives on scroll */
.next__shot--2 {
  --w: min(12.2rem, 13.5vw);
  --o0: 0;
  --o1: 1;
  --dx0: -18%;
  --dy0: -10%;
  --dx1: -320%;
  --dy1: -120%;
  z-index: 4;
}

/* Mid-right smile — opening cluster, then lower-right */
.next__shot--3 {
  --w: min(14.06rem, 15.6vw);
  --o0: 1;
  --o1: 1;
  --dx0: 26%;
  --dy0: 26%;
  --dx1: 210%;
  --dy1: 75%;
  z-index: 5;
}

/* Top-right — opening cluster, then upper-right */
.next__shot--4 {
  --w: min(21.125rem, 23.5vw);
  --o0: 1;
  --o1: 1;
  --dx0: 30%;
  --dy0: -16%;
  --dx1: 210%;
  --dy1: -50%;
  z-index: 2;
}

/* Bottom-center — arrives on scroll */
.next__shot--5 {
  --w: min(12.2rem, 13.5vw);
  --o0: 0;
  --o1: 1;
  --dx0: 4%;
  --dy0: 20%;
  --dx1: 0%;
  --dy1: 140%;
  z-index: 3;
}

.next__copy {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(42rem, calc(100% - 2.5rem));
  padding: 0 1rem;
  text-align: center;
  opacity: var(--next-copy);
  transform: translateY(calc((1 - var(--next-copy)) * 1.25rem));
  pointer-events: none;
}

.next__copy .btn {
  pointer-events: auto;
}

.next__eyebrow,
.next .eyebrow,
.next .eyebrow-lockup {
  margin: 0 0 0.75rem;
  color: var(--navy);
  justify-content: center;
}

.next .section-heading,
.next__title {
  margin: 0;
  max-width: 16ch;
  color: var(--navy);
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  font-weight: var(--section-heading-weight);
  letter-spacing: var(--section-heading-tracking);
  line-height: 1.12;
}

.next .lede,
.next__lede {
  margin: 0.85rem 0 0;
  max-width: 32rem;
  color: var(--slate);
  font-size: 1.05rem;
  line-height: 1.5;
}

.next__ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.faq:has(+ .next) {
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

@media (max-width: 900px) {
  .next {
    overflow: visible;
    clip-path: none;
    padding: 0 0 2.5rem;
  }

  .next__track {
    height: auto;
  }

  .next__pin {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.75rem 0 0.5rem;
  }

  .next__stage {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    grid-template-rows: auto auto;
    gap: 0.55rem;
    width: 100%;
    height: auto;
    padding: 0 1rem;
    pointer-events: auto;
  }

  .next__shot {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    opacity: 1;
    transform: none;
    box-shadow: 0 12px 28px rgba(21, 17, 62, 0.12);
  }

  .next__shot--1 {
    grid-column: 1;
    grid-row: 1 / span 2;
    aspect-ratio: 4 / 5;
  }

  .next__shot--3 {
    grid-column: 2;
    grid-row: 2;
    aspect-ratio: 5 / 4;
  }

  .next__shot--4 {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 5 / 4;
  }

  .next__shot--2,
  .next__shot--5 {
    display: none;
  }

  .next__copy {
    width: 100%;
    margin: 1.35rem 0 0;
    padding: 0 1.15rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .next__title {
    max-width: 14ch;
    font-size: clamp(1.85rem, 8.4vw, 2.45rem);
  }

  .next__lede {
    max-width: 36rem;
    font-size: 1rem;
  }

  .next__ctas {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 1.2rem;
  }

  .next__ctas .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .next__track {
    height: auto;
  }

  .next__pin {
    position: relative;
    top: auto;
    height: auto;
  }

  .next {
    --next-p: 1;
    --next-copy: 1;
    padding-bottom: 3rem;
  }

  .next__copy {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
