/* Inward 3D nav bar, shared by every page that uses it */
.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1000;
  width: min(calc(100% - 34px), var(--page-width, 1500px));
  height: 58px;
  padding: 0 9px 0 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  transform: translateX(-50%);
  background: rgba(11, 11, 15, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  clip-path: polygon(0 0, 97% 0, 100% 28%, 100% 100%, 3% 100%, 0 72%);
}

.topbar-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 2;
  pointer-events: none;
}

.mini-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: auto;
  height: 32px;
}

.brand-wordmark {
  width: auto;
  height: 21px;
}

.topbar nav {
  display: flex;
  gap: 28px;
  justify-self: center;
}

.topbar nav a {
  position: relative;
  color: #c7c3cc;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: var(--purple-light, #d86cff);
  transition: right 200ms ease;
}

.topbar nav a:hover,
.topbar nav a:focus-visible,
.topbar nav a.is-current {
  color: var(--purple-light, #d86cff);
}

.topbar nav a:hover::after,
.topbar nav a:focus-visible::after,
.topbar nav a.is-current::after {
  right: 0;
}

.archive-pill {
  justify-self: end;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px 0 18px;
  background: linear-gradient(90deg, var(--purple, #9909ff), #6d15f6);
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  clip-path: polygon(0 0, 92% 0, 100% 28%, 100% 100%, 8% 100%, 0 72%);
  transition: filter 160ms ease;
}

.archive-pill b {
  font-size: 18px;
  line-height: 1;
}

.archive-pill:hover,
.archive-pill:focus-visible {
  filter: brightness(1.2);
}

/* Pages other than the homepage tuck the nav away until the pointer reaches the top */
.topbar[data-autohide] {
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 380ms ease;
}

.topbar[data-autohide]:not(.is-shown) {
  transform: translate(-50%, calc(-100% - 30px));
  opacity: 0;
}

@media (max-width: 1000px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar nav {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    top: 10px;
    width: calc(100% - 18px);
    height: 54px;
  }

  .brand-mark {
    height: 28px;
  }

  .brand-wordmark {
    height: 18px;
  }

  .archive-pill {
    padding: 0 15px;
  }

  .archive-pill span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar[data-autohide] {
    transition: opacity 200ms ease;
  }
}
