/* ==========================================================================
   ROYAL SCAPING — PROMINENT FLOWER & LEAF BOTANICAL MOTION SYSTEM
   Lush swaying garlands, blooming blossoms, falling petals & 60fps choreography
   ========================================================================== */

/* ---------- Scroll Reveal Primitives ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.reveal-left { transform: translateX(-42px); }
.reveal.reveal-right { transform: translateX(42px); }
.reveal.reveal-scale { transform: scale(0.94) translateY(24px); }

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.40s; }
.delay-6 { transition-delay: 0.48s; }

/* ---------- Image Curtain Reveal ---------- */
.curtain-reveal {
  position: relative;
  overflow: hidden;
}

.curtain-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--sage-soft) 0%, var(--bg-canvas) 100%);
  transform: scaleY(1);
  transform-origin: top center;
  transition: transform 1.05s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 2;
  pointer-events: none;
}

.curtain-reveal.is-visible::after { transform: scaleY(0); }

.curtain-reveal img {
  transform: scale(1.1);
  transition: transform 1.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.curtain-reveal.is-visible img { transform: scale(1); }

/* ---------- Hero Entrance Choreography ---------- */
@keyframes heroWordUp {
  0% { opacity: 0; transform: translateY(108%) rotate(1.4deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}

@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(26px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.hero-line-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(108%);
}

body.page-ready .hero-line:nth-child(1) .hero-line-inner {
  animation: heroWordUp 0.92s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}
body.page-ready .hero-line:nth-child(2) .hero-line-inner {
  animation: heroWordUp 0.92s cubic-bezier(0.16, 1, 0.3, 1) 0.24s forwards;
}
body.page-ready .hero-line:nth-child(3) .hero-line-inner {
  animation: heroWordUp 0.92s cubic-bezier(0.16, 1, 0.3, 1) 0.38s forwards;
}
body.page-ready .hero-stagger {
  animation: fadeSlideUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) var(--stagger, 0.48s) both;
}

/* ==========================================================================
   PROMINENT FLORAL & LEAF ANIMATIONS
   ========================================================================== */

/* 1. Swaying Corner Floral Garlands & Branches */
@keyframes branchSway {
  0%, 100% {
    transform: rotate(-4.5deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(5deg) translate3d(6px, -10px, 0);
  }
}

@keyframes branchSwayAlt {
  0%, 100% {
    transform: rotate(4deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(-5.5deg) translate3d(-8px, 8px, 0);
  }
}

/* 2. Individual Flower Blooming Pulse */
@keyframes flowerBloom {
  0%, 100% {
    transform: scale(0.92) rotate(-6deg);
    filter: drop-shadow(0 6px 14px rgba(180, 133, 52, 0.24));
  }
  50% {
    transform: scale(1.1) rotate(8deg);
    filter: drop-shadow(0 12px 24px rgba(27, 107, 66, 0.32));
  }
}

/* 3. Individual Leaf Rustle / Flutter */
@keyframes leafFlutter {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  35% { transform: rotate(7deg) scale(1.04); }
  70% { transform: rotate(-3deg) scale(0.98); }
}

/* 4. Continuous Drifting Botanical Leaves & Blossoms Layer */
@keyframes botanicalDriftDown {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg) rotateY(0deg);
    opacity: 0;
  }
  10% { opacity: 0.92; }
  35% {
    transform: translate3d(48px, 28vh, 0) rotate(95deg) rotateY(150deg);
  }
  65% {
    transform: translate3d(-36px, 66vh, 0) rotate(215deg) rotateY(300deg);
    opacity: 0.88;
  }
  92% { opacity: 0.6; }
  100% {
    transform: translate3d(28px, 112vh, 0) rotate(360deg) rotateY(480deg);
    opacity: 0;
  }
}

@keyframes breatheBlob {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.55; }
  50% { transform: scale(1.12) translate(14px, -16px); opacity: 0.82; }
}

.floral-garland {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 16px 28px rgba(16, 62, 36, 0.22));
  will-change: transform;
}

.floral-garland-tl {
  top: 56px;
  left: -18px;
  width: clamp(190px, 24vw, 340px);
  transform-origin: top left;
  animation: branchSway 7.5s ease-in-out infinite;
}

.floral-garland-tr {
  top: 62px;
  right: -22px;
  width: clamp(180px, 22vw, 320px);
  transform-origin: top right;
  animation: branchSwayAlt 8.4s ease-in-out infinite;
}

.floral-garland-br {
  bottom: -24px;
  right: -18px;
  width: clamp(200px, 24vw, 330px);
  transform-origin: bottom right;
  animation: branchSway 9s ease-in-out infinite;
}

.floral-garland-bl {
  bottom: -24px;
  left: -18px;
  width: clamp(190px, 22vw, 310px);
  transform-origin: bottom left;
  animation: branchSwayAlt 8.2s ease-in-out infinite;
}

.floral-garland .bloom-head {
  transform-box: fill-box;
  transform-origin: center;
  animation: flowerBloom 5.4s ease-in-out infinite;
}

.floral-garland .bloom-head-2 {
  animation-delay: -2.1s;
  animation-duration: 6.2s;
}

.floral-garland .bloom-head-3 {
  animation-delay: -3.7s;
  animation-duration: 5.8s;
}

.floral-garland .leaf-flutter {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: leafFlutter 4.6s ease-in-out infinite;
}

.floral-garland .leaf-flutter-2 {
  animation-delay: -1.8s;
  animation-duration: 5.4s;
}

/* Floating Falling Flowers & Leaves Layer inside Hero */
.hero-floating-flora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.flora-sprite {
  position: absolute;
  top: -12%;
  left: var(--x, 15%);
  width: var(--sz, 34px);
  height: var(--sz, 34px);
  filter: drop-shadow(0 8px 14px rgba(18, 66, 39, 0.24));
  animation: botanicalDriftDown var(--dur, 14s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
}

/* Blooming Floral Section Divider */
.floral-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  padding: 0.4rem 0;
  background: var(--bg-canvas);
  position: relative;
  z-index: 3;
}

.floral-divider-line {
  height: 1.5px;
  width: clamp(70px, 18vw, 220px);
  background: linear-gradient(90deg, transparent, var(--emerald-bright), var(--gold));
  transform: scaleX(0);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.floral-divider-line.right {
  background: linear-gradient(90deg, var(--gold), var(--emerald-bright), transparent);
}

.floral-divider.is-visible .floral-divider-line {
  transform: scaleX(1);
}

.floral-divider-bloom {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: scale(0.4) rotate(-65deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s, opacity 0.6s ease 0.2s;
}

[data-theme="dark"] .floral-divider-bloom {
  background: var(--bg-elevated);
}

.floral-divider.is-visible .floral-divider-bloom {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.floral-divider.is-visible .floral-divider-bloom svg {
  animation: flowerBloom 6s ease-in-out infinite;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(75px);
  pointer-events: none;
  z-index: 0;
  animation: breatheBlob 12s ease-in-out infinite;
}

/* ---------- Card Hover Botanical Vine Flourish ---------- */
.service-card::after,
.testimonial-card::after {
  content: '❀';
  position: absolute;
  bottom: 0.7rem;
  right: 1rem;
  font-size: 1.55rem;
  color: var(--emerald);
  opacity: 0;
  transform: scale(0.4) rotate(-40deg);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.service-card:hover::after,
.testimonial-card:hover::after {
  opacity: 0.22;
  transform: scale(1.1) rotate(12deg);
}

/* ---------- Preloader Animations ---------- */
@keyframes crestDraw {
  0% { stroke-dashoffset: 340; opacity: 0.25; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes preloaderGlow {
  0%, 100% { filter: drop-shadow(0 4px 16px rgba(27, 107, 66, 0.24)); }
  50% { filter: drop-shadow(0 8px 28px rgba(46, 133, 85, 0.48)); }
}

.preloader-crest path,
.preloader-crest circle,
.preloader-crest polygon {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: crestDraw 1.05s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.preloader-crest {
  animation: preloaderGlow 2.2s ease-in-out infinite;
}

/* ---------- Ambient Floating ---------- */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(0.5deg); }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.float-slow { animation: floatSlow 6.5s ease-in-out infinite; }
.float-gentle { animation: floatGentle 4.5s ease-in-out infinite; }

/* ---------- Pulse Rings ---------- */
@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.78; }
  70% { transform: scale(1.75); opacity: 0; }
  100% { transform: scale(1.75); opacity: 0; }
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(37, 211, 102, 0.36), 0 0 0 0 rgba(37, 211, 102, 0.42); }
  50% { box-shadow: 0 14px 36px rgba(37, 211, 102, 0.44), 0 0 0 14px rgba(37, 211, 102, 0); }
}

.online-dot {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.online-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: pulseRing 2.1s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.online-dot.is-offline { background: var(--gold); }
.online-dot.is-offline::after { border-color: var(--gold); }

/* ---------- Infinite Marquee ---------- */
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 34s linear infinite;
}

.marquee-wrapper:hover .marquee-track { animation-play-state: paused; }

/* ---------- Shimmer Button Sweep ---------- */
@keyframes sheenSweep {
  0% { transform: translateX(-140%) skewX(-24deg); }
  100% { transform: translateX(260%) skewX(-24deg); }
}

.btn-sheen { position: relative; overflow: hidden; }
.btn-sheen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(-140%) skewX(-24deg);
  pointer-events: none;
}
.btn-sheen:hover::before { animation: sheenSweep 0.85s ease forwards; }

/* ---------- Scroll Cue Animation ---------- */
@keyframes scrollDrop {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  80% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(14px); opacity: 0; }
}
.scroll-indicator-dot { animation: scrollDrop 2s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

/* ---------- 3D Tilt & Sunlit Botanical Spotlight ---------- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.tilt-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(46, 133, 85, 0.14), transparent 58%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.tilt-card:hover::before { opacity: 1; }

/* ---------- Modal, Drawer & Card Entrances ---------- */
@keyframes modalPop {
  0% { opacity: 0; transform: translateY(22px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes widgetPop {
  0% { opacity: 0; transform: translateY(20px) scale(0.94); transform-origin: bottom right; }
  100% { opacity: 1; transform: translateY(0) scale(1); transform-origin: bottom right; }
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFadeIn {
  0% { opacity: 0; transform: translateY(18px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop.is-open .modal-dialog { animation: modalPop 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.wa-panel.is-open { animation: widgetPop 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.toast-item { animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.project-card-animate { animation: cardFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ---------- Reduced Motion Respect ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .hero-line-inner { opacity: 1 !important; transform: none !important; }
  .curtain-reveal::after { display: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .hero-floating-flora { display: none; }
}
