/* ============================================================
   Liquid bottom navigation (mobile only)
   The bar outline is an SVG path redrawn every frame by
   /js/bottom-nav.js, so the top edge genuinely deforms around
   the active item. Keep these numbers in sync with the JS:
   T = 30 (room above the bar), BAR_H = 64, INSET = 10
   ============================================================ */

.bottom-nav {
  --nav-h: 94px;                 /* = T + BAR_H */
  --nav-gap: 12px;               /* floating distance above the screen edge */
  --lime: #C6FF00;
  --muted: #8a84a6;

  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-gap) + env(safe-area-inset-bottom, 0px));
  max-width: 420px;
  margin-inline: auto;
  height: var(--nav-h);
  z-index: 1000;
  box-sizing: border-box;

  /* item row sits under the bump zone */
  padding: 30px 10px 0;          /* top = T, sides = INSET */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);

  pointer-events: none;          /* the empty bump zone never blocks taps on the page */
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  view-transition-name: bottom-nav;
}

/* ---------- injected by JS: the deformable bar ---------- */
.bottom-nav .nav-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter:
    drop-shadow(0 14px 22px rgba(4, 0, 20, 0.55))
    drop-shadow(0 0 16px rgba(198, 255, 0, 0.08));
}

/* ---------- injected by JS: the sliding pill ---------- */
.bottom-nav .nav-pill {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  pointer-events: none;
  will-change: transform;
  background:
    linear-gradient(180deg, rgba(198, 255, 0, 0.16), rgba(198, 255, 0, 0.02) 70%),
    #1b0f45;
  border: 1px solid rgba(198, 255, 0, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 22px rgba(198, 255, 0, 0.30),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

/* ---------- items ---------- */
.bottom-nav-item {
  --lift: 9px;
  --ico-scale: 1.1;

  position: relative;
  pointer-events: auto;
  appearance: none;
  min-width: 0;
  height: 64px;                  /* = BAR_H */
  margin: 0;
  padding: 0;

  border: 0;
  background: none;
  color: var(--muted);
  font-family: 'DM Sans', 'Noto Sans Myanmar', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;

  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: color 0.25s ease;
}

.bottom-nav-item[data-page="home"] { --lift: 11px; --ico-scale: 1.2; }

.bottom-nav-item:focus-visible::before {
  content: '';
  position: absolute;
  inset: 4px 2px;
  border-radius: 18px;
  box-shadow: 0 0 0 2px rgba(198, 255, 0, 0.7);
}

.bottom-nav-item i {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item span {
  line-height: 12px;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* indicator dot under every item */
.bottom-nav-item::after {
  content: '';
  width: 4px;
  height: 4px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.3s ease, box-shadow 0.3s ease, width 0.4s ease, border-radius 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .bottom-nav-item:not(.active):hover { color: #cfc9e8; }
}
.bottom-nav-item:not(.active):active i { transform: scale(0.9); }

/* ---------- active ---------- */
.bottom-nav-item.active { color: var(--lime); }
.bottom-nav-item.active i    { transform: translateY(calc(var(--lift) * -1)) scale(var(--ico-scale)); }
.bottom-nav-item.active span { transform: translateY(calc(var(--lift) * -1)); }
.bottom-nav-item.active::after {
  width: 16px;
  border-radius: 3px;
  background: var(--lime);
  box-shadow: 0 0 10px 2px rgba(198, 255, 0, 0.65);
}

/* ---------- View Transitions: keep the page fade, never ghost the bar ---------- */
::view-transition-group(bottom-nav) { animation: none; }
::view-transition-old(bottom-nav)   { display: none; }
::view-transition-new(bottom-nav)   { animation: none; }

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .bottom-nav-item,
  .bottom-nav-item i,
  .bottom-nav-item span,
  .bottom-nav-item::after { transition-duration: 0.01ms; }
}

/* ---------- mobile only + keep page content clear of the bar ---------- */
/* 768px is a guess: use the breakpoint style.css uses for the mobile layout */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
}
@media (max-width: 768px) {
  body {
    padding-bottom: calc(94px + 12px + env(safe-area-inset-bottom, 0px) + 16px);
  }
}