/* ==========================================================================
   Sisi Afrika Foundation — Motion
   All motion is disabled when the visitor prefers reduced motion.
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse-node { 0%, 100% { r: 5; opacity: 1; } 50% { r: 7; opacity: 0.75; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -400; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.32; } 50% { transform: scale(1.08); opacity: 0.4; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes word-up { from { transform: translateY(110%); } to { transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal--left { transform: translateX(-32px); }
.js .reveal--right { transform: translateX(32px); }
.js .reveal--scale { transform: scale(0.94); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Staggered children: JS assigns --delay on each child of [data-stagger] */
.js [data-stagger] > * {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js [data-stagger].is-visible > * { opacity: 1; transform: none; }

/* ---------- Headline word reveal ---------- */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-word > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: var(--delay, 0s); }
.is-split.is-visible .split-word > span { transform: none; }

/* ---------- Hero composition ---------- */
.hv-spin { animation: spin 80s linear infinite; transform-origin: 300px 300px; transform-box: view-box; }
.hv-spin-rev { animation: spin-rev 110s linear infinite; transform-origin: 300px 300px; transform-box: view-box; }
.hv-float { animation: float 7s ease-in-out infinite; }
.hv-float--slow { animation-duration: 10s; animation-delay: -3s; }
.hv-node { animation: pulse-node 4s ease-in-out infinite; }
.hv-node:nth-of-type(2n) { animation-delay: -1.3s; }
.hv-node:nth-of-type(3n) { animation-delay: -2.6s; }
.hv-flow { stroke-dasharray: 6 10; animation: flow 18s linear infinite; }
.hv-draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: dash 3.2s var(--ease) 0.4s forwards; }
.hero__glow { animation: breathe 12s ease-in-out infinite; }
.hero__glow--olive { animation-delay: -6s; }

.hero .hero__label, .hero .hero__sub, .hero .hero__text, .hero .btn-row, .hero .pillar-switch {
  animation: fade-up 1s var(--ease) both;
}
.hero .hero__label { animation-delay: 0.05s; }
.hero .hero__sub { animation-delay: 0.55s; }
.hero .hero__text { animation-delay: 0.7s; }
.hero .btn-row { animation-delay: 0.85s; }
.hero .pillar-switch { animation-delay: 1s; }
.hero__visual { animation: fade-up 1.2s var(--ease) 0.3s both; }

/* Pillar symbols animate on hover */
.pillar-card .sym-spin { transition: transform 1.2s var(--ease); transform-origin: 50px 50px; transform-box: view-box; }
.pillar-card:hover .sym-spin { transform: rotate(90deg); }
.pillar-card .sym-node { transition: transform 0.8s var(--ease); transform-box: fill-box; transform-origin: center; }
.pillar-card:hover .sym-node { transform: scale(1.25); }
.pillar-card .sym-wave { stroke-dasharray: 200; stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease); }
.pillar-card:hover .sym-wave { stroke-dashoffset: 200; }

/* Header brand line */
.pattern-band.reveal.is-visible { animation: grow-x 1.2s var(--ease) both; transform-origin: left; }

/* Parallax targets get will-change only while JS drives them */
[data-parallax] { will-change: transform; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; transition-delay: 0s !important;
  }
  .js .reveal, .js [data-stagger] > *, .split-word > span { opacity: 1 !important; transform: none !important; }
  .hv-draw { stroke-dashoffset: 0; }
  [data-parallax] { transform: none !important; will-change: auto; }
  .bars .bar__fill { width: var(--w); }
  .columns-chart .col__bar { height: var(--h); }
}

/* ---------- Hero slider ---------- */
@keyframes hs-kenburns { from { transform: scale(1.18) translate3d(1.5%, 1%, 0); } to { transform: scale(1.05) translate3d(0, 0, 0); } }
@keyframes hs-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hs-edge { 0% { left: 100%; opacity: 1; } 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes hs-edge-rev { 0% { left: 0; opacity: 1; } 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hs-media { transform: none !important; }
  .hs-media img { transform: scale(1.05) !important; animation: none !important; }
  .hs-edge { display: none; }
  .hs-deco { transform: none !important; }
}
