/* ==========================================================================
   LAvolt – animacje
   Osobny plik (czysty CSS, bez kompilacji SCSS). Ładowany po style.css.
   Wszystko wyłącza się przy prefers-reduced-motion.
   ========================================================================== */

:root {
  --lv-accent: #fca311;
  --lv-accent-2: #f9b443;
  --lv-blue: #bfceeb;
  --lv-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Pasek postępu przewijania
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 11;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(252, 163, 17, 0) 0%, var(--lv-accent) 60%, #fff 100%);
  box-shadow: 0 0 10px rgba(252, 163, 17, 0.8);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Nawigacja – wjazd po załadowaniu + podkreślenie linków
   -------------------------------------------------------------------------- */
.top__main .logo-header,
#navTop li,
.top .btnHeader,
.top .navbar-toggler {
  opacity: 0;
  transform: translateY(-12px);
  animation: lv-drop-in 0.7s var(--lv-ease-out) forwards;
}
.top__main .logo-header { animation-delay: 0.05s; }
#navTop li:nth-child(1) { animation-delay: 0.15s; }
#navTop li:nth-child(2) { animation-delay: 0.22s; }
#navTop li:nth-child(3) { animation-delay: 0.29s; }
#navTop li:nth-child(4) { animation-delay: 0.36s; }
.top .btnHeader { animation-delay: 0.45s; }
.top .navbar-toggler { animation-delay: 0.3s; }

ul#navTop li a::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0.35rem;
  height: 1px;
  background: var(--lv-accent);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform 0.35s var(--lv-ease-out);
}
ul#navTop li a:hover::after { transform: scaleX(1); }

.top .btnHeader { transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
.top .btnHeader:hover { box-shadow: 0 0 1.25rem rgba(252, 163, 17, 0.45); }
.top .btnHeader:hover .icon { animation: lv-ring 0.6s ease-in-out; }

/* Mobile menu – kaskadowe pojawianie pozycji */
#navbarNavDropdown.show #mobileNav li,
#navbarNavDropdown.collapsing #mobileNav li {
  animation: lv-fade-up 0.45s var(--lv-ease-out) both;
}
#mobileNav li:nth-child(2) { animation-delay: 0.05s; }
#mobileNav li:nth-child(3) { animation-delay: 0.1s; }
#mobileNav li:nth-child(4) { animation-delay: 0.15s; }
#mobileNav li:nth-child(5) { animation-delay: 0.2s; }

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */
#homeHeader {
  position: relative;
  isolation: isolate;
}

/* Poświata podążająca za kursorem */
#homeHeader::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 40%),
    rgba(252, 163, 17, 0.12),
    transparent 60%
  );
  pointer-events: none;
  transition: background 0.2s;
}

/* Iskry (canvas wstawiany z JS) */
.hero-sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Ikona pioruna: pojawienie + pulsująca poświata + fale */
#homeHeader .header-content .header-icon {
  position: relative;
  animation:
    lv-pop-in 0.8s var(--lv-ease-out) 0.2s both,
    lv-glow 2.8s ease-in-out 1s infinite;
}
#homeHeader .header-icon::before,
#homeHeader .header-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(252, 163, 17, 0.6);
  animation: lv-ripple 2.8s ease-out 1s infinite;
  pointer-events: none;
}
#homeHeader .header-icon::after { animation-delay: 2.4s; }
#homeHeader .header-icon img {
  animation: lv-flicker 5s linear 1.2s infinite;
}

/* Akcenty w nagłówku – przelewający się gradient */
#homeHeader h1 .accent {
  background: linear-gradient(100deg, var(--lv-accent) 0%, var(--lv-accent) 35%, #ffe2a8 50%, var(--lv-accent) 65%, var(--lv-accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lv-shimmer 4.5s ease-in-out 1.2s infinite;
}

/* Wskaźnik przewijania */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  width: 1.5rem;
  height: 2.5rem;
  margin-left: -0.75rem;
  border: 1px solid rgba(191, 206, 235, 0.5);
  border-radius: 1rem;
  opacity: 0;
  animation: lv-fade-in 1s ease 1.4s forwards;
  transition: border-color 0.3s;
}
.scroll-cue::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.45rem;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--lv-accent);
  animation: lv-scroll-dot 1.8s ease-in-out infinite;
}
.scroll-cue:hover { border-color: var(--lv-accent); }
@media (max-width: 991.98px) {
  .scroll-cue { display: none; }
}

/* --------------------------------------------------------------------------
   Przyciski – połysk + uniesienie
   -------------------------------------------------------------------------- */
.btnCTA,
.btnCTA-outline {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--lv-ease-out), box-shadow 0.3s;
}
.btnCTA::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: lv-shine 4s ease-in-out 2s infinite;
  pointer-events: none;
}
.btnCTA:hover,
.btnCTA-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 2rem -0.5rem rgba(252, 163, 17, 0.55);
}
.btnCTA:active,
.btnCTA-outline:active { transform: translateY(0) scale(0.98); }

/* --------------------------------------------------------------------------
   Nagłówki sekcji – kreski rozjeżdżają się po pojawieniu
   -------------------------------------------------------------------------- */
.headingContainer .sectionName::before,
.headingContainer .sectionName::after {
  transition: width 0.8s var(--lv-ease-out) 0.3s;
}
.headingContainer.aos-animate .sectionName::before,
.headingContainer.aos-animate .sectionName::after {
  width: 1.5rem;
}

/* --------------------------------------------------------------------------
   Rozmyte "kule" w tle – powolne pływanie
   -------------------------------------------------------------------------- */
.circle-bg-container .circle-bg {
  animation: lv-float 12s ease-in-out infinite;
}
.offer-card-list .circle-bg { animation-duration: 10s; }

/* --------------------------------------------------------------------------
   Karty – uniesienie, poświata za kursorem, animowana ikona
   -------------------------------------------------------------------------- */
.offer-card,
.why-card,
.client-card,
.contact-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.45s var(--lv-ease-out),
    border-color 0.45s,
    box-shadow 0.45s,
    background 0.3s;
}

/* AOS steruje transition/transform podczas wejścia. Po jego zakończeniu JS
   dodaje .lv-ready i dopiero wtedy przejmujemy płynny hover (bez opóźnień AOS). */
.offer-card.lv-ready,
.why-card.lv-ready,
.client-card.lv-ready,
.contact-card.lv-ready {
  transition-property: transform, border-color, box-shadow, background !important;
  transition-duration: 0.45s !important;
  transition-timing-function: var(--lv-ease-out) !important;
  transition-delay: 0s !important;
}
.offer-card.aos-animate:hover,
.why-card.aos-animate:hover,
.client-card.aos-animate:hover,
.contact-card.aos-animate:hover {
  transform: translateY(-6px);
  border-color: rgba(252, 163, 17, 0.35);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(252, 163, 17, 0.35);
}
.contact-method.aos-animate:hover {
  box-shadow: 0 1.5rem 3rem -1rem rgba(252, 163, 17, 0.6);
}

/* Spotlight za kursorem (zmienne ustawiane w JS) */
.offer-card::before,
.why-card::before,
.client-card::before,
.contact-card:not(.contact-method)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--x, 50%) var(--y, 50%),
    rgba(252, 163, 17, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}
.offer-card:hover::before,
.why-card:hover::before,
.client-card:hover::before,
.contact-card:hover::before { opacity: 1; }

.offer-card > *,
.why-card > *,
.client-card > *,
.contact-card > * {
  position: relative;
  z-index: 1;
}

/* Ikony w kartach */
.offer-card__icon,
.why-card__icon,
.client-card__icon,
.contact-card__icon {
  transition: transform 0.5s var(--lv-ease-out), background 0.4s, box-shadow 0.4s;
}
.offer-card:hover .offer-card__icon,
.client-card:hover .client-card__icon,
.contact-card:not(.contact-method):hover .contact-card__icon {
  transform: scale(1.12) rotate(-6deg);
  background: rgba(252, 163, 17, 0.2);
  box-shadow: 0 0 1.25rem rgba(252, 163, 17, 0.35);
}
.why-card:hover .why-card__icon {
  transform: scale(1.12) rotate(-6deg);
  background: rgba(191, 206, 235, 0.15);
  box-shadow: 0 0 1.25rem rgba(191, 206, 235, 0.25);
}
.why-card__icon .icon { transition: color 0.4s; }
.why-card:hover .why-card__icon .icon { color: #fff; }

.contact-method:hover .contact-card__icon {
  transform: scale(1.1);
}
.contact-method:hover .contact-card__icon .icon {
  animation: lv-ring 0.7s ease-in-out;
}

/* Tytuł karty – delikatne przesunięcie */
.offer-card__content .title,
.why-card__content .title {
  transition: color 0.3s, transform 0.4s var(--lv-ease-out);
}
.offer-card:hover .offer-card__content .title,
.why-card:hover .why-card__content .title {
  color: var(--lv-accent-2);
  transform: translateX(4px);
}

/* "Dlaczego my" – hovery w niebieskiej tonacji kafli */
.why-card.aos-animate:hover {
  border-color: rgba(191, 206, 235, 0.35);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(191, 206, 235, 0.3);
}
.why-card::before {
  background: radial-gradient(
    320px circle at var(--x, 50%) var(--y, 50%),
    rgba(191, 206, 235, 0.12),
    transparent 60%
  );
}
.why-card:hover .why-card__content .title {
  color: var(--lv-blue);
}

/* Karta "Dlaczego my" – połysk */
.why-info-card {
  position: relative;
  overflow: hidden;
}
.why-info-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.why-info-card.aos-animate::after {
  animation: lv-shine-once 1.4s ease-in-out 0.6s both;
}

/* --------------------------------------------------------------------------
   PROCES – linia "płynie prądem", kropki się zapalają
   -------------------------------------------------------------------------- */
.proces-card__line .line {
  position: relative;
  overflow: hidden;
}
.proces-card__line .line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--lv-accent), rgba(252, 163, 17, 0.2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.9s var(--lv-ease-out);
}
.proces-card__line .dot {
  position: relative;
  transition: background 0.4s, box-shadow 0.4s;
}

.proces-card.is-lit .proces-card__line .dot {
  background: var(--lv-accent);
  box-shadow: 0 0 0 4px rgba(252, 163, 17, 0.15), 0 0 14px rgba(252, 163, 17, 0.8);
}
.proces-card.is-lit .proces-card__line .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--lv-accent);
  animation: lv-ripple 2.4s ease-out infinite;
}
.proces-card.is-lit .proces-card__line .line::after {
  transform: scaleX(1);
}
.proces-card__count {
  transition: color 0.5s;
  font-variant-numeric: tabular-nums;
}
.proces-card.is-lit .proces-card__count { color: #fff; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes lv-drop-in {
  to { opacity: 1; transform: none; }
}
@keyframes lv-fade-in {
  to { opacity: 1; }
}
@keyframes lv-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes lv-pop-in {
  0% { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes lv-glow {
  0%, 100% { box-shadow: 0 0 2rem rgba(252, 163, 17, 0.5); }
  50% { box-shadow: 0 0 3.5rem rgba(252, 163, 17, 0.85), 0 0 0.5rem rgba(255, 255, 255, 0.4); }
}
@keyframes lv-ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes lv-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
}
@keyframes lv-shimmer {
  0% { background-position: 100% 0; }
  50%, 100% { background-position: 0% 0; }
}
@keyframes lv-scroll-dot {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}
@keyframes lv-shine {
  0%, 70% { left: -75%; }
  100% { left: 125%; }
}
@keyframes lv-shine-once {
  from { left: -60%; }
  to { left: 130%; }
}
@keyframes lv-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6rem, -2rem) scale(1.25); }
  66% { transform: translate(-6rem, 2rem) scale(0.9); }
}
@keyframes lv-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); }
}

/* --------------------------------------------------------------------------
   Ograniczony ruch – wyłączamy wszystko co dekoracyjne
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .hero-sparks,
  .scroll-cue { display: none; }
}
