/* UnlockPool Phase 14 - Premium Motion UI */
:root {
  --p14-cyan: #9fe8ff;
  --p14-green: #8fe28d;
  --p14-grid: rgba(159, 232, 255, 0.035);
  --p14-panel: rgba(11, 20, 37, 0.72);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* ambient moving grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--p14-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--p14-grid) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 88%);
  animation: p14-grid-drift 40s ease-in-out infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

@keyframes p14-grid-drift {
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(20px,20px,0); }
}

/* animated ambient glow */
.p14-ambient-glow {
  position: fixed;
  width: min(55vw, 900px);
  aspect-ratio: 1;
  right: -16vw;
  top: 8vh;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(96,214,255,.12), rgba(44,91,190,.05) 35%, transparent 70%);
  filter: blur(20px);
  animation: p14-glow-float 36s ease-in-out infinite;
}

@keyframes p14-glow-float {
  0%,100% { transform: translate3d(0,0,0) scale(1); opacity: .6; }
  50% { transform: translate3d(-5vw,4vh,0) scale(1.12); opacity: 1; }
}

/* particle layer */
.p14-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.p14-particle {
  position: absolute;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: var(--color, var(--p14-cyan));
  box-shadow: 0 0 14px currentColor;
  opacity: var(--opacity, .35);
  animation: p14-float var(--duration, 22s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes p14-float {
  0%,100% { transform: translate3d(0,-8px,0); }
  50% { transform: translate3d(12px,10px,0); }
}

/* keep site content above ambient layers */
.site-header,
main,
footer,
#app,
.page-wrapper,
.site-wrapper,
.hero,
.hero-section { position: relative; z-index: 1; }

/* shared reveal */
.p14-reveal {
  opacity: 0;
  transform: translate3d(0,36px,0);
  transition: opacity .75s ease, transform .75s cubic-bezier(.2,.8,.2,1);
}
.p14-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0,0,0);
}

/* cards */
.p14-motion-card {
  transition: transform .26s ease, box-shadow .26s ease, border-color .26s ease;
  will-change: transform;
}
.p14-motion-card:hover {
  transform: translate3d(0,-5px,0) scale(1.008);
  border-color: rgba(159,232,255,.32) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.28), 0 0 0 1px rgba(159,232,255,.05) inset;
}

/* live status pulse */
.p14-live-pulse,
.status-live,
.live-dot,
[data-status="live"]::before {
  animation: p14-live-pulse 2s ease-in-out infinite;
}
@keyframes p14-live-pulse {
  0%,100% { filter: drop-shadow(0 0 2px rgba(143,226,141,.25)); }
  50% { filter: drop-shadow(0 0 14px rgba(143,226,141,.95)); }
}

/* radar enhancement */
#galaxy-core,
.galaxy-core,
.radar-core,
.hero-radar {
  animation: p14-radar-breathe 6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes p14-radar-breathe {
  0%,100% { filter: drop-shadow(0 0 10px rgba(130,220,255,.10)); }
  50% { filter: drop-shadow(0 0 24px rgba(130,220,255,.28)); }
}

.galaxy,
.radar,
.peer-orbit,
.network-orbit {
  position: relative;
}
.galaxy::after,
.radar::after,
.peer-orbit::after,
.network-orbit::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(159,232,255,.14);
  border-radius: 50%;
  pointer-events: none;
  animation: p14-orbit-spin 60s linear infinite;
}
@keyframes p14-orbit-spin { to { transform: rotate(360deg); } }

/* flow packet */
.flow-line,
.infrastructure-line,
.pipeline-line,
.connection-line {
  position: relative;
  overflow: hidden;
}
.flow-line::after,
.infrastructure-line::after,
.pipeline-line::after,
.connection-line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--p14-cyan);
  box-shadow: 0 0 14px var(--p14-cyan);
  transform: translateY(-50%);
  animation: p14-packet 2.2s linear infinite;
}
@keyframes p14-packet {
  from { left: -18px; opacity: 0; }
  10%,85% { opacity: 1; }
  to { left: calc(100% + 18px); opacity: 0; }
}

/* subtle animated border for important panels */
.p14-glow-border { position: relative; overflow: hidden; }
.p14-glow-border::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 15%, rgba(159,232,255,.08) 42%, transparent 70%);
  transform: translateX(-120%);
  animation: p14-sheen 8s ease-in-out infinite;
}
@keyframes p14-sheen {
  0%,70%,100% { transform: translateX(-120%); }
  85% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
