/* Лендинг «Автоматизация для поставщиков и производителей оборудования».
   Вариант v2 «Тёмный герой»: тёмный первый экран с изумрудным свечением и сеткой,
   светлые секции, «остров» статистики на стыке, тёмная CTA-полоса перед футером.
   Без фреймворков и сборщиков. Шрифт Inter (Google Fonts) с системным фолбэком. */

:root {
  /* палитра */
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-tint: #edf3f0;
  --ink: #101b17;
  --muted: #5c6a64;
  --line: #e2e9e5;

  --accent: #0e7a5a;
  --accent-strong: #0a6248;
  --mint: #2fd39b;
  --mint-soft: rgba(47, 211, 155, .12);

  --dark: #0b141d;
  --dark-surface: #0d1723;
  --ink-inverse: #eef5f1;
  --muted-inverse: #94a49d;
  --line-inverse: rgba(255, 255, 255, .09);

  /* геометрия и тени */
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(12, 20, 24, .04), 0 12px 32px rgba(12, 20, 24, .06);
  --shadow-float: 0 24px 64px rgba(12, 20, 24, .14);
  --shadow-mint: 0 10px 30px rgba(47, 211, 155, .32);

  --header-h: 64px;
  --container: 1160px;
}

* { box-sizing: border-box; }

/* Атрибут hidden должен скрывать всегда — иначе display:flex у карточек его перебивает
   (флаги SHOW_BOTS_CARD / SHOW_TESTIMONIAL в index.html полагаются на hidden). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* якоря не прячутся под липкой шапкой */
#products, #cases, #testimonial, #lead, #contacts { scroll-margin-top: calc(var(--header-h) + 16px); }

/* видимый фокус */
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .18s ease;
}

/* основная (светлые секции): глубокий изумруд */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 8px 22px rgba(14, 122, 90, .28);
  transform: translateY(-1px);
}

/* главная на тёмном: яркая мята */
.btn-hero {
  padding: 15px 34px;
  background: linear-gradient(180deg, #3ee0ac, #17bd85);
  color: #06231a;
  font-weight: 700;
  font-size: 1.06rem;
  box-shadow: var(--shadow-mint);
}
.btn-hero:hover {
  background: linear-gradient(180deg, #55e7b7, #1ecf93);
  transform: translateY(-1px);
}

/* второстепенная на тёмном */
.btn-ghost {
  padding: 15px 30px;
  border-color: rgba(255, 255, 255, .22);
  color: var(--ink-inverse);
  font-size: 1.06rem;
  background: rgba(255, 255, 255, .02);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .34);
}

/* компактная в шапке */
.btn-header {
  padding: 9px 20px;
  background: linear-gradient(180deg, #3ee0ac, #17bd85);
  color: #06231a;
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.btn-header:hover { transform: translateY(-1px); box-shadow: var(--shadow-mint); }

/* контурная в карточках */
.btn-card {
  border-color: rgba(14, 122, 90, .38);
  color: var(--accent);
  background: transparent;
}
.btn-card:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ---------- Липкая шапка с блюром ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 20, 29, .78);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line-inverse);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-inverse);
}
.brand-mark { display: block; flex: none; }
.brand-name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 26px;
}
.site-nav a {
  color: rgba(238, 245, 241, .72);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  transition: color .18s ease;
}
.site-nav a:hover { color: #ffffff; }

/* ---------- Первый экран: тёмный, свечение + сетка ---------- */

.hero {
  position: relative;
  background-color: var(--dark);
  background-image:
    radial-gradient(1000px 520px at 72% -140px, rgba(47, 211, 155, .18), transparent 65%),
    radial-gradient(760px 420px at 8% 96%, rgba(47, 211, 155, .07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  color: var(--ink-inverse);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 88px 20px 176px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  padding: 7px 16px;
  border: 1px solid rgba(47, 211, 155, .32);
  border-radius: var(--radius-pill);
  background: rgba(47, 211, 155, .09);
  color: #8ce8c4;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(47, 211, 155, .18);
}

.hero h1 {
  margin: 0 auto 20px;
  max-width: 880px;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: #ffffff;
}

.hero .subtitle {
  margin: 0 auto 36px;
  max-width: 720px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: var(--muted-inverse);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hero-visual {
  position: relative;
  max-width: 900px;
  margin: 64px auto 0;
  border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .45), 0 12px 40px rgba(47, 211, 155, .12);
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -8% -12%;
  background: radial-gradient(closest-side, rgba(47, 211, 155, .14), transparent 70%);
  pointer-events: none;
}
.hero-visual svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

/* ---------- «Остров» статистики на стыке тёмного и светлого ---------- */

.stats { padding: 0 20px; }

.stats-card {
  position: relative;
  z-index: 2;
  max-width: 1060px;
  margin: -96px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 30px 10px;
}

.stat {
  padding: 8px 26px;
  text-align: center;
}
.stat + .stat { border-left: 1px solid var(--line); }

.stat-value {
  display: block;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--accent-strong);
  line-height: 1.15;
  margin-bottom: 6px;
  white-space: nowrap;
}
.stat-label {
  display: block;
  font-size: .85rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Заголовки секций ---------- */

.section-title {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.section-title-inverse { color: #ffffff; }

/* ---------- Карточки продуктов ---------- */

.products {
  max-width: var(--container);
  margin: 0 auto;
  padding: 96px 20px 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 28px 26px;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 122, 90, .28);
  box-shadow: 0 2px 4px rgba(12, 20, 24, .04), 0 20px 44px rgba(14, 122, 90, .12);
}

.card-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 13px;
  background: var(--mint-soft);
  color: var(--accent);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card .offer {
  margin: 0 0 14px;
  font-weight: 600;
  line-height: 1.5;
}
.card ul {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}
.card li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 24px;
  font-size: .95rem;
  color: #33413b;
}
.card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .48em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px var(--mint-soft);
}
.card .ext {
  margin: auto 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--muted);
}
.card .btn { align-self: flex-start; }

/* ---------- Кейсы ---------- */

.cases {
  margin-top: 96px;
  padding: 88px 20px 96px;
  background: var(--surface-tint);
}

.case-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}

.case {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 28px 26px;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.case:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 122, 90, .28);
  box-shadow: 0 2px 4px rgba(12, 20, 24, .04), 0 20px 44px rgba(14, 122, 90, .12);
}

/* пилюля «до → после» */
.case-flip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--mint-soft);
  border: 1px solid rgba(14, 122, 90, .18);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.case-flip svg { color: var(--accent); flex: none; }
.flip-old {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(92, 106, 100, .55);
}

.case h3 {
  margin: 0 0 12px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.case p { margin: 0 0 12px; }
.case-cta { color: var(--muted); font-size: .95rem; }
.case a { color: var(--accent); }
.case-cta a:hover { color: var(--accent-strong); }

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 6px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.pdf-link svg { flex: none; }
.pdf-link:hover { color: var(--accent-strong); text-decoration: underline; }

/* ---------- Отзыв (скрыт флагом) ---------- */

.testimonial {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 20px 0;
}
.testimonial blockquote {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  font-style: italic;
  box-shadow: var(--shadow-card);
}
.testimonial blockquote footer {
  margin-top: 12px;
  font-style: normal;
  color: var(--muted);
}

/* ---------- Финальная CTA-полоса с формой: тёмная, как герой ---------- */

.lead {
  margin-top: 96px;
  background-color: var(--dark);
  background-image:
    radial-gradient(860px 460px at 50% -160px, rgba(47, 211, 155, .16), transparent 65%),
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  border-radius: 40px 40px 0 0;
  overflow: hidden;
}

.lead-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 88px 20px 96px;
}

.lead .section-title { margin-bottom: 14px; }

.lead-note {
  margin: 0 0 36px;
  text-align: center;
  color: var(--muted-inverse);
}

.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 34px 32px 30px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .45);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: .93rem;
}
.req { color: var(--accent); margin-left: 2px; }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
  color: var(--ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 90, .16);
}
.field textarea { resize: vertical; }

#lead-form .btn { width: 100%; padding: 14px 26px; font-size: 1.02rem; }

.form-status {
  margin: 12px 0 0;
  min-height: 1.4em;
  color: #c2402f;
  font-size: .95rem;
}
.form-success {
  margin: 0;
  padding: 16px;
  background: #e8f5ee;
  border: 1px solid #bfe0cf;
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  font-weight: 600;
  text-align: center;
}

/* ---------- Футер: продолжение тёмной полосы, только контакты ---------- */

.footer {
  background: var(--dark);
  border-top: 1px solid var(--line-inverse);
  padding: 30px 20px 40px;
  text-align: center;
  color: var(--muted-inverse);
  font-size: .95rem;
}
.footer p { margin: 0; }
.footer .ph { font-family: inherit; color: var(--ink-inverse); }

/* ==================================================================
   Премиум-полировка: reveal-анимации, живой мокап героя, зерно,
   градиентные рамки карточек, spotlight кейсов, шапка, форма.
   Всё — прогрессивное улучшение: без JS страница полноценна.
   ================================================================== */

/* ---------- Scroll-reveal (скрытие только при включённом JS) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.2, .7, .2, 1), transform .55s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
html.js .reveal.on {
  opacity: 1;
  transform: none;
}
/* карточкам и кейсам проявление отдано однократной анимации (стаггер через
   animation-delay), а transition остаётся штатным — ховер срабатывает сразу
   и плавно, не дожидаясь transition-delay и не наследуя медленный реверс.
   fill-mode backwards: во время задержки держит скрытое состояние, а после
   завершения НЕ фиксирует transform (иначе ховер-подъём был бы заблокирован). */
html.js .card.reveal, html.js .case.reveal {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  transition-delay: 0s;
}
html.js .card.reveal.on, html.js .case.reveal.on {
  animation: reveal-in .55s cubic-bezier(.2, .7, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Появление заголовка героя при загрузке ----------
   Обёртки .h1-w в разметке инертны по умолчанию: становятся overflow-маской
   только при html.js И no-preference. Без JS / при reduced-motion — статично,
   без каких-либо сдвигов макета (анимируются только transform и opacity). */

@media (prefers-reduced-motion: no-preference) {
  html.js .hero h1 .h1-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    /* запас под выносные элементы, компенсирован отрицательными полями */
    padding: .08em .04em .14em;
    margin: -.08em -.04em -.14em;
  }
  html.js .hero h1 .h1-w > span {
    display: inline-block;
    transform: translateY(120%);
    animation: h1-word-up .7s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(.1s + var(--wi, 0) * 90ms);
  }

  /* бейдж и подзаголовок — лёгкий fade со стаггером после заголовка */
  html.js .hero-badge { animation: hero-fade-in .6s ease-out .5s both; }
  html.js .hero .subtitle { animation: hero-fade-in .6s ease-out .68s both; }
}

@keyframes h1-word-up {
  from { transform: translateY(120%); }
  to   { transform: none; }
}
@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Зерно/шум поверх тёмных полос (SVG feTurbulence, data-URI) ---------- */

.hero::after,
.lead::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: .045;
  mix-blend-mode: overlay;
}
.lead { position: relative; }
.lead-inner { position: relative; z-index: 1; }

/* ---------- Плавный стык тёмного героя и светлой секции ----------
   Вместо жёсткой границы: низ героя мягко подсвечивается тоном светлой
   секции, а над стат-островом висит деликатное мятное свечение.
   Стат-остров (z-index: 2) остаётся поверх свечения. */

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 190px;
  background: linear-gradient(180deg,
    transparent,
    rgba(245, 248, 247, .03) 40%,
    rgba(245, 248, 247, .09) 72%,
    rgba(245, 248, 247, .17));
  pointer-events: none;
}

.stats { position: relative; }
.stats::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -190px;
  width: min(920px, 100%);
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(47, 211, 155, .11), transparent 72%);
  pointer-events: none;
}

/* при поддержке scroll-driven animations свечение «довисает» при прокрутке
   через стык: проявляется на входе и мягко приподнимается на выходе.
   Без поддержки (и при reduced-motion) остаётся статичный градиент выше. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stats::before {
      animation: seam-glow linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 70%;
    }
  }
}
@keyframes seam-glow {
  from { opacity: .2; transform: translateX(-50%) translateY(26px); }
  45%  { opacity: 1;  transform: translateX(-50%) translateY(0); }
  to   { opacity: .45; transform: translateX(-50%) translateY(-14px); }
}

/* ---------- Живой мокап в хиро ---------- */

/* строки отчёта проявляются по очереди */
.hv-row {
  animation: hv-row-in .6s ease-out both;
  animation-delay: calc(.25s + var(--i, 0) * 140ms);
}
@keyframes hv-row-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* точки светофора мягко пульсируют */
.hv-dot {
  animation: hv-dot-pulse 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .35s);
}
@keyframes hv-dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* столбики «вырастают» снизу */
.hv-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: hv-bar-grow .7s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(.5s + var(--i, 0) * 90ms);
}
@keyframes hv-bar-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* линия графика прорисовывается (pathLength="1" в разметке) */
.hv-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hv-line-draw 1.5s ease-out .7s forwards;
}
@keyframes hv-line-draw {
  to { stroke-dashoffset: 0; }
}

/* конечная точка графика «дышит» */
.hv-ping {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: hv-ping 2.4s ease-in-out 2.2s infinite;
}
@keyframes hv-ping {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.45); opacity: .45; }
}

/* пульс точки в бейдже хиро */
.hero-dot { animation: hero-dot-pulse 2.2s ease-in-out infinite; }
@keyframes hero-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47, 211, 155, .18); }
  50%      { box-shadow: 0 0 0 7px rgba(47, 211, 155, .07); }
}

/* лёгкий параллакс свечения за мокапом (JS пишет --glow-shift при скролле) */
@media (prefers-reduced-motion: no-preference) {
  .hero-visual::before {
    transform: translate3d(0, var(--glow-shift, 0px), 0);
    will-change: transform;
  }
}

/* ---------- Стрелка в CTA сдвигается на ховере ---------- */

.btn .arr { flex: none; transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- Мягкий шиммер главной кнопки героя ----------
   Медленный световой свип поверх градиента: сам свип занимает ~1.2с,
   остальное время цикла (~4.6с) — пауза. Слой ::after не трогает фон
   и ховер кнопки; при reduced-motion анимация не подключается вовсе. */

.btn-hero { position: relative; overflow: hidden; }
.btn-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: translateX(-180%) skewX(-18deg);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .btn-hero::after { animation: hero-shimmer 4.6s ease-in-out 1.8s infinite; }
}
@keyframes hero-shimmer {
  0%   { transform: translateX(-180%) skewX(-18deg); }
  26%  { transform: translateX(430%) skewX(-18deg); }
  100% { transform: translateX(430%) skewX(-18deg); }
}

/* ---------- Карточки продуктов: градиентная рамка + оживающая иконка ---------- */

.card { position: relative; }
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, rgba(47, 211, 155, .65), rgba(14, 122, 90, .05) 42%, rgba(47, 211, 155, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card-icon { transition: transform .25s cubic-bezier(.2, .7, .2, 1), background-color .25s ease; }
.card:hover .card-icon { transform: translateY(-2px) scale(1.06) rotate(-3deg); }

/* ---------- Кейсы: подсветка следует за курсором ---------- */

.case { position: relative; overflow: hidden; }
@media (hover: hover) and (pointer: fine) {
  .case::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
                rgba(47, 211, 155, .12), transparent 65%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  .case:hover::after { opacity: 1; }
}

/* ---------- Шапка: прячется вниз / появляется вверх, активный пункт меню ---------- */

.site-header { transition: transform .35s ease; }
.site-header.header-hidden { transform: translateY(-100%); }

.site-nav a {
  padding-bottom: 4px;
  background-image: linear-gradient(var(--mint), var(--mint));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: color .18s ease, background-size .25s ease;
}
.site-nav a:hover { background-size: 100% 2px; }
.site-nav a.nav-active { color: #ffffff; background-size: 100% 2px; }

/* ---------- Форма: живые состояния фокуса, микроанимация кнопки ---------- */

.field label { transition: color .15s ease; }
.field:focus-within label { color: var(--accent); }

.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0) scale(.985); }

/* состояние «Отправляем…» */
#lead-form .btn[disabled] {
  opacity: .8;
  cursor: progress;
  animation: btn-sending 1.1s ease-in-out infinite;
}
@keyframes btn-sending {
  0%, 100% { opacity: .8; }
  50%      { opacity: .55; }
}

/* цифры статистики не «прыгают» при счётчике */
.stat-value { font-variant-numeric: tabular-nums; }

/* ---------- Планшет (~768px) ---------- */

@media (max-width: 980px) {
  .stats-card {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 8px;
    padding: 22px 10px;
  }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); padding-top: 18px; }
  .stat:nth-child(-n+2) { padding-bottom: 18px; }
}

/* ---------- Мобильная ширина (~375px) ---------- */

@media (max-width: 720px) {
  .site-nav { display: none; }
  .header-inner { gap: 14px; padding: 10px 16px; }
  .brand-name { font-size: .98rem; }

  .hero-inner { padding: 56px 16px 148px; }
  .hero-badge { font-size: .74rem; padding: 6px 12px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-visual { margin-top: 44px; }

  .stats { padding: 0 16px; }
  .stats-card { margin-top: -84px; }
  .stat { padding-left: 14px; padding-right: 14px; }

  .products { padding: 64px 16px 0; }
  .section-title { margin-bottom: 28px; }
  .cards, .case-grid { gap: 16px; }
  .card, .case { padding: 24px 20px 22px; }
  .card .btn { align-self: stretch; }

  .cases { margin-top: 64px; padding: 64px 16px 72px; }
  .testimonial { padding-top: 64px; }

  .lead { margin-top: 64px; border-radius: 28px 28px 0 0; }
  .lead-inner { padding: 60px 16px 68px; }
  .form-card { padding: 26px 20px 24px; }
}

@media (max-width: 400px) {
  body { font-size: 15px; }
  .btn-header { padding: 8px 14px; font-size: .86rem; }
  .stat-value { font-size: 1.35rem; }
  .stat-label { font-size: .78rem; }
}

/* ---------- Уважение к prefers-reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .card:hover, .case:hover, .btn-primary:hover, .btn-hero:hover,
  .btn-header:hover { transform: none; }

  /* reveal-блоки видны сразу, без сдвигов; анимацию карточек тоже глушим —
     иначе она перебила бы это правило по специфичности */
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html.js .card.reveal.on, html.js .case.reveal.on,
  html.js .card.reveal, html.js .case.reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  /* спокойный мокап: без пульсаций и прорисовок, всё в конечном состоянии */
  .hv-row, .hv-bar { animation: none; opacity: 1; transform: none; }
  .hv-line { animation: none; stroke-dashoffset: 0; }
  .hv-dot, .hv-ping, .hero-dot { animation: none; }
  .hero-visual::before { transform: none; }
  .site-header { transition: none; }
}
