/* Shared mounting rules for the existing cinematic SVG, without page styling. */
:root { --lit-train-styles-ready: 1; }
#v2-metro-intro, .v2-window-backdrop { display: none; }
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  /* Installed synchronously in <head> only for an explicit arrival request.
     CSS also releases the cover if a subsequent script fails completely. */
  html[data-lit-train-pending]::before {
    content: ''; position: fixed; inset: 0; z-index: 1000;
    background: #000; pointer-events: auto;
    animation: lit-train-guard-retire 4500ms step-end forwards;
  }
  #v2-metro-intro[data-lit-train-phase] {
    display: block; position: fixed; inset: 0; z-index: 1000;
    width: 100%; height: 100%; overflow: hidden; contain: layout paint style;
    pointer-events: auto;
  }
  #v2-metro-intro[data-lit-train-phase] svg { display: block; width: 100%; height: 100%; }
  #v2-metro-intro[data-lit-train-phase] mask { mask-type: luminance; }
  .v2-window-backdrop[data-lit-train-phase] {
    display: block; position: fixed; left: 0; z-index: -1; pointer-events: none;
    backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  }
  #v2-metro-intro[data-lit-train-phase] :is(.v2-intro-train, .v2-moving-clip) {
    transform-box: view-box; transform-origin: 0 0;
    transform: translate3d(var(--v2-from), 0, 0);
  }
  #v2-metro-intro[data-lit-train-phase] .v2-intro-train { will-change: transform; }
  /* The legacy route effect transforms body. Release it only during a train,
     so its fixed viewport and the live background keep their coordinate space. */
  html[data-lit-train-active]:is(.lit-route-arriving, .lit-route-ready, .lit-route-leaving) body {
    opacity: 1 !important; transform: none !important; filter: none !important;
  }
  /* Guard and overlay share the browser top layer when popovers are supported,
     without closing an existing menu or dialog or moving keyboard focus. */
  #v2-metro-intro[data-lit-train-phase][popover] {
    margin: 0; padding: 0; border: 0; max-width: none; max-height: none;
    background: transparent; color: inherit;
  }
  #v2-metro-intro[data-lit-train-phase]::backdrop { background: transparent; }
}
@keyframes lit-train-guard-retire { to { visibility: hidden; } }

#v2-metro-intro[data-lit-train-phase] .v2-train-body { filter: drop-shadow(-10px -9px 8px rgba(0, 0, 0, .65)); }
