#cat-sec {
  padding-block: clamp(44px, 5.5vw, 84px);
  background:
    radial-gradient(ellipse at 8% 0%, #cde8ff 0%, transparent 53%),
    radial-gradient(ellipse at 100% 100%, #cfe9ff 0%, transparent 58%),
    #eef8ff;
}

#cat-sec .sec-top {
  margin-bottom: clamp(22px, 3vw, 38px);
}

#cat-sec .sec-link {
  gap: 10px;
  padding: 10px 16px;
  color: #0754b3;
  background: #ffffffcf;
  border: 1px solid #c5e0fa;
  border-radius: 999px;
}

#cat-sec .cat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 20px);
}

#cat-sec .cat-card {
  position: relative;
  min-width: 0;
  min-height: 152px;
  padding: 12px 18px 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d3e5f7;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff 37%, #f2f8ff);
  box-shadow: 0 8px 22px #184f8f0c;
  text-align: start;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#cat-sec .cat-card::after {
  content: "";
  position: absolute;
  inset-inline-end: 18px;
  bottom: 22px;
  width: 7px;
  height: 7px;
  border-top: 2px solid #3676ba;
  border-right: 2px solid #3676ba;
  transform: rotate(45deg);
}

#cat-sec .cat-card:hover {
  border-color: #91c9ff;
  box-shadow: 0 12px 26px #184f8f18;
  transform: translateY(-3px);
}

#cat-sec .cat-card:focus-visible,
#cat-sec .sec-link:focus-visible {
  outline: 2px solid #0068ed;
  outline-offset: 3px;
}

#cat-sec .cat-name {
  min-width: 0;
  padding-inline-end: 14px;
  font-size: clamp(.92rem, 1.1vw, 1.07rem);
  font-weight: 750;
  line-height: 1.25;
  color: #10254b;
}

#cat-sec .direction-art {
  display: block;
  width: 94px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 22px;
  background-color: var(--art-color, #eaf5ff);
  background-image: url("home-direction-icons.png");
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: var(--art-x, 0%) var(--art-y, 0%);
}

#cat-sec .direction-tech { --art-x: 33.333%; --art-color: #e8f8ff; }
#cat-sec .direction-business { --art-x: 66.667%; --art-color: #fff5e1; }
#cat-sec .direction-community { --art-x: 100%; --art-color: #e5faf4; }
#cat-sec .direction-culture { --art-y: 100%; --art-color: #f3edff; }
#cat-sec .direction-sport { --art-x: 33.333%; --art-y: 100%; --art-color: #fff5e1; }
#cat-sec .direction-science { --art-x: 66.667%; --art-y: 100%; --art-color: #e2f8fc; }
#cat-sec .direction-media { --art-x: 100%; --art-y: 100%; --art-color: #eeefff; }

@media (max-width: 960px) {
  #cat-sec .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  #cat-sec .sec-top { align-items: flex-start; flex-direction: column; gap: 12px; }
  #cat-sec .cat-card { min-height: 126px; padding: 10px 12px 13px; border-radius: 16px; }
  #cat-sec .cat-card::after { inset-inline-end: 12px; bottom: 17px; }
  #cat-sec .direction-art { width: 72px; border-radius: 16px; }
  #cat-sec .cat-name { font-size: .87rem; }
}

@media (prefers-reduced-motion: reduce) {
  #cat-sec .cat-card { transition: none; }
  #cat-sec .cat-card:hover { transform: none; }
}
