/* REV JAMi-PROFILE-1.22 - Why section entry sequence + cleaner modal emphasis
   Additive only. Loaded after profile-why-polish.css. No image or gallery changes. */

/* Keep the three why cards clearly interactive, without adding visible labels. */
.why-interactive .rail-card {
  overflow: hidden;
  transform: translate3d(0,0,0);
  transition:
    transform 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease,
    background 260ms ease;
}

.why-interactive .rail-card:hover,
.why-interactive .rail-card:focus-visible,
.why-interactive .rail-card.is-active {
  transform: translate3d(0,-2px,0);
  border-color: rgba(107,255,238,0.34) !important;
  box-shadow:
    0 24px 74px rgba(0,0,0,0.48),
    0 0 0 1px rgba(107,255,238,0.08),
    0 0 28px rgba(72,199,194,0.12) !important;
}

.why-interactive .rail-card:active {
  transform: translate3d(0,0,0) scale(.992);
}

/* Replace the old full-card scan with a thin perimeter cue. */
.why-interactive .rail-card::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: -2px !important;
  left: -2px !important;
  top: -2px !important;
  right: -2px !important;
  bottom: -2px !important;
  width: auto !important;
  height: auto !important;
  border-radius: inherit !important;
  pointer-events: none !important;
  opacity: 0;
  z-index: 4 !important;
  background: none !important;
  border: 1px solid rgba(107,255,238,0.72) !important;
  filter: none !important;
  transform: scale(.985) !important;
  box-shadow:
    0 0 0 rgba(107,255,238,0),
    inset 0 0 0 rgba(107,255,238,0);
}

/* JS-enabled: let the three cards populate when the section comes into view. */
.why-interactive.why-js-ready .rail-card h3,
.why-interactive.why-js-ready .rail-card p {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
}

.why-interactive.why-sequence-run .rail-card {
  animation: whyCardLiftIn 760ms cubic-bezier(.18,.82,.2,1) both;
}

.why-interactive.why-sequence-run .rail-card h3 {
  animation: whyTextPopulate 520ms cubic-bezier(.18,.82,.2,1) both;
}

.why-interactive.why-sequence-run .rail-card p {
  animation: whyTextPopulate 600ms cubic-bezier(.18,.82,.2,1) both;
}

.why-interactive.why-sequence-run .rail-card::after {
  animation: whyPerimeterPulse 960ms cubic-bezier(.18,.82,.2,1) both;
}

.why-interactive.why-sequence-run .rail-card:nth-child(1),
.why-interactive.why-sequence-run .rail-card:nth-child(1)::after,
.why-interactive.why-sequence-run .rail-card:nth-child(1) h3 { animation-delay: 0ms !important; }
.why-interactive.why-sequence-run .rail-card:nth-child(1) p { animation-delay: 150ms !important; }

.why-interactive.why-sequence-run .rail-card:nth-child(2),
.why-interactive.why-sequence-run .rail-card:nth-child(2)::after,
.why-interactive.why-sequence-run .rail-card:nth-child(2) h3 { animation-delay: 230ms !important; }
.why-interactive.why-sequence-run .rail-card:nth-child(2) p { animation-delay: 380ms !important; }

.why-interactive.why-sequence-run .rail-card:nth-child(3),
.why-interactive.why-sequence-run .rail-card:nth-child(3)::after,
.why-interactive.why-sequence-run .rail-card:nth-child(3) h3 { animation-delay: 460ms !important; }
.why-interactive.why-sequence-run .rail-card:nth-child(3) p { animation-delay: 610ms !important; }

.why-interactive.why-sequence-complete .rail-card h3,
.why-interactive.why-sequence-complete .rail-card p {
  opacity: 1;
  transform: none;
}

/* After the intro, leave a very subtle static cue so it still feels clickable. */
.why-interactive.why-sequence-complete .rail-card {
  border-color: rgba(72,199,194,0.19) !important;
  box-shadow:
    0 20px 62px rgba(0,0,0,0.40),
    0 0 18px rgba(72,199,194,0.045) !important;
}

.why-interactive.why-sequence-complete .rail-card:hover::after,
.why-interactive.why-sequence-complete .rail-card:focus-visible::after {
  opacity: .42;
  transform: scale(1) !important;
  box-shadow: 0 0 24px rgba(107,255,238,0.18);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

@keyframes whyCardLiftIn {
  0% {
    opacity: .72;
    transform: translate3d(0, 16px, 0) scale(.985);
    border-color: rgba(72,199,194,0.10);
  }
  42% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.006);
    border-color: rgba(107,255,238,0.45);
    box-shadow:
      0 28px 84px rgba(0,0,0,0.52),
      0 0 34px rgba(107,255,238,0.14);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes whyTextPopulate {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    filter: blur(4px);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -1px, 0);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes whyPerimeterPulse {
  0% {
    opacity: 0;
    transform: scale(.982) !important;
    box-shadow: 0 0 0 rgba(107,255,238,0), inset 0 0 0 rgba(107,255,238,0);
  }
  24% {
    opacity: .95;
    transform: scale(1.004) !important;
    box-shadow: 0 0 28px rgba(107,255,238,0.30), inset 0 0 18px rgba(107,255,238,0.10);
  }
  64% {
    opacity: .48;
    transform: scale(1.012) !important;
    box-shadow: 0 0 46px rgba(255,55,165,0.12), inset 0 0 16px rgba(107,255,238,0.06);
  }
  100% {
    opacity: 0;
    transform: scale(1.018) !important;
    box-shadow: 0 0 0 rgba(107,255,238,0), inset 0 0 0 rgba(107,255,238,0);
  }
}

/* Cleaner modal read: less background blur and stronger text contrast. */
.modal {
  background: rgba(0,0,0,0.84) !important;
  backdrop-filter: blur(6px) saturate(.92) !important;
  -webkit-backdrop-filter: blur(6px) saturate(.92) !important;
}

#infoModal[data-modal-kind="why"] .ecosystem-modal-panel {
  background: rgba(5, 9, 10, 0.985) !important;
  border-color: rgba(107,255,238,0.22) !important;
  box-shadow:
    0 38px 110px rgba(0,0,0,0.72),
    0 0 0 1px rgba(255,255,255,0.055),
    0 0 26px rgba(72,199,194,0.08) !important;
}

#infoModal[data-modal-kind="why"] .ecosystem-modal-panel p {
  color: rgba(244,248,248,0.88) !important;
  text-shadow: none !important;
}

/* Replace the old green-white glow with a cleaner cyan emphasis. */
.modal-highlight {
  color: #7ffff1 !important;
  font-weight: 800 !important;
  text-shadow: 0 0 10px rgba(127,255,241,0.13) !important;
  background: rgba(72,199,194,0.075) !important;
  border-radius: .18em !important;
  padding: 0 .06em !important;
}

#infoModal[data-modal-kind="why"] .modal-points li {
  color: rgba(244,248,248,0.84) !important;
}

@media (prefers-reduced-motion: reduce) {
  .why-interactive.why-js-ready .rail-card h3,
  .why-interactive.why-js-ready .rail-card p {
    opacity: 1 !important;
    transform: none !important;
  }
  .why-interactive.why-sequence-run .rail-card,
  .why-interactive.why-sequence-run .rail-card h3,
  .why-interactive.why-sequence-run .rail-card p,
  .why-interactive.why-sequence-run .rail-card::after {
    animation: none !important;
  }
}
