.plio-transition,
.plio-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.plio-transition {
  /* Off-screen padding lets WebGL point sprites enter and exit in full. */
  inset: -80px;
  width: calc(100% + 160px);
  height: calc(100% + 160px);
  display: block;
  z-index: 10000;
  contain: strict;
  pointer-events: none;
}

/* Mirror the whole drawing: fish, their independent paths, and the school edges.
   This works for the GPU renderer and the 2D fallback without extra simulation. */
.plio-transition.is-reversed { transform: scaleX(-1); }

.plio-transition.is-vertical {
  inset: 50% auto auto 50%;
  width: calc(100vh + 160px);
  width: calc(100dvh + 160px);
  height: calc(100vw + 160px);
  transform: translate(-50%, -50%) rotate(90deg);
}

.plio-transition.is-vertical.is-reversed {
  transform: translate(-50%, -50%) rotate(90deg) scaleX(-1);
}

.plio-screen {
  z-index: 100;
  visibility: hidden;
  background: #f6f0e6;
  pointer-events: none;
}

html.is-plio-open .plio-screen.is-active {
  visibility: visible;
  pointer-events: auto;
}

html.is-plio-open,
html.is-plio-open body,
html.is-plio-transitioning,
html.is-plio-transitioning body { overflow: hidden; }

html.is-plio-open .construction-page,
html.is-plio-open .site-footer,
html.is-plio-open .site-controls { visibility: hidden; }

html.is-plio-transitioning .site-controls,
html.is-plio-transitioning .site-footer,
html.is-plio-transitioning .construction-page,
html.is-plio-transitioning .plio-screen { pointer-events: none; }

[data-pio-screen][aria-busy="true"] { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .plio-transition { display: none; }
}
