/* ─── Motion backdrop (front page) ───────────────────────────────────────────
   Breathing loader, fixed particle canvas (+ CSS fallback without WebGL),
   drifting aura blobs, cursor halo. Driven by assets/js/fx.js.
   ────────────────────────────────────────────────────────────────────────── */

/* Loader — hidden without JS, removed by fx.js, and auto-fades after 3.8s
   by CSS alone if a script never arrives. */
.ha-loader {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: var(--paper);
  animation: ha-ld-auto 0.8s 3.8s forwards;
}

html:not(.js) .ha-loader,
html.ready .ha-loader {
  display: none;
}

@keyframes ha-ld-auto {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.ha-loader__in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.ha-loader__orb {
  position: relative;
  width: 150px;
  height: 150px;

  i {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    filter: blur(14px);
    opacity: 0.75;
    mix-blend-mode: multiply;

    &:nth-child(1) {
      background: var(--sage);
      transform: translate(-14px, 6px);
    }

    &:nth-child(2) {
      background: var(--lav);
      transform: translate(14px, -6px);
    }

    &:nth-child(3) {
      background: var(--peach);
      transform: translate(0, 14px) scale(0.8);
    }
  }
}

.ha-loader__brand .ha-logo__t {
  font-size: 30px;
}

.ha-loader__msg {
  font: 400 12px var(--f-m);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Particles */
.ha-gl {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.no-gl .ha-gl {
  display: none;
}

.ha-gl-fallback {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 200vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(34vw 34vw at 74% 30%, color-mix(in srgb, var(--pastel-green) 35%, transparent), transparent 65%),
    radial-gradient(30vw 30vw at 82% 60%, color-mix(in srgb, var(--secondary-color) 30%, transparent), transparent 65%);
}

.no-gl .ha-gl-fallback,
html:not(.has-gl):not(.js) .ha-gl-fallback {
  display: block;
}

/* Aura */
.ha-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;

  i {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: ha-drift 22s ease-in-out infinite alternate;
  }

  .a1 {
    width: 46vw;
    height: 46vw;
    left: -14vw;
    top: -12vw;
    background: var(--tint-green);
  }

  .a2 {
    width: 40vw;
    height: 40vw;
    right: -10vw;
    top: 30vh;
    background: var(--tint-lav);
    animation-delay: -7s;
  }

  .a3 {
    width: 36vw;
    height: 36vw;
    left: 30vw;
    bottom: -18vw;
    background: var(--tint-peach);
    animation-delay: -14s;
  }
}

/* Cursor halo */
.ha-cur {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 180;
  display: none;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--pastel-green) 55%, transparent), color-mix(in srgb, var(--secondary-color) 25%, transparent) 60%, transparent 70%);
  opacity: 0;
  transition: width 0.6s, height 0.6s, margin 0.6s, opacity 0.4s;

  &.is-big {
    width: 90px;
    height: 90px;
    margin: -45px 0 0 -45px;
  }
}

.has-cur .ha-cur {
  display: block;
}

.cur-on .ha-cur {
  opacity: 1;
}

.home .ha-ftr {
  position: relative;
  z-index: 1;
}
