/* Played-once motion and small state changes. Slow and soft (power2.out, 600 to 900ms), nothing bounces.
   No ambient motion: fittings stay still. Everything here switches off with prefers-reduced-motion. */

@keyframes stroke-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes call-arrive {
  0% { background-color: var(--primary); }
  45% { background-color: var(--btn-active); }
  100% { background-color: var(--primary); }
}
@keyframes branch-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes say-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rule-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes datum-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes tick-in { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
@keyframes zone-glow-stroke { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* load (roof draw, headline lines, button last) is played by GSAP in js/scene.js: the pinned stage is re-inserted by
   ScrollTrigger on refresh, which would restart CSS animations. */

/* each section's level mark draws its 1px rule from the left as it enters (class set by IntersectionObserver) */
.js main > section:not(.descent) .level::before { transform: scaleX(0); }
.js main > section.is-in .level::before { animation: rule-draw var(--dur-3) var(--ease-out) both; }
.js main > section:not(.descent) .level .datum, .js main > section:not(.descent) .level-txt { opacity: 0; }
.js main > section.is-in .level .datum { animation: datum-in var(--dur-2) var(--ease-out) 500ms both; }
.js main > section.is-in .level-txt { animation: fade-in var(--dur-2) var(--ease-out) 650ms both; }

/* ticks */
.input[type="checkbox"]:checked { animation: tick-in var(--dur-1) var(--ease-out) both; }

/* the map zone being checked draws its outline */
.arr.is-on path { stroke-dasharray: 1; animation: zone-glow-stroke var(--dur-3) var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .js main > section:not(.descent) .level::before { transform: none; animation: none !important; }
  .js main > section:not(.descent) .level .datum, .js main > section:not(.descent) .level-txt { opacity: 1; animation: none !important; }
  .arr.is-on path { animation: none; stroke-dasharray: none; }
}
