/* ============================================================
   GooeyNav — Vanilla-Port des react-bits-Effekts für die Navbar.
   Weißer Gooey-Pill hinter dem aktiven Link + Partikel-Burst beim
   Klick. Nur Desktop (JS setzt .nav--gooey), Fallback: Gold-Pill.
   ============================================================ */

.nav {
  --color-1: var(--gold);
  --color-2: var(--blue-club);
  --color-3: var(--cream);
  --color-4: var(--reed);
}

.nav__inner { position: relative; }
.nav--gooey .nav__link { position: relative; z-index: 2; }

/* aktiver Link: eigener Gold-Pill weicht dem Gooey-Pill */
.nav--gooey .nav__link--active,
.nav--gooey .nav__link--active:hover {
  background: transparent;
  box-shadow: none;
  color: var(--gold-ink);
}

.nav__effect {
  position: absolute;
  opacity: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 1;
}

/* SVG-Goo-Filter (wird von gooey-nav.js ins DOM injiziert) statt des
   blend-mode-Tricks des Originals — der bricht in unserer Navbar am
   backdrop-filter-Stacking-Kontext. Alpha-Goo funktioniert überall. */
.nav__effect.filter {
  filter: url(#gooey-nav-goo);
}
.nav__effect.filter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scale(0);
  opacity: 0;
  z-index: -1;
  border-radius: 999px;
}
.nav__effect.filter.active::after { animation: gooeyPill 0.3s ease both; }

@keyframes gooeyPill {
  to { transform: scale(1); opacity: 1; }
}

/* Unter 820px (Burger-Menü) den Effekt ausblenden und den normalen
   Gold-Pill wiederherstellen — wichtig, wenn das Fenster nach dem
   Laden verkleinert wird und das Skript schon initialisiert ist. */
@media (max-width: 820px) {
  .nav__effect { display: none; }
  .nav--gooey .nav__link--active,
  .nav--gooey .nav__link--active:hover {
    background: var(--gold);
    box-shadow: 0 0 22px rgba(242, 201, 76, 0.55);
    color: var(--gold-ink);
  }
}

.particle,
.point {
  display: block;
  opacity: 0;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  transform-origin: center;
}

.particle {
  --time: 5s;
  position: absolute;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  animation: gooeyParticle var(--time) ease 1 -350ms;
}

.point {
  background: var(--color);
  opacity: 1;
  animation: gooeyPoint var(--time) ease 1 -350ms;
}

@keyframes gooeyParticle {
  0% {
    transform: rotate(0deg) translate(var(--start-x), var(--start-y));
    opacity: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  70% {
    transform: rotate(calc(var(--rotate) * 0.5)) translate(calc(var(--end-x) * 1.2), calc(var(--end-y) * 1.2));
    opacity: 1;
    animation-timing-function: ease;
  }
  85% {
    transform: rotate(calc(var(--rotate) * 0.66)) translate(var(--end-x), var(--end-y));
    opacity: 1;
  }
  100% {
    transform: rotate(calc(var(--rotate) * 1.2)) translate(calc(var(--end-x) * 0.5), calc(var(--end-y) * 0.5));
    opacity: 1;
  }
}

@keyframes gooeyPoint {
  0% {
    transform: scale(0);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  25% { transform: scale(calc(var(--scale) * 0.25)); }
  38% { opacity: 1; }
  65% {
    transform: scale(var(--scale));
    opacity: 1;
    animation-timing-function: ease;
  }
  85% { transform: scale(var(--scale)); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
