/**
 * story-drift - the layer js/plugins/story-drift.js adds to a
 * <section data-drift> and fills with phrases. It covers the whole section,
 * behind the section's own content; each .drift-phrase plays drift-life once
 * and is removed when it ends.
 *
 * Opacity comes per phrase from JS (--peak, 0.35-0.7), as do its life (--life),
 * sideways drift (--dx) and, for the phrases already mid-life when the slide
 * appears, a negative --delay. `.is-still` is the motion-off / print scatter.
 */
.reveal [data-drift] > .story-drift {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: none;
}
.reveal [data-drift] > :not(.story-drift) {
  position: relative;
  z-index: 1;
}

.reveal .drift-phrase {
  position: absolute;
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  color: var(--text-muted);
  opacity: 0;
  animation: drift-life var(--life, 6000ms) var(--ease) var(--delay, 0ms) both;
}
.reveal .drift-phrase[data-size="s"] { font-size: var(--step-0); }
.reveal .drift-phrase[data-size="m"] { font-size: var(--step-1); }
.reveal .drift-phrase[data-size="l"] { font-size: var(--step-2); font-weight: 600; }
.reveal .drift-phrase[data-kind="false"] { font-style: italic; }
.reveal .drift-phrase.is-still {
  animation: none;
  opacity: var(--peak);
}

@keyframes drift-life {
  0%   { opacity: 0; filter: blur(6px); transform: translate(0, 8px); }
  18%  { opacity: var(--peak); filter: blur(0); transform: translate(0, 0); }
  74%  { opacity: var(--peak); filter: blur(0); transform: translate(0, 0); }
  100% { opacity: 0; filter: blur(8px); transform: translate(var(--dx, 0px), -14px); }
}
