/* ══════════════════════════════════════════════════════════════════════
   Анімаційна система сайту
   - [data-reveal] елементи плавно з'являються, коли потрапляють у viewport
     (JS керує класом .is-visible через IntersectionObserver, див. js/motion.js)
   - [data-reveal-group] автоматично проставляє наростаючу затримку дочірнім
     [data-reveal] елементам (stagger), без ручного розписування delay
   - Декоративні keyframes для hero, іконок, кнопок і фонових акцентів
   ══════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-26px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes floatYSmall {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes progressGrow {
  from { width: 0%; }
  to   { width: 68%; }
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(.7); }
  70%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Reveal-on-scroll base ────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  animation-duration: .7s;
  animation-timing-function: cubic-bezier(.16,.8,.3,1);
  animation-fill-mode: forwards;
  animation-play-state: paused;
}
[data-reveal].is-visible { animation-play-state: running; }

[data-reveal="up"]    { animation-name: fadeUp; }
[data-reveal="fade"]  { animation-name: fadeIn; }
[data-reveal="scale"] { animation-name: scaleIn; }
[data-reveal="left"]  { animation-name: slideInLeft; }
[data-reveal="right"] { animation-name: slideInRight; }

/* stagger: JS проставляє --stagger-index на дітях data-reveal-group */
[data-reveal] { animation-delay: calc(var(--stagger-index, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; animation: none !important; }
}

/* ── Hero decor ───────────────────────────────────────────────────────── */
.hero-eyebrow .dot { animation: dotBlink 2s ease-in-out infinite; }

.app-mock-inner { animation: floatY 6s ease-in-out infinite; }
.app-mock-progress i { position: relative; overflow: hidden; animation: progressGrow 1.8s cubic-bezier(.16,.8,.3,1) .4s both; }
.app-mock-progress i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.app-mock-card { transition: transform .35s cubic-bezier(.16,.8,.3,1), border-color .25s; }
.app-mock-inner:hover .app-mock-card:nth-child(1) { transform: translateY(-3px); }
.trust-strip img { transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .25s; animation: floatYSmall 5s ease-in-out infinite; }
.trust-strip img:nth-child(2) { animation-delay: .3s; }
.trust-strip img:nth-child(3) { animation-delay: .6s; }
.trust-strip img:nth-child(4) { animation-delay: .9s; }
.trust-strip img:nth-child(5) { animation-delay: 1.2s; }
.trust-strip img:nth-child(6) { animation-delay: 1.5s; }
.trust-strip img:nth-child(7) { animation-delay: 1.8s; }
.trust-strip img:hover { transform: translateY(-4px) scale(1.08); }

/* ── Card / interactive hover motion ─────────────────────────────────── */
.card, .feature-card, .security-card, .edition-card, .faq-item, .dl-card, .checksum-box, .step-row {
  transition: transform .3s cubic-bezier(.16,.8,.3,1), border-color .25s, box-shadow .3s;
}
.feature-card:hover, .security-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.feature-card .ico { transition: transform .3s cubic-bezier(.34,1.56,.64,1), background-color .25s; }
.feature-card:hover .ico { transform: scale(1.12) rotate(-4deg); background: rgba(var(--orange-rgb), .14); color: var(--orange); }
.feature-card .ico .icon { transition: transform .3s; }

.edition-card { transition: transform .3s cubic-bezier(.16,.8,.3,1), border-color .25s; }
.edition-card:not(.locked):hover { transform: translateY(-3px); border-color: rgba(var(--orange-rgb), .4); }

.faq-item summary { transition: background-color .2s; }
.faq-item summary:hover { background: var(--hover); }
.faq-item .faq-body { animation: fadeIn .35s ease; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s, background-color .2s, box-shadow .25s; }
.btn:active { transform: scale(.96); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(var(--orange-rgb), .4); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.4) 40%, transparent 60%);
  background-size: 250% 100%; background-position: 150% 0;
  opacity: 0; transition: opacity .2s;
}
.btn-primary:hover::after { opacity: 1; animation: shimmer 1.1s ease; }
.btn-secondary:hover { transform: translateY(-2px); }

.lang-switch button, .theme-switch button { transition: background-color .2s, color .2s, transform .15s; }
.theme-switch button:hover { transform: scale(1.12); }
.theme-switch button.active { animation: popIn .35s cubic-bezier(.34,1.56,.64,1); }

.pill.accent { animation: pulseGlow 2.6s ease-in-out infinite; }

/* ── Nav links underline sweep ────────────────────────────────────────── */
.main-nav a { position: relative; }
.main-nav a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  background: var(--accent-grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.16,.8,.3,1);
}
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }

/* ── Security number badges ──────────────────────────────────────────── */
.security-card .num { display: inline-block; transition: transform .3s; }
.security-card:hover .num { transform: translateX(3px); }

/* ── Top bar entrance ─────────────────────────────────────────────────── */
.top { animation: fadeIn .5s ease; }
.brand img { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }

/* ── Mobile drawer motion ─────────────────────────────────────────────── */
.mobile-drawer .scrim { animation: fadeIn .2s ease; }
.mobile-drawer .panel { animation: slideInRight .28s cubic-bezier(.16,.8,.3,1); }

/* ── CTA band glow ────────────────────────────────────────────────────── */
.cta-band { position: relative; overflow: hidden; }
.cta-band::before {
  content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--orange-rgb), .25), transparent 70%);
  top: -160px; left: 50%; transform: translateX(-50%);
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

/* ── Bug report success pop ───────────────────────────────────────────── */
.bug-result.show { animation: popIn .5s cubic-bezier(.34,1.56,.64,1); }
.bug-result .ico { animation: floatYSmall 2.4s ease-in-out infinite; }
.check-result.show { animation: fadeUp .35s cubic-bezier(.16,.8,.3,1); }

/* ── Docs sidenav active indicator ───────────────────────────────────── */
.side-nav a { position: relative; transition: background-color .2s, color .2s, padding-left .2s; }
.side-nav a.active { padding-left: 16px; }
.toc a { transition: color .2s, border-color .2s, padding-left .2s; }
.toc a.active { padding-left: 13px; }

/* ── Spin utility (used sparingly, e.g. loading icon) ────────────────── */
.spin { animation: spinSlow 1.2s linear infinite; }
