/* =====================================================
   NEWS IMMIGRATION — ANIMATIONS
   IntersectionObserver-based Framer Motion replicas
   ===================================================== */

/* ---- Scroll-triggered fade-up ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"]       { transform: translateY(30px); }
[data-animate="fade-in"]       { transform: translateY(0); }
[data-animate="slide-left"]    { transform: translateX(-30px); }
[data-animate="slide-right"]   { transform: translateX(30px); }
[data-animate="scale-in"]      { transform: scale(0.92); }
[data-animate="word-reveal"]   { transform: translateY(100%); }

/* Delays */
[data-delay="0"]   { transition-delay: 0ms; }
[data-delay="80"]  { transition-delay: 80ms; }
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="150"] { transition-delay: 150ms; }
[data-delay="160"] { transition-delay: 160ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="240"] { transition-delay: 240ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="320"] { transition-delay: 320ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="480"] { transition-delay: 480ms; }
[data-delay="500"] { transition-delay: 500ms; }
[data-delay="600"] { transition-delay: 600ms; }

/* Visible state — added by IntersectionObserver */
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* ---- Hero word reveal ---- */
.hero-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: 0.25em;
}
.hero-word {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.55s ease;
}
.hero-word.revealed {
  transform: translateY(0);
  opacity: 1;
}

/* ---- Stagger helpers ---- */
.stagger-children > *:nth-child(1)  { transition-delay: 0ms; }
.stagger-children > *:nth-child(2)  { transition-delay: 80ms; }
.stagger-children > *:nth-child(3)  { transition-delay: 160ms; }
.stagger-children > *:nth-child(4)  { transition-delay: 240ms; }
.stagger-children > *:nth-child(5)  { transition-delay: 320ms; }
.stagger-children > *:nth-child(6)  { transition-delay: 400ms; }
.stagger-children > *:nth-child(7)  { transition-delay: 480ms; }
.stagger-children > *:nth-child(8)  { transition-delay: 560ms; }

/* ---- Counter animation ---- */
.count-up {
  display: inline;
}

/* ---- Floating plane ---- */
@keyframes plane-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-12px) rotate(2deg); }
}
.plane-float {
  animation: plane-float 6s ease-in-out infinite;
}

/* ---- Orbit SVG ---- */
@keyframes orbit-arc-draw {
  from { stroke-dashoffset: 2000; }
  to   { stroke-dashoffset: 0; }
}
.orbit-arc {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 1.6s ease;
}
.orbit-arc.is-visible { stroke-dashoffset: 0; }

/* ---- Flag orbit CSS animation ---- */
.orbit-ring-anim {
  animation: orbit-rotate 80s linear infinite;
  transform-origin: center;
}
.orbit-counter-anim {
  animation: orbit-counter 80s linear infinite;
}
@keyframes orbit-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes orbit-counter {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ---- Scroll strip marquee ---- */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-anim {
  animation: marquee-scroll 30s linear infinite;
}

/* ---- Hover text swap ---- */
.hover-swap-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.2;
}
.hover-swap-top,
.hover-swap-bot {
  display: block;
  transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
}
.hover-swap-bot { transform: translateY(110%); }

.hover-swap-wrap:hover .hover-swap-top,
.has-hover-swap:hover .hover-swap-wrap .hover-swap-top { transform: translateY(-110%); }
.hover-swap-wrap:hover .hover-swap-bot,
.has-hover-swap:hover .hover-swap-wrap .hover-swap-bot { transform: translateY(0); }

/* ---- Navbar scroll transition ---- */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* ---- Mobile menu slide ---- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  display: block !important;
}
.mobile-menu.open {
  max-height: 600px;
}

/* ---- Service card icon appear ---- */
@keyframes icon-pop {
  0%   { transform: rotate(-8deg) scale(0.9); opacity: 0; }
  100% { transform: rotate(0deg) scale(1);    opacity: 1; }
}
.service-card-icon {
  animation: icon-pop 0.5s ease forwards;
  opacity: 0;
}
.service-card-icon.revealed {
  opacity: 1;
}

/* ---- Page fade-in on load ---- */
body {
  animation: page-fadein 0.4s ease both;
}
@keyframes page-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Airplane SVG path motion ---- */
.path-airplane {
  offset-path: path("M -120 410 C 35 210, 225 210, 370 410 S 680 610, 825 410 S 1060 210, 1180 410");
  animation: along-path 9s linear infinite;
  opacity: 0;
}
.path-airplane.active { opacity: 1; }
@keyframes along-path {
  0%   { offset-distance: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
