.home-categories {
  padding: clamp(36px, 4vw, 56px) 0;
  color: #24143f;
  background: radial-gradient(ellipse at 15% 0%, #faf1ff 0%, transparent 65%), #eee5fa;
}

.home-categories .section-header {
  margin-bottom: clamp(28px, 3vw, 42px);
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.3vw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-category-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-category-grid[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-category-grid li { min-width: 0; }
@media (min-width: 701px) {
  .home-category-grid[data-count="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-category-grid[data-count="5"] li { grid-column: span 2; }
  .home-category-grid[data-count="5"] li:nth-last-child(-n+2) { grid-column: span 3; }
}

.home-category-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 10px;
  min-height: 190px;
  height: 100%;
  padding: clamp(12px, 1.4vw, 18px);
  overflow: hidden;
  border: 1px solid rgba(84, 39, 131, .24);
  border-radius: 18px;
  color: #fff;
  background: #2e154d;
  box-shadow: 0 8px 20px rgba(53, 25, 86, .14);
  text-decoration: none;
}

.home-category-card .home-category-photo,
.home-category-card::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-category-card .home-category-photo {
  z-index: -2;
  object-fit: cover;
  object-position: center 44%;
  transition: transform .35s ease;
}

.home-category-card::before {
  content: "";
  z-index: -1;
  background: linear-gradient(0deg, rgba(25, 7, 50, .96) 0%, rgba(46, 16, 78, .72) 31%, rgba(64, 29, 103, .12) 72%);
}

.home-category-card .home-category-icon,
.home-category-card .home-category-arrow {
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 225, 255, .48);
  border-radius: 50%;
  color: #fff;
  background: rgba(29, 8, 57, .64);
  line-height: 1;
}

.home-category-card .home-category-icon {
  width: 34px;
  height: 34px;
  align-self: start;
  grid-column: 1 / -1;
  font-size: 16px;
}

.home-category-card .home-category-arrow { width: 26px; height: 26px; font-size: 14px; }

.home-category-card .home-category-name {
  font: 650 clamp(20px, 2.2vw, 27px)/1.02 "Cormorant Garamond", Georgia, serif;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 4px rgba(19, 3, 35, .65);
}

.home-category-card:focus-visible { outline: 2px solid #6525ce; outline-offset: 3px; }
.home-category-card:hover { color: #fff; border-color: #9b66dd; }
.home-category-card:hover .home-category-photo { transform: scale(1.055); }

@media (max-width: 700px) {
  .home-category-grid, .home-category-grid[data-count] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-category-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .home-category-card { min-height: 150px; padding: 12px; border-radius: 15px; }
  .home-category-card .home-category-icon { grid-area: 1 / 1; }
  .home-category-card .home-category-arrow { grid-area: 2 / 2; align-self: end; }
  .home-category-card .home-category-name {
    grid-area: 2 / 1;
    font-size: clamp(16px, 4.7vw, 22px);
    hyphens: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-category-card .home-category-photo { transition: none; }
  .home-category-card:hover .home-category-photo { transform: none; }
}
