html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Базовый контракт продуктовой темы.
   Индивидуальные файлы ualkaline.css, ultima.css и т.д. переопределяют эти переменные. */
:root {
  --brand-red: #ea1e1e;
  --brand-purple: var(--product-primary);
  --brand-yellow: #FFF42B;
  --brand-dark: #1a1d24;
  --product-primary: #ea1e1e;
  --product-primary-rgb: 234, 30, 30;
  --product-neutral: #777777;
  --product-hero-glow: rgba(234, 30, 30, 0.82);
  --product-elevated-shadow: rgba(234, 30, 30, 0.8);
  --product-icon-hover-bg: rgba(234, 30, 30, 0.22);
  --product-icon-hover-shadow: rgba(234, 30, 30, 0.18);
  --product-pulse-start: rgba(var(--product-primary-rgb), 0.38);
  --product-pulse-end: rgba(var(--product-primary-rgb), 0);
  --product-cta-pulse-start: rgba(var(--product-primary-rgb), 0.45);
  --product-cta-pulse-end: rgba(var(--product-primary-rgb), 0);
  --product-mobile-bg: none;
}

/* Общие брендовые градиенты для продуктовых CTA/секций. */
.gradient-bg {
  background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-neutral), var(--product-primary) 100%);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}

.gradient-bg1 {
  background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-neutral) 100%);
}

.focus-ring:focus-visible {
  outline: 3px solid var(--product-primary);
  outline-offset: 3px;
}

/* Fallback для Tailwind-классов бренда.
   Нужен, чтобы ключевые цвета не зависели от CDN-генерации Tailwind перед продом. */
.bg-brand-primary {
  background-color: var(--product-primary) !important;
}

.text-brand-primary {
  color: var(--product-primary) !important;
}

.bg-brand-primary\/20 {
  background-color: rgba(var(--product-primary-rgb), 0.2) !important;
}

/* HERO: видео на десктопе, мобильная картинка через ::before в portrait-режиме. */
.video-bg {
  height: 70vh;
  min-height: 560px;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-neutral) 52%, var(--brand-dark) 100%);
  background-size: cover;
}

.video-bg video {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--product-mobile-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
}

.video-bg_content {
  position: relative;
  z-index: 5;
  color: #fff;
  width: 100%;
}

.hero-product-img {
  filter: drop-shadow(0 30px 40px var(--product-hero-glow));
}

@media (max-width: 767px) {
  .video-bg {
    height: auto;
    min-height: 72vh;
    padding: 88px 0 64px;
  }
}

@media (orientation: portrait) and (max-width: 767px) {
  .video-bg::before {
    opacity: 1;
  }

  .video-bg video {
    display: none;
  }
}

.elevated-card {
  box-shadow: 0 10px 30px -12px var(--product-elevated-shadow);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .group, .transition { transition: none !important; }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

/* Последовательное появление элементов первого экрана. */
.hero-animate-1 { animation: heroFadeUp 0.75s cubic-bezier(.22,.68,0,1) 0.10s both; }
.hero-animate-2 { animation: heroFadeUp 0.75s cubic-bezier(.22,.68,0,1) 0.24s both; }
.hero-animate-3 { animation: heroFadeUp 0.75s cubic-bezier(.22,.68,0,1) 0.38s both; }
.hero-animate-4 { animation: heroFadeUp 0.75s cubic-bezier(.22,.68,0,1) 0.52s both; }

/* Карточки преимуществ продукта: hover-подсветка и лёгкий подъём. */
#products article {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  will-change: transform, box-shadow;
  transition:
    transform 0.34s cubic-bezier(.22,.68,0,1.05),
    box-shadow 0.34s ease,
    border-color 0.34s ease;
}

#products article::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 22% 14%, rgba(255,244,43,0.34), transparent 32%),
    radial-gradient(circle at 84% 10%, rgba(63,0,153,0.20), transparent 34%),
    linear-gradient(135deg, rgba(234,30,30,0.12), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.34s ease;
}

#products article:hover,
#products article:focus-within {
  transform: translateY(-10px) scale(1.015);
  box-shadow: 0 24px 60px rgba(63,0,153,0.16), 0 0 0 1px rgba(234,30,30,0.08);
}

#products article:hover::before,
#products article:focus-within::before {
  opacity: 1;
}

#products article img:first-child {
  transition: transform 0.42s cubic-bezier(.22,.68,0,1.05), filter 0.42s ease;
}

#products article:hover img:first-child,
#products article:focus-within img:first-child {
  transform: scale(1.08) rotate(-1deg);
  filter: drop-shadow(0 18px 20px rgba(63,0,153,0.20));
}

/* В секции "Український бренд" reveal-delay не должен задерживать hover. */
section[aria-labelledby="patriotic-title"] li.reveal.transition {
  transition-property: opacity, transform, filter !important;
}

section[aria-labelledby="patriotic-title"] li.reveal:hover,
section[aria-labelledby="patriotic-title"] li.reveal:focus-within {
  background-color: rgba(255,255,255,0.15);
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--product-pulse-start); }
  70% { box-shadow: 0 0 0 16px var(--product-pulse-end); }
  100% { box-shadow: 0 0 0 0 var(--product-pulse-end); }
}

/* Карточки usage-grid: подсветка иконки в цвет конкретного продукта. */
#usage article .rounded-full {
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

#usage article.visible .rounded-full {
  animation: pulseRing 0.9s ease-out 0.35s 1;
}

#usage article:hover .rounded-full {
  transform: translateY(-4px) scale(1.04);
  background-color: var(--product-icon-hover-bg);
  box-shadow: 0 12px 24px var(--product-icon-hover-shadow);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes headerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes headerScrollReveal {
  from { transform: translateY(-14px); opacity: 0.82; }
  to { transform: translateY(0); opacity: 1; }
}

/* Header-анимации и состояние после скролла. */
.site-header {
  animation: headerSlideDown 0.62s cubic-bezier(.22,.68,0,1.05) both;
  transition:
    background-color 0.28s ease,
    box-shadow 0.28s ease,
    backdrop-filter 0.28s ease,
    transform 0.28s ease,
    opacity 0.28s ease;
}

.site-header.is-scrolled {
  background-color: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 44px rgba(26,29,36,0.12);
  animation: headerScrollReveal 0.42s ease both;
}

.site-header nav a {
  position: relative;
}

.site-header nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-red);
  transition: width 0.25s ease;
  border-radius: 2px;
}

.site-header nav a:hover::after {
  width: 100%;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--product-cta-pulse-start); }
  50% { box-shadow: 0 0 0 12px var(--product-cta-pulse-end); }
}

/* CTA-кнопки: пульсация и световой блик при hover/focus. */
.section-cta-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: btnPulse 2.6s ease infinite;
}

.section-cta-btn::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -120%;
  width: 70%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transition: left 0.72s ease;
  z-index: 0;
  pointer-events: none;
}

.section-cta-btn:hover::after,
.section-cta-btn:focus-visible::after {
  left: 135%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}
