/**
 * Portal visual polish (home + Discord bots) — body.jp-portal-polish-active.
 * Noticeable JP neon energy while keeping the layout unchanged.
 */

body.jp-portal-polish-active {
  --jp-home-glow: 1;
}

/* --- Animated energy field (behind content) --- */
.jp-home-energy-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.jp-home-energy-field__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  animation: jp-home-orb-drift calc(18s * var(--jp-polish-dur, 1)) ease-in-out infinite;
}

.jp-home-energy-field__orb--1 {
  width: min(70vw, 28rem);
  height: min(70vw, 28rem);
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 255, 65, 0.35) 0%, transparent 68%);
  animation-duration: calc(14s * var(--jp-polish-dur, 1));
}

.jp-home-energy-field__orb--2 {
  width: min(90vw, 36rem);
  height: min(90vw, 36rem);
  bottom: -8%;
  left: -12%;
  background: radial-gradient(circle, rgba(0, 255, 65, 0.18) 0%, transparent 70%);
  animation-delay: -6s;
  animation-duration: calc(22s * var(--jp-polish-dur, 1));
}

.jp-home-energy-field__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 255, 65, 0.03) 3px,
    rgba(0, 255, 65, 0.03) 4px
  );
  opacity: 0.7;
  animation: jp-home-scan-drift calc(24s * var(--jp-polish-dur, 1)) linear infinite;
}

@keyframes jp-home-orb-drift {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translateX(-48%) translateY(12px) scale(1.06);
    opacity: 0.75;
  }
}

.jp-home-energy-field__orb--2 {
  animation-name: jp-home-orb-drift-alt;
}

@keyframes jp-home-orb-drift-alt {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translate(24px, -16px) scale(1.08);
    opacity: 0.55;
  }
}

@keyframes jp-home-scan-drift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(48px);
  }
}

body.jp-portal-polish-active.jp-bg-drift::before {
  opacity: 0.12;
}

body.jp-portal-polish-active #particle-canvas {
  opacity: 0.95;
}

/* --- Hero logo: entrance + idle pulse --- */
body.jp-portal-polish-active.jp-home-page .hero-logo-block {
  opacity: 0;
  transform: scale(0.9) translateY(18px);
  transition: none;
}

body.jp-portal-polish-active.jp-home-page.jp-home-hero-ready .hero-logo-block {
  animation: jp-home-hero-logo-enter calc(0.85s * var(--jp-polish-dur, 1)) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes jp-home-hero-logo-enter {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.jp-portal-polish-active.jp-home-page.jp-home-hero-ready .hero-logo-frame {
  animation: jp-home-logo-glow-pulse calc(2.8s * var(--jp-polish-dur, 1)) ease-in-out calc(0.85s * var(--jp-polish-dur, 1)) infinite;
}

@keyframes jp-home-logo-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 0 24px rgba(0, 255, 65, 0.45),
      0 0 56px rgba(0, 255, 65, 0.18),
      inset 0 0 0 1px rgba(0, 255, 65, 0.35);
    border-color: rgba(0, 255, 65, 0.55);
  }
  50% {
    box-shadow:
      0 0 38px rgba(0, 255, 65, 0.7),
      0 0 88px rgba(0, 255, 65, 0.28),
      inset 0 0 0 1px rgba(0, 255, 65, 0.55);
    border-color: rgba(0, 255, 65, 0.9);
  }
}

/* Rotating energy ring (Discord bots page — not homepage simple bg) */
body.jp-portal-polish-active:not(.jp-home-simple-bg) .hero-logo-block::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 4px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0, 255, 65, 0.15) 40deg,
    rgba(0, 255, 65, 0.85) 120deg,
    rgba(0, 255, 65, 0.2) 200deg,
    transparent 280deg
  );
  opacity: 0.85;
  z-index: -1;
  animation: jp-home-energy-ring calc(6s * var(--jp-polish-dur, 1)) linear infinite;
  filter: blur(1px);
}

@keyframes jp-home-energy-ring {
  to {
    transform: rotate(360deg);
  }
}

@media (hover: hover) and (pointer: fine) {
  body.jp-portal-polish-active .profile-ring--menu-trigger:hover .hero-logo-frame,
  body.jp-portal-polish-active .profile-ring--menu-trigger:focus-visible .hero-logo-frame {
    transform: scale(1.03);
    box-shadow:
      0 0 42px rgba(0, 255, 65, 0.75),
      0 0 72px rgba(0, 255, 65, 0.3),
      inset 0 0 24px rgba(0, 255, 65, 0.12);
    border-color: var(--color-green);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }

  body.jp-portal-polish-active .profile-ring--menu-trigger:hover::after,
  body.jp-portal-polish-active .profile-ring--menu-trigger:focus-visible::after {
    display: block !important;
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 65, 0.35);
    box-shadow: 0 0 28px rgba(0, 255, 65, 0.35);
    opacity: 1;
    pointer-events: none;
    animation: jp-home-menu-hover-pulse 1.2s ease-in-out infinite;
  }
}

@keyframes jp-home-menu-hover-pulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

body.jp-portal-polish-active .profile-ring--menu-trigger[aria-expanded="true"] .hero-logo-frame {
  box-shadow:
    0 0 48px rgba(0, 255, 65, 0.8),
    0 0 80px rgba(0, 255, 65, 0.35);
  border-color: var(--color-green);
}

/* --- View Services CTA (home + bots) --- */
body.jp-portal-polish-active .btn--view-services {
  border-color: rgba(0, 255, 65, 0.85);
  background: rgba(0, 20, 8, 0.75);
  animation: jp-home-cta-glow calc(2.4s * var(--jp-polish-dur, 1)) ease-in-out infinite;
}

@keyframes jp-home-cta-glow {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(0, 255, 65, 0.35),
      inset 0 0 12px rgba(0, 255, 65, 0.06);
  }
  50% {
    box-shadow:
      0 0 26px rgba(0, 255, 65, 0.55),
      0 0 48px rgba(0, 255, 65, 0.15),
      inset 0 0 18px rgba(0, 255, 65, 0.1);
  }
}

@media (hover: hover) and (pointer: fine) {
  body.jp-portal-polish-active .btn--view-services:hover,
  body.jp-portal-polish-active .btn--view-services:focus-visible {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--color-green);
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.8);
    box-shadow:
      0 0 32px rgba(0, 255, 65, 0.65),
      0 0 64px rgba(0, 255, 65, 0.25),
      inset 0 0 20px rgba(0, 255, 65, 0.15);
    animation: none;
  }

  body.jp-portal-polish-active .btn--view-services:active {
    transform: translateY(0) scale(0.99);
  }
}

/* Header JP logo — subtle idle glow on homepage */
body.jp-portal-polish-active .header-logo__ring {
  box-shadow: 0 0 14px rgba(0, 255, 65, 0.35);
  animation: jp-header-ring-idle calc(3s * var(--jp-polish-dur, 1)) ease-in-out infinite;
}

@keyframes jp-header-ring-idle {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 255, 65, 0.55);
  }
}

body.jp-portal-polish-active .hero__name {
  text-shadow: 0 0 24px rgba(0, 255, 65, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .jp-home-energy-field__orb,
  .jp-home-energy-field__scan,
  body.jp-portal-polish-active .hero-logo-block::before,
  body.jp-portal-polish-active.jp-home-page.jp-home-hero-ready .hero-logo-frame,
  body.jp-portal-polish-active .btn--view-services,
  body.jp-portal-polish-active .header-logo__ring,
  body.jp-portal-polish-active.bot-showcase-page .bot-showcase__title {
    animation: none !important;
  }

  body.jp-portal-polish-active.jp-home-page .hero-logo-block,
  body.jp-portal-polish-active.jp-home-page.jp-home-hero-ready .hero-logo-block {
    opacity: 1;
    transform: none;
  }

  body.jp-portal-polish-active.jp-home-page .hero-logo-frame {
    box-shadow:
      0 0 24px rgba(0, 255, 65, 0.45),
      inset 0 0 0 1px rgba(0, 255, 65, 0.35);
  }

  body.jp-portal-polish-active.bot-showcase-page .jp-bots-reveal {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* --- Discord bots page --- */
body.jp-portal-polish-active.bot-showcase-page .jp-bots-reveal {
  opacity: 0;
  transform: translateY(14px);
}

body.jp-portal-polish-active.bot-showcase-page.jp-bots-reveal-ready .jp-bots-reveal {
  animation: jp-home-reveal-in calc(0.5s * var(--jp-polish-dur, 1)) ease-out forwards;
}

body.jp-portal-polish-active.bot-showcase-page.jp-bots-reveal-ready .bot-showcase__title.jp-bots-reveal {
  animation-delay: calc(0.06s * var(--jp-polish-dur, 1));
}

body.jp-portal-polish-active.bot-showcase-page.jp-bots-reveal-ready .bot-showcase__intro.jp-bots-reveal {
  animation-delay: calc(0.18s * var(--jp-polish-dur, 1));
}

body.jp-portal-polish-active.bot-showcase-page .bot-showcase__title {
  text-shadow: 0 0 28px rgba(0, 255, 65, 0.22);
  animation: jp-bots-title-glow calc(3.2s * var(--jp-polish-dur, 1)) ease-in-out infinite;
}

@keyframes jp-bots-title-glow {
  0%,
  100% {
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
  }
  50% {
    text-shadow: 0 0 32px rgba(0, 255, 65, 0.35);
  }
}

body.jp-portal-polish-active.bot-showcase-page.jp-bots-reveal-ready .bot-showcase__title {
  animation:
    jp-home-reveal-in calc(0.5s * var(--jp-polish-dur, 1)) ease-out forwards,
    jp-bots-title-glow calc(3.2s * var(--jp-polish-dur, 1)) ease-in-out calc(0.5s * var(--jp-polish-dur, 1)) infinite;
}

body.jp-portal-polish-active.bot-showcase-page .bot-card {
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.08);
}

@media (hover: hover) and (pointer: fine) {
  body.jp-portal-polish-active.bot-showcase-page .btn--home:hover,
  body.jp-portal-polish-active.bot-showcase-page .btn--home:focus-visible {
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.45);
  }

  body.jp-portal-polish-active.bot-showcase-page .bot-card:hover {
    box-shadow:
      0 0 28px rgba(0, 255, 65, 0.22),
      0 0 48px rgba(0, 255, 65, 0.08);
  }
}

body.jp-portal-polish-active.bot-showcase-page .bot-showcase__cta {
  padding-top: 0.5rem;
}
