/* Scroll reveal.
 *
 * The class is added by JavaScript, so with JS off nothing is hidden and the
 * page reads normally. That ordering matters: hiding in CSS and revealing in
 * JS means a script failure leaves a blank page.
 *
 * 14px of rise and 500ms. Enough to register as movement, not enough to make
 * anyone wait for it. */

.will-reveal {
  opacity: 0;
  transform: translateY(14px);
}

.will-reveal,
.is-revealed {
  transition: opacity 500ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.is-revealed {
  opacity: 1;
  transform: none;
}

/* Once it has run, drop the compositing hint so long pages do not keep dozens
 * of promoted layers alive. */
.is-revealed {
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .will-reveal,
  .is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
