/* ===================================
   Tritonium Shared Navigation Styles
   =================================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--space-3, 16px) var(--section-padding-x, 40px);
  min-height: var(--nav-height, 72px);
  background: rgba(5, 6, 12, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: all 0.3s ease;
}

nav.scrolled {
  padding: var(--space-2, 12px) var(--section-padding-x, 40px);
  background: rgba(3, 5, 12, 0.92);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
}

/* Homepage-style navigation */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-4);
  background: #fff;
  color: #000;
  border-radius: var(--radius-full, 999px);
  font-weight: 600;
  transition: top 0.2s ease;
  z-index: 2000;
}

.skip-link:focus-visible {
  top: 16px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(5, 7, 16, 0.6);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6, 24px);
  min-height: var(--nav-height, 72px);
  padding-block: var(--space-3, 16px);
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-5, 20px);
}

body.nav-open {
  overflow: hidden;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(2.5rem, 4vw, 3.75rem);
  position: relative;
}

.logo {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary, #ff8c00), var(--secondary, #00d9c0));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-decoration: none;
  margin-right: 60px;
  animation: glow 2s ease-in-out infinite alternate;
}

@media (min-width: 769px) {
  .nav-container {
    min-height: var(--nav-height, 72px);
  }
}

.nav-links {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(2rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}

.nav-links-primary {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  padding-block: var(--space-1, 8px);
  color: var(--text-muted, rgba(245, 246, 255, 0.8));
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: var(--font-size-sm, 0.95rem);
  transition: color 0.3s ease, opacity 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary, #ff8c00), var(--secondary, #00d9c0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--light, #f5f6ff);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-links a.is-active,
.nav-links a[aria-current='page'] {
  color: var(--light, #f5f6ff);
}

.nav-links-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3, 16px);
  flex-wrap: wrap;
}

.nav-links .login-link {
  color: var(--light, #f5f6ff);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 16px 32px;
  border-radius: var(--radius-full, 999px);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  line-height: 1;
  letter-spacing: -0.01em;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links .login-link::after {
  display: none;
}

.nav-links .login-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-links .status-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(245, 246, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.nav-links .status-link::after {
  display: none;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #3cffb0, #00c46d);
  box-shadow: 0 0 10px rgba(60, 255, 176, 0.8);
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(60, 255, 176, 0.8);
  }
  100% {
    transform: scale(1.35);
    box-shadow: 0 0 14px rgba(60, 255, 176, 0);
  }
}

.nav-links .cta-button {
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  line-height: 1;
  letter-spacing: -0.01em;
  box-sizing: border-box;
  color: var(--light, #f5f6ff);
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-links .cta-button::after {
  display: none;
}

.nav-links .cta-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 80;
}

.nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--primary, #ff8c00);
  outline-offset: 2px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-toggle-bars {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--light, #f5f6ff);
  transition: transform 0.3s ease, background 0.3s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--light, #f5f6ff);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle-bars::before {
  top: -8px;
}

.nav-toggle-bars::after {
  top: 8px;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.5)); }
  to { filter: drop-shadow(0 0 20px rgba(0, 217, 192, 0.45)); }
}

@media (max-width: 768px) {
  nav {
    padding: 16px var(--section-padding-x-mobile, 20px);
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.95), rgba(10, 14, 20, 0.65));
    backdrop-filter: blur(8px);
  }

  .nav-links {
    position: absolute;
    inset: calc(100% + 10px) var(--space-4, 16px) auto var(--space-4, 16px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    background: rgba(10, 14, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 90;
  }

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

  .nav-links a {
    display: block;
  }

  .nav-links .cta-button,
  .nav-links .login-link {
    width: 100%;
    text-align: center;
  }

  .nav-links .status-link {
    justify-content: center;
  }

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

  body.nav-open {
    overflow: hidden;
  }
}
