/* Page transition between Work (index.html) and About (about.html), driven by transition.js.
   Leaving: the dog runs off to the right wiping out the nav, everything else disperses.
   Arriving: the dog runs in from the left to the middle, then the page fades in. */

/* the dog (also used on the About page, where index.html's styles.css is not loaded) */
.dog { --u: 8px; display: block; flex: none; width: calc(16 * var(--u)); height: calc(8 * var(--u));
  background: url('intro/dog-sprite.png?v=3') no-repeat 0 0 / 300% 100%; }
.dog[data-f="0"] { background-position: 0% 0; }
.dog[data-f="1"] { background-position: 50% 0; }
.dog[data-f="2"] { background-position: 100% 0; }
.dog-runner { --u: 3px; position: fixed; top: 22px; left: calc(50% - 8 * var(--u)); z-index: 170; pointer-events: none; transform-origin: 0 0; opacity: 0; }
.dog-runner.is-on { opacity: 1; }
@media (max-width: 820px) { .dog-runner { top: 18px; } }

/* arriving: everything but the dog stays hidden until he reaches the middle */
html.pt-in:not(.pt-home) body > *:not(#dog-runner):not(script):not(style):not(.grain) { opacity: 0 !important; }
html.pt-reveal:not(.pt-home) body > *:not(#dog-runner):not(script):not(style):not(.grain) { transition: opacity 0.8s ease; }
html.pt-skip .site-nav-links button, html.pt-skip .nav-brand, html.pt-skip .site-nav-links li, html.pt-skip .pill-clock, html.pt-skip .pill-marquee { animation: none !important; }
html.pt-skip .showcase.sc-run .sc-stage { animation: none !important; }

/* arriving on the Work page: the shell stays visible and each piece comes in on its own time (delays set by transition.js) */
html.pt-home.pt-in .nav-brand, html.pt-home.pt-in .site-nav-links button, html.pt-home.pt-in .pill-clock, html.pt-home.pt-in .pill-marquee,
html.pt-home.pt-in .sc-slide, html.pt-home.pt-in .sc-info { opacity: 0 !important; }
@keyframes pt-come { from { opacity: 0; translate: var(--ptx, 0) var(--pty, 16px); } }
html.pt-home.pt-reveal .pill-clock    { --ptx: 0; --pty: -14px; animation: pt-come 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }
html.pt-home.pt-reveal .sc-slide      { --ptx: 0; --pty: 34px;  animation: pt-come 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }
html.pt-home.pt-reveal .nav-brand     { --ptx: -14px; --pty: 0; animation: pt-come 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }
html.pt-home.pt-reveal .site-nav-links button { --ptx: 0; --pty: -12px; animation: pt-come 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }
html.pt-home.pt-reveal .sc-info       { --ptx: -18px; --pty: 0; animation: pt-come 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }
html.pt-home.pt-reveal .pill-marquee  { --ptx: 18px; --pty: 0;  animation: pt-come 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) var(--ptd, 0s) backwards !important; }

/* leaving: the page disperses */
html.pt-out body > *:not(#dog-runner):not(script):not(style):not(.grain) { opacity: 0 !important; transition: opacity 0.65s ease !important; }
html.pt-out .sc-slide { translate: calc(var(--d, 0) * 16vw) -5vh !important; transition: translate 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease !important; opacity: 0 !important; }
html.pt-out .sc-info { transform: translateY(-18px) !important; }
html.pt-out .top-bar { transform: translateY(20px) !important; }
html.pt-out .reveal { opacity: 0 !important; transform: translateY(-28px) !important; transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important; }
@media (prefers-reduced-motion: reduce) { html.pt-in body > * { opacity: 1 !important; } }
