/* ==========================================================================
   Radha Krishna wedding theme — "Vrindavan comes alive" (with rk-alive.js)
   --------------------------------------------------------------------------
   The third motion layer. opening/invitation/love-story.css draw and enter
   the page; motion.css + rk-motion.js tie it to the scroll; this layer adds
   what makes it feel alive: light, air, the flute, the peacock, and answers
   to the visitor's touch.

     1. Shared            the particle sky, the gold sheen on script names,
                          the shine and ripple on every button
     2. Opening           dawn light and rays, the touch between the hands,
                          the clouds that part on Open Invitation
     3. Invitation        the diya glow, the Swastik's halo, the darshan halo
                          behind Radha-Krishna, the garden breathing
     4. Love story        the portrait develops, the frame blooms open, the
                          memories on an arc, the lightbox, the countdown flip,
                          the reply card, the meadow
     5. The peacock       the guide that flies through the page
     6. Lenis             smooth scrolling (desktop)

   `.rk-alive` is on the root only while rk-alive.js runs (never with reduced
   motion, never without GSAP). Every rule below is scoped to it, so without
   the script the page is exactly what the other stylesheets draw.

   THE RULE OF ONE OWNER still holds. Entrances own `transform`; rk-motion.js
   writes `translate` / `rotate` on its own targets. This layer only animates
   elements it creates, the INNER images of artwork whose wrapper someone
   else moves, or properties nobody else writes (filter, clip-path on the
   portrait frame, background-position of the sheen). It never touches
   .rk-love or .rk-love__rite — the pinned ceremonies live inside them.
   ========================================================================== */


/* 1. Shared =============================================================== */

/* the particle sky: one canvas over the whole page, never in the way */
.rk-alive-sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9500;
  pointer-events: none;
}

/* --- the gold sheen ------------------------------------------------------
   The script names are written in ink; every so often a line of gold runs
   through them, left to right, as if the light caught the ink. The text is
   painted by its own background (clipped to the glyphs), in its own ink
   colour except for the moving band. rk-alive.js widens the box by the
   swashes' reach (padding, cancelled by an equal negative margin) so no
   flourish of the script falls outside the painted area. */
.rk-alive .rk-alive-sheen {
  background-image: linear-gradient(105deg,
      var(--rk-ink) 0%, var(--rk-ink) 41%,
      #c9962f 45%, #f7dc8a 48.5%, #fff7dc 50%, #f2cd6e 51.5%, #b8862a 55%,
      var(--rk-ink) 59%, var(--rk-ink) 100%);
  background-size: 320% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.rk-alive .rk-alive-sheen.is-shining {
  animation: rk-sheen 2.4s cubic-bezier(0.45, 0.05, 0.3, 1) both;
}

@keyframes rk-sheen {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

/* --- buttons: a slow shine, a magnetic pull, a gold ripple on press ------- */
.rk-alive .rk-alive-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  translate: var(--rk-mag-x, 0px) var(--rk-mag-y, 0px);
}

.rk-alive .rk-alive-btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 236, 170, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg) translateX(0);
  animation: rk-btn-shine 5.5s cubic-bezier(0.55, 0, 0.25, 1) 1.2s infinite;
  pointer-events: none;
}

@keyframes rk-btn-shine {
  0%       { transform: skewX(-18deg) translateX(0); }
  32%, 100% { transform: skewX(-18deg) translateX(430%); }
}

.rk-alive-ripple {
  position: absolute;
  z-index: -1;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 215, 124, 0.85) 0%, rgba(200, 160, 60, 0.35) 45%, rgba(200, 160, 60, 0) 70%);
  pointer-events: none;
  animation: rk-ripple 0.75s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}

@keyframes rk-ripple {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(28); opacity: 0; }
}

/* words that rise as they are read (rk-alive.js splits them) */
.rk-alive .rk-alive-w {
  display: inline-block;
  will-change: transform, opacity;
}


/* 2. Opening ============================================================== */

/* --- dawn over Vrindavan ------------------------------------------------
   Between the sky and the clouds: a warm glow at the top of the sky that
   gathers as the feather comes down (rk-alive.js scrubs --dawn), and thin
   rays turning so slowly they are felt rather than seen. */
.rk-alive-dawn {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  --dawn: 0.35;
}

.rk-alive-dawn__glow {
  position: absolute;
  left: 50%;
  top: -38vmax;
  width: 120vmax;
  height: 80vmax;
  margin-left: -60vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 205, 0.95), rgba(255, 226, 150, 0.55) 38%, rgba(255, 214, 140, 0.18) 66%, rgba(255, 214, 140, 0) 100%);
  opacity: var(--dawn);
  mix-blend-mode: screen;
}

.rk-alive-dawn__rays {
  position: absolute;
  left: 50%;
  top: -10vmax;
  width: 170vmax;
  height: 170vmax;
  margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(from 0deg,
      rgba(255, 246, 214, 0.38) 0deg 2.2deg,
      rgba(255, 246, 214, 0) 2.2deg 9deg,
      rgba(255, 240, 200, 0.22) 9deg 10.4deg,
      rgba(255, 246, 214, 0) 10.4deg 17deg);
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 4%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0) 52%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 4%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0) 52%);
  opacity: calc(var(--dawn) * 0.9);
  mix-blend-mode: soft-light;
  animation: rk-rays-turn 140s linear infinite;
}

@keyframes rk-rays-turn {
  to { transform: rotate(360deg); }
}

/* --- the touch ----------------------------------------------------------
   When the scroll brings Radha's hand to Krishna's, light breaks where
   they meet: a bloom and a ring (and sparks and petals on the canvas). */
.rk-alive-touch {
  position: fixed;
  z-index: 9400;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rk-alive-touch i {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
}

.rk-alive-touch__bloom {
  width: 46vmin;
  height: 46vmin;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 238, 180, 0.75) 18%, rgba(247, 205, 110, 0.32) 42%, rgba(247, 205, 110, 0) 70%);
  mix-blend-mode: screen;
}

.rk-alive-touch__ring {
  width: 30vmin;
  height: 30vmin;
  border: 2px solid rgba(255, 226, 150, 0.9);
  box-shadow: 0 0 24px rgba(255, 214, 120, 0.7), inset 0 0 18px rgba(255, 214, 120, 0.5);
}

/* --- into the light ------------------------------------------------------
   Open Invitation: a circle of warm ivory light opens from the button and
   fills the screen (rk-alive.js scales it up), a soft gold glow riding
   its edge; winter mist (on the canvas) wreathes the edge and then carries
   the light away over the invitation. No raster is ever scaled up, so it
   stays crisp at every size. */
.rk-alive-veil {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow: hidden;
  pointer-events: none;
}

.rk-alive-veil__iris {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #fffef9 0%, #fdf9ee 45%, #f6f0e0 100%);
  transform: scale(0);
  will-change: transform, opacity;
}

/* a ring of light whose radius matches the iris' (scaled by the script):
   the glow sits at 70% of the box's radius */
.rk-alive-veil__ring {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
      rgba(255, 236, 180, 0) 62%,
      rgba(255, 226, 150, 0.55) 67.5%,
      rgba(255, 248, 225, 0.95) 70%,
      rgba(255, 236, 180, 0.35) 72.5%,
      rgba(255, 236, 180, 0) 78%);
  transform: scale(0);
  will-change: transform, opacity;
}

/* while the light opens, the opening keeps its colour behind it (its own
   700ms fade, opening.css, would wash it out under the light) */
.rk-alive-veiled .rk-opening.is-opening {
  opacity: 1;
  transform: none;
}

/* the invitation's head arrives as the light clears: its lines follow one
   another quickly, so nothing waits behind an empty page */
.rk-alive .rk-invite {
  --t-ganesh: 0.05s;
  --t-blessed: 0.12s;
  --t-title: 0.2s;
  --t-divider: 0.3s;
  --t-message: 0.38s;
}


/* 3. Invitation =========================================================== */

/* the opening line glows as if a diya were lit beneath it: a warm light
   behind the words that breathes (opacity only, so it stays on the
   compositor). The line's own entrance (invitation.css) is untouched. */
.rk-alive .rk-inv__ganesh {
  position: relative;
  isolation: isolate;
}

.rk-alive .rk-inv__ganesh::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(30em, 92%);
  height: 2.6em;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 196, 92, 0.42), rgba(247, 196, 92, 0.16) 55%, rgba(247, 196, 92, 0));
  opacity: 0;
  pointer-events: none;
}

.rk-alive .rk-invite.is-revealed .rk-inv__head.is-in .rk-inv__ganesh::after {
  animation: rk-diya 4.2s ease-in-out 1.8s infinite;
}

@keyframes rk-diya {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 1; }
}

/* a slow golden breath behind the Swastik */
.rk-alive .rk-inv__swastik {
  position: relative;
  isolation: isolate;
}

.rk-alive .rk-inv__swastik::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 205, 110, 0.55) 0%, rgba(247, 205, 110, 0.18) 38%, rgba(247, 205, 110, 0) 68%);
  animation: rk-halo-breathe 4.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes rk-halo-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

/* --- darshan: the light behind Radha-Krishna ----------------------------
   rk-alive.js places it on the couple and scrubs --halo in as the finale
   is reached; the rays turn, and with the music on the glow breathes with
   the flute (--energy). */
.rk-alive-halo {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 0;
  width: 60%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(calc(0.6 + var(--halo, 0) * 0.4));
  opacity: var(--halo, 0);
  pointer-events: none;
  --energy: 0;
}

.rk-alive-halo i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.rk-alive-halo__glow {
  background: radial-gradient(circle, rgba(255, 250, 228, 0.95) 0%, rgba(255, 232, 168, 0.7) 20%, rgba(250, 210, 120, 0.3) 44%, rgba(250, 210, 120, 0) 70%);
  opacity: calc(0.75 + var(--energy) * 0.25);
  transform: scale(calc(1 + var(--energy) * 0.08));
}

.rk-alive-halo__rays {
  inset: -30% !important;
  background: repeating-conic-gradient(from 0deg,
      rgba(236, 184, 72, 0.5) 0deg 1.6deg,
      rgba(236, 184, 72, 0) 1.6deg 7.5deg);
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0.85) 24%, rgba(0, 0, 0, 0.3) 46%, rgba(0, 0, 0, 0) 62%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0.85) 24%, rgba(0, 0, 0, 0.3) 46%, rgba(0, 0, 0, 0) 62%);
  animation: rk-rays-turn 90s linear infinite;
  opacity: 0.85;
}

.rk-alive-halo__ring {
  inset: 14% !important;
  border: 1.5px solid rgba(214, 168, 70, 0.55);
  box-shadow: 0 0 22px rgba(247, 205, 110, 0.45);
  animation: rk-ring-pulse 5s ease-in-out infinite;
}

@keyframes rk-ring-pulse {
  0%, 100% { transform: scale(0.96); opacity: 0.35; }
  50%      { transform: scale(1.04); opacity: 0.9; }
}

/* --- the garden breathes ------------------------------------------------
   Inner images only: the groups and wrappers belong to the reveal and the
   scroll depth. Each sways about its own foot, out of step with the rest.
   The wrappers carry the pointer's depth (--rk-mx / --rk-my, desktop). */
.rk-alive .rk-invite.is-revealed .rk-tree img {
  transform-origin: 50% 100%;
  animation: rk-sway-m 9s ease-in-out infinite;
}

.rk-alive .rk-invite.is-revealed .rk-tree--r img { animation-duration: 10.4s; animation-delay: -4s; }

.rk-alive .rk-invite.is-revealed .rk-mix img {
  transform-origin: 50% 100%;
  animation: rk-sway-s 7.5s ease-in-out infinite;
}

.rk-alive .rk-invite.is-revealed .rk-mix--r img { animation-delay: -3.1s; }

.rk-alive .rk-invite.is-revealed .rk-lily img {
  transform-origin: 50% 100%;
  animation: rk-sway-l 6s ease-in-out infinite, rk-lily-breathe 5.2s ease-in-out infinite;
}

.rk-alive .rk-invite.is-revealed .rk-lily--r img { animation-delay: -2.4s, -1.3s; }

/* the peacocks strut: a little hop and a settle, now and then */
.rk-alive .rk-invite.is-revealed .rk-mor img {
  transform-origin: 50% 100%;
  animation: rk-strut 7s cubic-bezier(0.4, 0, 0.3, 1) infinite;
}

.rk-alive .rk-invite.is-revealed .rk-mor--r img { animation-delay: -3.6s; }

/* fixed values, not custom properties: keyframes that read var() cannot
   run on the compositor, and these move large images all the time */
@keyframes rk-sway-s {
  0%, 100% { rotate: -0.8deg; }
  50%      { rotate: 0.8deg; }
}

@keyframes rk-sway-m {
  0%, 100% { rotate: -1.1deg; }
  50%      { rotate: 1.1deg; }
}

@keyframes rk-sway-l {
  0%, 100% { rotate: -1.6deg; }
  50%      { rotate: 1.6deg; }
}

@keyframes rk-lily-breathe {
  0%, 100% { scale: 1; }
  50%      { scale: 1.035; }
}

@keyframes rk-strut {
  0%, 84%, 100% { translate: 0 0; rotate: 0deg; }
  88%           { translate: 0 -7%; rotate: -2deg; }
  92%           { translate: 0 0; rotate: 1deg; }
  95%           { translate: 0 -3%; rotate: 0deg; }
}

.rk-alive .rk-tree,
.rk-alive .rk-minar,
.rk-alive .rk-mor,
.rk-alive .rk-lily,
.rk-alive .rk-mix {
  translate: calc(var(--rk-mx, 0) * var(--depth, 0px)) calc(var(--rk-my, 0) * var(--depth, 0px) * 0.4);
}

.rk-alive .rk-tree  { --depth: -10px; }
.rk-alive .rk-minar { --depth: -6px; }
.rk-alive .rk-mor   { --depth: 6px; }
.rk-alive .rk-mix   { --depth: 12px; }
.rk-alive .rk-lily  { --depth: 18px; }

/* the elephants raise their trunks in welcome as they shower the petals */
.rk-alive .rk-eleph img {
  transform-origin: 30% 95%;
}

.rk-eleph--r img { transform-origin: 70% 95%; }

.rk-alive .rk-eleph--l.is-saluting img {
  animation: rk-salute-l 1.6s cubic-bezier(0.4, 0, 0.3, 1);
}

.rk-alive .rk-eleph--r.is-saluting img {
  animation: rk-salute-r 1.6s cubic-bezier(0.4, 0, 0.3, 1);
}

@keyframes rk-salute-l {
  0%, 100% { rotate: 0deg; }
  35%      { rotate: -3.2deg; }
  60%      { rotate: -2.4deg; }
}

@keyframes rk-salute-r {
  0%, 100% { rotate: 0deg; }
  35%      { rotate: 3.2deg; }
  60%      { rotate: 2.4deg; }
}


/* 4. Love story =========================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* --- the portrait develops, like a photograph in the tray ------------- */
  .rk-alive .rk-love__story .rk-love__photo {
    filter: sepia(0.8) saturate(0.45) brightness(1.08) blur(5px);
    transition: filter 1.9s cubic-bezier(0.3, 0, 0.2, 1) 0.7s;
  }

  .rk-alive .rk-love__story.is-revealed .rk-love__photo {
    filter: none;
  }

  /* the carved frame blooms open from its centre */
  .rk-alive .rk-love__story .rk-love__frame-art {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 1.9s cubic-bezier(0.55, 0.05, 0.2, 1) 0.85s;
  }

  .rk-alive .rk-love__story.is-revealed .rk-love__frame-art {
    clip-path: circle(75% at 50% 50%);
  }

  /* the figure turns towards the pointer (rk-alive.js writes --tx/--ty) */
  .rk-alive .rk-love__story {
    perspective: 1400px;
  }

  .rk-alive .rk-love__story .rk-love__figure {
    rotate: var(--ty, 0) var(--tx, 0) 0 var(--tilt, 0deg);
  }

  /* --- the reply card unfolds ------------------------------------------- */
  .rk-alive .wiy-rk--rsvp .wiy-rk__card.rk-love__rise {
    transform-origin: 50% 0%;
    rotate: x 18deg;
    transition-property: opacity, transform, rotate;
    transition-duration: 1.1s, 1.1s, 1.4s;
    transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .rk-alive .wiy-rk--rsvp.is-revealed .wiy-rk__card.rk-love__rise {
    rotate: x 0deg;
  }
}

/* --- the toran the plumes hang from: alive once it is hung ------------- */
.rk-alive .rk-love__story.is-revealed .rk-love__pendant {
  animation: rk-pendant 3.6s ease-in-out 1.6s infinite;
}

@keyframes rk-pendant {
  0%, 100% { rotate: -7deg; }
  50%      { rotate: 7deg; }
}

.rk-alive .rk-love__story.is-revealed .rk-love__rosette {
  animation: rk-rosette 40s linear infinite;
}

.rk-alive .rk-love__story.is-revealed .rk-love__rosette--r {
  animation-direction: reverse;
}

@keyframes rk-rosette {
  to { rotate: 360deg; }
}

/* light runs along the beads, one after another */
.rk-alive .rk-love__bead::after,
.rk-alive .rk-love__pendant::after {
  content: "";
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 225, 0.95) 0%, rgba(255, 230, 160, 0.45) 30%, rgba(255, 230, 160, 0) 62%);
  opacity: 0;
}

.rk-alive .rk-love__story.is-revealed .rk-love__bead::after,
.rk-alive .rk-love__story.is-revealed .rk-love__pendant::after {
  animation: rk-bead-glint 4.8s ease-in-out infinite;
  animation-delay: calc(2s + var(--f, 0.5) * 1.2s);
}

@keyframes rk-bead-glint {
  0%, 70%, 100% { opacity: 0; }
  78%           { opacity: 1; }
}

/* a gold line draws under the field being written in */
.rk-alive .wiy-rk__field {
  position: relative;
}

.rk-alive .wiy-rk__field::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(200, 160, 60, 0), #c8a03c 25%, #f2cd6e 50%, #c8a03c 75%, rgba(200, 160, 60, 0));
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}

.rk-alive .wiy-rk__field:focus-within::after {
  transform: scaleX(1);
}

/* --- the countdown turns over, digit by digit --------------------------- */
.rk-alive .wiy-rk__num {
  display: inline-block;
}

.rk-alive .wiy-rk__num.is-tick {
  animation: rk-tick 0.6s cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes rk-tick {
  from { transform: perspective(300px) rotateX(-80deg) translateY(-18%); opacity: 0.1; filter: blur(1px); }
  to   { transform: none; opacity: 1; filter: none; }
}

/* --- Moments of Love: the arc and the lightbox ------------------------- */
.rk-alive .rk-love__memory-frame {
  will-change: transform;
}

@media (hover: hover) {
  .rk-alive .rk-love__memory {
    cursor: zoom-in;
  }
}

.rk-alive-lb {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: grid;
  place-items: center;
  padding: max(20px, 4vmin);
  background: rgba(32, 40, 18, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0;
}

.rk-alive-lb__fig {
  position: relative;
  margin: 0;
  max-width: min(92vw, 720px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rk-alive-lb__fig img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 3px solid #fdf8ec;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(200, 160, 60, 0.6);
}

.rk-alive-lb__cap {
  font-family: "Ananda", "Norican", "Segoe Script", cursive;
  font-size: clamp(26px, 4.4vmin, 42px);
  color: #fdf3d6;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.rk-alive-lb__close {
  position: absolute;
  /* top left: the music control keeps the top right corner, above everything */
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 160, 60, 0.8);
  border-radius: 50%;
  background: #fdf8ec;
  color: #3a4a20;
  cursor: pointer;
  font: 600 22px/1 "Poppins", system-ui, sans-serif;
}

.rk-alive-lb__close:focus-visible {
  outline: 2px solid #f2cd6e;
  outline-offset: 3px;
}

/* --- the meadow: the cows breathe, the flowers stir --------------------- */
.rk-alive .rk-love__ground.is-revealed .rk-love__cow {
  transform-origin: 50% 100%;
  animation: rk-cow-breathe 5.6s ease-in-out 2s infinite;
}

.rk-alive .rk-love__ground.is-revealed .rk-love__cow--r {
  animation-delay: 4.1s;
}

@keyframes rk-cow-breathe {
  0%, 100% { scale: 1 1; }
  45%      { scale: 1.006 1.014; }
}

.rk-alive .rk-love__ground.is-revealed .rk-love__flora {
  transform-origin: 50% 100%;
  animation: rk-sway-s 6.5s ease-in-out infinite;
}

.rk-alive .rk-love__ground.is-revealed .rk-love__flora--r {
  animation-delay: -2.7s;
}


/* 5. The peacock ========================================================== */

.rk-alive-peacock {
  position: fixed;
  z-index: 9400;
  left: 0;
  top: 0;
  width: clamp(104px, 15vw, 230px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

.rk-alive-peacock__body {
  width: 100%;
  height: 100%;
  animation: rk-glide 1.15s ease-in-out infinite;
}

.rk-alive-peacock.is-right .rk-alive-peacock__body {
  scale: -1 1;
}

.rk-alive-peacock img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 14px rgba(40, 60, 30, 0.22));
}

/* a glide: the body lifts on each wingbeat and the wings' line rocks */
@keyframes rk-glide {
  0%, 100% { transform: translateY(0) rotate(0deg) scaleY(1); }
  30%      { transform: translateY(-7%) rotate(-2.5deg) scaleY(0.965); }
  65%      { transform: translateY(3%) rotate(1.5deg) scaleY(1.02); }
}


/* 6. Lenis (smooth scroll on desktop) ===================================== */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}


/* With reduced motion this layer is never switched on; and if the visitor
   changes the preference mid-visit, everything here stands down at once. */
@media (prefers-reduced-motion: reduce) {
  .rk-alive-sky,
  .rk-alive-dawn,
  .rk-alive-halo,
  .rk-alive-peacock,
  .rk-alive-touch,
  .rk-alive-veil {
    display: none !important;
  }
}
