section.projects .categories ul:has(.project-category-link) {
  gap: 12px;
}

section.projects .categories .project-category-link {
  --project-category-size: 52px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--project-category-size);
  height: var(--project-category-size);
  padding: 0;
  isolation: isolate;
  text-decoration: none;
  transition: none;
}

section.projects .categories a.project-category-link:is(:hover, :focus) {
  text-decoration: none;
  text-shadow: none;
}

.project-category-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: var(--project-category-size);
  height: var(--project-category-size);
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
}

.project-category-link img {
  display: block;
  filter: invert(1);
}

.project-category-link:is(:hover, :focus-visible)::before {
  background: rgb(255 255 255 / 28%);
}

.project-category-link[aria-current="page"]::before {
  background: #fff;
}

.project-category-link[aria-current="page"] img {
  filter: none;
}

.project-category-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 50%;
}

.project-category-label {
  position: absolute;
  inset-inline-start: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  visibility: hidden;
  padding: 4px 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.project-category-link:is(:hover, :focus-visible) {
  z-index: 1;
}

.project-category-link:is(:hover, :focus-visible) .project-category-label {
  visibility: visible;
}

@media (width < 1200px) {
  section.projects .categories ul:has(.project-category-link) {
    justify-content: center;
  }

  .project-category-label {
    inset-inline-start: 0;
    top: calc(100% + 4px);
    transform: none;
  }

  .categories li:nth-last-child(-n + 2) .project-category-label {
    inset-inline: auto 0;
  }
}

@media (width < 338px) {
  section.projects .categories > .container:has(.project-category-link) {
    padding-inline: 6px;
  }
}
