/* ═══════════════════════════════════════════════════════
   NAV.CSS — Apple liquid-glass bottom pill  v3
   Fixed at bottom on ALL devices. No hamburger.

   CENTERING: uses left:0/right:0 + flexbox — NOT
   transform:translateX(-50%) — to avoid iOS Safari bug
   where position:fixed + transform gets clipped by
   body overflow-x:hidden.
═══════════════════════════════════════════════════════ */

/* ── Body clearance so content doesn't hide under pill ─ */
body {
  padding-bottom: 80px; /* fallback */
}

@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════
   NAV WRAPPER
   Full-width fixed strip, flexbox-centered pill inside
═══════════════════════════════════════════════════ */

.site-nav {
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  z-index: 1001;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* pill handles touches */
}

@supports (padding: env(safe-area-inset-bottom)) {
  .site-nav {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════
   GLASS PILL
═══════════════════════════════════════════════════ */

.nav-pill {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 18px;
  pointer-events: auto;

  /* Solid fallback for browsers without backdrop-filter */
  background: rgba(15, 15, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);

  transition:
    padding 300ms ease,
    background 300ms ease,
    box-shadow 300ms ease;
}

/* Glassmorphism where supported */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .nav-pill {
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

/* Compact — slightly smaller when scrolling down */
.site-nav.nav-compact .nav-pill {
  padding: 8px 14px;
  background: rgba(15, 15, 15, 0.90);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.6),
    0 1px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-nav.nav-compact .nav-pill {
    background: rgba(0, 0, 0, 0.52);
  }
}

/* ═══════════════════════════════════════════════════
   NAV ITEMS
═══════════════════════════════════════════════════ */

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 18px;
  min-width: 64px;
  min-height: 58px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 260ms ease,
    transform 200ms ease,
    background 200ms ease;
}

.nav-item:hover {
  color: rgba(255, 255, 255, 0.85);
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.07);
}

.site-nav.nav-compact .nav-item {
  padding: 7px 14px;
  min-height: 48px;
}

/* ── Icon ─────────────────────────────────────────── */
.nav-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: width 300ms ease, height 300ms ease;
}

.site-nav.nav-compact .nav-icon {
  width: 20px;
  height: 20px;
}

/* ── Label ────────────────────────────────────────── */
.nav-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: font-size 300ms ease, opacity 300ms ease;
}

.site-nav.nav-compact .nav-label {
  font-size: 0.63rem;
  opacity: 0.88;
}

/* ═══════════════════════════════════════════════════
   ACTIVE STATE
   Icon: electric blue (#41BDFE) via color inheritance
   Label: blue→pink gradient text
═══════════════════════════════════════════════════ */

.nav-item.nav-active {
  color: #41BDFE;
}

.nav-item.nav-active .nav-label {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item.nav-active:hover {
  background: rgba(65, 189, 254, 0.09);
  transform: scale(1.06);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — tighter padding on small screens
═══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .nav-item {
    padding: 9px 14px;
  }

  .site-nav.nav-compact .nav-item {
    padding: 7px 11px;
  }
}

@media (max-width: 480px) {
  .nav-item {
    padding: 9px 10px;
    min-width: 52px;
  }

  .site-nav.nav-compact .nav-item {
    padding: 7px 8px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .site-nav.nav-compact .nav-icon {
    width: 18px;
    height: 18px;
  }

  .nav-label {
    font-size: 0.66rem;
  }

  /* No hover scale on touch */
  .nav-item:hover {
    transform: none;
  }

  /* Tap feedback */
  .nav-item:active {
    transform: scale(0.93);
    transition: transform 100ms ease;
  }
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .nav-pill,
  .nav-item,
  .nav-icon,
  .nav-label {
    transition: none !important;
  }
}
