#gw-login-screen .gw-intro {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100vh - 64px - env(safe-area-inset-bottom, 0px));
  height: calc(100svh - 64px - env(safe-area-inset-bottom, 0px));
  min-height: 300px;
  padding: max(28px, env(safe-area-inset-top, 0px)) 16px 0;
  overflow: hidden;
}

#gw-login-screen .gw-logo-wrap {
  position: relative;
  z-index: 50;
  flex: 0 0 auto;
  cursor: pointer;
}
#gw-login-screen .gw-logo {
  display: block;
  width: min(300px, 64vw);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* Size the complete stack against both available height and screen width. */
#gw-login-screen .gw-scene {
  container-type: size;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
#gw-login-screen .gw-layers {
  position: relative;
  width: min(460px, 86vw, 62cqh);
  aspect-ratio: 1 / 1.52;
  cursor: pointer;
}
#gw-login-screen .gw-layer {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--layer-order) * 14% - 8%);
  z-index: var(--layer-z);
  width: 100%;
  aspect-ratio: 1;
  animation: gw-float 5.6s ease-in-out infinite;
  animation-delay: var(--float-delay);
  will-change: transform;
}
#gw-login-screen .gw-layer img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  filter: drop-shadow(0 14px 16px rgb(28 36 44 / 12%));
}
#gw-login-screen .gw-layer-campus { --layer-order: 0; --layer-z: 40; --float-delay: 0s; }
#gw-login-screen .gw-layer-computing { --layer-order: 1; --layer-z: 30; --float-delay: -0.7s; }
#gw-login-screen .gw-layer-infrastructure { --layer-order: 2; --layer-z: 20; --float-delay: -1.4s; }
#gw-login-screen .gw-layer-energy { --layer-order: 3; --layer-z: 10; --float-delay: -2.1s; }

@keyframes gw-float {
  0%, 100% { transform: translateY(3px) rotate(0.08deg); }
  50% { transform: translateY(-4px) rotate(-0.08deg); }
}

#gw-login-screen .gw-intro-cta {
  position: absolute;
  z-index: 100;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}
#gw-login-screen #gw-login-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  min-height: 64px;
  padding: 16px 32px;
  border: 1px solid #dce0e5;
  border-radius: 999px;
  background: #fff;
  color: #3b4149;
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 600;
  box-shadow: 0 12px 32px rgb(32 40 50 / 12%), 0 2px 5px rgb(32 40 50 / 4%);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
#gw-login-screen #gw-login-cta:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgb(32 40 50 / 18%); }
#gw-login-screen #gw-login-cta:active { transform: translateY(0); }

#gw-login-screen .gw-form { display: none; }
#gw-login-screen[data-state="login"] .gw-intro { display: none; }
#gw-login-screen[data-state="login"] .gw-form { display: flex; }
#gw-login-screen[data-state="leaving"] .gw-logo-wrap { animation: gw-fly-up 650ms cubic-bezier(.2,.8,.2,1) forwards; }
#gw-login-screen[data-state="leaving"] .gw-layer { animation: gw-fly-down 650ms cubic-bezier(.2,.8,.2,1) forwards; }
#gw-login-screen[data-state="leaving"] .gw-intro-cta { opacity: 0; transition: opacity 180ms ease; pointer-events: none; }

@keyframes gw-fly-up { to { transform: translateY(-120vh); opacity: 0; } }
@keyframes gw-fly-down { to { transform: translateY(140vh) rotate(5deg); opacity: 0; } }

@media (max-height: 700px) {
  #gw-login-screen .gw-intro { padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  #gw-login-screen .gw-logo { width: min(220px, 60vw); }
  #gw-login-screen #gw-login-cta { width: 196px; min-height: 56px; padding-block: 12px; }
  #gw-login-screen .gw-intro-cta { bottom: 12px; }
}
@media (max-height: 480px) {
  #gw-login-screen .gw-logo { width: 128px; }
}
@media (prefers-reduced-motion: reduce) {
  #gw-login-screen .gw-layer,
  #gw-login-screen[data-state="leaving"] .gw-logo-wrap { animation: none; }
}
