/* JuntoVerse Cinematic Experience 3.0
   Homepage-specific visual enhancements.
   No global overrides or external dependencies.
*/

@media (prefers-reduced-motion: no-preference) {

  body:has(> main > .hero) .hero-copy > * {
    animation: jvCinematicReveal .85s both;
  }

  body:has(> main > .hero) .hero-copy > :nth-child(1) {
    animation-delay: .12s;
  }

  body:has(> main > .hero) .hero-copy > :nth-child(2) {
    animation-delay: .24s;
  }

  body:has(> main > .hero) .hero-copy > :nth-child(3) {
    animation-delay: .38s;
  }

  body:has(> main > .hero) .hero-copy > :nth-child(4) {
    animation-delay: .52s;
  }

  body:has(> main > .hero) .hero-copy > :nth-child(5) {
    animation-delay: .66s;
  }

  @keyframes jvCinematicReveal {
    from {
      opacity: 0;
      transform: translateY(24px);
      filter: blur(5px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
      filter: blur(0);
    }
  }
}

/* Cinematic atmosphere */

body:has(> main > .hero) .hero {
  position: relative;
  isolation: isolate;
}

body:has(> main > .hero) .hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -8% -6%;
  background:
    radial-gradient(
      ellipse at 75% 35%,
      rgba(125, 88, 255, .20),
      transparent 48%
    ),
    radial-gradient(
      ellipse at 55% 75%,
      rgba(65, 230, 213, .09),
      transparent 50%
    ),
    radial-gradient(
      ellipse at 90% 85%,
      rgba(255, 150, 130, .07),
      transparent 42%
    );
}

/* Official logo presentation */

body:has(> main > .hero) .hero-brand-visual {
  isolation: isolate;
}

body:has(> main > .hero) .hero-brand-visual::after {
  content: "";
  position: absolute;
  inset: 13%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(105, 234, 214, .16),
      rgba(140, 105, 255, .12) 40%,
      transparent 72%
    );
  filter: blur(28px);
}

body:has(> main > .hero) .hero-brand-visual img {
  filter: drop-shadow(
    0 0 24px rgba(135, 112, 255, .16)
  );
}

/* Mobile atmosphere */

@media (max-width: 760px) {
  body:has(> main > .hero) .hero::before {
    inset: 0;
    background:
      radial-gradient(
        ellipse at 55% 65%,
        rgba(120, 90, 255, .17),
        transparent 65%
      );
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  body:has(> main > .hero) .hero-copy > * {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================
   CINEMATIC SCROLL STORYTELLING
   ========================================= */

@media (prefers-reduced-motion: no-preference) {

  body:has(> main > .hero) main > section.jv-cinematic-pending {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    filter: blur(4px);
  }

  body:has(> main > .hero) main > section.jv-cinematic-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }

  body:has(> main > .hero) main > section.jv-cinematic-pending,
  body:has(> main > .hero) main > section.jv-cinematic-visible {
    transition:
      opacity .9s cubic-bezier(.22, 1, .36, 1),
      transform .9s cubic-bezier(.22, 1, .36, 1),
      filter .9s cubic-bezier(.22, 1, .36, 1);
  }

}

/* Reduced-motion visitors always see content immediately. */

@media (prefers-reduced-motion: reduce) {

  body:has(> main > .hero) main > section.jv-cinematic-pending,
  body:has(> main > .hero) main > section.jv-cinematic-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

}

/* =========================================
   CINEMATIC CARD CASCADE
   ========================================= */

/* Homepage cards only. No global card changes. */

@media (prefers-reduced-motion: no-preference) {

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation: jvCardCascade .75s
      cubic-bezier(.22, 1, .36, 1) both;
  }

  @keyframes jvCardCascade {
    from {
      opacity: 0;
      translate: 0 22px;
    }

    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  /* Stagger cards within their respective groups. */

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(1) {
    animation-delay: .08s;
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(2) {
    animation-delay: .17s;
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(3) {
    animation-delay: .26s;
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(4) {
    animation-delay: .35s;
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(5) {
    animation-delay: .44s;
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(6) {
    animation-delay: .53s;
  }

}

/* Reduced motion: no cascading animations. */

@media (prefers-reduced-motion: reduce) {

  body:has(> main > .hero)
  main > section
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation: none !important;
    translate: none !important;
    opacity: 1 !important;
  }

}

/* =========================================
   CINEMATIC CASCADE REFINEMENT
   ========================================= */

@media (prefers-reduced-motion: no-preference) {

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation-name: jvCardCascadeRefined;
    animation-duration: .85s;
    animation-timing-function: cubic-bezier(.22, 1, .36, 1);
    animation-fill-mode: both;
  }

  @keyframes jvCardCascadeRefined {
    from {
      opacity: 0;
      translate: 0 42px;
      filter: blur(5px);
    }

    to {
      opacity: 1;
      translate: 0 0;
      filter: blur(0);
    }
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(1) { animation-delay: .15s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(2) { animation-delay: .32s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(3) { animation-delay: .49s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(4) { animation-delay: .66s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(5) { animation-delay: .83s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(6) { animation-delay: 1s; }

}

@media (prefers-reduced-motion: reduce) {

  body:has(> main > .hero)
  main > section
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation: none !important;
    filter: none !important;
    translate: none !important;
  }

}

/* =========================================
   CINEMATIC CHOREOGRAPHY POLISH
   ========================================= */

@media (prefers-reduced-motion: no-preference) {

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation-name: jvCardCascadePolished;
    animation-duration: .85s;
    animation-timing-function: cubic-bezier(.16, 1, .3, 1);
    animation-fill-mode: both;
  }

  @keyframes jvCardCascadePolished {
    from {
      opacity: 0;
      translate: 0 28px;
      filter: blur(2px);
    }

    to {
      opacity: 1;
      translate: 0 0;
      filter: blur(0);
    }
  }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(1) { animation-delay: .16s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(2) { animation-delay: .28s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(3) { animation-delay: .40s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(4) { animation-delay: .52s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(5) { animation-delay: .64s; }

  body:has(> main > .hero)
  main > section.jv-cinematic-visible
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ):nth-child(6) { animation-delay: .76s; }

}

@media (prefers-reduced-motion: reduce) {

  body:has(> main > .hero)
  main > section
  :is(
    .jv-discovery-tile,
    .v3-path,
    .jv2-card,
    .v4-tile,
    .feature-card
  ) {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    translate: none !important;
  }

}