/* Homepage hero — square-framed animated logo (MP4) */

body.jp-home-page .hero-logo-block.profile-ring {
  --jp-hero-logo-size: clamp(14rem, 42vw, 20rem);
  position: relative;
  width: var(--jp-hero-logo-size);
  height: var(--jp-hero-logo-size);
  margin-bottom: 0.625rem;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

/* Disable legacy circular orbit / ring decorations on homepage */
body.jp-home-page .hero-logo-block .profile-ring__orbit {
  display: none !important;
}

body.jp-home-page .hero-logo-block.profile-ring--menu-trigger::after {
  display: none !important;
}

body.jp-home-page .hero-logo-block .profile-ring__inner.hero-logo-frame {
  position: relative;
  inset: auto;
  border-radius: 0;
  overflow: visible;
}

body.jp-home-page .hero-logo-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  inset: auto;
  border-radius: 0;
  border: 1px solid var(--color-green-dim);
  background: #000000;
  box-shadow:
    0 0 18px rgba(0, 255, 65, 0.22),
    0 0 36px rgba(0, 255, 65, 0.08),
    inset 0 0 0 1px rgba(0, 255, 65, 0.06);
  padding: 0.75rem;
  box-sizing: border-box;
  overflow: visible;
}

body.jp-home-page .hero-logo-frame__media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.profile-ring__inner--hero-media {
  --jp-hero-video-scale: 1.04;
  --jp-hero-video-position-x: 50%;
  --jp-hero-video-position-y: 50%;
}

.profile-ring__inner--hero-media.jp-hero-video-active .profile-ring__video--hero {
  display: block !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Visible presentation — canvas (no native video chrome / loop play flash) */
.hero-logo-frame__canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  background: #000000;
  border: none;
  border-radius: 0;
  pointer-events: none;
  transform: scale(var(--jp-hero-video-scale));
  transform-origin: center center;
}

/* Hidden decoder — plays muted + loop; never shown (avoids control overlays) */
.profile-ring__video--hero,
.hero-logo-frame__video {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  max-width: 1px;
  max-height: 1px;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  object-fit: contain;
  object-position: var(--jp-hero-video-position-x) var(--jp-hero-video-position-y);
  display: block;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  pointer-events: none;
}

.profile-ring__inner--hero-media.jp-hero-video-active .hero-logo-frame__canvas {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.profile-ring__inner--hero-media:not(.jp-hero-video-active) .hero-logo-frame__canvas {
  display: none !important;
}

.hero-logo-frame__video,
.profile-ring__video--hero {
  -webkit-appearance: none;
  appearance: none;
}

.hero-logo-frame__video::-webkit-media-controls,
.profile-ring__video--hero::-webkit-media-controls,
.hero-logo-frame__video::-webkit-media-controls-enclosure,
.profile-ring__video--hero::-webkit-media-controls-enclosure,
.hero-logo-frame__video::-webkit-media-controls-panel,
.profile-ring__video--hero::-webkit-media-controls-panel,
.hero-logo-frame__video::-webkit-media-controls-play-button,
.profile-ring__video--hero::-webkit-media-controls-play-button,
.hero-logo-frame__video::-webkit-media-controls-start-playback-button,
.profile-ring__video--hero::-webkit-media-controls-start-playback-button,
.hero-logo-frame__video::-webkit-media-controls-overlay-play-button,
.profile-ring__video--hero::-webkit-media-controls-overlay-play-button,
.hero-logo-frame__video::-webkit-media-controls-overlay-enclosure,
.profile-ring__video--hero::-webkit-media-controls-overlay-enclosure {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

.profile-ring__inner--hero-media:not(.is-static-fallback) .profile-ring__image--hero-fallback {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.profile-ring__inner--hero-media .profile-ring__image--hero-fallback,
.hero-logo-frame__fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  object-position: center;
  padding: 0.35rem;
  box-sizing: border-box;
  background: #000000;
  border-radius: 0;
}

.profile-ring__inner--hero-media.is-static-fallback .profile-ring__video--hero {
  display: none !important;
}

.profile-ring__inner--hero-media.is-static-fallback .profile-ring__image--hero-fallback,
.profile-ring__inner--hero-media.is-static-fallback .hero-logo-frame__fallback {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (hover: hover) and (pointer: fine) {
  body.jp-home-page .hero-logo-block.profile-ring--menu-trigger:hover .hero-logo-frame,
  body.jp-home-page .hero-logo-block.profile-ring--menu-trigger:focus-visible .hero-logo-frame {
    border-color: var(--color-green);
    box-shadow:
      0 0 22px rgba(0, 255, 65, 0.35),
      0 0 40px rgba(0, 255, 65, 0.12),
      inset 0 0 0 1px rgba(0, 255, 65, 0.1);
  }
}

body.jp-home-page .hero-logo-block.profile-ring--idle-pulse .hero-logo-frame {
  animation: hero-logo-frame-pulse 1.2s ease-out 1;
}

@keyframes hero-logo-frame-pulse {
  0% {
    box-shadow:
      0 0 12px rgba(0, 255, 65, 0.15),
      inset 0 0 0 1px rgba(0, 255, 65, 0.06);
  }
  45% {
    box-shadow:
      0 0 26px rgba(0, 255, 65, 0.45),
      0 0 48px rgba(0, 255, 65, 0.15),
      inset 0 0 0 1px rgba(0, 255, 65, 0.12);
  }
  100% {
    box-shadow:
      0 0 18px rgba(0, 255, 65, 0.22),
      inset 0 0 0 1px rgba(0, 255, 65, 0.06);
  }
}

@media (max-width: 768px) {
  body.jp-home-page .hero-logo-block.profile-ring {
    --jp-hero-logo-size: clamp(12.5rem, 48vw, 17rem);
  }

  body.jp-home-page .hero-logo-frame {
    padding: 0.6rem;
  }
}

@media (max-width: 480px) {
  body.jp-home-page .hero-logo-block.profile-ring {
    --jp-hero-logo-size: clamp(11rem, 78vw, 15rem);
    margin-bottom: 0.5rem;
  }

  body.jp-home-page .hero-logo-frame {
    padding: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Only hide video when JS chose static fallback — not while hero video is active */
  body.jp-home-page .profile-ring__inner--hero-media:not(.jp-hero-video-active) .profile-ring__video--hero {
    display: none !important;
  }

  body.jp-home-page .profile-ring__inner--hero-media.jp-hero-video-active .profile-ring__video--hero {
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  body.jp-home-page .profile-ring__inner--hero-media:not(.jp-hero-video-active) .profile-ring__image--hero-fallback,
  body.jp-home-page .profile-ring__inner--hero-media.is-static-fallback .profile-ring__image--hero-fallback {
    display: block !important;
  }
}
