/* A small pill at the bottom of the page: the nav bar, or a back button.
   Self-contained so it can sit on top of any page. */
.nav {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: .15rem;
  padding: .25rem;
  border-radius: 999px;
  background: rgba(28, 33, 39, .72);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  backdrop-filter: blur(10px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 10px 30px rgba(8, 11, 14, .45);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: rgba(232, 236, 239, .66);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}

.nav a::before {
  content: "";
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--dot);
  opacity: .7;
}

.nav a:hover,
.nav a:focus-visible { color: #e8ecef; }

.nav a:focus-visible { outline: 1px solid var(--dot); outline-offset: -2px; }

.nav a[aria-current] { color: #e8ecef; background: rgba(255, 255, 255, .07); }

.nav a[aria-current]::before { opacity: 1; box-shadow: 0 0 10px var(--dot); }

/* the back button swaps the dot for an arrow */
.nav a.back { padding: 0 1.15rem 0 1rem; color: #e8ecef; }

.nav a.back::before {
  content: "\2190";
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: var(--dot);
  opacity: 1;
  font-size: .95rem;
  letter-spacing: 0;
}

@media (max-width: 420px) {
  .nav a { gap: .4rem; padding: 0 .7rem; letter-spacing: .13em; }
}

@media (max-width: 340px) {
  .nav a { padding: 0 .5rem; letter-spacing: .08em; }
  .nav a:not(.back)::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav a { transition: none; }
}
