/* Variant B (Geio, Nov 17), after humansize.de. Loaded only by index-b.html, on top of style.css. */
:root {
  --ease-nav: cubic-bezier(0.53, 0, 0.12, 0.99);
  --dur-nav: 500ms;
}

/* the deck moves on the same curve as every view change */
html[data-flow='b'] .s7c {
  transition:
    left var(--dur-nav) var(--ease-nav),
    top var(--dur-nav) var(--ease-nav),
    width var(--dur-nav) var(--ease-nav),
    clip-path var(--dur-nav) var(--ease-nav),
    border-radius var(--dur-nav) var(--ease-nav),
    opacity 300ms ease,
    background-color 300ms ease;
}

/* pictures appear only once loaded */
html[data-flow='b'] img.fade { opacity: 0; transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1); }
html[data-flow='b'] img.fade.is-ready { opacity: 1; }

/* during a view transition the new state is set at once; the browser animates between the two snapshots */
html.vt-run .detail,
html.vt-run .detail *,
html.vt-run .device * { transition: none !important; }

/* the old view stays as it is while the new one fades in on top */
::view-transition { background: transparent; }
::view-transition-old(root) { animation: none; opacity: 1; }
::view-transition-new(root) { animation: vt-in 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
@keyframes vt-in { from { opacity: 0; } }

/* the travelling picture: the card's screenshot morphs into the page's hero */
::view-transition-group(work-frame) { animation-duration: var(--dur-nav); animation-timing-function: var(--ease-nav); }
::view-transition-image-pair(work-frame) { overflow: hidden; border-radius: 28px; }
::view-transition-old(work-frame),
::view-transition-new(work-frame) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(work-frame) { animation: none; opacity: 1; }
::view-transition-new(work-frame) { animation: vt-in var(--dur-nav) linear both; }

@media (prefers-reduced-motion: reduce) {
  html[data-flow='b'] img.fade { transition: none; opacity: 1; }
}
