/* ==========================================================================
   animations.css — motion styling only (GSAP logic lives in animations.js).
   1. Hero start state before first paint (only when JS + motion allowed)
   2. Failsafe: everything visible if GSAP fails (.anim-off)
   3. Offcanvas menu link stagger
   4. Reduced-motion fallbacks
   ========================================================================== */

/* 1 */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.anim-off) [data-hero] { opacity: 0; }
}

/* 2 */
.anim-off [data-hero],
.anim-off [data-reveal],
.anim-off [data-reveal-image],
.anim-off [data-reveal-group] > * {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

/* 3. Menu links slide in from the right after the panel opens */
.mobile-menu .menu-list li,
.mobile-menu .menu-actions,
.mobile-menu .menu-contact {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  transition-delay: calc(0.12s + var(--i, 6) * 0.05s);
}
.mobile-menu .menu-list li:nth-child(1) { --i: 0; }
.mobile-menu .menu-list li:nth-child(2) { --i: 1; }
.mobile-menu .menu-list li:nth-child(3) { --i: 2; }
.mobile-menu .menu-list li:nth-child(4) { --i: 3; }
.mobile-menu .menu-list li:nth-child(5) { --i: 4; }
.mobile-menu .menu-list li:nth-child(6) { --i: 5; }
.mobile-menu .menu-actions { --i: 6; }
.mobile-menu .menu-contact { --i: 7; }
.mobile-menu.show .menu-list li,
.mobile-menu.show .menu-actions,
.mobile-menu.show .menu-contact { opacity: 1; transform: none; }

/* Hamburger morph while the menu is open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { width: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 4 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
