/* CSS starts the opening sequence before the first paint, avoiding a visible-then-hidden flash.
   Scroll content is concealed only after JavaScript has installed its observer. */
@keyframes s-enter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  /* Native anchor scrolling preserves fragment URLs, history and keyboard behavior. */
  html { scroll-behavior: smooth; }

  .w-hero__text > *, .w-pagehead .w-container > * {
    animation: s-enter 1000ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .w-hero__text > :nth-child(2), .w-pagehead .w-container > :nth-child(2) { animation-delay: 120ms; }
  .w-hero__text > :nth-child(3), .w-pagehead .w-container > :nth-child(3) { animation-delay: 240ms; }
  .w-hero__text > :nth-child(4) { animation-delay: 360ms; }

  [data-motion="pending"] { opacity: 0; transform: translateY(32px); }
  @media (max-width: 639px) {
    [data-motion="pending"] { transform: translateY(24px); }
  }

  /* A deep link, restored page or focused action is immediately readable. */
  html:has(:target) .w-hero__text > *, html:has(:target) .w-pagehead .w-container > *,
  .s-motion-settled .w-hero__text > *, .s-motion-settled .w-pagehead .w-container > *,
  .w-hero__text > :focus-within, .w-pagehead .w-container > :focus-within {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce), print {
  .w-page *, .w-page *::before, .w-page *::after {
    animation: none !important;
    transition: none !important;
  }
  .w-page [data-motion] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Clip only the answer, leaving the summary's keyboard focus ring unobstructed. */
.w-disc__content { overflow: hidden; }
.w-faq .w-disc__mark { transition-duration: 320ms; }
.w-disc[data-disclosure="closing"] .w-disc__mark { transform: rotate(0); }
