/* React Bits behaviors adapted to Sagafin's static landing architecture. */

.site-header {
  isolation: isolate;
}

.nav-shell {
  position: relative;
  z-index: 2;
}

.nav-menu {
  gap: 10px;
}

.gooey-nav-container {
  position: relative;
  isolation: isolate;
}

.gooey-nav-links {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-menu .gooey-nav-links a {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  color: #d4d0ca;
  transition: color 180ms ease-out;
}

.nav-menu .gooey-nav-links a:hover {
  color: #ffffff;
}

.nav-menu .gooey-nav-links a.is-active {
  color: var(--ink);
  text-shadow: none;
}

.gooey-effect {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 0;
  height: 0;
  display: block;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  background: var(--neon);
  box-shadow: 0 0 0 1px rgba(184, 255, 77, .32), 0 8px 20px rgba(0, 0, 0, .2);
  will-change: left, top, width, height;
}

.gooey-effect.is-popping {
  animation: sagafin-gooey-pill 420ms cubic-bezier(.22, 1, .36, 1) both;
}

.gooey-particle {
  position: absolute;
  top: calc(50% - (var(--particle-size) / 2));
  left: calc(50% - (var(--particle-size) / 2));
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: var(--particle-color);
  opacity: 0;
  animation: sagafin-gooey-particle 760ms cubic-bezier(.22, 1, .36, 1) var(--particle-delay) both;
}

@keyframes sagafin-gooey-pill {
  0% { transform: scale(.82); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes sagafin-gooey-particle {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.2); }
  18% { opacity: 1; }
  62% { opacity: 1; transform: translate3d(var(--particle-x), var(--particle-y), 0) scale(1); }
  100% { opacity: 0; transform: translate3d(var(--particle-return-x), var(--particle-return-y), 0) scale(0); }
}

.card-nav-content {
  display: none;
}

.gradual-blur {
  pointer-events: none;
  isolation: isolate;
}

.nav-gradual-blur {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 88px;
  opacity: 0;
  transition: opacity 260ms ease-out;
}

.site-header.is-scrolled .nav-gradual-blur {
  opacity: 1;
}

.gradual-blur-layer {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
  will-change: backdrop-filter, mask-image;
}

.scroll-reveal {
  transform-origin: 0% 50%;
}

.scroll-reveal-visual {
  display: inline;
}

.scroll-reveal-word {
  display: inline-block;
  will-change: opacity, filter;
}

@supports not (backdrop-filter: blur(1px)) {
  .nav-gradual-blur {
    background: linear-gradient(to bottom, rgba(9, 9, 9, .28), transparent);
  }

  .gradual-blur-layer {
    display: none;
  }
}

@media (max-width: 960px) and (min-width: 721px) {
  .gooey-nav-container {
    display: none;
  }
}

@media (max-width: 720px) {
  .nav-menu {
    display: block;
    height: 0;
    max-height: calc(100svh - 96px);
    padding: 0 10px;
    overflow-x: hidden;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .nav-menu.is-open {
    display: block;
    height: auto;
    padding-block: 10px;
    visibility: visible;
    pointer-events: auto;
  }

  .gooey-nav-container,
  .desktop-nav-cta {
    display: none;
  }

  .card-nav-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nav-card {
    min-height: 104px;
    display: grid;
    grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr);
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    user-select: none;
  }

  .nav-card-neon {
    border-color: #8fc72d;
    background: var(--neon);
    color: var(--ink);
  }

  .nav-card-orange {
    border-color: #e65a22;
    background: var(--orange);
    color: #ffffff;
  }

  .nav-card-paper {
    border-color: var(--border-strong);
    background: var(--paper);
    color: var(--ink);
  }

  .nav-card-label {
    align-self: start;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
  }

  .nav-card-links {
    display: grid;
    gap: 2px;
  }

  .nav-menu .card-nav-link,
  .nav-menu a.card-nav-link:not(.button) {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border: 0;
    color: inherit;
    font-size: 13px;
    line-height: 1.2;
  }

  .card-nav-link span {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 12px;
  }

  .nav-gradual-blur {
    height: 62px;
  }
}

@media (max-width: 380px) {
  .nav-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .nav-card-label {
    font-size: 16px;
  }
}

.no-js .nav-toggle,
.no-js .nav-menu {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .gooey-effect,
  .gooey-particle,
  .nav-gradual-blur {
    animation: none !important;
    transition: none !important;
  }

  .scroll-reveal,
  .scroll-reveal-word {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}
