/* REV JAMi-PROFILE-1.21 - Why Partners section interaction upgrade
   Additive only. Loaded after performance CSS. Does not touch gallery/images. */

.why-interactive .why-stack {
  gap: clamp(18px, 4vw, 26px);
}

.why-interactive .rail-card {
  cursor: pointer;
  isolation: isolate;
  min-height: 190px;
  padding: clamp(28px, 5vw, 38px) !important;
}

.why-interactive .rail-card h3,
.why-interactive .rail-card p {
  position: relative;
  z-index: 2;
}

.why-interactive .rail-card h3 {
  display: inline-block;
  text-shadow: 0 0 0 rgba(72,199,194,0);
  transition: text-shadow 260ms ease, color 260ms ease, transform 260ms ease;
}

.why-interactive .rail-card p {
  max-width: 25rem;
}

/* Re-enable one cheap overlay only for the three why cards. */
.why-interactive .rail-card::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  background:
    radial-gradient(circle at var(--why-x, 22%) 18%, rgba(95, 255, 240, 0.16), transparent 14rem),
    linear-gradient(90deg, transparent, rgba(95, 255, 240, 0.10), transparent);
  transform: translate3d(-12%, 0, 0);
  transition: opacity 280ms ease, transform 520ms cubic-bezier(.18,.8,.22,1);
}

.why-interactive .rail-card::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: -40%;
  top: 0;
  width: 34%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(95,255,240,0.00) 12%,
    rgba(95,255,240,0.16) 45%,
    rgba(255,255,255,0.12) 54%,
    rgba(255,55,165,0.10) 64%,
    transparent 100%);
  filter: blur(9px);
  transform: skewX(-12deg) translate3d(0,0,0);
}

.why-interactive .rail-card:hover::before,
.why-interactive .rail-card:focus-visible::before,
.why-interactive .rail-card.is-active::before {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.why-interactive .rail-card:hover h3,
.why-interactive .rail-card:focus-visible h3,
.why-interactive .rail-card.is-active h3 {
  color: rgba(245, 255, 252, 1);
  text-shadow:
    0 0 12px rgba(72,199,194,0.18),
    0 0 22px rgba(72,199,194,0.12);
  transform: translateY(-1px);
}

/* One-time 'boom, boom, boom' scan as the section enters viewport. */
.why-interactive.why-cascade .rail-card {
  animation: whyCardArrivalPulse 720ms cubic-bezier(.18,.82,.2,1) 1 !important;
}

.why-interactive.why-cascade .rail-card::after {
  animation: whyCardScan 980ms cubic-bezier(.18,.82,.2,1) 1;
}

.why-interactive.why-cascade .rail-card:nth-child(1),
.why-interactive.why-cascade .rail-card:nth-child(1)::after { animation-delay: 0ms !important; }
.why-interactive.why-cascade .rail-card:nth-child(2),
.why-interactive.why-cascade .rail-card:nth-child(2)::after { animation-delay: 180ms !important; }
.why-interactive.why-cascade .rail-card:nth-child(3),
.why-interactive.why-cascade .rail-card:nth-child(3)::after { animation-delay: 360ms !important; }

@keyframes whyCardArrivalPulse {
  0% {
    border-color: rgba(72,199,194,0.12);
    box-shadow: 0 20px 62px rgba(0,0,0,0.42), 0 0 14px rgba(72,199,194,0.05);
    transform: translate3d(0, 0, 0);
  }
  38% {
    border-color: rgba(95,255,240,0.50);
    box-shadow:
      0 26px 74px rgba(0,0,0,0.52),
      0 0 0 1px rgba(95,255,240,0.18),
      0 0 38px rgba(95,255,240,0.24);
    transform: translate3d(0, -2px, 0);
  }
  100% {
    border-color: rgba(72,199,194,0.13);
    box-shadow: 0 20px 62px rgba(0,0,0,0.42), 0 0 14px rgba(72,199,194,0.07);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes whyCardScan {
  0% { opacity: 0; transform: skewX(-12deg) translate3d(0,0,0); }
  18% { opacity: .70; }
  70% { opacity: .42; }
  100% { opacity: 0; transform: skewX(-12deg) translate3d(430%,0,0); }
}

/* Why modals: keep the neutral design, but add premium emphasis on key words. */
#infoModal[data-modal-kind="why"] .ecosystem-modal-panel {
  background: linear-gradient(150deg, rgba(8,13,14,0.98), rgba(3,8,9,0.995)) !important;
  border-color: rgba(95,255,240,0.18) !important;
  box-shadow:
    0 42px 130px rgba(0,0,0,0.74),
    0 0 0 1px rgba(255,255,255,0.045),
    0 0 34px rgba(72,199,194,0.10) !important;
}

.modal-highlight {
  color: rgba(238,255,251,1);
  font-weight: 760;
  text-shadow:
    0 0 10px rgba(95,255,240,0.25),
    0 0 20px rgba(95,255,240,0.10);
  background: linear-gradient(180deg, transparent 58%, rgba(72,199,194,0.16) 58%, rgba(72,199,194,0.04) 100%);
  border-radius: 4px;
  padding: 0 .05em;
}

#infoModal[data-modal-kind="why"] .modal-points li::marker {
  color: rgba(95,255,240,0.92);
}

#infoModal[data-modal-kind="why"] .modal-points li {
  transition: color 220ms ease, text-shadow 220ms ease;
}

#infoModal[data-modal-kind="why"] .modal-points li:hover {
  color: rgba(245,255,252,1);
  text-shadow: 0 0 12px rgba(95,255,240,0.15);
}

@media (prefers-reduced-motion: reduce) {
  .why-interactive.why-cascade .rail-card,
  .why-interactive.why-cascade .rail-card::after {
    animation: none !important;
  }
}
