/* Site-wide quiet motion (brand-book「動き」: 14px fade-up, reduced-motion stops everything).
   Pairs with /assets/js/moai-motion.js, which only hides what is still below the fold. */
@keyframes moaiMotionUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Opening heading block: children of the h1 container rise in order on first paint.
     The home hero, the top page (home-rich) and the diagnosis tool animate on their own. */
  body:not(.home, .home-rich) :has(> h1):not(.fade-in, .fade-in *) > * {
    animation: moaiMotionUp .6s cubic-bezier(.2, .8, .2, 1) both;
  }
  body:not(.home, .home-rich) :has(> h1):not(.fade-in, .fade-in *) > :nth-child(2) { animation-delay: .08s; }
  body:not(.home, .home-rich) :has(> h1):not(.fade-in, .fade-in *) > :nth-child(3) { animation-delay: .16s; }
  body:not(.home, .home-rich) :has(> h1):not(.fade-in, .fade-in *) > :nth-child(4) { animation-delay: .24s; }
  body:not(.home, .home-rich) :has(> h1):not(.fade-in, .fade-in *) > :nth-child(n+5) { animation-delay: .32s; }

  /* Sections below the fold rise once as they enter. */
  .moai-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
  }
  .moai-reveal.is-in { opacity: 1; transform: none; }

  /* Cards in a grid follow the section, one after another. */
  .moai-reveal .moai-reveal-item {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1);
    transition-delay: calc(.12s + var(--moai-i, 0) * 70ms);
  }
  .moai-reveal.is-in .moai-reveal-item { opacity: 1; transform: none; }
}

@media print {
  .moai-reveal, .moai-reveal .moai-reveal-item { opacity: 1 !important; transform: none !important; }
}
