/* ==========================================================================
   UNIFIED FLOATING PILL NAVIGATION (Matches Portfolio & About Pages)
   Works automatically on both <header class="glass-nav"> and <header class="top">
   ========================================================================== */
.glass-nav,
header.top {
  position: fixed;
  top: 1.15rem;
  left: 2rem;
  right: 2rem;
  height: 68px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(9, 18, 31, 0.9);
  border: 1px solid rgba(124, 92, 255, 0.45);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(3, 7, 18, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
}

header.top .nav-wrap {
  width: 100%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  gap: 1rem;
  flex-direction: row;
  padding: 0;
}

body:has(header.top) main,
body:has(.glass-nav):not(:has(.viewport-lock)) main {
  padding-top: 6.2rem;
}

.brand-id,
header.top .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--text, #edf6ff);
  flex-shrink: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-logo-img,
header.top .brand-mark {
  height: 44px;
  width: 44px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.25));
}

.brand-orb-fallback {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #7c5cff, #e879f9);
  display: none;
  place-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.4);
}

.brand-text strong,
header.top .brand-text {
  display: block;
  white-space: nowrap;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text, #edf6ff);
}

.brand-text strong em,
header.top .brand-text span {
  display: inline;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  margin-top: 0;
  font-style: normal;
  color: var(--cyan, #22d3ee);
}

.brand-id .brand-text > span,
header.top .brand-sub {
  display: block;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal, #2dd4bf);
  margin-top: 0.18rem;
}

.nav-links,
header.top .main-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

header.top .nav-wrap:has(.header-quote) .main-nav {
  margin-left: auto;
}

.nav-links a,
header.top .main-nav a {
  position: relative;
  padding: 0.4rem 0;
  color: var(--muted, #9eb2c9);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
header.top .main-nav a:hover {
  color: var(--magenta, #e879f9);
  transform: translateY(-1px);
}

.nav-links a.active,
.nav-links a[aria-current="page"],
header.top .main-nav a[aria-current="page"] {
  color: var(--teal, #2dd4bf);
  font-weight: 700;
}

.nav-links a.active::after,
.nav-links a[aria-current="page"]::after,
header.top .main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan, #22d3ee), var(--green, #34d399));
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.45);
}

.nav-cta,
header.top .header-quote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.62rem 1.2rem !important;
  border-radius: 12px;
  background: linear-gradient(135deg, #e879f9, #f0abfc) !important;
  border: 1px solid #e879f9 !important;
  color: #050b13 !important;
  font: 800 0.86rem/1.2 "Inter", sans-serif !important;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 0 28px rgba(232, 121, 249, 0.4), 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.nav-cta:hover,
header.top .header-quote:hover {
  transform: translateY(-1px);
  color: #050b13 !important;
  box-shadow: 0 0 40px rgba(232, 121, 249, 0.65), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.45);
  color: var(--text, #edf6ff);
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 76px;
  left: 0.85rem;
  right: 0.85rem;
  background: rgba(9, 18, 31, 0.98);
  border: 1px solid rgba(124, 92, 255, 0.55);
  border-radius: 22px;
  padding: 1.1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  z-index: 99;
  flex-direction: column;
  gap: 0.35rem;
  max-height: calc(100dvh - 92px);
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  display: flex;
}

.mobile-nav-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.05rem;
  border-radius: 14px;
  color: var(--muted, #9eb2c9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.mobile-nav-drawer a:hover,
.mobile-nav-drawer a.active,
.mobile-nav-drawer a[aria-current="page"] {
  background: rgba(124, 92, 255, 0.15);
  color: var(--teal, #2dd4bf);
  font-weight: 700;
}

.mobile-nav-drawer a.mobile-drawer-cta {
  margin-top: 0.4rem;
  justify-content: center;
  background: linear-gradient(135deg, #e879f9, #f0abfc);
  border: 1px solid #e879f9;
  color: #050b13;
  font-weight: 800;
  box-shadow: 0 0 28px rgba(232, 121, 249, 0.4);
}

@media (max-width: 1040px) {
  .glass-nav,
  header.top {
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    height: 58px;
    padding: 0 1rem;
  }
  .nav-links,
  header.top .main-nav,
  header.top .header-quote {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
    flex-shrink: 0;
  }
  header.top .nav-wrap {
    min-height: 58px;
  }

  @media (max-width: 480px) {
    header.top .brand {
      gap: 0.5rem;
    }

    @media print {
      header.top,
      .mobile-nav-drawer {
        display: none;
      }
    }
    header.top .brand-mark {
      width: 36px;
      height: 36px;
    }
    header.top .brand-text {
      font-size: 0.95rem;
    }
    header.top .brand-sub {
      font-size: 0.55rem;
      letter-spacing: 0.1em;
    }
  }
  body:has(header.top) main,
  body:has(.glass-nav):not(:has(.viewport-lock)) main {
    padding-top: 5.2rem;
  }
}
