/* ============================================================
   improvements.css — overlay polish on top of bundled CSS
   Не трогаем bundle, только улучшаем существующее.
   ============================================================ */

:root {
  --imp-accent: #d4a574;
  --imp-accent-soft: rgba(212, 165, 116, 0.18);
  --imp-accent-glow: rgba(212, 165, 116, 0.45);
  --imp-bg-deep: #0a0908;
  --imp-bg-card: rgba(28, 25, 23, 0.7);
  --imp-border: rgba(255, 255, 255, 0.08);
  --imp-border-hot: rgba(212, 165, 116, 0.35);
  --imp-text-soft: rgba(255, 255, 255, 0.72);
  --imp-radius: 18px;
  --imp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Smooth scrolling + focus visibility ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
*:focus-visible {
  outline: 2px solid var(--imp-accent) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

/* ---------- Scroll-reveal animation ---------- */
.imp-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--imp-ease), transform 0.9s var(--imp-ease);
  will-change: opacity, transform;
}
.imp-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.imp-reveal[data-delay="1"] { transition-delay: 0.08s; }
.imp-reveal[data-delay="2"] { transition-delay: 0.16s; }
.imp-reveal[data-delay="3"] { transition-delay: 0.24s; }
.imp-reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ---------- Универсальная feature-card подстройка ---------- */
/* Карточки преимуществ / шагов / инфраструктуры */
.imp-card {
  position: relative;
  isolation: isolate;
  transition:
    transform 0.5s var(--imp-ease),
    border-color 0.5s var(--imp-ease),
    box-shadow 0.5s var(--imp-ease),
    background 0.5s var(--imp-ease);
}
.imp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(212, 165, 116, 0) 0%,
    rgba(212, 165, 116, 0.5) 50%,
    rgba(212, 165, 116, 0) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s var(--imp-ease);
  pointer-events: none;
  z-index: 1;
}
.imp-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 60px -20px rgba(212, 165, 116, 0.25),
    0 0 0 1px rgba(212, 165, 116, 0.18);
}
.imp-card:hover::before { opacity: 1; }

/* ---------- Галерея: облагораживаем изображения ---------- */
.imp-gallery-img {
  overflow: hidden;
  border-radius: var(--imp-radius);
  position: relative;
  transition:
    transform 0.6s var(--imp-ease),
    box-shadow 0.6s var(--imp-ease);
  will-change: transform;
}

/* Фикс: в большой галерее «Примеры обработки» картинки example-1/2
   шли с object-fit:fill и фиксированной высотой 186px,
   из-за чего нижняя половина карточки 376px оставалась пустой.
   Растягиваем img на всю карточку с правильным cover. */
.imp-gallery-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}
/* Карточкам галереи задаём минимальную высоту, чтобы они не схлопывались
   когда img внутри теряет фиксированную высоту */
.imp-gallery-img {
  min-height: 100%;
}
.imp-gallery-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--imp-ease);
}
.imp-gallery-img img {
  transition: transform 1.1s var(--imp-ease), filter 0.6s var(--imp-ease);
  will-change: transform;
}
.imp-gallery-img:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow:
    0 30px 80px -30px rgba(212, 165, 116, 0.35),
    0 0 0 1px rgba(212, 165, 116, 0.2);
}
.imp-gallery-img:hover img {
  transform: scale(1.06);
  filter: saturate(1.15) contrast(1.04);
}
.imp-gallery-img:hover::after { opacity: 1; }

/* ---------- CTA: glow-pulse у "Перейти в нейросеть" ---------- */
.imp-cta-glow {
  position: relative;
  isolation: isolate;
}
.imp-cta-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%,
    rgba(212, 165, 116, 0.55) 0%,
    rgba(212, 165, 116, 0) 70%);
  filter: blur(14px);
  opacity: 0.4;
  z-index: -1;
  animation: impPulse 2.8s var(--imp-ease) infinite;
}
@keyframes impPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.08); }
}

/* ---------- CTA-пара: «На сайте» + «В Telegram» ---------- */
.imp-cta-pair {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.imp-cta-pair > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.imp-cta-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.imp-cta-label {
  display: inline-block;
  vertical-align: middle;
}

/* Secondary (бот) — Telegram-blue */
.imp-cta-secondary {
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 50%, #1C8AC0 100%) !important;
  color: #fff !important;
  border-color: rgba(42, 171, 238, 0.5) !important;
  box-shadow:
    0 10px 28px -10px rgba(42, 171, 238, 0.45),
    0 0 0 1px rgba(42, 171, 238, 0.25);
  transition:
    transform 0.35s var(--imp-ease),
    box-shadow 0.35s var(--imp-ease),
    filter 0.35s var(--imp-ease);
}
.imp-cta-secondary:hover {
  filter: brightness(1.08) saturate(1.05);
  transform: translateY(-2px);
  box-shadow:
    0 18px 40px -12px rgba(42, 171, 238, 0.6),
    0 0 0 1px rgba(42, 171, 238, 0.4);
}
.imp-cta-secondary:active {
  transform: translateY(0);
}

/* Mobile — стек */
@media (max-width: 540px) {
  .imp-cta-pair {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .imp-cta-pair > a {
    width: 100%;
  }
}

/* ---------- Counter (statistic numbers) ---------- */
.imp-counter {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  background: linear-gradient(180deg, #fff 0%, var(--imp-accent) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Connector-линии и step-num badge удалены — ломали layout степов. */

/* ---------- Infrastructure pulse-dot ---------- */
.imp-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: impDotPulse 2s infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes impDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- Tips (Рекомендации по фото) — иконки ---------- */
.imp-tip {
  position: relative;
  transition: transform 0.4s var(--imp-ease);
}
.imp-tip:hover { transform: translateX(4px); }
.imp-tip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--imp-accent);
  box-shadow: 0 0 8px var(--imp-accent-glow);
  margin-right: 12px;
  transform: translateY(-2px);
}

/* Mobile spacing убран — оригинальные отступы работают корректно */

/* ---------- Footer polish ---------- */
footer {
  border-top: 1px solid var(--imp-border);
  margin-top: 32px;
}

/* ---------- Section heading underline accent ---------- */
.imp-heading-accent::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  margin: 18px auto 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--imp-accent) 50%,
    transparent 100%);
}

/* ---------- Image-loading skeleton ---------- */
img {
  background-color: rgba(28, 25, 23, 0.4);
}
