/* Landmark - animacje (estetyczne + zoptymalizowane: tylko transform/opacity, GPU).
   Izolowane: rollback = usun link do anim.css + anim.js. Gated .js-anim (degradacja gdy brak JS),
   wylaczone przy prefers-reduced-motion. */

/* ── Plynne przejscia miedzy stronami (View Transitions API, progresywne) ── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 320ms; }
::view-transition-new(root) { animation-duration: 320ms; }

@media (prefers-reduced-motion: no-preference) {
  /* ── Ken Burns: powolny zoom tla hero ── */
  .hero-bg img, .patria-hero-bg img { animation: lm-kb 24s ease-out both; transform-origin: 50% 45%; will-change: transform; }
  .home-hero-bg { animation: lm-kb 26s ease-out both; transform-origin: 50% 40%; }
  @keyframes lm-kb { from { transform: scale(1.09); } to { transform: scale(1); } }

  /* ── Wejscie tresci hero (stagger), gated .js-anim ── */
  .js-anim .hero-inner > *, .js-anim .home-hero-content > *, .js-anim .patria-hero-inner > * {
    opacity: 0; animation: lm-up .85s cubic-bezier(.2,.6,.2,1) forwards;
  }
  .js-anim .hero-inner > *:nth-child(1), .js-anim .home-hero-content > *:nth-child(1), .js-anim .patria-hero-inner > *:nth-child(1) { animation-delay: .15s; }
  .js-anim .hero-inner > *:nth-child(2), .js-anim .home-hero-content > *:nth-child(2), .js-anim .patria-hero-inner > *:nth-child(2) { animation-delay: .27s; }
  .js-anim .hero-inner > *:nth-child(3), .js-anim .home-hero-content > *:nth-child(3), .js-anim .patria-hero-inner > *:nth-child(3) { animation-delay: .39s; }
  .js-anim .hero-inner > *:nth-child(4), .js-anim .home-hero-content > *:nth-child(4), .js-anim .patria-hero-inner > *:nth-child(4) { animation-delay: .51s; }
  .js-anim .hero-inner > *:nth-child(5), .js-anim .home-hero-content > *:nth-child(5), .js-anim .patria-hero-inner > *:nth-child(5) { animation-delay: .63s; }
  .js-anim .hero-inner > *:nth-child(n+6), .js-anim .home-hero-content > *:nth-child(n+6) { animation-delay: .72s; }
  @keyframes lm-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

  /* ── Reveal zdjec: lekkie skalowanie przy wejsciu w kadr ── */
  .js-anim .anim-img { overflow: hidden; }
  .js-anim .anim-img img, .js-anim img.anim-img { transform: scale(1.08); transition: transform 1.15s cubic-bezier(.2,.6,.2,1); will-change: transform; }
  .js-anim .anim-img.in img, .js-anim img.anim-img.in { transform: scale(1); }

  /* ── Stagger kart w siatkach ── */
  .js-anim .anim-child { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js-anim .anim-child.in { opacity: 1; transform: none; }
}

