/* ==================================================================
   The Rising Gurukul School — Motion & FX layer (v1.0)
   Flying birds · drifting clouds · falling petals & flowers ·
   floating geometric shapes on breadcrumbs · kindergarten sticker
   parade, rockets, astronauts, planets & falling stars.
   All layers are decorative (aria-hidden) and respect reduced motion.
   ================================================================== */

.fx-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.fx-layer.top { z-index: 4; }

/* ---------- Birds ---------- */
.fx-bird { position: absolute; left: 0; top: 0; width: 46px; height: 24px; animation: birdFly linear infinite; will-change: transform; }
.fx-bird .bob { width: 100%; height: 100%; animation: birdBob 3s ease-in-out infinite; }
.fx-bird svg { width: 100%; height: 100%; overflow: visible; }
.fx-bird .wl, .fx-bird .wr { transform-box: fill-box; animation: flap .55s ease-in-out infinite alternate; }
.fx-bird .wl { transform-origin: 100% 60%; }
.fx-bird .wr { transform-origin: 0% 60%; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.55); } }
@keyframes birdFly { from { transform: translateX(-8vw); } to { transform: translateX(108vw); } }
@keyframes birdFlyRev { from { transform: translateX(108vw) scaleX(-1); } to { transform: translateX(-8vw) scaleX(-1); } }
@keyframes birdBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* ---------- Clouds ---------- */
.fx-cloud { position: absolute; left: 0; opacity: .5; animation: cloudDrift linear infinite; filter: blur(2px) drop-shadow(0 6px 10px rgba(0,0,0,.08)); }
.fx-cloud svg { width: 100%; height: auto; display: block; }
@keyframes cloudDrift { from { transform: translateX(-25vw); } to { transform: translateX(110vw); } }

/* ---------- Petals / flowers ---------- */
.fx-petal { position: absolute; top: -40px; left: 0; animation: petalFall linear infinite; will-change: transform; }
.fx-petal .sw { animation: petalSway ease-in-out infinite alternate; }
.fx-petal svg { display: block; animation: spin 7s linear infinite; }
@keyframes petalFall { from { transform: translateY(-40px); } to { transform: translateY(var(--fall, 110vh)); } }
@keyframes petalSway { from { transform: translateX(-26px) rotate(-12deg); } to { transform: translateX(26px) rotate(12deg); } }

/* ---------- Floating geometric shapes (breadcrumb) ---------- */
.fx-shape { position: absolute; opacity: .55; will-change: transform; }
.fx-shape.circle { border-radius: 50%; border: 3px solid currentColor; }
.fx-shape.dot { border-radius: 50%; background: currentColor; }
.fx-shape.square { border: 3px solid currentColor; border-radius: 6px; }
.fx-shape.tri { width: 0 !important; height: 0 !important; border-left: var(--s) solid transparent; border-right: var(--s) solid transparent; border-bottom: calc(var(--s) * 1.7) solid currentColor; opacity: .35; }
.fx-shape.plus::before, .fx-shape.plus::after { content: ""; position: absolute; background: currentColor; border-radius: 3px; }
.fx-shape.plus::before { left: 40%; top: 0; width: 20%; height: 100%; }
.fx-shape.plus::after { top: 40%; left: 0; height: 20%; width: 100%; }
.fx-shape.ring { border-radius: 50%; border: 6px dashed currentColor; opacity: .3; }
.fx-shape.zig svg, .fx-shape.wave svg { width: 100%; height: 100%; overflow: visible; }
.m-float1 { animation: mf1 9s ease-in-out infinite; }
.m-float2 { animation: mf2 12s ease-in-out infinite; }
.m-spin { animation: spin 18s linear infinite; }
.m-pulse { animation: mpulse 4s ease-in-out infinite; }
@keyframes mf1 { 0%, 100% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(30px, -26px) rotate(60deg); } 66% { transform: translate(-22px, 18px) rotate(-30deg); } }
@keyframes mf2 { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-40px, -30px) rotate(180deg); } }
@keyframes mpulse { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.35); opacity: .2; } }
.page-hero .wave-edge { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; z-index: 3; }
.page-hero .wave-edge svg { width: 100%; height: clamp(40px, 6vw, 80px); display: block; }
.page-hero .mini-sun { position: absolute; right: 8%; top: 22%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #ffd46b 0%, #ffb627 45%, rgba(255, 127, 17, 0) 70%); opacity: .55; animation: mpulse 6s ease-in-out infinite; z-index: 1; }
.page-hero .page-sticker { position: absolute; right: 6%; bottom: 60px; width: clamp(80px, 11vw, 150px); z-index: 2; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .3)); animation: bob 6s ease-in-out infinite; }
@media (max-width: 767px) { .page-hero .page-sticker { width: 70px; right: 4%; bottom: 40px; opacity: .9; } }

/* ---------- Bubbles (parallax / stats) ---------- */
.fx-bubble { position: absolute; bottom: -60px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08)); border: 1px solid rgba(255, 255, 255, .3); animation: bubbleUp linear infinite; }
@keyframes bubbleUp { from { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-120vh) translateX(40px); opacity: 0; } }

/* ---------- Butterflies ---------- */
.fx-butterfly { position: absolute; width: 34px; height: 30px; animation: bflyPath ease-in-out infinite; }
.fx-butterfly svg { width: 100%; height: 100%; overflow: visible; }
.fx-butterfly .w1, .fx-butterfly .w2 { transform-box: fill-box; animation: bflap .22s ease-in-out infinite alternate; }
.fx-butterfly .w1 { transform-origin: 100% 50%; }
.fx-butterfly .w2 { transform-origin: 0% 50%; }
@keyframes bflap { from { transform: scaleX(1); } to { transform: scaleX(.25); } }
@keyframes bflyPath { 0% { transform: translate(0, 0) rotate(8deg); } 25% { transform: translate(120px, -60px) rotate(-6deg); } 50% { transform: translate(240px, 10px) rotate(10deg); } 75% { transform: translate(110px, 70px) rotate(-8deg); } 100% { transform: translate(0, 0) rotate(8deg); } }

/* ---------- Kindergarten sticker motion ---------- */
.kg-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.kg-walk { position: absolute; bottom: 6px; left: 0; height: var(--h, 90px); animation: kgWalk linear infinite; will-change: transform; }
.kg-walk img { height: 100%; width: auto; animation: kgStep .6s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.kg-walk.flip img { transform: scaleX(-1); animation-name: kgStepFlip; }
@keyframes kgWalk { from { transform: translateX(-20vw); } to { transform: translateX(115vw); } }
@keyframes kgStep { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-6px) rotate(2deg); } }
@keyframes kgStepFlip { from { transform: scaleX(-1) translateY(0) rotate(-2deg); } to { transform: scaleX(-1) translateY(-6px) rotate(2deg); } }
.kg-fly { position: absolute; left: 0; top: 0; width: var(--w, 120px); animation: kgFly linear infinite; will-change: transform; }
.kg-fly img { width: 100%; height: auto; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .25)); }
@keyframes kgFly { from { transform: translate(-20vw, var(--y1, 40vh)) rotate(var(--r, 0deg)); } to { transform: translate(115vw, var(--y2, 5vh)) rotate(var(--r, 0deg)); } }
.kg-flyrev { animation-name: kgFlyRev; }
@keyframes kgFlyRev { from { transform: translate(115vw, var(--y1, 20vh)); } to { transform: translate(-25vw, var(--y2, 30vh)); } }
.kg-float { position: absolute; width: var(--w, 90px); animation: kgFloat ease-in-out infinite; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .2)); }
.kg-float img { width: 100%; height: auto; }
@keyframes kgFloat { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(18px, -22px) rotate(4deg); } 50% { transform: translate(-6px, -38px) rotate(10deg); } 75% { transform: translate(-20px, -14px) rotate(-2deg); } }
.kg-spin { animation: spin 30s linear infinite; }
.fx-star { position: absolute; top: -40px; animation: starFall linear infinite; }
.fx-star img, .fx-star svg { width: 100%; height: auto; display: block; animation: spin 4s linear infinite; }
@keyframes starFall { 0% { transform: translateY(-40px) translateX(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(var(--fall, 100vh)) translateX(var(--drift, 60px)); opacity: .2; } }
.fx-twinkle { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255, 255, 255, .8); animation: twinkle ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.3); } }
.fx-shoot { position: absolute; width: 140px; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); border-radius: 2px; transform: rotate(-25deg); animation: shoot linear infinite; opacity: 0; }
@keyframes shoot { 0% { opacity: 0; transform: translate(0, 0) rotate(-25deg); } 4% { opacity: 1; } 12% { opacity: 0; transform: translate(-380px, 180px) rotate(-25deg); } 100% { opacity: 0; transform: translate(-380px, 180px) rotate(-25deg); } }

/* Kindergarten page hero (space theme) */
.kg-hero { position: relative; overflow: hidden; background: radial-gradient(ellipse at 20% 0%, #2a3d8f 0%, #141c4d 45%, #0a0f2e 100%); padding: 120px 0 170px; color: #fff; isolation: isolate; }
.kg-hero h1 { color: #fff; font-family: var(--font-fun); font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 800; animation: capIn .9s var(--ease) both; }
.kg-hero h1 span { background: linear-gradient(90deg, #ffd46b, #ff8fb1, #7fe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kg-hero p.lead-sub { color: #dce4ff; max-width: 620px; font-size: 1.1rem; }
.kg-hero .breadcrumb { background: rgba(255, 255, 255, .12); display: inline-flex; padding: 8px 20px; border-radius: 30px; margin-bottom: 18px; }
.kg-hero .breadcrumb-item, .kg-hero .breadcrumb-item a { color: #fff; font-weight: 600; font-size: .9rem; }
.kg-hero .breadcrumb-item.active { color: #ffd46b; }
.kg-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .6); }
.kg-hero .container { position: relative; z-index: 5; }
.kg-hero .grass { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; z-index: 3; background: linear-gradient(180deg, #5ccf6e, #2f9e4a); border-radius: 50% 50% 0 0 / 40px 40px 0 0; }
.kg-hero .grass::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 28px; background: radial-gradient(circle at 10px 28px, #5ccf6e 12px, transparent 13px) repeat-x; background-size: 22px 28px; }
.kg-hero .kg-stage.ground { z-index: 4; bottom: 30px; top: auto; height: 160px; }
.kg-section-fun { position: relative; overflow: hidden; }
.kg-card { background: #fff; border-radius: 28px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow); height: 100%; transition: transform .45s var(--bounce); position: relative; overflow: hidden; border: 3px solid transparent; }
.kg-card:hover { transform: translateY(-10px) rotate(-1deg); border-color: var(--sunrise); }
.kg-card .kg-ic { width: 90px; height: 90px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--snow); }
.kg-card .kg-ic img { width: 72px; height: 72px; object-fit: contain; transition: transform .5s var(--bounce); }
.kg-card:hover .kg-ic img { transform: scale(1.18) rotate(-8deg); }
.kg-card h3 { font-family: var(--font-fun); font-size: 1.3rem; margin-bottom: 6px; }
.kg-card p { font-size: .93rem; margin: 0; }

@media (max-width: 767px) {
  .fx-bird { width: 32px; height: 17px; }
  .kg-walk { --h: 64px !important; }
  .kg-fly { --w: 80px !important; }
  .kg-float { --w: 60px !important; }
  .kg-hero { padding: 90px 0 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .fx-layer, .kg-stage { display: none !important; }
}
