@media screen and (prefers-reduced-motion: no-preference) {
  /* The header stays put while the new page moves across the linen background. */
  html[data-portfolio-motion], html[data-portfolio-motion] body { overflow-x: clip; }
  html[data-portfolio-motion="waiting"] { --entry-play: paused; }

  html[data-portfolio-slide][data-portfolio-motion] main {
    animation: portfolio-slide-in .85s cubic-bezier(.22,.68,.18,1) backwards;
    animation-play-state: var(--entry-play, running);
  }
  @keyframes portfolio-slide-in {
    from { transform: translateX(85vw); opacity: .15; }
    to { transform: translateX(0); opacity: 1; }
  }

  html[data-portfolio-motion] .rt-centred > *,
  html[data-portfolio-motion] .rt-trio .painting {
    animation: portfolio-rise .9s cubic-bezier(.2,.65,.2,1) backwards;
    animation-delay: var(--entry-delay, .08s);
    animation-play-state: var(--entry-play, running);
  }
  .rt-centred h1 { --entry-delay: .21s; }
  .rt-centred > p:last-child { --entry-delay: .35s; }
  .rt-trio .painting { --entry-delay: .45s; --entry-rise: 54px; }
  .rt-trio .painting:nth-child(2) { --entry-delay: .68s; }
  .rt-trio .painting:nth-child(3) { --entry-delay: .91s; }
  @keyframes portfolio-rise {
    from { opacity: 0; transform: translateY(var(--entry-rise, 28px)); }
    to { opacity: 1; transform: translateY(0); }
  }
}
