/**
 * Poder Ciudadano Hero - motion layer only.
 */

.pch-hero {
  --pch-nebula-one: #10d8ff;
  --pch-nebula-two: #ffc638;
  --pch-nebula-three: #516dff;
  --pch-nebula-opacity: 0.42;
  --pch-nebula-blur: 80px;
  --pch-nebula-speed: 34s;
  --pch-motion-x: 0;
  --pch-motion-y: 0;
}

.pch-motion {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none !important;
  transform: translateZ(0);
}

.pch-motion * {
  pointer-events: none !important;
}

.pch-motion__nebula {
  position: absolute;
  width: clamp(320px, 48vw, 780px);
  height: clamp(320px, 48vw, 780px);
  border-radius: 999px;
  filter: blur(var(--pch-nebula-blur));
  mix-blend-mode: screen;
  opacity: var(--pch-nebula-opacity);
  will-change: transform, opacity, filter;
}

.pch-motion__nebula--one {
  top: -18%;
  left: -14%;
  background: radial-gradient(circle, var(--pch-nebula-one), transparent 64%);
  animation: pch-nebula-one var(--pch-nebula-speed) linear infinite;
}

.pch-motion__nebula--two {
  top: 2%;
  right: -18%;
  background: radial-gradient(circle, var(--pch-nebula-two), transparent 66%);
  animation: pch-nebula-two calc(var(--pch-nebula-speed) * 1.22) linear infinite;
}

.pch-motion__nebula--three {
  bottom: -28%;
  left: 28%;
  background: radial-gradient(circle, var(--pch-nebula-three), transparent 64%);
  animation: pch-nebula-three calc(var(--pch-nebula-speed) * 1.48) ease-in-out infinite;
}

.pch-motion__shape {
  position: absolute;
  opacity: 0.08;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transform: translateZ(0);
}

.pch-motion__shape--one {
  right: 34%;
  bottom: -6%;
  width: clamp(140px, 14vw, 220px);
  height: clamp(360px, 44vw, 620px);
  clip-path: polygon(36% 0, 100% 12%, 100% 100%, 0 100%, 0 20%);
}

.pch-motion__shape--two {
  right: 10%;
  top: 16%;
  width: clamp(220px, 32vw, 520px);
  height: clamp(220px, 32vw, 520px);
  border-radius: 48px;
  transform: rotate(22deg);
}

.pch-motion__svg {
  position: absolute;
  right: clamp(0px, 5vw, 76px);
  bottom: clamp(28px, 8vw, 110px);
  width: clamp(210px, 34vw, 520px);
  height: auto;
  opacity: 0.18;
  filter: drop-shadow(0 26px 60px rgba(0, 0, 0, 0.16));
  transform:
    translate3d(
      calc(var(--pch-motion-x) * 1px),
      calc(var(--pch-motion-y) * 1px),
      0
    )
    rotate(-2deg)
    scale(1);
  transform-origin: center;
  animation: pch-svg-idle 16s ease-in-out infinite;
  will-change: transform;
}

.pch-motion__permission {
  pointer-events: auto !important;
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: none;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(0, 20, 58, 0.62);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
}

.pch-hero[data-pch-tilt="true"] .pch-motion__permission.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes pch-nebula-one {
  0% {
    transform: translate3d(calc(var(--pch-motion-x) * -0.3px), calc(var(--pch-motion-y) * -0.3px), 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--pch-motion-x) * -0.3px + 4%), calc(var(--pch-motion-y) * -0.3px + 2%), 0) rotate(180deg) scale(1.08);
  }
  100% {
    transform: translate3d(calc(var(--pch-motion-x) * -0.3px), calc(var(--pch-motion-y) * -0.3px), 0) rotate(360deg) scale(1);
  }
}

@keyframes pch-nebula-two {
  0% {
    transform: translate3d(calc(var(--pch-motion-x) * 0.42px), calc(var(--pch-motion-y) * 0.26px), 0) rotate(360deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--pch-motion-x) * 0.42px - 4%), calc(var(--pch-motion-y) * 0.26px + 3%), 0) rotate(180deg) scale(1.1);
  }
  100% {
    transform: translate3d(calc(var(--pch-motion-x) * 0.42px), calc(var(--pch-motion-y) * 0.26px), 0) rotate(0deg) scale(1);
  }
}

@keyframes pch-nebula-three {
  0%, 100% {
    transform: translate3d(calc(var(--pch-motion-x) * 0.25px - 4%), calc(var(--pch-motion-y) * -0.36px + 2%), 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--pch-motion-x) * 0.25px + 5%), calc(var(--pch-motion-y) * -0.36px - 4%), 0) rotate(180deg) scale(1.08);
  }
}

@keyframes pch-svg-idle {
  0%, 100% {
    transform: translate3d(calc(var(--pch-motion-x) * 1px), calc(var(--pch-motion-y) * 1px), 0) rotate(-2deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--pch-motion-x) * 1px + 6px), calc(var(--pch-motion-y) * 1px - 8px), 0) rotate(3deg) scale(1.035);
  }
}

@media (max-width: 1050px) {
  .pch-motion__svg {
    right: -8vw;
    bottom: 10%;
    opacity: 0.13;
  }

  .pch-motion__shape--one {
    right: -8%;
  }
}

@media (max-width: 640px) {
  .pch-motion__svg {
    right: -24vw;
    bottom: 22%;
    width: clamp(260px, 78vw, 420px);
    opacity: 0.1;
  }

  .pch-motion__shape--two {
    right: -42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pch-hero[data-pch-reduced-motion="true"] .pch-motion__nebula,
  .pch-hero[data-pch-reduced-motion="true"] .pch-motion__svg {
    animation: none;
  }
}
