/* =========================
          NAVBAR
========================= */

nav {
  position: sticky;
  top: 0;
  z-index: 100;

  position: sticky;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.96),
      rgba(245,247,255,0.9)
    );

  backdrop-filter: blur(10px) saturate(120%);

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 18px 8%;

  transition:
    box-shadow 0.3s ease,
    background 0.3s ease;

  /* anchor pseudo-elements */
  position: sticky;
}

/* Scroll elevation */
nav.scrolled {
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.98),
      rgba(240,244,255,0.92)
    );

  box-shadow:
    0 10px 28px rgba(0,0,0,0.08),
    inset 0 -1px 0 rgba(30,43,255,0.08);
}

/* Ambient gradient glow (FIXED) */
nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background:
    linear-gradient(
      90deg,
      rgba(30,43,255,0.06),
      transparent 45%,
      transparent 55%,
      rgba(30,43,255,0.06)
    );

  pointer-events: none;
}

/* Ensure content is above glow */
nav > * {
  position: relative;
  z-index: 1;
}

/* =========================
   BRAND
========================= */

.nav-brand {
  display: flex;
  align-items: center;

  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;

  color: var(--black);
  text-decoration: none;

  position: relative;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* Brand underline */
.nav-brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;

  background: linear-gradient(
    90deg,
    var(--blue-primary),
    rgba(30,43,255,0.6)
  );

  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav-brand:hover::after {
  width: 100%;
}

/* =========================
   NAV LINKS
========================= */

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin-left: 28px;

  font-size: 0.95rem;
  font-weight: 500;

  color: var(--black);
  opacity: 0.85;
  text-decoration: none;

  position: relative;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;

  background: linear-gradient(
    90deg,
    var(--blue-primary),
    rgba(30,43,255,0.6)
  );

  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav-links a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

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

/* =========================
   AGENT BUTTON
========================= */

.agent-btn {
  width: 40px;
  height: 40px;
  margin-left: 32px;

  background:
    radial-gradient(
      circle at top left,
      rgba(255,255,255,0.35),
      var(--blue-primary)
    );

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;

  box-shadow:
    0 8px 24px rgba(30,43,255,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.3);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;

  animation: agentPulse 4s ease-in-out infinite;
}

@keyframes agentPulse {
  0%, 100% {
    box-shadow:
      0 8px 24px rgba(30,43,255,0.35),
      inset 0 0 0 1px rgba(255,255,255,0.25);
  }
  50% {
    box-shadow:
      0 14px 40px rgba(30,43,255,0.5),
      inset 0 0 0 1px rgba(255,255,255,0.35);
  }
}

@media (hover: hover) and (pointer: fine) {
  .agent-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
      0 18px 48px rgba(30,43,255,0.6);
  }
}

.agent-btn::after {
  display: none;
}

/* =========================
   ACCESSIBILITY
========================= */

.nav-links a:focus-visible,
.agent-btn:focus-visible,
.nav-brand:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--blue-primary);
  outline-offset: 4px;
}

/* =========================
   MOBILE NAV
========================= */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;

  font-size: 1.6rem;
  margin-left: 16px;
  transition: transform 0.2s ease;
}

.nav-toggle:hover {
  transform: scale(1.08);
}

.nav-toggle:active {
  transform: scale(0.94);
}

@media (max-width: 768px) {

  nav {
    padding: 16px 6%;
  }

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

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    background:
      linear-gradient(
        180deg,
        rgba(255,255,255,0.98),
        rgba(240,244,255,0.96)
      );

    backdrop-filter: blur(12px);

    flex-direction: column;
    align-items: flex-start;

    padding: 22px 6%;
    box-shadow: 0 16px 36px rgba(0,0,0,0.1);

    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav-links a {
    margin: 14px 0;
    font-size: 1rem;
  }

  .agent-btn {
    margin: 20px 0 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-toggle.active {
    transform: rotate(90deg);
  }
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
