.portfolio-project-nav ~ * {
  scroll-margin-bottom: 96px;
}

body:has(.portfolio-project-nav) {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.portfolio-project-nav {
  align-items: center;
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(237, 247, 255, 0.18)),
    rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(126, 147, 176, 0.13);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 14px 42px rgba(55, 92, 126, 0.08);
  color: rgba(31, 39, 52, 0.58);
  display: flex;
  gap: 6px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 7px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 99999;
}

.portfolio-project-nav a {
  --icon-url: url("/nav-icons/icon-home.svg");
  align-items: center;
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  font: 500 0/1 Inter, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
  white-space: nowrap;
  width: 42px;
}

.portfolio-project-nav a::before {
  background: currentColor;
  content: "";
  display: block;
  height: 21px;
  mask: var(--icon-url) center / contain no-repeat;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  width: 21px;
}

.portfolio-project-nav a::after {
  background: rgba(18, 24, 35, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  bottom: calc(100% + 9px);
  box-shadow: 0 10px 26px rgba(20, 32, 52, 0.18);
  color: rgba(255, 255, 255, 0.94);
  content: attr(aria-label);
  font: 500 11px/1 Inter, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  left: 50%;
  letter-spacing: 0.02em;
  opacity: 0;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.portfolio-project-nav a:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.portfolio-project-nav a:hover {
  background: rgba(255, 255, 255, 0.22);
  color: rgba(29, 35, 46, 0.82);
  transform: translateY(-1px);
}

.portfolio-project-nav a[data-kind="home"] {
  --icon-url: url("/nav-icons/icon-home.svg");
}

.portfolio-project-nav a[data-kind="prev"] {
  --icon-url: url("/nav-icons/icon-double_chevron_left.svg");
  background: rgba(255, 255, 255, 0.14);
}

.portfolio-project-nav a[data-kind="next"] {
  --icon-url: url("/nav-icons/icon-double_chevron_right.svg");
  background: rgba(28, 36, 52, 0.2);
  color: rgba(29, 35, 46, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.portfolio-project-nav a[data-kind="next"]:hover {
  background: rgba(58, 132, 255, 0.2);
  color: rgba(24, 80, 190, 0.92);
}

.portfolio-project-nav a[data-kind="top"] {
  --icon-url: url("/nav-icons/icon-back_top.svg");
}

@media (max-width: 720px) {
  .portfolio-project-nav {
    bottom: max(12px, env(safe-area-inset-bottom));
    justify-content: center;
  }

  .portfolio-project-nav a {
    height: 40px;
    width: 40px;
  }
}
