/* The desktop's seat for the shared app switcher (os/switcher/card-switcher.css
   draws the cards themselves). This sheet only places the layer over the desktop
   and takes the live window layer out of the way while it is up. */

.desktop-switcher-layer {
  position: absolute;
  inset: 0;
  /* Above the raised window layer (2147483095) and everything it stacks inside it. */
  z-index: 2147483100;
  animation: desktop-switcher-in .2s ease both;
}
.desktop-switcher-layer[hidden] { display: none; animation: none; }
/* The dim, on its own layer UNDER the windows, so the live previews stay bright. */
.desktop-switcher-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2147483090;
  animation: desktop-switcher-in .2s ease both;
}
.desktop-switcher-backdrop[hidden] { display: none; animation: none; }
@keyframes desktop-switcher-in { from { opacity: 0; } to { opacity: 1; } }

/* NO backdrop-filter here, deliberately. A full-screen backdrop-filter has to
   be re-sampled every frame the cards move over it, and it measured as the
   single most expensive thing in the switcher — 200ms/frame with it, 83ms
   without. The same look comes from blurring the WALLPAPER instead: a static
   filter on an element that does not move, so it is rasterised once and the
   compositor reuses it for the whole gesture. */
.desktop-shell[data-switcher="true"] .desktop-wallpaper {
  filter: blur(14px) saturate(.9);
  transform: scale(1.04);
}
.desktop-shell .desktop-wallpaper { transition: filter .2s ease, transform .2s ease; }

/* The cards ARE the real windows (os/switcher/live-preview.js): the window
   layer rises between the dim and the stage, stops taking input, and every
   window that is not on a card (Help & Support) steps out of sight. A hidden
   (minimized) window on a card paints again through .is-previewing. */
.desktop-shell[data-switcher="true"] .desktop-window-layer {
  z-index: 2147483095;
  pointer-events: none;
}
.desktop-shell[data-switcher="true"] .desktop-window:not(.is-previewing) { visibility: hidden; }
.desktop-window.is-previewing {
  display: flex !important;
  visibility: visible;
  pointer-events: none !important;
  will-change: transform, opacity;
  transform-origin: center center;
  border-radius: var(--aos-r-xl, 28px);
  box-shadow: var(--aos-shadow-l);
}
.desktop-window.is-previewing .resize-handle { display: none; }

/* The per-window loading placeholder is never painted in the window itself. */
.window-frame-loading { display: none; }

@media (prefers-reduced-motion: reduce) {
  .desktop-switcher-layer { animation: none; }
  .desktop-shell .desktop-window-layer,
  .desktop-shell .desktop-wallpaper { transition: none; }
}
