/* Native document navigation; never replaces a workspace or its script lifecycle. */
@view-transition { navigation: none; }
::view-transition { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-entry-transition="welcome"]::view-transition-old(root) { animation: entry-retreat .4s ease both; }
html[data-entry-transition="welcome"]::view-transition-new(root) { animation: entry-reveal .45s ease both; }
html[data-entry-transition="hub"]::view-transition-old(root) { animation: entry-retreat .25s ease both; }
html[data-entry-transition="hub"]::view-transition-new(root) { animation: entry-reveal .3s ease both; }
html[data-entry-transition="collaborators"]::view-transition-old(root) { animation: entry-auxiliary-out .25s ease-out both; }
html[data-entry-transition="collaborators"]::view-transition-new(root) { animation: entry-auxiliary-in .25s ease-out both; }
@keyframes entry-auxiliary-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes entry-auxiliary-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes entry-retreat { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.96); } }
@keyframes entry-reveal { from { opacity: 0; transform: scale(.975); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

::view-transition-group(entry-logo), ::view-transition-group(entry-scene) { animation-duration: .45s; animation-timing-function: cubic-bezier(.22,.8,.25,1); }

/* A separate mark travels to the viewport centre before the camera passage. */
html[data-entry-logo-flight] body > main { opacity: 0; }
html[data-entry-logo-flight="active"] body > main { animation: entry-logo-hub 1.1s linear both; }
html[data-entry-logo-flight] :is(.avatar-helper, .competition-dock, .platform-navigation) { visibility: hidden; }
.entry-logo-flight-layer { position: fixed; inset: 0; z-index: 1045; overflow: hidden; pointer-events: none; isolation: isolate; }
.entry-logo-flight-veil { position: absolute; inset: 0; background-color: #fbfcfe; animation: entry-logo-veil 1.1s linear both; }
.entry-logo-flight-veil::before { content: ""; position: absolute; inset: 0; background: var(--ceeb-page-background-image) center / cover no-repeat; opacity: .62; }
.entry-logo-flight-image {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--entry-logo-width);
  height: var(--entry-logo-height);
  max-width: none;
  object-fit: contain;
  transform-origin: var(--entry-logo-origin-x) var(--entry-logo-origin-y);
}
.entry-logo-flight-image--rounded { border-radius: 50%; }
@keyframes entry-logo-hub {
  0%, 68% { opacity: 0; transform: none; }
  100% { opacity: 1; transform: none; }
}
@keyframes entry-logo-veil { 0%, 68% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html[data-entry-logo-flight] body > main { opacity: 1; animation: none; }
  html[data-entry-logo-flight] :is(.avatar-helper, .competition-dock, .platform-navigation) { visibility: visible; }
  .entry-logo-flight-layer { display: none; }
}

/* Keep the Hub snapshot above the live destination; only the selected mark lifts out. */
html[data-entry-departure="competition"] :is(.entry-brand, .entry-scene-camera) { view-transition-name: none; }
html[data-entry-competition-flight]::view-transition-group(root) { z-index: 1; animation: none; }
html[data-entry-competition-flight]::view-transition-image-pair(root) { isolation: auto; }
html[data-entry-competition-flight]::view-transition-old(root) {
  z-index: 2;
  animation: entry-competition-dissolve 1.1s cubic-bezier(.4,0,.2,1) both;
}
html[data-entry-competition-flight]::view-transition-new(root) { z-index: 1; opacity: 1; animation: none; }
html[data-entry-competition-flight]::view-transition-group(entry-modality-logo) {
  z-index: 2;
  animation: none;
  transform-origin: var(--entry-logo-origin-x) var(--entry-logo-origin-y);
}
html[data-entry-competition-flight]::view-transition-old(entry-modality-logo) {
  animation: none;
  mix-blend-mode: normal;
  width: 100%;
  height: 100%;
}
@keyframes entry-competition-dissolve {
  0%, 18% { opacity: 1; filter: blur(0); }
  48% { opacity: .72; filter: blur(2px); }
  88%, 100% { opacity: 0; filter: blur(4px); }
}

/* The dock is a shared anchor; workspace and wallpaper remain in the viewport snapshot. */
html:is([data-entry-departure="module"], [data-entry-module-arrival], [data-entry-module-flight]) .competition-dock-wrap--immersive { view-transition-name: competition-dock; backdrop-filter: none; -webkit-backdrop-filter: none; }
html:is([data-entry-departure="module"], [data-entry-module-arrival], [data-entry-module-flight]) .competition-dock-current-icon { view-transition-name: competition-dock-icon; }
html:is([data-entry-departure="module"], [data-entry-module-arrival], [data-entry-module-flight]) .competition-dock-toggle-label { view-transition-name: competition-dock-label; }
body.has-competition-dock > .background-container { animation: none; }
html[data-entry-module-flight]::view-transition-group(root) { animation: none; z-index: 1; }
html[data-entry-module-flight]::view-transition-image-pair(root) { isolation: auto; }
html[data-entry-module-flight]::view-transition-old(root) { z-index: 2; animation: entry-module-dissolve .35s cubic-bezier(.4,0,.2,1) both; }
html[data-entry-module-flight]::view-transition-new(root) { z-index: 1; opacity: 1; animation: none; }
html[data-entry-module-flight]::view-transition-group(competition-dock) { z-index: 3; animation: none; }
html[data-entry-module-flight]::view-transition-image-pair(competition-dock) { isolation: auto; }
html[data-entry-module-flight]::view-transition-old(competition-dock) { z-index: 2; animation: entry-dock-dissolve .15s ease-out both; }
html[data-entry-module-flight]::view-transition-new(competition-dock) { z-index: 1; opacity: 1; animation: none; }
html[data-entry-module-flight]::view-transition-group(competition-dock-icon),
html[data-entry-module-flight]::view-transition-group(competition-dock-label) { z-index: 4; animation-duration: .15s; animation-timing-function: ease-out; }
html[data-entry-module-flight]::view-transition-image-pair(competition-dock-icon),
html[data-entry-module-flight]::view-transition-image-pair(competition-dock-label) { isolation: auto; }
html[data-entry-module-flight]::view-transition-old(competition-dock-icon),
html[data-entry-module-flight]::view-transition-old(competition-dock-label) { z-index: 2; animation: entry-dock-dissolve .15s ease-out both; mix-blend-mode: normal; }
html[data-entry-module-flight]::view-transition-new(competition-dock-icon),
html[data-entry-module-flight]::view-transition-new(competition-dock-label) { z-index: 1; opacity: 1; animation: none; mix-blend-mode: normal; }
html[data-entry-module-flight]::view-transition-old(competition-dock-label),
html[data-entry-module-flight]::view-transition-new(competition-dock-label) { width: auto; }
@keyframes entry-module-dissolve { from { opacity: 1; filter: blur(0); } to { opacity: 0; filter: blur(1.5px); } }
@keyframes entry-dock-dissolve { from { opacity: 1; } to { opacity: 0; } }
