/**
 * TWOJA STRONA - Animacje i Efekty Wizualne CSS3
 * Pełna optymalizacja wydajnościowa i wsparcie dla prefers-reduced-motion
 */

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

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulseCore {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(7, 139, 255, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 32px rgba(73, 197, 255, 0.85);
  }
}

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

@keyframes ribbonFlow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 80; }
}

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

/* Karta z efektem podświetlenia kursorem myszy (Spotlight) */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: var(--spotlight-y, -1000px);
  left: var(--spotlight-x, -1000px);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(7, 139, 255, 0.16) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

html.light .spotlight-card::before {
  background: radial-gradient(circle, rgba(7, 139, 255, 0.09) 0%, transparent 70%);
}

/* ==========================================================================
   SCROLL REVEAL — PŁYNNE ANIMACJE WEJŚCIA ELEMENTÓW PRZY PRZEWIJANIU
   Bez JS treść pozostaje w 100% widoczna (klasa js-ready aktywowana dynamicznie)
   ========================================================================== */
html.js-ready .reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.js-ready .reveal-on-scroll[data-reveal="fade-up"] {
  transform: translateY(24px);
}

html.js-ready .reveal-on-scroll[data-reveal="fade-down"] {
  transform: translateY(-20px);
}

html.js-ready .reveal-on-scroll[data-reveal="fade-left"] {
  transform: translateX(28px);
}

html.js-ready .reveal-on-scroll[data-reveal="fade-right"] {
  transform: translateX(-28px);
}

html.js-ready .reveal-on-scroll[data-reveal="zoom-in"] {
  transform: scale(0.94) translateY(12px);
}

/* Stan po wejściu do pola widzenia */
html.js-ready .reveal-on-scroll.is-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Opóźnienia sekwencyjne dla elementów w grupach i siatkach */
html.js-ready .reveal-on-scroll.delay-1 { transition-delay: 0.08s; }
html.js-ready .reveal-on-scroll.delay-2 { transition-delay: 0.16s; }
html.js-ready .reveal-on-scroll.delay-3 { transition-delay: 0.24s; }
html.js-ready .reveal-on-scroll.delay-4 { transition-delay: 0.32s; }
html.js-ready .reveal-on-scroll.delay-5 { transition-delay: 0.40s; }

/* ==========================================================================
   MIKROINTERAKCJE HOVER / ACTIVE / KONFIGURATOR
   ========================================================================== */
.btn-primary,
.btn-secondary,
.icon-btn,
.portfolio-filter-btn,
.event-filter-btn {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              color 0.2s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
}

.btn-primary:active,
.btn-secondary:active,
.icon-btn:active,
.portfolio-filter-btn:active,
.event-filter-btn:active {
  transform: scale(0.97) translateY(0);
}

.project-client-card,
.editorial-pricing-col,
.event-timeline-item,
.pillar-card,
.hero-value-card {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.28s ease,
              border-color 0.25s ease,
              background-color 0.25s ease;
}

.project-client-card:hover,
.event-timeline-item:hover {
  transform: translateY(-4px);
}

.pill-option-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
}

.pill-option-label:hover .pill-option-card {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.pill-option-label input:checked + .pill-option-card {
  transform: scale(1.015);
  box-shadow: 0 8px 20px rgba(8, 123, 255, 0.15);
}

.config-step {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.config-step:focus-within {
  border-color: rgba(8, 123, 255, 0.45);
}

/* Wsparcie dla preferencji użytkownika: prefers-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;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .pulse-dot,
  .cube-core-pulse,
  .cube-orbit-ring,
  .separator-path,
  .separator-node {
    animation: none !important;
  }

  .spotlight-card::before {
    display: none !important;
  }
}
