/* ==================================================================
   Falah motion layer — modern transitions on top of site.css.
   Everything is scoped to html.fx, which the <head> sets only when the
   visitor has NOT asked for reduced motion, so "reduce motion" phones and
   no-JS visitors get the calm, static site. Only transform / opacity /
   filter are animated (GPU-cheap on low-end phones).
   ================================================================== */

/* Smooth cross-page fade (Chrome / Edge / Android; others ignore it) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: fxPageOut .22s ease both; }
  ::view-transition-new(root) { animation: fxPageIn .38s cubic-bezier(.16,1,.3,1) both; }
}
@keyframes fxPageOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fxPageIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Scroll progress bar (gold, top edge) ---------- */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, #c4952f, #e0ae12); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Header shrinks once you scroll ---------- */
.fx header.sticky { transition: box-shadow .35s ease, background-color .35s ease; }
.fx header.sticky > div { transition: height .35s cubic-bezier(.16,1,.3,1); }
.fx header.sticky img { transition: transform .35s cubic-bezier(.16,1,.3,1); }
.fx header.sticky.is-scrolled { box-shadow: 0 8px 24px -14px rgba(15,51,32,.45); }
.fx header.sticky.is-scrolled > div { height: 3.75rem; }
.fx header.sticky.is-scrolled img { transform: scale(.86); }

/* ---------- Hero ---------- */
.fx .hero-pattern { position: relative; overflow: hidden; isolation: isolate; }
/* slow drifting zoom on the valley picture */
.fx .hero-pattern::before { content: ""; position: absolute; inset: -6%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(16,42,24,.72), rgba(15,42,24,.55) 45%, rgba(20,51,29,.78)), url('../images/hero-bg.svg');
  background-size: cover, cover; background-position: center, center bottom; background-repeat: no-repeat;
  animation: fxKenBurns 28s ease-in-out infinite alternate; }
.fx .hero-pattern { background-image: none; }
/* two soft gold lights floating behind the text */
.fx .hero-pattern::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 46vmax; height: 46vmax; left: -12vmax; top: 30%;
  border-radius: 50%; background: radial-gradient(circle, rgba(224,174,18,.20), transparent 62%);
  animation: fxFloat 16s ease-in-out infinite alternate; }
@keyframes fxKenBurns { from { transform: scale(1) translate3d(0,0,0); } to { transform: scale(1.08) translate3d(-1.5%,-1%,0); } }
@keyframes fxFloat { from { transform: translate3d(0,0,0); } to { transform: translate3d(38vw,-14vh,0); } }

/* entrance: logo, headline, text and buttons arrive one after another */
.fx .hero-pattern > div > :not(.hero-sun) { animation: fxRise .9s cubic-bezier(.16,1,.3,1) both; }
.fx .hero-sun-img { animation: fxSunIn 1.1s cubic-bezier(.16,1,.3,1) both; } /* the sun keeps its own float */
.fx .hero-pattern > div > :nth-child(2) { animation: fxRiseBlur 1s cubic-bezier(.16,1,.3,1) .18s both; }
.fx .hero-pattern > div > :nth-child(3) { animation-delay: .34s; }
.fx .hero-pattern > div > :nth-child(4) { animation-delay: .46s; }
.fx .hero-pattern > div > :nth-child(5) { animation: none; }
.fx .hero-pattern > div > :nth-child(5) > * { animation: fxRise .8s cubic-bezier(.16,1,.3,1) both; }
.fx .hero-pattern > div > :nth-child(5) > :nth-child(1) { animation-delay: .58s; }
.fx .hero-pattern > div > :nth-child(5) > :nth-child(2) { animation-delay: .66s; }
.fx .hero-pattern > div > :nth-child(5) > :nth-child(3) { animation-delay: .74s; }
.fx .hero-pattern > div > :nth-child(5) > :nth-child(4) { animation-delay: .82s; }
@keyframes fxRise { from { opacity: 0; transform: translate3d(0,22px,0); } }
@keyframes fxSunIn { from { opacity: 0; transform: scale(.7); } }
@keyframes fxRiseBlur { from { opacity: 0; transform: translate3d(0,26px,0) scale(.98); filter: blur(8px); } }

/* ---------- Gold heading bars draw themselves ---------- */
.fx .fx-bar { transform: scaleX(0); transition: transform .9s cubic-bezier(.16,1,.3,1) .15s; }
.fx .fx-bar.is-in { transform: scaleX(1); }

/* ---------- Icons pop in (trust badges, card icons) ---------- */
.fx .fx-pop { opacity: 0; transform: scale(.4) rotate(-12deg); transition: opacity .5s ease, transform .7s cubic-bezier(.34,1.56,.64,1); transition-delay: var(--rd, 0ms); }
.fx .fx-pop.is-in { opacity: 1; transform: none; }

/* ---------- Cards: lift, gold edge, icon spin, light 3D tilt ---------- */
.fx .fx-card { transition: transform .45s cubic-bezier(.16,1,.3,1), box-shadow .45s ease, border-color .3s ease; }
@media (hover: hover) {
  .fx .fx-card:hover { transform: perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-6px);
    box-shadow: 0 22px 40px -22px rgba(15,51,32,.45), 0 0 0 1px rgba(196,149,47,.55); }
  .fx .fx-card:hover .rounded-full > i, .fx .fx-card:hover .rounded-full.text-accent { animation: fxWiggle .6s ease; }
}
@keyframes fxWiggle { 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.05); } }

/* ---------- Gold buttons: shine sweep on hover ---------- */
.fx a.bg-accent, .fx button.bg-accent { position: relative; overflow: hidden; isolation: isolate; }
.fx a.bg-accent::after, .fx button.bg-accent::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%); transform: translateX(-120%); }
@media (hover: hover) { .fx a.bg-accent:hover::after, .fx button.bg-accent:hover::after { transform: translateX(120%); transition: transform .8s ease; } }

/* ---------- WhatsApp buttons breathe gently ---------- */
.fx a[class*="bg-[#25D366]"].rounded-full { animation: fxPulse 2.8s ease-out infinite; }
@keyframes fxPulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45); } 70%, 100% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } }

/* ---------- Pictures fade and sharpen as they load ---------- */
.fx img.fx-img { opacity: 0; filter: blur(6px); transform: scale(1.02); transition: opacity .6s ease, filter .8s ease, transform 1s cubic-bezier(.16,1,.3,1); }
.fx img.fx-img.is-loaded { opacity: 1; filter: none; transform: none; }

/* ---------- Section edges: soft sand curve above cream bands ---------- */
.fx section.bg-cream { position: relative; }
.fx section.bg-cream::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; pointer-events: none;
  background: radial-gradient(60% 18px at 50% 100%, var(--fx-cream, #faf7f0) 98%, transparent 100%); }

/* Safety net: anything still marked for motion is shown when motion is off */
@media (prefers-reduced-motion: reduce) {
  .fx-bar, .fx-pop, img.fx-img { opacity: 1 !important; transform: none !important; filter: none !important; }
}
