/* ========================================
   STREFA UMYSŁU — ANIMATION.CSS
   Animations & Micro-interactions
   v1.0 | 2026
======================================== */

/* ---- KEYFRAMES ---- */

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,111,94,0); }
  50%       { box-shadow: 0 0 0 8px rgba(139,111,94,0.08); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes morph {
  0%   { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
  33%  { border-radius: 45% 55% 40% 60% / 60% 40% 60% 40%; }
  66%  { border-radius: 55% 45% 65% 35% / 45% 55% 45% 55%; }
  100% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- HERO SHAPES ---- */
.hero-shape-1 {
  animation: morph 12s ease-in-out infinite, floatSlow 6s ease-in-out infinite;
}

.hero-shape-2 {
  animation: morph 16s ease-in-out infinite reverse, floatSlow 8s ease-in-out infinite 2s;
}

/* ---- PAGE LOAD SEQUENCE ---- */
.hero-content { animation: fadeUp 0.9s ease both; animation-delay: 0.15s; }
.hero-visual  { animation: fadeIn 1.2s ease both; animation-delay: 0.4s; }

/* ---- MODULE CARDS STAGGER ---- */
.module-card:nth-child(1) { animation-delay: 0s; }
.module-card:nth-child(2) { animation-delay: 0.08s; }
.module-card:nth-child(3) { animation-delay: 0.16s; }
.module-card:nth-child(4) { animation-delay: 0.24s; }
.module-card:nth-child(5) { animation-delay: 0.32s; }
.module-card:nth-child(6) { animation-delay: 0.40s; }

/* ---- TESTIMONIAL STAGGER ---- */
.testimonial-card:nth-child(1) { animation-delay: 0s; }
.testimonial-card:nth-child(2) { animation-delay: 0.1s; }
.testimonial-card:nth-child(3) { animation-delay: 0.2s; }
.testimonial-card:nth-child(4) { animation-delay: 0.3s; }
.testimonial-card:nth-child(5) { animation-delay: 0.4s; }

/* ---- HOVER MICRO-INTERACTIONS ---- */

/* Pulse on primary buttons */
.btn-primary {
  animation: pulseSoft 3s ease infinite;
}

.btn-primary:hover {
  animation: none;
}

/* Module card number grow on hover */
.module-card:hover .module-num {
  animation: scaleIn 0.3s ease both;
}

/* FAQ smooth open */
.faq-item[open] .faq-answer {
  animation: fadeUp 0.3s ease both;
}

/* ---- LOADING SPINNER (for forms) ---- */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spinSlow 0.7s linear infinite;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
}

/* ---- SHIMMER SKELETON (lazy load placeholder) ---- */
.skeleton {
  background: linear-gradient(90deg,
    var(--clr-bg-soft) 25%,
    var(--clr-border) 50%,
    var(--clr-bg-soft) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--r-sm);
}

/* ---- SCROLL PROGRESS BAR ---- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-gold));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ---- COUNT UP NUMBERS ---- */
.count-up {
  display: inline-block;
  animation: countUp 0.6s ease both;
}

/* ---- STICKY HEADER TRANSITION ---- */
.site-header {
  transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

/* ---- CARD REVEAL ---- */
[data-aos="fade-up"] {
  transition-property: transform, opacity;
}

/* ---- FORM SUCCESS ANIMATION ---- */
.form-success.show {
  animation: fadeUp 0.4s ease both;
}

/* ---- SOCIAL LINK ICON ---- */
.social-link:hover .social-icon {
  animation: pulseSoft 0.6s ease;
  color: var(--clr-accent);
}

/* ---- BACK TO TOP ---- */
.back-to-top {
  transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

/* ---- OUTLINE / FOCUS VISIBLE ---- */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- REDUCED MOTION ---- */
@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;
  }
}
