/**
 * GooeyNav — React Bits official CSS (vanilla port)
 * Gold-themed for portfolio menu; structure matches react-bits GooeyNav.
 */

:root {
  --linear-ease: linear(
    0,
    0.068,
    0.19 2.7%,
    0.804 8.1%,
    1.037,
    1.199 13.2%,
    1.245,
    1.27 15.8%,
    1.274,
    1.272 17.4%,
    1.249 19.1%,
    0.996 28%,
    0.949,
    0.928 33.3%,
    0.926,
    0.933 36.8%,
    1.001 45.6%,
    1.013,
    1.019 50.8%,
    1.018 54.4%,
    1 63.1%,
    0.995 68%,
    1.001 85%,
    1
  );
}

.gooey-nav-container {
  /* Particle palette indices 1–4 (gold) */
  --color-1: #d9b76f;
  --color-2: #f1d78f;
  --color-3: #a88b4a;
  --color-4: #e8d5a3;

  position: relative;
  display: flex;
  align-items: center;
  /* Prevent gooey filter black plate from painting over page chrome */
  isolation: isolate;
  overflow: visible;
  max-width: 100%;
}

:root[data-theme="light"] .gooey-nav-container {
  --color-1: #9b7530;
  --color-2: #c9a24d;
  --color-3: #7a5c22;
  --color-4: #d4b56a;
}

/* Official: nav > ul — we use .gooey-nav-list as the ul */
.gooey-nav-container nav,
.gooey-nav-container .gooey-nav-list {
  display: flex;
  position: relative;
  transform: translate3d(0, 0, 0.01px);
}

.gooey-nav-container .gooey-nav-list {
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 3;
  color: var(--muted, rgba(255, 255, 255, 0.75));
  text-shadow: 0 1px 1px hsl(40deg 30% 10% / 0.15);
}

.gooey-nav-container .gooey-nav-list > li {
  border-radius: 100vw;
  position: relative;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 0 0.5px 1.5px transparent;
  color: var(--muted, rgba(255, 255, 255, 0.75));
}

.gooey-nav-container .gooey-nav-list > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: inherit;
  background: transparent !important;
  box-shadow: none !important;
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.gooey-nav-container .gooey-nav-list > li:focus-within:has(:focus-visible) {
  box-shadow: 0 0 0.5px 1.5px color-mix(in srgb, var(--accent, #d9b76f) 80%, white);
}

/* Official white pill → gold pill for brand */
.gooey-nav-container .gooey-nav-list > li::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 100vw;
  background: linear-gradient(135deg, #f1d78f 0%, #d9b76f 50%, #a88b4a 100%);
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: -1;
}

:root[data-theme="light"] .gooey-nav-container .gooey-nav-list > li::after {
  background: linear-gradient(135deg, #e0c882 0%, #c9a24d 50%, #9b7530 100%);
}

.gooey-nav-container .gooey-nav-list > li.active {
  color: #0a0a08;
  text-shadow: none;
}

.gooey-nav-container .gooey-nav-list > li.active > a,
.gooey-nav-container .gooey-nav-list > li.active > a.nav__link.active {
  color: #0a0a08;
  background: transparent !important;
  box-shadow: none !important;
}

.gooey-nav-container .gooey-nav-list > li:hover:not(.active) {
  color: var(--text-strong, #fff);
}

.gooey-nav-container .gooey-nav-list > li.active::after {
  opacity: 1;
  transform: scale(1);
}

.gooey-nav-container .effect {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 1;
}

.gooey-nav-container .effect.text {
  color: transparent;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
}

.gooey-nav-container .effect.text.active {
  color: #0a0a08;
}

/* Soft gooey particles without contrast/black plate that blanked the UI */
.gooey-nav-container .effect.filter {
  filter: none;
  mix-blend-mode: normal;
  overflow: visible;
  z-index: 0;
}

.gooey-nav-container .effect.filter::before {
  display: none; /* was solid black plate covering header/content */
}

.gooey-nav-container .effect.filter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f1d78f 0%, #d9b76f 50%, #a88b4a 100%);
  transform: scale(0);
  opacity: 0;
  z-index: -1;
  border-radius: 100vw;
  pointer-events: none;
}

:root[data-theme="light"] .gooey-nav-container .effect.filter::after {
  background: linear-gradient(135deg, #e0c882 0%, #c9a24d 50%, #9b7530 100%);
}

.gooey-nav-container .effect.active::after,
.gooey-nav-container .effect.filter.active::after {
  animation: pill 0.3s ease both;
}

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

.gooey-nav-container .particle,
.gooey-nav-container .point {
  display: block;
  opacity: 0;
  width: 20px;
  height: 20px;
  border-radius: 100%;
  transform-origin: center;
}

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

.gooey-nav-container .point {
  background: var(--color);
  opacity: 1;
  animation: point calc(var(--time)) ease 1 -350ms;
}

@keyframes particle {
  0% {
    transform: rotate(0deg) translate(calc(var(--start-x)), calc(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(calc(var(--end-x)), calc(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 point {
  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;
  }
}

/* Site shell */
.nav__gooey {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 1060px) {
  .gooey-nav-container .gooey-nav-list > li > a {
    padding-inline: 9px;
  }
}

@media (max-width: 768px) {
  .nav__gooey {
    width: 100%;
    display: block;
  }

  .gooey-nav-container {
    width: 100%;
    display: block;
  }

  .gooey-nav-container .gooey-nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  .gooey-nav-container .gooey-nav-list > li > a {
    justify-content: flex-start;
    width: 100%;
    font-size: 0.875rem;
    padding: 12px 24px;
  }

  .gooey-nav-container .effect.text {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
  }

  .gooey-nav-container .effect.filter::before {
    inset: -40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gooey-nav-container .gooey-nav-list > li::after {
    transition: none;
  }

  .gooey-nav-container .effect.filter,
  .gooey-nav-container .particle,
  .gooey-nav-container .point {
    animation: none !important;
  }
}
