/* === CASES (КЕЙСЫ) — СЛАЙДЕР + МОДАЛКА =============================== */

/* ГЛАВНЫЕ НАСТРОЙКИ РАЗМЕРОВ (МЕНЯЕШЬ ТОЛЬКО ЗДЕСЬ)
   ------------------------------------------------------------------
   1) ВЫСОТА КАРТОЧКИ КЕЙСА       ->  height: 320px;
   2) "ВЫСОТА ОКНА" СЛАЙДЕРА      ->  padding: 32px 80px; (32px сверху/снизу)
*/

.section.section--cases {
  position: relative;
  overflow: visible; /* не режем анимацию сверху/снизу */
}

.section.section--cases .container {
  overflow: visible; /* на всякий случай, если в style.css стоит overflow: hidden */
}

/* ================= СЛАЙДЕР КЕЙСОВ ================= */

/* ОКНО СЛАЙДЕРА (фон, в котором лежат кейсы)
   НАСТРОЙКА "ВЫСОТЫ ОКНА" — ЭТО ВЕРХНИЙ/НИЖНИЙ PADDING */
.section.section--cases .cases-slider {
  position: relative;
  padding: 32px 80px; /* 32px сверху/снизу, 80px слева/справа под стрелки */
}

/* Вьюпорт: по горизонтали прячем лишнее, по вертикали — нет */
.section.section--cases .cases-slider__viewport {
  position: relative;

  /* вместо overflow-x/overflow-y */
  overflow: hidden;

  /* безопасная зона для анимации и свечения */
  padding: 42px 16px;

  /* чтобы визуальные размеры не изменились */
  margin: -12px -16px;
}



/* Лента с карточками */
.section.section--cases .cases-slider__track {
  display: flex;
  align-items: stretch;
  gap: 24px;
  will-change: transform;
  transition: transform 0.4s ease;
}

/* Карточка кейса
   НАСТРОЙКА "ВЫСОТЫ КАРТОЧКИ" — ПАРАМЕТР height: 320px; */
.section.section--cases .case-card {
  position: relative;
  flex: 0 0 calc(33.333% - 16px); /* три карточки в ряд на десктопе */
  height: 320px;                  /* <<< ВЫСОТА КАРТОЧКИ КЕЙСА */
  border-radius: 22px;
  overflow: hidden;
  background-size: 102% auto;
  /* базовая тень под карточкой */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;

  /* отключаем глобальную «плавающую» анимацию из custom.css */
  animation: none;

  transform: translate3d(0, 0, 0);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease,
    transform 0.25s ease;
}

/* Внутренний слой с текстом — БЕЗ тонирования картинки */
.section.section--cases .case-card__overlay {
  position: absolute;
  inset: 0;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;

  background: none !important;
  backdrop-filter: none !important;
}

/* Заголовок, подзаголовок, список */
.section.section--cases .case-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.section.section--cases .case-card p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted, #94a3b8);
}

.section.section--cases .case-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted, #94a3b8);
}

.section.section--cases .case-card ul li + li {
  margin-top: 3px;
}

/* Ховер: мягкое свечение, обводка, подпрыгивание/дрожание */
.section.section--cases .case-card:hover,
.section.section--cases .case-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
  animation: caseCardHover 2.4s ease-out infinite;

  /* при наведении убираем тень, остаётся только свечение */
  box-shadow: none;
}

.section.section--cases .case-card:active {
  transform: translate3d(0, -2px, 0) scale(0.99);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
}

/* Анимация подпрыгивания и дрожания — амплитуда подобрана,
   чтобы карточку НЕ РЕЗАЛО краями окна при текущей высоте/паддингах */
@keyframes caseCardHover {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  20%  { transform: translate3d(-1px, -4px, 0) scale(1.012) rotate(-0.12deg); }
  40%  { transform: translate3d(1px, -3px, 0)  scale(1.01)  rotate(0.12deg); }
  60%  { transform: translate3d(-1px, -5px, 0) scale(1.015) rotate(-0.08deg); }
  80%  { transform: translate3d(0, -3px, 0)   scale(1.01); }
  100% { transform: translate3d(0, 0, 0)      scale(1); }
}

/* ================= СТРЕЛКИ СЛАЙДЕРА ================= */

/* Общий стиль кнопок */
.section.section--cases .cases-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

/* Левая и правая кнопки — чуть отодвигаем от карточек */
.section.section--cases .cases-slider__btn--prev {
  left: 18px;
}

.section.section--cases .cases-slider__btn--next {
  right: 18px;
}

/* Сам «уголок» стрелки (по умолчанию — вправо) */
.section.section--cases .cases-slider__btn span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;   /* классическая "галка" ↘ */
  transform: rotate(-45deg);   /* базово: стрелка вправо (→) */
}

/* Для левой стрелки разворачиваем уголок влево */
.section.section--cases .cases-slider__btn--prev span {
  transform: rotate(135deg);   /* стрелка влево (←) */
}

/* Ховер/фокус по стрелкам */
.section.section--cases .cases-slider__btn:hover {
  transform: translateY(-50%) translateY(-1px);
  border-color: rgba(248, 250, 252, 0.9);
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
}

.section.section--cases .cases-slider__btn:active {
  transform: translateY(-50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.8);
}

.section.section--cases .cases-slider__btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(248, 250, 252, 0.8),
    0 0 0 3px rgba(251, 146, 60, 0.8);
}

/* На мобильных стрелки убираем — остаётся свайп */
@media (max-width: 768px) {
  .section.section--cases .cases-slider {
    padding: 16px;
  }

  .section.section--cases .cases-slider__btn {
    display: none;
  }
}

/* ================= МОДАЛЬНОЕ ОКНО КЕЙСА ================= */

.case-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
  z-index: 50;
}

.case-modal--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.case-modal__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.78), rgba(3, 7, 18, 0.96));
}

/* Карточка внутри модалки */
.case-modal__dialog {
  position: relative;
  max-width: 1040px;
  width: 100%;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 0 0, rgba(248, 250, 252, 0.08), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.16), transparent 55%),
    rgba(4, 7, 16, 0.98);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.96),
    0 0 40px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.case-modal__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  min-height: 420px;
}

/* Левая часть — картинка */
.case-modal__image {
  position: relative;
  background-size: 102% auto;
  background-position: center;
  min-height: 260px;
}

.case-modal__image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(248, 250, 252, 0.18), transparent 60%);
  mix-blend-mode: screen;
}

/* Правая часть — текст */
.case-modal__content {
  position: relative;
  padding: 28px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-modal__eyebrow {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(148, 163, 184, 0.9);
}

.case-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}

.case-modal__meta {
  margin: 0;
  font-size: 14px;
  color: rgba(148, 163, 184, 0.95);
}

.case-modal__text {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.96);
}

.case-modal__text p {
  margin: 0 0 10px;
}

.case-modal__text ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.case-modal__text li + li {
  margin-top: 4px;
}

/* Кнопки внизу модалки */
.case-modal__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.case-modal__btn-primary,
.case-modal__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.case-modal__btn-primary {
  background: linear-gradient(115deg, #ff8f2b, #ff4e1c);
  color: #050816;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.95),
    0 0 24px rgba(255, 143, 43, 0.55);
}

.case-modal__btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.98),
    0 0 26px rgba(255, 143, 43, 0.7);
}

.case-modal__btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(255, 143, 43, 0.55);
}

.case-modal__btn-secondary {
  background: rgba(15, 23, 42, 0.7);
  color: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.45);
}

.case-modal__btn-secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* Кнопка закрытия */
.case-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.case-modal__close:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.85);
  border-color: rgba(248, 250, 252, 0.8);
  background: rgba(15, 23, 42, 0.98);
}

.case-modal__close:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.8);
}

.case-modal__close-line {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
}

.case-modal__close-line:first-child {
  transform: rotate(45deg);
}

.case-modal__close-line:last-child {
  transform: rotate(-45deg);
}

/* ================= АДАПТИВ ================= */

@media (max-width: 1024px) {
  .section.section--cases .case-card {
    flex: 0 0 calc(50% - 12px);
    height: 300px;
  }
}

@media (max-width: 768px) {
  .case-modal__body {
    grid-template-columns: 1fr;
  }

  .case-modal__image {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .section.section--cases .case-card {
    flex: 0 0 100%;
    height: 260px;
  }
}
.section.section--cases .case-card__overlay .case-card__stats li {
  color: #ff7a00 !important;
  font-weight: 600;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}


