/* ==========================================================
   i'min LP — Background Animations
   Three independent modules. Drop the CSS + JS in,
   then add the matching markup described in README.md.
   ========================================================== */


/* ----------------------------------------------------------
   1) Constellation particles  (global, full-viewport canvas)
   ---------------------------------------------------------- */
#constellation {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

/* Ensure page content sits ABOVE the fixed canvas.
   Adjust selectors to match your layout's top-level sections. */
body>section,
body>header,
body>footer {
  position: relative;
  z-index: 2;
}


/* ----------------------------------------------------------
   3) Grid pulse rings  (scoped to the hero section)
   ----------------------------------------------------------
   Markup expected:
     <section class="hero">
       ...
       <div class="hero-pulse">
         <span></span><span></span><span></span><span></span>
       </div>
       ...
     </section>

   The hero must be `position: relative;` so the pulse layer
   can be absolutely positioned inside it.
   ---------------------------------------------------------- */
.hero-pulse {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* fades the rings out toward the edges */
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 75%);
}

.hero-pulse span {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.234);
  animation: pulse-ring 6s ease-out infinite;
}

.hero-pulse span:nth-child(2) {
  animation-delay: 1.5s;
}

.hero-pulse span:nth-child(3) {
  animation-delay: 3s;
}

.hero-pulse span:nth-child(4) {
  animation-delay: 4.5s;
}

@keyframes pulse-ring {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0;
  }

  20% {
    opacity: 1.0;
  }

  100% {
    width: 140vmin;
    height: 140vmin;
    opacity: 0;
    border-color: rgba(123, 92, 240, 0.01);
  }
}


/* ----------------------------------------------------------
   5) Number morph  (inline number roll-up on viewport enter)
   ----------------------------------------------------------
   Markup:
     <span class="roll" data-to="7" data-suffix="%">7%</span>
   The textContent is the static fallback; JS rolls it up
   from a higher number when the element scrolls into view.
   ---------------------------------------------------------- */
.roll {
  display: inline-block;
  min-width: 1ch;
  /* keep glyphs from jittering during the roll */
  font-variant-numeric: tabular-nums;
}