/* ==========================================================================
   VirexHosting — CLEAN ANIMATIONS
   Dedykowany plik animacji. Działa niezależnie od JS i IntersectionObserver.
   ========================================================================== */

/* ---------- 1. WEJŚCIE STRONY — stagger reveal (zawsze działa) ---------- */
@keyframes vx-enter-up {
  0%   { opacity: 0; transform: translateY(38px) scale(.96); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes vx-enter-left {
  0%   { opacity: 0; transform: translateX(-40px); }
  100% { opacity: 1; transform: none; }
}
@keyframes vx-enter-right {
  0%   { opacity: 0; transform: translateX(40px); }
  100% { opacity: 1; transform: none; }
}
@keyframes vx-enter-scale {
  0%   { opacity: 0; transform: scale(.88); }
  100% { opacity: 1; transform: scale(1); }
}

/* Hero — każdy element wchodzi po kolei */
.hero > * {
  animation: vx-enter-up .95s cubic-bezier(.16,1,.3,1) both !important;
}
.hero > *:nth-child(1) { animation-delay: .05s !important; }
.hero > *:nth-child(2) { animation-delay: .15s !important; }
.hero > *:nth-child(3) { animation-delay: .25s !important; }
.hero > *:nth-child(4) { animation-delay: .35s !important; }
.hero > *:nth-child(5) { animation-delay: .45s !important; }
.hero > *:nth-child(6) { animation-delay: .55s !important; }

/* ---------- 2. NAGŁÓWKI SEKCJI — wjazd z lewa/prawa ---------- */
.section .head, .section > .eyebrow, .section > h2, .section > p.sub.l {
  animation: vx-enter-left .85s cubic-bezier(.16,1,.3,1) both;
}
.section .head:nth-child(even) { animation-name: vx-enter-right; }

/* ---------- 3. KARTY — pojawiają się falą (opacity 1 domyślnie = bezpieczne) ---------- */
@keyframes vx-card-in {
  0%   { opacity: 0; transform: translateY(30px) scale(.95); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
/* Karty — zawsze widoczna fala wejścia (niezależnie od ustawień systemu) */
.grid .card, .games .game, .plans .plan, .stats > div, .locs .loc, .steps .step, .feat span, .rev {
  animation: vx-card-in .75s cubic-bezier(.16,1,.3,1) both;
}
.grid .card:nth-child(1),.games .game:nth-child(1),.plans .plan:nth-child(1),.stats > div:nth-child(1){animation-delay:.05s}
.grid .card:nth-child(2),.games .game:nth-child(2),.plans .plan:nth-child(2),.stats > div:nth-child(2){animation-delay:.11s}
.grid .card:nth-child(3),.games .game:nth-child(3),.plans .plan:nth-child(3),.stats > div:nth-child(3){animation-delay:.17s}
.grid .card:nth-child(4),.games .game:nth-child(4),.plans .plan:nth-child(4),.stats > div:nth-child(4){animation-delay:.23s}
.games .game:nth-child(5),.grid .card:nth-child(5){animation-delay:.29s}
.games .game:nth-child(6),.grid .card:nth-child(6){animation-delay:.35s}
.games .game:nth-child(7){animation-delay:.41s}
.games .game:nth-child(8){animation-delay:.47s}
.games .game:nth-child(9){animation-delay:.53s}
.games .game:nth-child(10){animation-delay:.59s}
.games .game:nth-child(11){animation-delay:.65s}
.games .game:nth-child(12){animation-delay:.71s}

/* ---------- 4. CIĄGŁE ANIMACJE ATMOSFERY ---------- */
@keyframes vx-float-slow { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-18px)} }
@keyframes vx-pulse-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(124,92,255,.45); }
  50%     { box-shadow: 0 0 0 14px rgba(124,92,255,0); }
}
@keyframes vx-grad-shift { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
@keyframes vx-shimmer { 0%{transform:translateX(-120%)} 100%{transform:translateX(220%)} }
@keyframes vx-spin { to { transform: rotate(360deg); } }
@keyframes vx-breathe { 0%,100%{opacity:.35;transform:scale(1)} 50%{opacity:.6;transform:scale(1.08)} }

.aura { animation: vx-breathe 14s ease-in-out infinite !important; }
.aura.a2 { animation-delay: -5s !important; }
.aura.a3 { animation-delay: -10s !important; }

.pill .dot, .tag .dot { animation: vx-pulse-glow 2.2s infinite !important; }

h1 em, .stats b, .plan .price, .sum .price {
  background-size: 200% auto !important;
  animation: vx-grad-shift 5s linear infinite !important;
}

.promo {
  background: linear-gradient(90deg,#7c5cff,#18d3f0,#a06bff,#7c5cff) !important;
  background-size: 300% 100% !important;
  animation: vx-grad-shift 8s linear infinite !important;
}

/* Shimmer na przyciskach pri */
.btn.pri { background-size: 200% 200% !important; animation: vx-grad-shift 6s ease infinite !important; }

/* Obracający się pierścień wokół wyróżnionego planu */
.plan.ft::after {
  content:""; position:absolute; inset:-2px; border-radius:22px; padding:2px;
  background:conic-gradient(from 0deg,#7c5cff,#18d3f0,#ff5cae,#7c5cff);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  animation:vx-spin 6s linear infinite; pointer-events:none;
}

/* ---------- 5. HOVER — interakcje ---------- */
@keyframes vx-shine { 0%{left:-60%} 100%{left:130%} }
.btn.pri::after {
  content:""; position:absolute; top:0; left:-60%; width:35%; height:100%;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);
  transform:skewX(-22deg); pointer-events:none;
}
.btn.pri:hover::after { animation: vx-shine .7s ease-out; }

.game .tile::before {
  content:""; position:absolute; inset:0; z-index:1;
  background:linear-gradient(115deg,transparent 35%,rgba(255,255,255,.22) 50%,transparent 65%);
  transform:translateX(-120%); transition:transform .6s ease;
}
.game:hover .tile::before { transform:translateX(120%); }

.game:hover img { animation: vx-wiggle .6s ease-in-out; }
@keyframes vx-wiggle { 0%,100%{transform:rotate(0) scale(1)} 30%{transform:rotate(-10deg) scale(1.12)} 70%{transform:rotate(10deg) scale(1.12)} }

.card:hover .ico { animation: vx-pop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes vx-pop { 0%{transform:scale(1)} 50%{transform:scale(1.22) rotate(-8deg)} 100%{transform:scale(1.1)} }

/* ---------- 6. LICZNIKI — animacja po wejściu (JS robi count-up) ---------- */
.stats b { will-change: transform; }
.stats > div:hover b { animation: vx-pop .5s cubic-bezier(.34,1.56,.64,1); }

/* ---------- 7. TRACKER KURSY / STATUS — migająca kropka ---------- */
.preview-header-status .pulse-dot, .summary-live .pulse-dot {
  animation: vx-pulse-glow 1.8s infinite !important;
}

/* ---------- 8. SCROLL REVEAL — naprawiony fallback ---------- */
/* Jeśli JS doda .rv, ale IntersectionObserver nie odpali — element i tak
   staje się widoczny po 1.2s. Dzięki temu nigdy nie ma pustej strony. */
.rv { opacity: 0 !important; transform: translateY(26px); }
.rv.in { opacity: 1 !important; transform: none; }
@keyframes vx-failsafe { to { opacity:1 !important; transform:none; } }
.rv:not(.in) { animation: vx-failsafe .6s ease 1.2s forwards; }

/* ---------- 9. MENU MOBILNE — slide ---------- */
@keyframes vx-slide-down { from{opacity:0;transform:translateY(-14px)} to{opacity:1;transform:none} }
nav.open { animation: vx-slide-down .3s ease; }

/* ---------- 10. MODAL — wejście ---------- */
.omod.open .omodin, .order-modal.open .order-modal-dialog {
  animation: vx-enter-scale .4s cubic-bezier(.16,1,.3,1) both;
}

/* ---------- 11. REDUCED MOTION — skracamy, ale NIE wyłączamy ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero > *, .section .head, .grid .card, .games .game, .plans .plan, .stats > div {
    animation-duration: .35s !important;
    animation-delay: 0ms !important;
  }
  .rv { opacity: 1 !important; transform: none !important; }
  .aura, .promo, h1 em { animation-duration: 20s !important; }
}
