/* Page-to-page transitions (Joel, Oct 5: the motion preview after studying burnthill.farm).
   Cross-document View Transitions, CSS only. The page you are leaving stays put, fully opaque, while the
   page you land on fades in over it. Nothing slides at page level, so no strip of the old page or the
   light background can show under the header (Joel saw a white bar when it did); the header holds
   perfectly still. The movement lives inside the new page instead: its opening heading rises into place.
   A page opts in through Base.astro's `viewTransitions` prop; both the page you leave and the page you
   land on must opt in. Browsers without support navigate normally. Nothing runs for anyone who asks
   their device to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .header { view-transition-name: site-header; }
  ::view-transition-group(site-header) { animation-duration: 0s; }
  ::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: vt-in 0.9s cubic-bezier(0.33, 0, 0.2, 1) both; }

  /* An inner page's opening (About in the preview): kicker, title, stripe and lede rise one after another
     and the stripe draws across. Text moves but never fades, so contrast holds in every frame. The navy
     block's own padding hides the short travel, so nothing spills past it. */
  .masthead .col > * { animation: vt-rise 1.2s cubic-bezier(0.33, 0, 0.2, 1) both; }
  .masthead .col > :nth-child(2) { animation-delay: 0.08s; }
  .masthead .col > :nth-child(4) { animation-delay: 0.18s; }
  .masthead .col > :nth-child(n + 5) { animation-delay: 0.26s; }
  .masthead .col > .stripe { transform-origin: left center; animation: vt-draw 1.2s cubic-bezier(0.33, 0, 0.2, 1) 0.2s both; }
}
@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-rise { from { transform: translateY(28px); } }
@keyframes vt-draw { from { transform: scaleX(0); } }
