/* AngeLEO · drobné animácie (aktívne len s triedou .nahlad na <html>) */
:root { --ease-back: cubic-bezier(.34, 1.56, .64, 1); --ease-out: cubic-bezier(.22, 1, .36, 1); }

/* Nálepky */
.nahlad .art { display: inline-block; width: 56px; height: 56px; cursor: pointer; vertical-align: middle; filter: drop-shadow(2px 3px 0 rgba(20, 35, 61, .18)); }
.nahlad .art img { width: 100%; height: 100%; transform-origin: 50% 60%; }
.nahlad .art-inline { width: 44px; height: 44px; margin-left: 10px; transform: translateY(-4px) rotate(-6deg); }
.nahlad .hero figure { position: relative; }
.nahlad .art-lev { position: absolute; left: -34px; top: 38%; width: 104px; height: 104px; rotate: -10deg; z-index: 2; }
.nahlad .art-slnko { position: absolute; right: -18px; top: -22px; width: 78px; height: 78px; z-index: 2; }
.nahlad #kroky { position: relative; }
.nahlad .art-corner { position: absolute; right: 4%; top: 8px; width: 64px; height: 64px; }

/* Krídielka anjelika */
.nahlad .art-wings svg { width: 100%; height: 100%; overflow: visible; display: block; }
.nahlad .art-wings .w-l { transform-origin: 74px 58px; transform-box: view-box; animation: flap-l 3.6s ease-in-out infinite; }
.nahlad .art-wings .w-r { transform-origin: 86px 58px; transform-box: view-box; animation: flap-r 3.6s ease-in-out infinite; }
@keyframes flap-l { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: 14deg; } 86% { rotate: -4deg; } 92% { rotate: 9deg; } }
@keyframes flap-r { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -14deg; } 86% { rotate: 4deg; } 92% { rotate: -9deg; } }
.nahlad .fx-flap:hover .w-l, .nahlad .art-wings.boop .w-l { animation: flap-l 900ms ease-in-out infinite; animation-delay: -2.5s; }
.nahlad .fx-flap:hover .w-r, .nahlad .art-wings.boop .w-r { animation: flap-r 900ms ease-in-out infinite; animation-delay: -2.5s; }
.nahlad .has-wings { position: relative; display: inline-block; }
.nahlad .logo > span { position: relative; display: inline-block; isolation: isolate; }
.nahlad .logo .art-logo { position: absolute; left: 50%; top: 50%; width: 96px; height: 60px; translate: -50% -62%; z-index: -1; pointer-events: none; filter: none; }
.nahlad .art-hero-wings { position: absolute; left: 50%; top: -46px; width: 132px; height: 82px; translate: -50% 0; z-index: 2; animation: bob 4.8s ease-in-out infinite; }

/* Jemné vznášanie a pomalé otáčanie */
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes spin { to { rotate: 360deg; } }
.nahlad .bob { animation: bob 4.4s ease-in-out infinite; }
.nahlad .art-inline.bob { animation-duration: 5.2s; }
.nahlad .spin-slow img { animation: spin 40s linear infinite; }

/* Pohyb pri prejdení myšou alebo dotyku */
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -12deg; } 40% { rotate: 9deg; } 60% { rotate: -5deg; } 80% { rotate: 3deg; } }
@keyframes jelly { 0%, 100% { scale: 1; } 25% { scale: 1.2 .82; } 45% { scale: .88 1.12; } 65% { scale: 1.06 .95; } }
@keyframes swing { 0%, 100% { rotate: 0deg; } 25% { rotate: 16deg; } 50% { rotate: -10deg; } 75% { rotate: 5deg; } }
@keyframes boop { 0% { scale: 1; rotate: 0deg; } 40% { scale: 1.35; rotate: 200deg; } 75% { scale: .92; rotate: 340deg; } 100% { scale: 1; rotate: 360deg; } }
.nahlad .fx-wiggle:hover img { animation: wiggle 620ms ease-in-out; }
.nahlad .fx-jelly:hover img { animation: jelly 700ms ease-out; transform-origin: 50% 100%; }
.nahlad .fx-swing:hover img { animation: swing 900ms ease-in-out; transform-origin: 50% 0; }
.nahlad .fx-boop:hover img { animation: boop 760ms var(--ease-out); }
.nahlad .art.boop img { animation: boop 700ms var(--ease-out) !important; }

/* Lišta pricestuje zhora len pri prvom otvorení webu v danej návšteve (trieda .intro z hlavičky stránky).
   Bez fill-mode forwards, aby menu s position: fixed fungovalo. */
@keyframes zhora { from { opacity: 0; translate: 0 -110%; } to { opacity: 1; translate: 0 0; } }
.nahlad.intro .site-header { animation: zhora 700ms var(--ease-out) backwards; }

/* Objavovanie sekcií pri skrolovaní: krátko, len smerom hore, postupne v rámci skupiny */
.nahlad .reveal { opacity: 0; translate: 0 22px; transition: opacity 600ms var(--ease-out) var(--d, 0ms), translate 700ms var(--ease-out) var(--d, 0ms); }
.nahlad .reveal.in { opacity: 1; translate: 0 0; }

/* Úvod: fotky sa „položia“ na stôl, jeden spoločný pohyb pri načítaní */
@keyframes poloz { from { opacity: 0; translate: 0 26px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes vynor { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
.nahlad .hero-home .hero-title, .nahlad .hero-home .hero-lead, .nahlad .hero-home .hero-actions { animation: vynor 650ms var(--ease-out) 250ms both; }
.nahlad .hero-home .hero-lead { animation-delay: 380ms; }
.nahlad .hero-home .hero-actions { animation-delay: 480ms; }
.nahlad .hero-home .print-hero { animation: poloz 850ms var(--ease-back) 400ms both; }
.nahlad .hero-home .print-small { animation: poloz 850ms var(--ease-back) 680ms both; }
.nahlad .hero-home .sticker { animation: vynor 500ms var(--ease-out) 1000ms both, tilt 6s ease-in-out 1.5s infinite; }
/* Podstránky: nadpis a fotka v úvode */
.nahlad main > section:first-child h1, .nahlad main > section:first-child .lead { animation: vynor 650ms var(--ease-out) 250ms both; }
.nahlad main > section:first-child figure.print { animation: poloz 850ms var(--ease-back) 380ms both; }
.nahlad .hero-photo .art-lev { left: -44px; top: 4%; z-index: 3; }
.nahlad .hero-photo .art-slnko { right: -26px; top: -30px; z-index: 3; }

/* Fotka na úvode: nálepka "Každý cvik" sa zahojdá */
@keyframes tilt { 0%, 100% { rotate: -3deg; } 50% { rotate: 2deg; } }
.nahlad .hero:not(.hero-home) .sticker { animation: tilt 6s ease-in-out infinite; transform-origin: 20% 50%; }


/* Leo: detské stopy medzi krokmi */
.nahlad .kroky::before { opacity: .35; }
.nahlad .stopy { position: absolute; left: -38px; top: 34px; bottom: -30px; width: 26px; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; pointer-events: none; }
.nahlad .stopy i { display: block; width: 14px; height: 21px; opacity: 0; transform: translateX(calc((var(--k) - 1.5) * 0px)) rotate(8deg) scale(.6); }
.nahlad .stopy i:nth-child(odd) { translate: -6px 0; rotate: -10deg; }
.nahlad .stopy i:nth-child(even) { translate: 6px 0; rotate: 10deg; }
.nahlad .stopy svg { width: 100%; height: 100%; fill: var(--accent); opacity: .85; }
.nahlad .kroky li.stopy-in .stopy i { animation: krok 420ms var(--ease-back) forwards; animation-delay: calc(var(--k) * 260ms + 200ms); }
@keyframes krok { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* Bublinka: bodky a srdiečko */
.nahlad .bublina { position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 14px; width: 72px; height: 46px; background: #fff; border: 3px solid var(--ink); border-radius: 22px; transform: translateY(-.15em); font-size: 0; }
.nahlad .bublina::after { content: ""; position: absolute; left: 8px; bottom: -11px; width: 14px; height: 14px; background: #fff; border: solid var(--ink); border-width: 0 0 3px 3px; transform: skewY(-35deg) rotate(-12deg); }
.nahlad .bublina .dots { display: flex; gap: 6px; animation: dots-hide 6s infinite; }
.nahlad .bublina .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: dot 1.2s ease-in-out infinite; }
.nahlad .bublina .dots i:nth-child(2) { animation-delay: .2s; }
.nahlad .bublina .dots i:nth-child(3) { animation-delay: .4s; }
.nahlad .bublina .heart { position: absolute; font-size: 28px; line-height: 1; color: var(--accent); opacity: 0; animation: heart-show 6s infinite; }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes dots-hide { 0%, 55% { opacity: 1; } 62%, 94% { opacity: 0; } 100% { opacity: 1; } }
@keyframes heart-show { 0%, 58% { opacity: 0; transform: scale(.3); } 66% { opacity: 1; transform: scale(1.25); } 72%, 90% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(.6); } }
@media (max-width: 700px) { .nahlad .bublina { width: 58px; height: 38px; margin-left: 8px; } .nahlad .bublina .dots i { width: 7px; height: 7px; } }

/* Časová os: 15. 2. modrou farbou AS */
.nahlad .tl-key .tl-dot { background: #3D7DDB; border-color: #3D7DDB; box-shadow: none; animation: pulz 2.4s ease-out infinite; }
@keyframes pulz { 0% { box-shadow: 0 0 0 0 rgba(61, 125, 219, .5); } 80%, 100% { box-shadow: 0 0 0 14px rgba(61, 125, 219, 0); } }

/* DNA: pomaly sa otáča okolo svojej osi */
@keyframes dna-turn { 0%, 100% { transform: perspective(300px) rotateY(-35deg) rotate(-8deg); } 50% { transform: perspective(300px) rotateY(35deg) rotate(8deg); } }
@keyframes flip { to { transform: perspective(300px) rotateY(360deg); } }
.nahlad .art-dna { width: 54px; height: 54px; }
.nahlad .h1 .art-dna { width: 72px; height: 72px; }
.nahlad .art-dna img { animation: dna-turn 5s ease-in-out infinite; }
.nahlad .fx-flip:hover img { animation: flip 900ms var(--ease-out); }

/* Pätička: spiaci levík */
.nahlad .site-footer .wrap { position: relative; }
.nahlad .levik { position: absolute; right: 24px; top: -118px; width: 70px; height: 70px; padding: 0; border: 0; background: none; cursor: pointer; }
.nahlad .levik img { width: 100%; height: 100%; animation: dych 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
.nahlad .levik.hore img { animation: jelly 700ms ease-out; }
@keyframes dych { 0%, 100% { scale: 1; } 50% { scale: 1.04 .97; } }

/* Iskričky pri darovaní */
.iskra { position: fixed; z-index: 100; pointer-events: none; font-size: 22px; line-height: 1; translate: -50% -50%; animation: iskra 1s var(--ease-out) forwards; }
@keyframes iskra { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(25deg); } }


@media (max-width: 700px) {
  .nahlad .art-lev { width: 76px; height: 76px; left: -8px; top: 30%; }
  .nahlad .art-slnko { width: 60px; height: 60px; right: -4px; }
  .nahlad .art-inline { width: 36px; height: 36px; }
  .nahlad .art-hero-wings { width: 104px; height: 64px; top: -36px; }
  .nahlad .hero-photo .art-lev { left: -24px; top: 2%; }
  .nahlad .art-logo { width: 72px; height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  .nahlad *, .nahlad *::before, .nahlad *::after { animation: none !important; transition-duration: .01ms !important; }
  .nahlad .reveal { opacity: 1; translate: 0 0; }
}
