/* Interactive motion — cursor, magnetic, ripple, tilt, neon brand glow */

.cursor-spot {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 850;
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(90, 200, 255, 0.16) 0%,
    rgba(40, 65, 140, 0.08) 42%,
    transparent 70%
  );
  mix-blend-mode: screen;
  transition: opacity 0.35s ease;
  will-change: transform;
}

.cursor-spot.is-on {
  opacity: 1;
}

@media (pointer: coarse) {
  .cursor-spot {
    display: none;
  }
}

.is-magnetic {
  --mx: 0px;
  --my: 0px;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 0.25s var(--ease-out);
}

.research-card.is-magnetic:hover,
.pillar.is-magnetic:hover {
  transform: translate3d(var(--mx), calc(var(--my) - 6px), 0);
}

.has-tilt {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.btn,
.program-tab {
  position: relative;
  overflow: hidden;
}

.ui-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  transform: scale(0);
  animation: rippleOut 0.65s var(--ease-out) forwards;
}

@keyframes rippleOut {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

.nav-link.is-hot {
  text-shadow: 0 0 16px rgba(90, 200, 255, 0.45);
}

body:not(.page-home) .nav-link.is-hot {
  text-shadow: 0 0 14px rgba(40, 65, 140, 0.25);
}

.hero-video.is-ready {
  opacity: 1;
}

.hero.is-video-fallback .hero-media {
  background:
    linear-gradient(115deg, rgba(10, 18, 48, 0.55), rgba(26, 44, 102, 0.35)),
    image-set(
      url("../assets/images/hero-poster.jpg") type("image/jpeg"),
      url("../assets/images/campus-10-poster.jpg") type("image/jpeg")
    )
    center / cover no-repeat;
}

.hero-mute.is-nudge {
  animation: muteNudge 1.4s var(--ease) infinite;
  box-shadow: 0 0 0 0 rgba(90, 200, 255, 0.45);
}

@keyframes muteNudge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(90, 200, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(90, 200, 255, 0);
  }
}

/* ---------- Brand neon border (blue ↔ earth) ---------- */
@keyframes neonFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes brandGlowPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(40, 65, 140, 0.35),
      0 0 16px rgba(40, 65, 140, 0.28),
      0 0 32px rgba(90, 180, 255, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(165, 120, 101, 0.45),
      0 0 18px rgba(165, 120, 101, 0.35),
      0 0 36px rgba(165, 120, 101, 0.18);
  }
}

.neon-frame {
  position: relative;
  isolation: isolate;
}

.neon-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    var(--blue),
    #5ac8ff,
    var(--earth),
    var(--blue)
  );
  background-size: 300% 300%;
  animation: neonFlow 5.5s linear infinite;
  opacity: 0.7;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.page-home .partner-chip.neon-frame::before {
  z-index: 1;
  opacity: 0.55;
}

.page-home .partner-chip.neon-frame:hover::before {
  opacity: 1;
}

/* Home: apply neon + motion to key blocks */
.page-home .btn-primary,
.page-home .btn-ghost {
  animation: brandGlowPulse 4s ease-in-out infinite;
}

.page-home .btn-ghost {
  border-color: rgba(90, 200, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(40, 65, 140, 0.2),
    0 0 18px rgba(90, 200, 255, 0.18);
}

.page-home .btn-primary:hover,
.page-home .btn-ghost:hover {
  animation: none;
  box-shadow:
    0 0 0 1px rgba(165, 120, 101, 0.5),
    0 0 22px rgba(165, 120, 101, 0.45),
    0 0 40px rgba(40, 65, 140, 0.25);
}

.page-home .study-strip__link {
  position: relative;
  transition: box-shadow 0.35s var(--ease-soft);
}

.page-home .study-strip__link:hover,
.page-home .study-strip__link:focus-visible {
  box-shadow: 0 0 0 1px rgba(90, 200, 255, 0.45), 0 0 14px rgba(90, 200, 255, 0.28);
}

.page-home .research-home-card {
  position: relative;
  border-radius: 2px;
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s;
}

.page-home .research-home-card.is-in {
  animation: brandGlowPulse 5s ease-in-out infinite;
}

.page-home .research-home-card:hover {
  animation: none;
  box-shadow:
    0 0 0 1px rgba(40, 65, 140, 0.35),
    0 0 24px rgba(40, 65, 140, 0.28),
    0 12px 32px rgba(15, 26, 61, 0.12);
}

.page-home .partner-chip {
  transition: border-color 0.35s, box-shadow 0.4s, transform 0.35s, color 0.3s;
}

.page-home .partner-chip:hover {
  border-color: transparent;
  color: var(--blue);
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(40, 65, 140, 0.4),
    0 0 18px rgba(40, 65, 140, 0.3),
    0 0 28px rgba(165, 120, 101, 0.25);
}

.page-home .stats-home-item strong {
  text-shadow: 0 0 20px rgba(90, 200, 255, 0.35);
  transition: color 0.4s, text-shadow 0.4s;
}

.page-home .stats-home-item:hover strong {
  color: var(--earth);
  text-shadow: 0 0 22px rgba(165, 120, 101, 0.55);
}

.page-home .hero-mute {
  border: 1px solid rgba(90, 200, 255, 0.4);
  box-shadow: 0 0 16px rgba(40, 65, 140, 0.35);
  transition: border-color 0.35s, box-shadow 0.35s, background 0.35s;
}

.page-home .hero-mute:hover {
  border-color: rgba(165, 120, 101, 0.7);
  box-shadow:
    0 0 18px rgba(165, 120, 101, 0.45),
    0 0 32px rgba(90, 200, 255, 0.25);
}

.page-home .scroll-progress {
  box-shadow: 0 0 10px rgba(90, 200, 255, 0.55), 0 0 18px rgba(165, 120, 101, 0.35);
}

/* Inner pages: lighter neon on cards */
body:not(.page-home) .research-card:hover {
  box-shadow:
    0 0 0 1px rgba(40, 65, 140, 0.35),
    0 0 22px rgba(40, 65, 140, 0.22),
    0 10px 28px rgba(15, 26, 61, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .cursor-spot,
  .ui-ripple,
  .is-magnetic,
  .has-tilt,
  .neon-frame::before {
    display: none !important;
    transform: none !important;
    animation: none !important;
  }

  .page-home .btn-primary,
  .page-home .btn-ghost,
  .page-home .research-home-card.is-in,
  .back-top.is-visible {
    animation: none !important;
  }
}
