/* ==========================================================================
   AARUHI — animations.css
   Keyframes, loader, and CSS fail-safes. GSAP owns all scroll motion;
   CSS owns ambient loops and guarantees nothing is ever left hidden.
   ========================================================================== */
@keyframes arrowLoop { 0% { transform: translateX(0); } 49% { transform: translateX(140%); } 50% { transform: translateX(-140%); } 100% { transform: translateX(0); } }
@keyframes scrollLine { to { transform: translateY(350%); } }
@keyframes ping { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes barFill { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
@keyframes ptransOut { to { transform: translateY(-100%); } }
@keyframes failsafe { to { opacity: 1; visibility: visible; } }
@keyframes loaderGone { to { visibility: hidden; opacity: 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ringSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.chip-float { animation: floaty 5s ease-in-out infinite; }
.chip-float--b { animation-delay: -1.6s; } .chip-float--c { animation-delay: -3.2s; }
.showcase__ring { animation: ringSpin 30s linear infinite; }

/* ---------- Loader (<2s) ---------- */
.loader { position: fixed; inset: 0; z-index: 500; display: none; background: var(--ink); color: #fff; }
html.show-loader .loader { display: grid; animation: loaderGone 0s 5s forwards; }
.loader__inner { align-self: center; justify-self: center; width: min(92vw, 760px); display: grid; gap: 22px; }
.loader__name { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem, 5vw, 3.6rem); letter-spacing: -0.045em; line-height: 1; overflow: hidden; }
.loader__name span { display: inline-block; }
.loader__name em { font-style: normal; color: var(--violet-2); }
.loader__row { display: flex; align-items: center; gap: 18px; }
.loader__line { flex: 1; height: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.loader__line i { display: block; height: 100%; background: var(--lime); transform-origin: left; transform: scaleX(0); }
.loader__pct { font-family: var(--f-display); font-size: 0.875rem; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }

/* ---------- Above-the-fold pre-state, with a fail-safe ---------- */
html.js:not(.no-motion):not(.is-ready) .hero,
html.js:not(.no-motion):not(.is-ready) .phero > .container { opacity: 0; animation: failsafe 0.4s 3s forwards; }

/* ---------- Reduced motion: calm and complete ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .loader { display: none !important; }
}
html.no-motion .appstory { position: relative; inset: auto; padding: 40px var(--pad); pointer-events: auto; }
