/* ==========================================================================
   Home Tools — секция перелинковки с главной на инструменты
   (Удаление фона / Улучшение качества / Каталог нейросетей)
   Премиум-стиль: высокие карточки 3:4, фото на всю карточку, текст снизу
   поверх градиентного затемнения. Палитра страниц /models и /account:
   violet #8b5cf6 → magenta #ec4899 → cyan #22d3ee.
   Desktop: 3 карточки в ряд. Mobile: свайп-карусель + точки-индикаторы.
   ========================================================================== */

.home-tools { position: relative; }
.home-tools .section-header { margin-bottom: 34px; }
.home-tools .ht-accent {
  background: linear-gradient(115deg, #a855f7 0%, #ec4899 52%, #22d3ee 112%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 24px rgba(236, 72, 153, .3));
}

/* ---- Трек карточек ---- */
.ht-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---- Карточка (настоящая ссылка <a>) ---- */
.ht-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: #f1f5f9;
  background: #0f1b32;
  border: 1px solid rgba(139, 92, 246, .20);
  box-shadow: 0 18px 50px rgba(8, 10, 20, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .32s cubic-bezier(.2, .7, .3, 1), box-shadow .32s ease, border-color .32s ease;
  isolation: isolate;
}
.ht-card:hover {
  transform: translateY(-8px);
  border-color: rgba(236, 72, 153, .55);
  box-shadow: 0 28px 70px rgba(8, 10, 20, .6), 0 0 0 1px rgba(236, 72, 153, .4), 0 20px 55px rgba(236, 72, 153, .22);
}
.ht-card:focus-visible {
  outline: none;
  border-color: rgba(34, 211, 238, .65);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .4);
}

/* ---- Медиа (фото на всю карточку) ---- */
.ht-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0f1b32;
}
.ht-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}
.ht-card:hover .ht-card__img { transform: scale(1.07); }
/* градиент-затемнение снизу — чтобы текст читался поверх фото */
.ht-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 11, 20, 0) 30%,
    rgba(8, 11, 20, .35) 54%,
    rgba(8, 11, 20, .78) 80%,
    rgba(8, 11, 20, .95) 100%
  );
  pointer-events: none;
}

/* ---- Бейдж ---- */
.ht-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 8px 22px rgba(236, 72, 153, .45);
  white-space: nowrap;
}

/* ---- Текстовая часть (абсолютом прижата к низу) ---- */
.ht-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 22px 24px 24px;
}
.ht-card__title {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
}
.ht-card__desc {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #dbe2ee;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
  /* описание проявляется плавно на hover, в покое — компактно */
  max-height: 4.2em;
  overflow: hidden;
}
.ht-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s ease, border-color .25s ease, gap .2s ease;
}
.ht-card__cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.ht-card:hover .ht-card__cta {
  gap: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  border-color: transparent;
}
.ht-card:hover .ht-card__cta svg { transform: translateX(3px); }

/* ---- Точки-индикаторы (только мобайл) ---- */
.ht-dots { display: none; }

/* ==========================================================================
   Mobile ≤768px — свайп-карусель
   ========================================================================== */
@media (max-width: 768px) {
  .ht-track {
    display: flex;
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 4px 4px 6px;
    margin: 0 -4px;
    scrollbar-width: none;
  }
  .ht-track::-webkit-scrollbar { display: none; }
  .ht-card {
    flex: 0 0 76%;
    max-width: 360px;
    scroll-snap-align: center;
  }
  .ht-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
  }
  .ht-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(148, 163, 184, .35);
    transition: width .25s ease, background .25s ease;
  }
  .ht-dot.is-active {
    width: 24px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
  }
}

@media (max-width: 480px) {
  .ht-card { flex-basis: 82%; }
  .ht-card__title { font-size: 21px; }
  .ht-card__body { padding: 20px 20px 22px; }
}

/* ---- Доступность: уменьшенная анимация ---- */
@media (prefers-reduced-motion: reduce) {
  .ht-card, .ht-card__img, .ht-card__cta, .ht-card__cta svg, .ht-dot { transition: none !important; }
  .ht-card:hover { transform: none; }
  .ht-card:hover .ht-card__img { transform: none; }
  .ht-track { scroll-behavior: auto; }
}

