.planet-home .planet-shell {
  --catalog-inset: calc(clamp(16px, 2vw, 24px) + 1px);
  --category-line: #d3d3d3;
  --category-current-line: #5b58fb;
}

.dark .planet-home .planet-shell {
  --category-line: #53545e;
  --category-current-line: #a19eff;
}

:root:not(.dark) .planet-home[data-v-c5514d7d] {
  background: linear-gradient(100deg, #f4f7fd 20%, #f8f8fb 58%, #fdf7f2);
}

.planet-home .planet-shell > .categories {
  margin: clamp(14px, 2vw, 26px) var(--catalog-inset) 0;
  border: 0;
  scroll-padding-inline: 6px;
}

.planet-home .planet-shell > section.catalog {
  margin-top: 40px;
  padding: 0 var(--catalog-inset) clamp(16px, 2vw, 24px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.planet-home .categories .category-rail {
  position: relative;
  width: max-content;
  min-width: 0;
  gap: 0;
  justify-content: flex-start;
}

.planet-home .categories .category-rail::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background-color: var(--category-line);
  pointer-events: none;
}

.planet-home .planet-shell > .categories .category {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: clamp(112px, 15.625vw, 160px);
  height: 125px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 74px 21px;
  align-content: start;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 0;
  border: 0;
  background: transparent;
  color: var(--color-foreground);
  font-size: 16px;
  line-height: 21px;
}

.planet-home .categories .category[aria-current="page"] {
  color: var(--color-foreground);
  font-weight: 400;
}

.planet-home .categories .category[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--category-current-line);
  pointer-events: none;
}

@media (hover: hover) {
  .planet-home .categories .category:hover {
    color: var(--color-primary);
  }
}

.planet-home .categories .category:focus-visible {
  outline: none;
  text-decoration: underline 2px;
  text-underline-offset: 4px;
}

.planet-home .categories .category-icon {
  width: 120px;
  max-width: 100%;
}

/* Feather the baked-in backdrop of the uploaded 120 × 74 category artwork.
   The artwork keeps its original colours in the middle of each image. */
.planet-home .categories .category-icon img {
  mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent),
              linear-gradient(to bottom, transparent, black 12%, black 79%, transparent);
  mask-composite: intersect;
}

:root:not(.dark) .planet-home .categories .category-icon img {
  mix-blend-mode: darken;
}

.dark .planet-home .categories .category-icon img {
  filter: url("#sat33-category-ink");
}

@media (max-width: 700px) {
  .planet-home .planet-shell {
    --catalog-inset: 12px;
  }

  .planet-home .planet-shell > section.catalog {
    margin-top: 20px;
    padding-bottom: 11px;
  }

  .planet-home .categories .category-rail {
    min-width: 100%;
  }

  .planet-home .planet-shell > .categories .category {
    flex: 1 0 60px;
    width: 60px;
    min-width: 0;
    height: 86px;
    grid-template-rows: 48px 20px;
    row-gap: 4px;
    padding: 4px 0 0;
    font-size: 14px;
    line-height: 20px;
  }

  .planet-home .categories .category-icon {
    width: 80px;
    height: 48px;
  }
}


.planet-home .planet-shell > .categories {
  --category-min-width: 112px;
  overscroll-behavior-x: contain;
}

.planet-home .planet-shell > .categories[lang|="en"] {
  --category-min-width: 132px;
}

.planet-home .planet-shell > .categories .category-rail {
  /* Use the available width unless the visible links need more room. */
  width: max(100%, calc(var(--home-category-count, 1) * var(--category-min-width)));
}

.planet-home .planet-shell > .categories .category {
  flex: 1 0 0;
  width: auto;
  min-width: var(--category-min-width);
  overflow: hidden;
}

.planet-home .categories .category-shortcut .category-icon img {
  width: 72px;
  height: 72px;
  mask-image: none;
  mix-blend-mode: normal;
  filter: none;
}

@media (max-width: 700px) {
  .planet-home .planet-shell > .categories {
    --category-min-width: clamp(70px, 20vw, 104px);
  }

  .planet-home .planet-shell > .categories[lang|="en"] {
    --category-min-width: max(92px, 20vw);
  }

  .planet-home .planet-shell > .categories .category {
    font-size: 14px;
  }

  .planet-home .categories .category-shortcut .category-icon img {
    width: 48px;
    height: 48px;
    max-width: 100%;
  }
}

@media (max-width: 700px), (max-width: 1023px) and (pointer: coarse) {
  .planet-home .planet-shell > .categories {
    scroll-padding-inline: 0;
    scroll-snap-type: x proximity;
  }

  .planet-home .planet-shell > .categories .category-rail {
    width: max(100%, calc(100% * var(--home-category-count, 5) / 5));
  }

  .planet-home .planet-shell > .categories .category {
    min-width: 0;
    min-height: 86px;
    height: auto;
    grid-template-rows: 48px minmax(20px, auto);
    gap: 4px;
    padding: 4px 2px 6px;
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    scroll-snap-align: start;
  }

  .planet-home .categories .category-icon {
    width: 80px;
    height: 48px;
  }

  .planet-home .categories .category-shortcut .category-icon img {
    width: 48px;
    height: 48px;
    max-width: 100%;
  }
}


.planet-home .planet-shell > .categories {
  --category-art-edge: 48px;
}

.planet-home .categories .category-icon {
  position: relative;
  width: var(--category-art-edge);
  height: var(--category-art-edge);
  aspect-ratio: 1;
}

.planet-home .categories .category-icon > svg {
  width: var(--category-art-edge);
  height: var(--category-art-edge);
}

.planet-home .categories .category-icon > img,
.planet-home .categories .category-shortcut .category-icon > img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--category-image-edge, var(--category-art-edge));
  height: var(--category-image-edge, var(--category-art-edge));
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

/* The two older images include opaque backgrounds and have different internal margins. */
.planet-home .categories .category-icon > img[src$="/b06ab533-15c9-4be6-8a50-8e6b0a1f6caa.png"] {
  --category-image-edge: 90px;
}

.planet-home .categories .category-icon > img[src$="/b9f3f1b5-17c5-4bf0-9af7-7b2df309073a.png"] {
  --category-image-edge: 104px;
}

/* The current AI and social PNGs use the same transparent canvas from the asset export. */
.planet-home .categories .category[href="/categories/ai"] .category-icon > img,
.planet-home .categories .category[href="/categories/video"] .category-icon > img:not([src$="/b9f3f1b5-17c5-4bf0-9af7-7b2df309073a.png"]) {
  --category-image-edge: 92px;
  mask-image: none;
  mix-blend-mode: normal;
  filter: none;
}

.planet-home .categories .category-shortcut .category-icon > img {
  --category-image-edge: 58px;
}
