/* One calm entrance after primary text faces are ready. The 480ms/.2 curve
   comes from the existing forum surface entrance; no translate/layout shift.
   No attribute exists without JS: every page remains visible in that case. */
html[data-av-page-ready] body.av-cabinet .av-forum-surface,
html[data-av-page-ready] body.av-cabinet .av-page-heading > h1 {
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  html[data-av-page-ready="pending"] body.av-cabinet .av-forum-surface,
  html[data-av-page-ready="pending"] body.av-cabinet > .site-footer {
    opacity: 0;
    /* CSS also fails open if a later script error prevents JS cleanup. */
    animation: av-page-fail-open 1ms linear 1200ms forwards;
  }
  html[data-av-page-ready="ready"] body.av-cabinet .av-forum-surface,
  html[data-av-page-ready="ready"] body.av-cabinet > .site-footer {
    animation: av-page-ready 480ms cubic-bezier(.2, 0, 0, 1) both;
  }
}

@keyframes av-page-ready { from { opacity: 0; } to { opacity: 1; } }
@keyframes av-page-fail-open { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html[data-av-page-ready] body.av-cabinet .av-forum-surface,
  html[data-av-page-ready] body.av-cabinet > .site-footer {
    opacity: 1;
    animation: none;
  }
}
