/**
 * PHASE 3: NAVBAR REBUILD
 * Fixed position glass effect, responsive layout
 */

/* =========================================================
   NAVBAR HARD ISOLATION — FIXES LAYOUT CONTEXT BLEED
   DO NOT REMOVE
   ========================================================= */

nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;

  width: 100vw !important;
  max-width: none !important;

  transform: none !important;
  perspective: none !important;
  filter: none !important;

  contain: layout paint !important;
  isolation: isolate !important;

  pointer-events: auto !important;

  height: 80px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 999;
}

/* Navigation Container */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 999;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  will-change: background;
  transition: all 0.3s ease-out;
}

/* Dark background on content pages */
nav.nav-dark {
  background: rgba(0, 0, 0, 0.65);
}

/* Hero page context - lighter nav */
nav.nav-hero {
  background: rgba(0, 0, 0, 0.25);
}

/* On scroll, apply darker background */
nav.scrolled {
  background: rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* 🔥 PHASE 2: REMOVE PAGE LAYOUT INFLUENCE ON NAVBAR */
body,
main,
section,
.hero,
[data-parallax],
[data-scroll],
[data-lenis],
[data-smooth-scroll] {
  transform-style: flat !important;
}

/* Prevent fixed-position breaking due to transforms */
body {
  transform: none !important;
  perspective: none !important;
}

/* 🔥 PHASE 3: FORCE IDENTICAL INNER ALIGNMENT */
nav > div {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
  width: 100% !important;
}

/* Logo Section */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  z-index: 10;
}

.nav-brand:hover {
  color: #d4af37;
  transition: color 0.2s ease;
}

/* Center Navigation Links */
.nav-links {
  display: none;
  gap: 2rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.nav-links.visible {
  display: flex;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  position: relative;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #8B0000;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: #d4af37;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* CTA Button */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  background: rgba(139, 0, 0, 0.9);
  border: 1px solid #8B0000;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 10;
}

.nav-cta:hover {
  background: #8B0000;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(139, 0, 0, 0.4);
}

.nav-cta:active {
  transform: translateY(0);
}

/* Mobile Menu */
.nav-mobile-menu {
  display: none;
  z-index: 10;
}

.nav-mobile-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-mobile-toggle:hover {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile menu expanded */
.nav-mobile-menu.expanded {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem;
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-mobile-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  padding: 0.5rem 0;
  text-transform: uppercase;
  transition: color 0.2s ease;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.nav-mobile-links a:hover,
.nav-mobile-links a.active {
  color: #d4af37;
  border-left-color: #8B0000;
}

/* Tablet Layout */
@media (max-width: 1024px) {
  nav {
    padding: 0 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-menu {
    display: block;
  }

  .nav-cta {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }
}

/* Mobile Layout */
@media (max-width: 768px) {
  nav {
    height: 70px;
    padding: 0 1rem;
  }

  .nav-brand {
    font-size: 0.75rem;
  }

  .nav-cta {
    display: none;
  }

  .nav-mobile-menu.expanded {
    top: 70px;
    padding: 0.75rem 1rem;
  }

  .nav-mobile-links {
    gap: 0.5rem;
  }

  .nav-mobile-links a {
    font-size: 0.75rem;
    padding: 0.375rem 0;
    padding-left: 0.5rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  nav,
  .nav-links a,
  .nav-cta,
  .nav-mobile-toggle,
  .nav-mobile-links a {
    transition: none;
  }

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

/* High Contrast Mode */
@media (prefers-contrast: more) {
  nav {
    border-bottom-width: 2px;
  }

  .nav-cta {
    border-width: 2px;
  }
}

/* Print Media */
@media print {
  nav {
    display: none;
  }
}

/* Dark Mode Detection */
@media (prefers-color-scheme: dark) {
  nav {
    background: rgba(0, 0, 0, 0.35);
  }

  nav.scrolled {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* Focus Visible for Keyboard Navigation */
.nav-links a:focus-visible,
.nav-cta:focus-visible,
.nav-mobile-links a:focus-visible,
.nav-mobile-toggle:focus-visible {
  outline: 2px solid #d4af37;
  outline-offset: 2px;
}
/* =========================================================
   APP-LIKE NAVBAR SCROLL BEHAVIOR
   Hides on scroll down, reappears on scroll up
   ========================================================= */
.nav-hidden {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}