/* ========== KINETIC NAVIGATION ========== */

/* Keep the navbar above the fullscreen menu so Close stays clickable */
.ios-nav[data-kinetic-nav] {
  z-index: 1000;
}

/* Menu toggle button (in navbar) */
.nav-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: none;
  border: none;
  color: #c084fc;
  cursor: pointer;
  /* 44px minimum tap target (Apple HIG) — the button must stay
     comfortably tappable even when its text label is hidden. */
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  font-family: inherit;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.nav-close-btn:hover { opacity: 0.75; }

.menu-button-text {
  position: relative;
  height: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-button-text p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.01em;
  height: 22px;
  white-space: nowrap;
}

.menu-button-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: currentColor;
}

/* Fullscreen overlay shell */
.fullscreen-menu-container {
  position: fixed;
  z-index: 900;
  inset: 0;
  pointer-events: none;
  /* must not create a zero-size box for the fixed child */
  width: 100%;
  height: 100%;
}

.nav-overlay-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: none;
  pointer-events: none;
}

.nav-overlay-wrapper[data-nav="open"] { pointer-events: auto; }

.nav-overlay-wrapper .overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 3, 20, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
}

.menu-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  display: flex;
  align-items: center;
  transform: translateX(120%);
  overflow: hidden;
}

.menu-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.backdrop-layer {
  position: absolute;
  inset: 0;
  transform: translateX(101%);
}

.backdrop-layer.first {
  background: linear-gradient(135deg, rgba(120, 50, 200, 0.55) 0%, rgba(60, 20, 110, 0.6) 100%);
}

.backdrop-layer.second {
  background: linear-gradient(135deg, rgba(70, 25, 140, 0.75) 0%, rgba(35, 10, 70, 0.85) 100%);
}

.backdrop-layer:not(.first):not(.second) {
  background: linear-gradient(135deg, rgba(30, 10, 60, 0.96) 0%, rgba(12, 4, 30, 0.98) 100%);
  border-left: 1px solid rgba(192, 132, 252, 0.22);
}

/* Ambient hover shapes */
.ambient-background-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bg-shape.active { opacity: 1; }

/* Menu links */
.menu-content-wrapper {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 48px 40px;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list-item {
  position: relative;
  /* no overflow:hidden — it clipped the link text.
     The nav-link masks its own reveal instead. */
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: #fff;
  padding: 14px 20px;
  position: relative;
  border-radius: 14px;
  transition: color 0.25s ease;
}

.nav-link:hover { color: #e9d5ff; }

.nav-link-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: #c084fc;
  transition: transform 0.25s ease;
}

.nav-link:hover .nav-link-icon { transform: translateX(3px) scale(1.06); }

.nav-link-text {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0;
  text-shadow: 0 2px 20px rgba(168, 85, 247, 0.35);
}

.nav-link-hover-bg {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.16) 0%, transparent 85%);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.65, 0.05, 0, 1);
  pointer-events: none;
}

.nav-link:hover .nav-link-hover-bg { transform: translateX(0); }

body.menu-open { overflow: hidden; }

/* ---- No-GSAP / pre-GSAP fallback: pure CSS open state ---- */
.nav-overlay-wrapper.is-open .overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.nav-overlay-wrapper.is-open .menu-content {
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.65, 0.05, 0, 1);
}

.nav-overlay-wrapper.is-open .backdrop-layer {
  transform: translateX(0);
  transition: transform 0.55s cubic-bezier(0.65, 0.05, 0, 1);
}

.nav-overlay-wrapper.is-open .backdrop-layer.second { transition-delay: 0.08s; }
.nav-overlay-wrapper.is-open .backdrop-layer:not(.first):not(.second) { transition-delay: 0.16s; }

.nav-overlay-wrapper.is-open .nav-link {
  animation: knav-link-in 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.nav-overlay-wrapper.is-open .menu-list-item:nth-child(1) .nav-link { animation-delay: 0.24s; }
.nav-overlay-wrapper.is-open .menu-list-item:nth-child(2) .nav-link { animation-delay: 0.30s; }
.nav-overlay-wrapper.is-open .menu-list-item:nth-child(3) .nav-link { animation-delay: 0.36s; }
.nav-overlay-wrapper.is-open .menu-list-item:nth-child(4) .nav-link { animation-delay: 0.42s; }

@keyframes knav-link-in {
  from { transform: translateY(140%) rotate(8deg); opacity: 0; }
  to   { transform: translateY(0) rotate(0deg);   opacity: 1; }
}

.nav-overlay-wrapper.is-open .menu-button-text p:first-child { transform: translateY(-100%); }
.nav-overlay-wrapper.is-open ~ * .menu-button-icon { transform: rotate(315deg); }

.menu-button-text p { transition: transform 0.3s ease; }
.menu-button-icon { transition: transform 0.35s ease; }

@media (max-width: 640px) {
  .menu-content { max-width: 100%; }
  .menu-content-wrapper { padding: 32px 24px; }
  .nav-link-text { font-size: 2.1rem; }
  .nav-link-icon { width: 26px; height: 26px; }
  .nav-link { gap: 14px; padding: 12px 14px; }

  /* Hide only the Menu/Close wording — never the button itself.
     The icon grows and gains a tinted pill so it still reads as
     a tappable control. */
  .menu-button-text { display: none; }

  .nav-close-btn {
    gap: 0;
    border-radius: 12px;
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.25);
  }

  .nav-close-btn:active {
    background: rgba(192, 132, 252, 0.22);
  }

  .menu-button-icon {
    width: 18px;
    height: 18px;
  }
}
