/* ============================================================
   SPACEMAN TECHNOLOGIES — Navigation
   ============================================================ */

header {
  position: relative;
  z-index: var(--z-nav);
}

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--sp-24) var(--sp-40);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-slow), border-color var(--transition-slow), padding var(--transition-base), backdrop-filter var(--transition-slow), box-shadow var(--transition-slow);
  border-bottom: 1px solid transparent;
  will-change: background, padding, box-shadow;
}

#nav.nav-scrolled {
  background: rgba(10, 10, 26, 0.94);
  border-bottom-color: var(--glass-border);
  padding: var(--sp-16) var(--sp-40);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 240, 255, 0.08);
}

/* ── BRAND LOGO & WORDMARK ─────────────────────────────────── */
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.nav-brand:hover {
  transform: translateY(-1px);
}

.nav-logo-box {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4), 0 0 25px rgba(168, 85, 247, 0.2);
  background: rgba(5, 6, 15, 0.95);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.nav-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  display: block;
}

.nav-brand:hover .nav-logo-box {
  border-color: #00f0ff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.85), 0 0 35px rgba(168, 85, 247, 0.55), 0 0 14px rgba(255, 209, 102, 0.4);
  transform: scale(1.06);
}

.nav-wordmark {
  font-family: var(--font-montserrat);
  font-size: 16px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wordmark);
  text-transform: uppercase;
  color: var(--color-pure-white);
  white-space: nowrap;
  transition: all var(--transition-base);
  background: var(--color-pure-white);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* Iluminación cromática idéntica a 'otra dimensión' (Cian + Azul Eléctrico + Púrpura Real + Oro Solar) */
.nav-brand:hover .nav-wordmark,
.nav-wordmark:hover,
.nav-wordmark:focus-visible {
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 30%, #a855f7 68%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 12px rgba(0, 240, 255, 0.7))
    drop-shadow(0 0 24px rgba(168, 85, 247, 0.5))
    drop-shadow(0 0 36px rgba(255, 209, 102, 0.35));
}

/* ── NAV LINKS ───────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-40);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-source);
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition-base), text-shadow var(--transition-base);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00f0ff, #38bdf8, #a855f7, #ffd166);
  box-shadow: 0 0 10px #00f0ff, 0 0 16px #a855f7;
  transition: width var(--transition-base);
  border-radius: 2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ── BURGER (Touch-Friendly 44x44px Button) ──────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  z-index: calc(var(--z-nav) + 5);
  position: relative;
  transition: all var(--transition-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-burger:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-pure-white);
  transition: transform var(--transition-base), opacity var(--transition-base), width var(--transition-base), background var(--transition-base);
  transform-origin: center;
  border-radius: 2px;
}

.nav-burger.active {
  border-color: rgba(0, 240, 255, 0.6);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.nav-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #00f0ff; }
.nav-burger.active span:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #a855f7; }

/* ── MOBILE OVERLAY MENU ─────────────────────────────────────── */
.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(18, 12, 38, 0.98) 0%, rgba(5, 6, 16, 0.99) 75%);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  z-index: calc(var(--z-nav) + 2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  padding: var(--sp-40) var(--sp-24);
}

.nav-mobile-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.nav-mobile-overlay .nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
  text-align: center;
  width: 100%;
  max-width: 320px;
}

.nav-mobile-overlay .nav-links li {
  width: 100%;
}

.nav-mobile-overlay .nav-links a {
  font-family: var(--font-playfair);
  font-size: 26px;
  font-weight: 500;
  color: var(--color-pure-white);
  letter-spacing: 0.05em;
  transition: all var(--transition-base);
  padding: 10px 20px;
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-mobile-overlay .nav-links a::after {
  display: none;
}

.nav-mobile-overlay .nav-links a:hover,
.nav-mobile-overlay .nav-links a.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
  background-image: linear-gradient(135deg, #00f0ff 0%, #38bdf8 30%, #a855f7 70%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.7)) drop-shadow(0 0 28px rgba(168, 85, 247, 0.5));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.12);
  transform: scale(1.03);
}

/* Gradient accent borders inside the mobile overlay */
.nav-mobile-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00f0ff, #38bdf8, #a855f7, transparent);
}

.nav-mobile-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #a855f7, #ffd166, #00f0ff, transparent);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  #nav .nav-links { display: none; }
  .nav-burger { display: flex; }
  #nav { padding: var(--sp-16) var(--sp-20); }
  #nav.nav-scrolled { padding: var(--sp-12) var(--sp-20); }

  .nav-mobile-overlay .nav-links {
    display: flex !important;
    flex-direction: column;
    gap: var(--sp-20);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-brand {
    gap: 8px;
  }
  .nav-logo-box {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }
  .nav-wordmark {
    font-size: 13px;
    letter-spacing: 0.12em;
  }
}



