body.categories-page {
  background: radial-gradient(circle at 20% 15%, rgba(34, 55, 107, 0.6), rgba(4, 6, 15, 0.95));
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100vh;
  color: #f7f7fb;
}

.categories-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.categories-hero {
  text-align: center;
  padding: 20px 0 10px;
}

.categories-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 13px;
  color: rgba(247, 247, 251, 0.7);
  margin-bottom: 12px;
}

.categories-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 10px;
}

.categories-hero .lead {
  max-width: 640px;
  margin: 0 auto;
  color: rgba(247, 247, 251, 0.8);
  line-height: 1.6;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.categories-empty {
  text-align: center;
  grid-column: 1 / -1;
  color: rgba(247, 247, 251, 0.75);
  font-size: 1.1rem;
  padding: 40px 0;
}

.category-card {
  background: rgba(9, 12, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.category-card__media {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: rgba(9, 12, 24, 0.6);
}

.category-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover .category-card__media img,
.category-card:focus-within .category-card__media img {
  transform: scale(1.05);
}

.category-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.category-card__body h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #fff;
}

.category-card__description {
  position: relative;
  max-height: 170px;
  overflow-y: auto;
  line-height: 1.5;
  color: rgba(247, 247, 251, 0.82);
  padding-right: 6px;
  font-size: 0.98rem;
  --cat-desc-fade: 22px;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 1) var(--cat-desc-fade),
    rgba(0, 0, 0, 1) calc(100% - var(--cat-desc-fade)),
    transparent
  );
  mask-image: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 1) var(--cat-desc-fade),
    rgba(0, 0, 0, 1) calc(100% - var(--cat-desc-fade)),
    transparent
  );
  transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
}

.category-card__description.is-at-top {
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 1) calc(100% - var(--cat-desc-fade)),
    transparent
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 1) calc(100% - var(--cat-desc-fade)),
    transparent
  );
}

.category-card__description.is-at-bottom {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 1) var(--cat-desc-fade),
    rgba(0, 0, 0, 1)
  );
  mask-image: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 1) var(--cat-desc-fade),
    rgba(0, 0, 0, 1)
  );
}

.category-card__description.is-at-top.is-at-bottom {
  -webkit-mask-image: none;
  mask-image: none;
}

.category-card__description p {
  margin: 0 0 10px;
}

.category-card__description p:last-child {
  margin-bottom: 0;
}

.category-card__cta {
  align-self: center;
  margin-top: auto;
  padding: 12px 32px;
  width: 240px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background-image: linear-gradient(125deg, rgba(39, 240, 201, 0.9), rgba(110, 64, 255, 0.85));
  color: #10121c;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 25px rgba(20, 19, 30, 0.35);
}

.category-card__cta:hover,
.category-card__cta:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 15px 35px rgba(39, 240, 201, 0.3);
}

.category-card__cta:focus-visible {
  outline: 2px solid rgba(39, 240, 201, 0.7);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .categories-grid {
    gap: 18px;
  }

  .category-card__body {
    padding: 18px;
  }

  .category-card__cta {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .categories-main {
    padding: 30px 18px 60px;
  }
}
