/* ============================================================
   RASHFAN — Animations
   مطابقة لمتغيرات framer-motion الأصلية:
   fadeUp / staggerContainer / textReveal + انتقالات الهيرو.
   ============================================================ */

/* ---------- fadeUp (generic reveal) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-standard), transform 0.8s var(--ease-standard);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* fade only (no translate) */
[data-reveal="fade"] { transform: none; }

/* scale-in (used by product cards via scroll-linked progress instead,
   but kept as fallback for reduced-motion / no-JS) */
[data-reveal="scale"] { transform: scale(0.8); }
[data-reveal="scale"].is-visible { transform: scale(1); }

/* ---------- Word-by-word spring reveal (AnimatedText) ---------- */
.split-word {
  display: inline-block;
  margin-inline-end: 0.25em;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring);
  transition-delay: calc(var(--w, 0) * 100ms + 40ms);
}
.split-word.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero entrance ---------- */
@keyframes rf-logo-in {
  from { opacity: 0; transform: scale(0.9); filter: blur(10px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0px); }
}
.hero__logo { animation: rf-logo-in 1.5s ease-out both; }

@keyframes rf-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__title { animation: rf-fade-up 0.8s var(--ease-standard) both; }
.hero__lead  { animation: rf-fade-up 0.8s var(--ease-standard) 0.6s both; }

@keyframes rf-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
.hero__cta   { animation: rf-fade-in 0.8s ease 1s both; }
.hero__scroll-indicator { animation: rf-fade-in 1s ease 1.5s both; }

@keyframes rf-scroll-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.hero__scroll-line { animation: rf-scroll-bob 2s ease-in-out infinite; }

/* ---------- Navbar entrance ---------- */
@keyframes rf-nav-in {
  from { opacity: 0; transform: translateY(-80px); }
  to   { opacity: 1; transform: translateY(0); }
}
.navbar { animation: rf-nav-in 0.8s var(--ease-standard) 1.8s both; }

/* ---------- Mobile menu open ---------- */
@keyframes rf-menu-in {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu.is-open { animation: rf-menu-in 0.3s var(--ease-standard) both; }

/* ---------- Side navbar ---------- */
@keyframes rf-sidenav-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.side-nav.is-visible { animation: rf-sidenav-in 0.5s var(--ease-standard) both; }

.side-nav__tooltip {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.side-nav__item:hover .side-nav__tooltip,
.side-nav__item:focus-visible .side-nav__tooltip {
  opacity: 1;
  transform: translateX(0);
}

.side-nav__dot {
  transition: transform 0.25s, background-color 0.25s;
}
.side-nav__item[data-active="true"] .side-nav__dot {
  transform: scale(1.4);
  background: var(--primary);
}
.side-nav__ring {
  opacity: 0;
  transform: scale(1.4);
  transition: opacity 0.25s, transform 0.25s;
}
.side-nav__item[data-active="true"] .side-nav__ring {
  opacity: 1;
  transform: scale(2.2);
}

/* ---------- Button fill sweep ---------- */
.btn-ghost-primary { position: relative; overflow: hidden; }
.btn-ghost-primary .fill {
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease-standard);
  z-index: 0;
}
.btn-ghost-primary:hover .fill { transform: translateX(0); }
.btn-ghost-primary .label { position: relative; z-index: 1; }

.btn-solid-primary { position: relative; overflow: hidden; }
.btn-solid-primary .shine {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-standard);
  z-index: 0;
}
.btn-solid-primary:hover .shine { transform: translateY(0); }
.btn-solid-primary .label { position: relative; z-index: 1; }

/* ---------- Underline hover (nav links) ---------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--primary);
  transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* Product cards now use the generic [data-reveal="scale"] system below —
   see the shared fadeUp/scale rules at the top of this file. */

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .split-word, .product-card {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__logo, .hero__title, .hero__lead, .hero__cta,
  .hero__scroll-indicator, .navbar {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
