/* =============================================================================
   animation.css — श्री गुरुदेव आशीर्वाद animation slider (home page)
   -----------------------------------------------------------------------------
   Used by index.html (row "special row for sri gurudev photo animation")
   together with js/animation.js, which builds the scenes inside .ak-slider.
   Every class here starts with "ak-", so these rules do not touch anything
   else on the site.

   Sections:  1. slider frame & controls   2. scene base   3. Sri Gurudev,
              halo & blessing light        4. rolling sukti box / hint / overlays
              5. प्रातः काल landscape       6. सन्ध्या काल landscape
              6b. मध्याह्न  6c. रात्रि  6d. सूक्ष्म जगत  6e. light on Sri Gurudev
              6f. सहस्रदल कमल   7. paused state & reduced motion
   ========================================================================== */


/* ---------- 1. slider frame & controls ---------- */

.ak-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;          /* desktop: wide cinematic frame */
  max-height: 82vh;
  min-height: 300px;
  overflow: hidden;
  background: #141a3e;
  touch-action: pan-y;           /* page still scrolls; sideways swipes change slide */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.ak-slider:focus-visible { box-shadow: 0 0 0 3px #ffb300; }

@media only screen and (max-width: 992px) {        /* tablets */
  .ak-slider { aspect-ratio: 4 / 3; }
}
@media only screen and (max-width: 600px) {        /* phones: tall frame */
  .ak-slider { aspect-ratio: 3 / 4; max-height: none; }
}

.ak-slider:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; max-height: none; }
.ak-slider:-webkit-full-screen { width: 100%; height: 100%; max-height: none; }

.ak-track {
  display: flex;
  height: 100%;
  transition: transform .8s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}
.ak-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

/* buttons: undo Materialize's teal "button:focus" background */
.ak-slider button { font: inherit; padding: 0; margin: 0; }
.ak-slider button:focus { outline: none; background-color: rgba(30, 14, 10, .55); }
.ak-slider button:focus-visible { outline: 2px solid #ffc94a; outline-offset: 2px; }

/* previous / next arrows (appear on hover; always faintly visible on touch screens) */
.ak-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 200, .5);
  background: rgba(30, 14, 10, .35);
  color: #fff3dc;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s, background-color .2s;
}
.ak-prev { left: 12px; }
.ak-next { right: 12px; }
.ak-nav svg { width: 22px; height: 22px; }
.ak-nav:hover { background-color: rgba(120, 60, 20, .6); }

/* dots */
.ak-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 10;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}
.ak-slider .ak-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 240, 210, .85);
  background: rgba(255, 240, 210, .25);
  cursor: pointer;
  transition: background-color .3s, transform .3s;
}
.ak-slider .ak-dot[aria-selected="true"] { background-color: #ffd36b; transform: scale(1.25); }

/* replay + full screen (top-right; bottom-right next to the dots on phones) */
.ak-ctl {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity .3s;
}
.ak-ctl button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 200, .5);
  background: rgba(30, 14, 10, .35);
  color: #fff3dc;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.ak-ctl button:hover { background-color: rgba(120, 60, 20, .6); transform: scale(1.06); }
.ak-ctl svg { width: 18px; height: 18px; }

.ak-slider:hover .ak-nav, .ak-slider:focus-within .ak-nav,
.ak-slider:hover .ak-ctl, .ak-slider:focus-within .ak-ctl { opacity: 1; }
@media (hover: none) {
  .ak-nav { opacity: .7; }
  .ak-ctl { opacity: .85; }
}
@media only screen and (max-width: 600px) {
  .ak-nav { width: 36px; height: 36px; margin-top: -18px; }
  .ak-prev { left: 6px; }
  .ak-next { right: 6px; }
  .ak-ctl { top: auto; bottom: 6px; right: auto; left: calc(50% + 32px); gap: 6px; }
  .ak-ctl button { width: 30px; height: 30px; }
  .ak-dots { bottom: 15px; transform: translateX(calc(-50% - 30px)); }
}


/* ---------- 2. scene base ---------- */

.ak-scene {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  line-height: 1.3;
  font-family: 'Tiro Devanagari Hindi', 'Nirmala UI', 'Mangal', 'Noto Serif Devanagari', serif;
}
.ak-scene * { box-sizing: border-box; }
.ak-land, .ak-ground, .ak-fx {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.ak-ground, .ak-fx { pointer-events: none; }
.ak-saint-wrap {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  will-change: transform;
}


/* ---------- 3. Sri Gurudev, halo & blessing light ---------- */

.ak-saint {
  position: absolute;
  left: 64%;                     /* landscape frame: to the right of the sun */
  bottom: -3%;                   /* the photo's cut-off edge sits just below the frame */
  aspect-ratio: 727 / 946;       /* height / width are set by animation.js */
  transform: translateX(-50%);
  opacity: 0;
  animation: ak-appear-m 3.4s 1.6s cubic-bezier(.2, .7, .2, 1) forwards;
}
.ak-portrait .ak-saint { left: 50%; }
.ak-e .ak-saint { animation: ak-appear-e 3.6s 1.2s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes ak-appear-m {
  0%   { opacity: 0; filter: blur(16px) brightness(2.6); }
  45%  { opacity: 1; filter: blur(4px) brightness(1.7); }
  100% { opacity: 1; filter: none; }
}
@keyframes ak-appear-e {
  0%   { opacity: 0; filter: blur(18px) brightness(2.2) sepia(.6); }
  45%  { opacity: 1; filter: blur(5px) brightness(1.5) sepia(.3); }
  100% { opacity: 1; filter: none; }
}
.ak-saint > * { position: absolute; }

/* soft golden aura behind the whole figure */
.ak-aura {
  left: -35%; right: -35%; top: -18%; bottom: -6%;
  background: radial-gradient(ellipse 42% 48% at 56% 40%, rgba(255, 242, 205, .6), rgba(255, 206, 130, .3) 42%, rgba(255, 180, 100, 0) 72%);
  animation: ak-aura 7s 4.5s ease-in-out infinite;
}
.ak-e .ak-aura { background: radial-gradient(ellipse 42% 48% at 56% 40%, rgba(255, 214, 150, .5), rgba(255, 160, 90, .24) 42%, rgba(255, 140, 80, 0) 72%); }
@keyframes ak-aura { 0%, 100% { opacity: .8; transform: scale(1); } 20% { opacity: 1; transform: scale(1.05); } }

/* halo (prabhamandal) around the head */
.ak-halo {
  left: 66%; top: 16.9%;
  width: 58%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.3);
  opacity: 0;
  animation: ak-halo-in 2.6s 3.4s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes ak-halo-in { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.ak-halo i { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; }
.ak-h-glow {
  background: radial-gradient(circle, rgba(255, 250, 228, .95) 0 15%, rgba(255, 224, 145, .78) 29%, rgba(255, 182, 72, .32) 48%, rgba(255, 160, 60, 0) 68%);
  animation: ak-aura 7s 4.5s ease-in-out infinite;
}
.ak-e .ak-h-glow { background: radial-gradient(circle, rgba(255, 246, 214, .95) 0 15%, rgba(255, 206, 120, .78) 29%, rgba(255, 150, 60, .32) 48%, rgba(255, 130, 50, 0) 68%); }
.ak-halo .ak-h-rays {
  top: -38%; right: -38%; bottom: -38%; left: -38%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 152, .6) 0deg 1.4deg, rgba(255, 224, 152, 0) 1.4deg 7deg);
  -webkit-mask: radial-gradient(circle, transparent 17%, #000 26%, rgba(0, 0, 0, .55) 44%, transparent 68%);
          mask: radial-gradient(circle, transparent 17%, #000 26%, rgba(0, 0, 0, .55) 44%, transparent 68%);
  animation: ak-spin 90s linear infinite;
}
.ak-halo .ak-h-ring {
  top: 13%; right: 13%; bottom: 13%; left: 13%;
  border: 2px solid rgba(255, 228, 155, .92);
  box-shadow: 0 0 22px rgba(255, 196, 90, .85), inset 0 0 22px rgba(255, 196, 90, .55);
}
.ak-e .ak-halo .ak-h-ring { border-color: rgba(255, 220, 140, .92); box-shadow: 0 0 22px rgba(255, 170, 70, .85), inset 0 0 22px rgba(255, 170, 70, .55); }
.ak-halo .ak-h-ring2 {
  top: 5.5%; right: 5.5%; bottom: 5.5%; left: 5.5%;
  border: 1.5px dashed rgba(255, 238, 185, .7);
  animation: ak-spin 70s linear infinite reverse;
}
@keyframes ak-spin { to { transform: rotate(360deg); } }

/* glow behind the blessing palm */
.ak-palm-aura {
  left: 44.7%; top: 14.8%;
  width: 78%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: ak-fade-in 2.4s 3.8s ease-out forwards;
}
.ak-palm-aura::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 215, .9) 0 7%, rgba(255, 218, 135, .5) 21%, rgba(255, 182, 82, .18) 42%, rgba(255, 170, 80, 0) 64%);
  animation: ak-palm-aura 7s 4.5s ease-in-out infinite;
}
@keyframes ak-palm-aura { 0%, 100% { transform: scale(.9); opacity: .75; } 20% { transform: scale(1.12); opacity: 1; } }
@keyframes ak-fade-in { to { opacity: 1; } }

/* the figure: body layer + the raised hand layer on top of it */
.ak-figure {
  top: 0; right: 0; bottom: 0; left: 0;
  transform-origin: 50% 100%;
  animation: ak-breathe 5.5s 3s ease-in-out infinite;
  will-change: transform;
}
@keyframes ak-breathe { 50% { transform: scale(1.004, 1.009); } }
.ak-figure img, .ak-figure canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}
.ak-figure .ak-body { filter: drop-shadow(0 0 9px rgba(255, 214, 150, .6)) saturate(1.06) contrast(1.04); }
.ak-hand img { filter: saturate(1.06) contrast(1.04); }
/* evening: dimmer, warmer, lit from the west by the setting sun */
.ak-e .ak-figure img { filter: brightness(.9) contrast(1.06) saturate(1.08) sepia(.1); }
.ak-e .ak-figure .ak-body { filter: drop-shadow(-5px 0 12px rgba(255, 120, 50, .5)) brightness(.9) contrast(1.06) saturate(1.08) sepia(.1); }
.ak-figure canvas.ak-lit { mix-blend-mode: screen; pointer-events: none; }
.ak-figure canvas.ak-rim { opacity: .95; }
.ak-figure canvas.ak-fire { opacity: .45; }

/* the blessing gesture: the hand turns gently at the wrist */
.ak-hand {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform-origin: 40.58% 24.52%;    /* the wrist, as a fraction of the photo */
  animation: ak-bless 7s 4.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes ak-bless {
  0%, 100% { transform: rotate(0) scale(1); }
  20%      { transform: rotate(-2.2deg) scale(1.028); }
  42%      { transform: rotate(.7deg) scale(1.012); }
  64%      { transform: rotate(-1.3deg) scale(1.02); }
  84%      { transform: rotate(.3deg) scale(1.004); }
}
.ak-palm-glow {
  position: absolute;
  left: 44.7%; top: 14.8%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: .25;
  mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 250, 222, .42) 0 8%, rgba(255, 222, 140, .24) 30%, rgba(255, 200, 110, 0) 62%);
  animation: ak-palm-glow 7s 4.5s ease-in-out infinite;
}
@keyframes ak-palm-glow {
  0%, 100% { opacity: .25; transform: translate(-50%, -50%) scale(.85); }
  20%      { opacity: .7;  transform: translate(-50%, -50%) scale(1.15); }
  45%      { opacity: .4;  transform: translate(-50%, -50%) scale(1); }
}
.ak-ripple {
  position: absolute;
  left: 44.7%; top: 14.8%;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 232, 165, .9);
  box-shadow: 0 0 14px rgba(255, 210, 120, .75), inset 0 0 10px rgba(255, 210, 120, .5);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3);
  animation: ak-ripple 7s 4.5s ease-out infinite;
}
.ak-ripple.ak-r2 { animation-delay: 5.1s; }
.ak-ripple.ak-r3 { animation-delay: 5.7s; }
@keyframes ak-ripple {
  0%, 14%   { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  18%       { opacity: .9; }
  58%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(4.4); }
}


/* ---------- 4. title, hint and colour overlays ---------- */

.ak-grade, .ak-vignette, .ak-flash {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
}
.ak-grade { background: linear-gradient(180deg, rgba(255, 190, 110, .10), rgba(255, 170, 90, 0) 45%, rgba(40, 30, 10, .12)); mix-blend-mode: soft-light; }
.ak-e .ak-grade { background: linear-gradient(180deg, rgba(80, 40, 120, .10), rgba(255, 120, 60, .06) 55%, rgba(30, 10, 20, .18)); }
.ak-vignette { background: radial-gradient(ellipse 85% 80% at 50% 45%, rgba(0, 0, 0, 0) 60%, rgba(20, 10, 0, .38) 100%); }
.ak-e .ak-vignette { background: radial-gradient(ellipse 85% 80% at 45% 50%, rgba(0, 0, 0, 0) 55%, rgba(12, 4, 18, .5) 100%); }
.ak-flash { opacity: 0; background: radial-gradient(circle at var(--fx, 60%) var(--fy, 30%), rgba(255, 244, 210, .55), rgba(255, 220, 150, 0) 45%); }
.ak-flash.ak-on { animation: ak-flash 1.2s ease-out; }
@keyframes ak-flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* --- the rolling sukti box (filled by animation.js, font-size set there to fit) ---
   A soft dark backing keeps the text readable over bright skies. Each line
   rolls in from below like a turning drum, stays, then rolls away upwards. */
.ak-sukti {
  position: absolute;
  left: 4%;
  top: 6%;
  z-index: 6;
  max-width: 40%;
  padding: .7em 1em .8em;
  border-radius: 14px;
  background: rgba(14, 10, 26, .3);
  box-shadow: 0 0 34px 20px rgba(14, 10, 26, .3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .7s ease;
  font-size: 22px;
}
.ak-sukti.ak-in { opacity: 1; }
.ak-sukti.ak-out { opacity: 0; transition-duration: 1s; transition-delay: .25s; }
.ak-ln {
  display: block;
  opacity: 0;
  transform-origin: 50% 50%;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.ak-in .ak-ln  { animation: ak-roll-in 1s cubic-bezier(.2, .75, .25, 1) calc(var(--d, 0) * .22s) both; }
.ak-out .ak-ln { animation: ak-roll-out .85s cubic-bezier(.55, 0, .8, .2) calc(var(--d, 0) * .1s) both; }
@keyframes ak-roll-in {
  from { opacity: 0; transform: perspective(600px) translateY(70%) rotateX(-88deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes ak-roll-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: perspective(600px) translateY(-70%) rotateX(88deg); }
}
.ak-hi {                                    /* Hindi: the main line */
  font-family: 'Tiro Devanagari Hindi', 'Nirmala UI', 'Mangal', serif;
  font-size: 1em;
  line-height: 1.5;
  color: #fff8e8;
  text-shadow: 0 1px 3px rgba(20, 10, 0, .8), 0 0 14px rgba(20, 10, 0, .4);
}
.ak-en {                                    /* English translation */
  margin-top: .45em;
  font-family: 'Tiro Devanagari Hindi', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: .74em;
  line-height: 1.45;
  color: #f2ead9;
  text-shadow: 0 1px 3px rgba(20, 10, 0, .8);
}
.ak-ref {                                   /* सूक्ति शतक … — योगर्षि श्रीकपिल */
  margin-top: .6em;
  font-family: 'Tiro Devanagari Hindi', Georgia, serif;
  font-size: .56em;
  line-height: 1.5;
  color: #ffd27a;
  text-shadow: 0 1px 3px rgba(20, 10, 0, .85);
}
.ak-noen .ak-en, .ak-noen .ak-ref-en { display: none; }   /* very long sukti on a phone: Hindi only */

/* tall (phone) frame: text centred on top */
.ak-portrait .ak-sukti { left: 3%; right: 3%; top: 3%; max-width: none; text-align: center; padding: .55em .8em .65em; }

.ak-hint {
  position: absolute;
  left: 5%;
  bottom: 4%;
  z-index: 6;
  pointer-events: none;
  color: #fff7e3;
  font-size: clamp(11px, calc(var(--u, 10px) * 1.05), 16px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  opacity: 0;
  animation: ak-hint 9s 9s ease-in-out forwards;
}
.ak-e .ak-hint { animation-delay: 10s; }
.ak-portrait .ak-hint { display: none; }
@keyframes ak-hint { 0% { opacity: 0; } 15%, 75% { opacity: .85; } 100% { opacity: 0; } }

.ak-land .bloom { mix-blend-mode: screen; }
@keyframes ak-to-one { to { opacity: 1; } }
@keyframes ak-to-zero { to { opacity: 0; } }


/* ---------- 5. प्रातः काल landscape (sunrise) ---------- */

.ak-m .ak-land .rise { transform: translateY(310px); animation: ak-m-rise 10s cubic-bezier(.22, .6, .3, 1) .3s forwards; }
@keyframes ak-m-rise { to { transform: translateY(0); } }
.ak-m .ak-land .sunrays { transform-origin: 620px 250px; animation: ak-spin 220s linear infinite; }
.ak-m .ak-land .sunpulse { transform-origin: 620px 250px; animation: ak-m-sun-pulse 6s ease-in-out infinite; }
@keyframes ak-m-sun-pulse { 50% { transform: scale(1.06); opacity: .85; } }
.ak-m .ak-land .stars { animation: ak-to-zero 6s ease-in forwards; }
.ak-m .ak-land .night { animation: ak-to-zero 9s ease-in-out .2s forwards; }
.ak-m .ak-land .cloudsLayer { opacity: .35; animation: ak-to-one 9s ease-in-out forwards; }
.ak-m .ak-land .glitterLayer { opacity: 0; animation: ak-to-one 6s 3s ease-in-out forwards; }
.ak-m .ak-land .cloud { animation: ak-m-drift linear infinite; }
@keyframes ak-m-drift { from { transform: translateX(-420px); } to { transform: translateX(1980px); } }
.ak-m .ak-land .flock { animation: ak-m-fly linear infinite both; }
.ak-m .ak-land .flock.rev { animation-name: ak-m-fly-rev; }
@keyframes ak-m-fly { from { transform: translate(-250px, 40px); } to { transform: translate(1900px, -50px); } }
@keyframes ak-m-fly-rev { from { transform: translate(1900px, 0); } to { transform: translate(-250px, -40px); } }
.ak-m .ak-land .mist { animation: ak-m-mist 28s ease-in-out infinite alternate; }
@keyframes ak-m-mist { from { transform: translateX(-45px); } to { transform: translateX(45px); } }
.ak-m .ak-land .sway { transform-box: fill-box; transform-origin: 50% 100%; animation: ak-m-sway 5s ease-in-out infinite alternate; }
@keyframes ak-m-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.ak-m .ak-land .flow { animation: ak-m-flow 1.5s linear infinite; }
@keyframes ak-m-flow { to { stroke-dashoffset: -28; } }
.ak-m .ak-land .fall { animation: ak-m-fall .9s linear infinite; }
@keyframes ak-m-fall { to { stroke-dashoffset: -52; } }
.ak-m .ak-land .glint { transform-box: fill-box; transform-origin: center; animation: ak-glint 2.6s ease-in-out infinite; }
@keyframes ak-glint { 0%, 100% { opacity: .12; transform: scaleX(.5); } 50% { opacity: .95; transform: scaleX(1.2); } }
.ak-m .ak-land .rip { transform-box: fill-box; transform-origin: center; animation: ak-m-rip 6s ease-out infinite; }
@keyframes ak-m-rip { 0% { transform: scale(.15); opacity: 0; } 10% { opacity: .75; } 100% { transform: scale(1.7); opacity: 0; } }
.ak-m .ak-land .bob { transform-box: fill-box; transform-origin: 50% 80%; animation: ak-m-bob 5s ease-in-out infinite alternate; }
@keyframes ak-m-bob { from { transform: translateY(-1.3px) rotate(-2.5deg); } to { transform: translateY(1.3px) rotate(2.5deg); } }
.ak-m .ak-land .foam { transform-box: fill-box; transform-origin: center; animation: ak-m-foam 1.8s ease-in-out infinite alternate; }
@keyframes ak-m-foam { from { transform: scale(.85); opacity: .55; } to { transform: scale(1.15); opacity: .9; } }


/* ---------- 6. सन्ध्या काल landscape (sunset) ---------- */

/* --sunFrom is set by animation.js: how far above the horizon the sun starts */
.ak-e .ak-land .sunset { transform: translateY(var(--sunFrom, -206px)); animation: ak-e-sunset 34s cubic-bezier(.3, .1, .35, 1) .5s forwards; }
@keyframes ak-e-sunset { from { transform: translateY(var(--sunFrom, -206px)); } to { transform: translateY(0); } }
.ak-e .ak-land .sundisk { transform-box: fill-box; transform-origin: center; animation: ak-e-flatten 34s .5s ease-in forwards; }
@keyframes ak-e-flatten { to { transform: scale(1.05, .9); } }
.ak-e .ak-land .sunpulse { transform-origin: 520px 566px; animation: ak-e-sun-pulse 6s ease-in-out infinite; }
@keyframes ak-e-sun-pulse { 50% { transform: scale(1.08); opacity: .8; } }
.ak-e .ak-land .lalima { opacity: .35; animation: ak-to-one 34s .5s ease-in-out forwards; }
.ak-e .ak-land .stars { opacity: 0; animation: ak-to-one 20s 12s ease-in forwards; }
.ak-e .ak-land .tw { animation: ak-e-twinkle 3s ease-in-out infinite alternate; }
@keyframes ak-e-twinkle { from { opacity: .2; } to { opacity: 1; } }
.ak-e .ak-land .moonrise { transform: translateY(70px); opacity: .35; animation: ak-e-moonrise 34s .5s ease-out forwards; }
@keyframes ak-e-moonrise { to { transform: none; opacity: 1; } }
.ak-e .ak-land .cloud { animation: ak-e-cloud 90s ease-in-out infinite alternate; }
@keyframes ak-e-cloud { from { transform: translateX(40px); } to { transform: translateX(-60px); } }
.ak-e .ak-land .flock { animation: ak-e-fly linear infinite both; }
@keyframes ak-e-fly { from { transform: translate(1900px, 30px); } to { transform: translate(-260px, -40px); } }
/* landscape layers darken as dusk falls (--to = final darkness) */
.ak-e .ak-land .dusk { opacity: 0; animation: ak-e-dusk 32s 2s ease-in-out forwards; }
@keyframes ak-e-dusk { to { opacity: var(--to, .45); } }
.ak-e .ak-land .sunrefl { animation: ak-e-refl-dim 34s .5s ease-in forwards; }
@keyframes ak-e-refl-dim { to { opacity: .72; } }
.ak-e .ak-land .glint { transform-box: fill-box; transform-origin: center; animation: ak-e-glint 2.6s ease-in-out infinite; }
@keyframes ak-e-glint { 0%, 100% { opacity: .15; transform: scaleX(.5); } 50% { opacity: .95; transform: scaleX(1.2); } }
.ak-e .ak-land .shim { animation: ak-e-shim 3.4s ease-in-out infinite alternate; }
@keyframes ak-e-shim { from { opacity: .25; } to { opacity: .9; } }
.ak-e .ak-land .mist { animation: ak-e-mist 30s ease-in-out infinite alternate; }
@keyframes ak-e-mist { from { transform: translateX(-50px); } to { transform: translateX(50px); } }
/* village lamps lighting up one by one */
.ak-e .ak-land .vl { opacity: 0; animation: ak-to-one 4s ease-out forwards; }
.ak-e .ak-land .vlg, .ak-e .ak-land .lamp { transform-box: fill-box; transform-origin: center; animation: ak-e-lamp 2.2s ease-in-out infinite alternate; }
.ak-e .ak-land .lamp { animation-duration: 1.3s; }
@keyframes ak-e-lamp { from { transform: scale(.75); opacity: .7; } to { transform: scale(1.15); opacity: 1; } }
.ak-e .ak-land .frond { animation: ak-e-frond 6s ease-in-out infinite alternate; }
@keyframes ak-e-frond { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
/* the boatman crossing the sun's path */
.ak-e .ak-land .boat { animation: ak-e-sail 170s linear -38s infinite; }
@keyframes ak-e-sail { from { transform: translateX(0); } to { transform: translateX(-1380px); } }
.ak-e .ak-land .pole { transform-origin: 9px -20px; animation: ak-e-pole 4.5s ease-in-out infinite alternate; }
@keyframes ak-e-pole { from { transform: rotate(-9deg); } to { transform: rotate(7deg); } }
/* floating diyas: drift, light up one by one, flicker */
.ak-e .ak-land .fdrift { transform-box: fill-box; transform-origin: center; animation: ak-e-fdrift 20s ease-in-out infinite alternate; }
@keyframes ak-e-fdrift { from { transform: translate(0, 0) rotate(-2.5deg); } to { transform: translate(-34px, 1.5px) rotate(2.5deg); } }
.ak-e .ak-land .ignite { transform-origin: 8.5px -3.5px; transform: scale(0); animation: ak-e-ignite 1.4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ak-e-ignite { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ak-e .ak-land .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: ak-e-flick 1s ease-in-out infinite; }
@keyframes ak-e-flick {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  25%      { transform: scale(.9, 1.14) skewX(-5deg); }
  50%      { transform: scale(1.06, .92) skewX(3deg); }
  75%      { transform: scale(.95, 1.08) skewX(-2deg); }
}
.ak-e .ak-land .fglow { animation: ak-e-fglow .6s ease-in-out infinite alternate; }
@keyframes ak-e-fglow { from { opacity: .65; } to { opacity: 1; } }
.ak-e .ak-land .frefl { transform-box: fill-box; transform-origin: 50% 0; animation: ak-e-frefl 1.2s ease-in-out infinite alternate; }
@keyframes ak-e-frefl { from { opacity: .4; transform: scale(.8, .9); } to { opacity: .85; transform: scale(1.15, 1.1); } }


/* ---------- 6b. मध्याह्न — peepal tree by the lotus pond ---------- */

.ak-g .ak-land .cloud { animation: ak-m-drift linear infinite; }
.ak-g .ak-land .flock { animation: ak-m-fly linear infinite both; }
.ak-g .ak-land .flock.rev { animation-name: ak-m-fly-rev; }
.ak-g .ak-land .mist { animation: ak-m-mist 28s ease-in-out infinite alternate; }
.ak-g .ak-land .rip { transform-box: fill-box; transform-origin: center; animation: ak-m-rip 6s ease-out infinite; }
.ak-g .ak-land .bob { transform-box: fill-box; transform-origin: 50% 80%; animation: ak-m-bob 5s ease-in-out infinite alternate; }
.ak-g .ak-land .shim { animation: ak-e-shim 3.4s ease-in-out infinite alternate; }
/* sunbeams through the canopy breathe softly */
.ak-g .ak-land .ray { animation: ak-g-ray 7s ease-in-out infinite alternate; }
@keyframes ak-g-ray { from { opacity: .25; } to { opacity: .8; } }
/* hanging peepal leaves flutter on their stems */
.ak-g .ak-land .leaf { transform-origin: 0 0; animation: ak-g-leaf 4s ease-in-out infinite alternate; }
@keyframes ak-g-leaf { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
/* swans drift slowly to and fro */
.ak-g .ak-land .swan { transform-box: fill-box; transform-origin: center; animation: ak-g-swan 50s ease-in-out infinite alternate; }
@keyframes ak-g-swan { from { transform: translateX(-45px); } to { transform: translateX(45px) translateY(2px); } }


/* ---------- 6c. रात्रि — moonlit Himalaya ---------- */

.ak-n .ak-land .tw { animation: ak-e-twinkle 3s ease-in-out infinite alternate; }
.ak-n .ak-land .mist { animation: ak-e-mist 30s ease-in-out infinite alternate; }
.ak-n .ak-land .shim { animation: ak-e-shim 3.4s ease-in-out infinite alternate; }
.ak-n .ak-land .glint { transform-box: fill-box; transform-origin: center; animation: ak-glint 2.6s ease-in-out infinite; }
.ak-n .ak-land .lamp { transform-box: fill-box; transform-origin: center; animation: ak-e-lamp 1.4s ease-in-out infinite alternate; }
/* a shooting star streaks across now and then */
.ak-n .ak-land .shoot { opacity: 0; animation: ak-n-shoot linear infinite both; }
@keyframes ak-n-shoot {
  0%        { opacity: 0; transform: translate(0, 0); }
  1%        { opacity: 1; }
  6%, 100%  { opacity: 0; transform: translate(-300px, 111px); }
}
/* smoke curling up from the hut */
.ak-n .ak-land .puff { transform-box: fill-box; transform-origin: center; animation: ak-n-puff 6s linear infinite; }
@keyframes ak-n-puff {
  from { transform: translate(0, 0) scale(.6); opacity: .45; }
  to   { transform: translate(10px, -50px) scale(2.2); opacity: 0; }
}


/* ---------- 6d. सूक्ष्म जगत — the cosmos ---------- */

.ak-c .ak-land .tw { animation: ak-e-twinkle 3s ease-in-out infinite alternate; }
.ak-c .ak-land .neb { transform-box: fill-box; transform-origin: center; animation: ak-c-neb 50s ease-in-out infinite alternate; }
@keyframes ak-c-neb { from { transform: translate(-30px, 10px) scale(1); } to { transform: translate(30px, -10px) scale(1.07); } }
/* golden mandala turning behind Sri Gurudev (three rings, alternate directions) */
.ak-mandala {
  left: 55%;
  top: 44%;
  width: 210%;
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  animation: ak-c-mandala-in 3s 1.5s ease-out forwards;
}
@keyframes ak-c-mandala-in { to { opacity: .55; } }
.ak-mandala g { transform-origin: 0 0; }
.ak-md-a { animation: ak-spin 140s linear infinite; }
.ak-md-b { animation: ak-spin 100s linear infinite reverse; }
.ak-md-c { animation: ak-spin 70s linear infinite; }


/* ---------- 6e. Sri Gurudev's light in the new scenes ---------- */

/* night: dimmer, cooler, moonlit from the east, firelight from the dhuni */
.ak-n .ak-saint { animation: ak-appear-e 3.6s 1.2s cubic-bezier(.2, .7, .2, 1) forwards; }
.ak-n .ak-figure img { filter: brightness(.8) contrast(1.08) saturate(.86); }
.ak-n .ak-figure .ak-body { filter: drop-shadow(5px 0 12px rgba(170, 190, 255, .45)) brightness(.8) contrast(1.08) saturate(.86); }
.ak-n .ak-aura { background: radial-gradient(ellipse 42% 48% at 56% 40%, rgba(255, 236, 200, .42), rgba(190, 200, 255, .18) 42%, rgba(160, 170, 255, 0) 72%); }
.ak-n .ak-grade { background: linear-gradient(180deg, rgba(60, 80, 170, .12), rgba(30, 40, 100, .05) 60%, rgba(5, 8, 20, .2)); }
.ak-n .ak-vignette { background: radial-gradient(ellipse 85% 80% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(2, 4, 14, .55) 100%); }
/* cosmos: a golden glow all round */
.ak-c .ak-figure .ak-body { filter: drop-shadow(0 0 14px rgba(255, 210, 140, .75)) saturate(1.05) contrast(1.04); }
.ak-c .ak-aura { background: radial-gradient(ellipse 45% 50% at 56% 40%, rgba(255, 230, 190, .55), rgba(255, 150, 210, .22) 45%, rgba(160, 120, 255, 0) 75%); }
.ak-c .ak-grade { background: none; }
.ak-c .ak-vignette { background: radial-gradient(ellipse 85% 80% at 55% 45%, rgba(0, 0, 0, 0) 55%, rgba(5, 2, 15, .55) 100%); }


/* ---------- 6f. सहस्रदल कमल — thousand-petalled white lotus in an endless galaxy ----------
   (the lotus, the galaxy and the light are drawn by animation.js; Sri Gurudev's
   place on the lotus is set there too, as inline left / bottom) */

.ak-sh .ak-land .tw { animation: ak-e-twinkle 3s ease-in-out infinite alternate; }
.ak-sh .ak-land .neb { transform-box: fill-box; transform-origin: center; animation: ak-c-neb 50s ease-in-out infinite alternate; }
/* the whole sky drifts very slowly closer: travelling on into the endless cosmos */
.ak-sh .ak-land .zoom { transform-box: view-box; transform-origin: 62% 58%; animation: ak-sh-zoom 70s linear both; }
@keyframes ak-sh-zoom { from { transform: scale(1); } to { transform: scale(1.12); } }
/* Sri Gurudev appears in white light once the lotus has opened */
.ak-sh .ak-saint { animation: ak-appear-sh 3.4s 3s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes ak-appear-sh {
  0%   { opacity: 0; filter: blur(18px) brightness(3); }
  45%  { opacity: 1; filter: blur(4px) brightness(1.8); }
  100% { opacity: 1; filter: none; }
}
.ak-sh .ak-figure .ak-body { filter: drop-shadow(0 0 14px rgba(225, 232, 255, .7)) saturate(1.04) contrast(1.04); }
.ak-sh .ak-aura { background: radial-gradient(ellipse 45% 50% at 56% 40%, rgba(255, 250, 235, .55), rgba(190, 200, 255, .22) 45%, rgba(140, 150, 255, 0) 75%); }
.ak-sh .ak-h-glow { background: radial-gradient(circle, rgba(255, 255, 250, .95) 0 15%, rgba(255, 240, 205, .75) 29%, rgba(230, 220, 255, .3) 48%, rgba(200, 200, 255, 0) 68%); }
.ak-sh .ak-halo .ak-h-ring { border-color: rgba(255, 250, 235, .95); box-shadow: 0 0 22px rgba(225, 228, 255, .85), inset 0 0 22px rgba(255, 238, 205, .55); }
.ak-sh .ak-grade { background: none; }
.ak-sh .ak-vignette { background: radial-gradient(ellipse 85% 80% at 58% 50%, rgba(0, 0, 0, 0) 55%, rgba(2, 3, 16, .6) 100%); }


/* ---------- 7. paused state & reduced motion ---------- */

/* a scene that is off screen / not the current slide is frozen */
.ak-paused, .ak-paused *, .ak-paused *::before, .ak-paused *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .ak-track { transition: none; }
  .ak-scene *, .ak-scene *::before, .ak-scene *::after {
    animation-duration: .01s !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
}
