/* =========================================================
   animation.css — reveal, keyframes, interactive motion
   Animations run only when html has .js (content stays visible without JS)
   and pause when their section is off-screen (.is-onscreen toggled by JS).
   ========================================================= */

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- hero title ---------- */
.js .hero__line > span { transform: translateY(110%); animation: heroLine 1.1s var(--ease) forwards; }
.js .hero__line:nth-child(2) > span { animation-delay: .15s; }
.js .hero__line:nth-child(3) > span { animation-delay: .3s; }
@keyframes heroLine { to { transform: none; } }
.hero__media img { animation: heroZoom 24s ease-in-out infinite alternate; }
@keyframes heroZoom { from { scale: 1.02; } to { scale: 1.1; } }
.scroll-cue span::after { animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.hero__slogan { background: linear-gradient(90deg, var(--gold-2), #fff, var(--gold-2)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }

/* ---------- concept flows: travelling pulse ---------- */
.flow__steps li { transition: background .4s, color .4s, border-color .4s; }
.flow__steps li.is-pulse { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,149,80,.18); }
.flow--sub .flow__steps li.is-pulse { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(217,78,117,.15); }

/* ---------- AI game visuals ---------- */
.viz-wave i { animation: wave 1.1s ease-in-out infinite alternate; }
.viz-wave i:nth-child(2n) { animation-duration: .8s; } .viz-wave i:nth-child(3n) { animation-duration: 1.4s; } .viz-wave i:nth-child(5n) { animation-duration: .65s; }
@keyframes wave { from { height: 15%; } to { height: 100%; } }
.viz-pose span { animation: pose 2.4s ease-in-out infinite; }
.viz-pose span:nth-child(2) { animation-delay: .3s; } .viz-pose span:nth-child(3) { animation-delay: .6s; } .viz-pose span:nth-child(4) { animation-delay: .9s; }
@keyframes pose { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
.viz-pose { animation: scan 3s ease-in-out infinite; }
@keyframes scan { 0%,100% { border-color: rgba(205,174,114,.8); } 50% { border-color: rgba(217,78,117,.9); } }
.ops__sync i { animation: sync 2.2s ease-in-out infinite alternate; }
@keyframes sync { to { left: calc(100% - 10px); } }

/* ---------- audition ring ---------- */
.ring::before { animation: ringSpin 14s linear infinite; }
@keyframes ringSpin { to { rotate: 360deg; } }

/* ---------- UGC phone bubbles ---------- */
.bubble { animation: float 4s ease-in-out infinite; }
.b2 { animation-delay: -1s; } .b3 { animation-delay: -2s; } .b4 { animation-delay: -3s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.phone-stage::before { animation: ringSpin 40s linear infinite; }
.tree__links path { stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); }
.tree.is-in .tree__links path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease); }
.tree.is-in .tree__links path.l2 { transition-delay: .6s; }
.tree__nodes > * { opacity: 0; transition: opacity .6s; }
.tree.is-in .tree__nodes > * { opacity: 1; }
.tree.is-in .tree__nodes .t2 { transition-delay: .5s; } .tree.is-in .tree__nodes .t3 { transition-delay: 1.1s; } .tree.is-in .tree__nodes .t4 { transition-delay: 1.6s; }

/* ---------- flywheel light ---------- */
.flywheel__light { animation: orbit 8s linear infinite; }
@keyframes orbit { to { rotate: 360deg; } }

/* ---------- value chain flowing line ---------- */
.vchain ol::before { animation: flowDown 1.2s linear infinite; }
@keyframes flowDown { to { background-position: 0 24px; } }
.rev-panel:not([hidden]) .vchain li { animation: chainIn .5s var(--ease) both; }
.rev-panel:not([hidden]) .vchain li:nth-child(2) { animation-delay: .08s; } .rev-panel:not([hidden]) .vchain li:nth-child(3) { animation-delay: .16s; } .rev-panel:not([hidden]) .vchain li:nth-child(4) { animation-delay: .24s; } .rev-panel:not([hidden]) .vchain li:nth-child(5) { animation-delay: .32s; } .rev-panel:not([hidden]) .vchain li:nth-child(6) { animation-delay: .4s; } .rev-panel:not([hidden]) .vchain li:nth-child(7) { animation-delay: .48s; }
@keyframes chainIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.phase:not([hidden]), .afunnel__detail > div:not([hidden]), .fw-detail article:not([hidden]), .org-detail > div:not([hidden]) { animation: fadeUp .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- map ---------- */
.route { stroke-dashoffset: 0; }
.js .map .route { opacity: 0; }
.js .map.is-in .route { animation: routeIn 1s var(--ease) forwards, dash 1.2s linear infinite; }
.js .map.is-in .route[data-step="2"] { animation-delay: .3s, .3s; }
.js .map.is-in .route[data-step="3"] { animation-delay: .9s, .9s; }
.js .map.is-in .route[data-step="4"] { animation-delay: 1.5s, 1.5s; }
.js .map.is-in .route[data-step="5"] { animation-delay: 2.1s, 2.1s; }
.js .map.is-in .route--hq { animation-delay: 0s, 0s; }
@keyframes routeIn { to { opacity: .85; } }
@keyframes dash { to { stroke-dashoffset: -24; } }
.js .map .pin:not(.pin--hq):not(.pin--1) { opacity: 0; transition: opacity .6s; }
.js .map.is-in .pin:not(.pin--hq):not(.pin--1) { opacity: 1; }
.js .map.is-in .pin[data-step="2"] { transition-delay: .9s; } .js .map.is-in .pin[data-step="3"] { transition-delay: 1.5s; } .js .map.is-in .pin[data-step="4"] { transition-delay: 2.1s; } .js .map.is-in .pin[data-step="5"] { transition-delay: 2.7s; }
.pin__pulse { animation: pulse 2s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* ---------- closing cycle ---------- */
.cycle li { transition: border-color .5s, background .5s; }

/* ---------- pause off-screen animations ---------- */
.io-ready section:not(.is-onscreen) *, .io-ready section:not(.is-onscreen) *::before, .io-ready section:not(.is-onscreen) *::after { animation-play-state: paused !important; }

/* fallback when scripts fail to run */
.reveal-all .reveal, .reveal-all .ifunnel button { opacity: 1 !important; transform: none !important; }
.reveal-all .hero__line > span { transform: none !important; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .hero__line > span { transform: none; }
  .js .map .route, .js .map .pin { opacity: 1 !important; }
  .js .ifunnel button { transform: none; opacity: 1; }
  .tree__links path { stroke-dashoffset: 0 !important; }
  .tree__nodes > * { opacity: 1 !important; }
  .parallax { transform: none !important; }
}
