/* ==========================================
   ANIMATIONS — דנית חולי
   ========================================== */

/* ==========================================
   SCROLL REVEAL
   ========================================== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58,104,104,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(58,104,104,0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ==========================================
   HERO — PILL EXPANSION
   ========================================== */

/*
  הגדרת מצב ברירת מחדל: Hero תמונה ב"pill" (מלבן מעוגל עם margin).
  clip-path הוא GPU-composited → אין layout reflow, אנימציה חלקה.
  JS מעדכן את clip-path דינמית בהתאם ל-scrollY.
*/
.hero-frame {
  position: absolute;
  inset: 0;
  /* ברירה מחדלת: כרטיס מעוגל יותר — JS מחשב ערכים מדויקים */
  clip-path: inset(calc(var(--vh, 1vh) * 46) 10vw 0px round 32px);
  will-change: clip-path;
  overflow: hidden;
  z-index: 0;
}

/* כשה-JS מוסיף .expanded — transition לפני שה-clip-path מתעדכן ב-scroll */
.hero-frame.no-transition {
  transition: none;
}

/* ==========================================
   HERO CONTENT — מופיע אחרי ה-expansion
   ========================================== */

.hero-content {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   HERO ANIMATIONS (tag, title, subtitle)
   מופעלות אחרי שה-hero-content מקבל .visible
   ========================================== */

.hero-tag {
  animation: fadeIn 0.6s ease 0.1s both;
  animation-play-state: paused;
}
.hero-title {
  animation: fadeInUp 0.8s ease 0.2s both;
  animation-play-state: paused;
}
.hero-subtitle {
  animation: fadeInUp 0.8s ease 0.35s both;
  animation-play-state: paused;
}
.hero-actions {
  animation: fadeInUp 0.8s ease 0.5s both;
  animation-play-state: paused;
}

/* JS מוסיף .hero-content.visible → מפעיל את האנימציות */
.hero-content.visible .hero-tag,
.hero-content.visible .hero-title,
.hero-content.visible .hero-subtitle,
.hero-content.visible .hero-actions {
  animation-play-state: running;
}

/* ==========================================
   FLOATING ELEMENTS
   ========================================== */

.float {
  animation: float 4s ease-in-out infinite;
}

.float-slow {
  animation: float 6s ease-in-out infinite;
}

.float-delay {
  animation: float 4s ease-in-out 1s infinite;
}

/* ==========================================
   PULSE CTA
   ========================================== */

.pulse-btn {
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   GRADIENT SHIMMER (loading states)
   ========================================== */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-alt) 25%,
    var(--cream) 50%,
    var(--bg-alt) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
}

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */

.page-enter {
  animation: fadeIn 0.5s ease both;
}

/* ==========================================
   PARALLAX HINT
   ========================================== */

.parallax-img {
  will-change: transform;
  transition: transform 0.05s linear;
}

/* ==========================================
   NUMBER COUNTER ANIMATION
   ========================================== */

.stat-num.counted {
  animation: countUp 0.6s ease both;
}

/* ==========================================
   NAV SCROLL LINE
   ========================================== */

.nav-progress {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  left: 100%;
  height: 3px;
  background: linear-gradient(to left, var(--gold), var(--teal));
  z-index: 999;
  transition: left 0.1s linear;
}

/* ==========================================
   SECTION FADE VARIANTS
   ========================================== */

.reveal-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   STAGGER — כרטיסים נכנסים מלמטה (כמו ברפרנס)
   ========================================== */

.stagger-children > * {
  opacity: 0;
  transform: translateY(60px) scale(0.97);
  transition: opacity 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* stagger delay — כל ילד מגיע 150ms אחרי הקודם */
.stagger-children.visible > *:nth-child(1)  { transition-delay: 0.00s; }
.stagger-children.visible > *:nth-child(2)  { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(3)  { transition-delay: 0.30s; }
.stagger-children.visible > *:nth-child(4)  { transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(5)  { transition-delay: 0.60s; }
.stagger-children.visible > *:nth-child(6)  { transition-delay: 0.75s; }
.stagger-children.visible > *:nth-child(7)  { transition-delay: 0.90s; }
.stagger-children.visible > *:nth-child(8)  { transition-delay: 1.05s; }
.stagger-children.visible > *:nth-child(9)  { transition-delay: 1.20s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 1.35s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* גרסה מהירה יותר לgrid של 4 פריטים */
.stagger-fast > * {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-fast.visible > *:nth-child(1) { transition-delay: 0.00s; }
.stagger-fast.visible > *:nth-child(2) { transition-delay: 0.10s; }
.stagger-fast.visible > *:nth-child(3) { transition-delay: 0.20s; }
.stagger-fast.visible > *:nth-child(4) { transition-delay: 0.30s; }
.stagger-fast.visible > * { opacity: 1; transform: translateY(0); }

/* ==========================================
   REDUCE MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-card,
  .stagger-children > *,
  .stagger-fast > * {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Hero pill — מיד מלא, בלי אנימציה */
  .hero-wrapper { height: calc(var(--vh, 1vh) * 100) !important; }
  .hero-frame {
    clip-path: inset(0px 0px 0px round 0px) !important;
  }

  .hero-content {
    opacity: 1 !important;
    transform: none !important;
  }
}
