/* Stable first paint, dominant boot overlay and legacy-repaint suppression. */

#caBootShell {
  display: none;
}

html.ca-app-booting,
html.ca-app-booting body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #020617 !important;
}

html.ca-app-booting body > :not(#caBootShell) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.ca-app-booting #caBootShell {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: grid !important;
  place-items: center;
  isolation: isolate;
  box-sizing: border-box;
  width: 100vw !important;
  min-width: 100vw;
  height: 100vh !important;
  min-height: 100svh;
  margin: 0 !important;
  padding: clamp(18px, 4vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(14, 165, 233, 0.16), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(34, 211, 238, 0.09), transparent 32%),
    #020617;
  opacity: 1;
  pointer-events: auto !important;
  user-select: none;
  touch-action: none;
  transition: opacity 280ms ease;
}

html.ca-app-booting #caBootShell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 22%, transparent 76%);
}

html.ca-app-booting.ca-app-releasing #caBootShell {
  opacity: 0;
}

.ca-boot-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 15px;
  width: min(560px, 100%);
  padding: clamp(34px, 7vw, 64px);
  border: 1px solid rgba(103, 213, 255, 0.42);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.2), transparent 50%),
    linear-gradient(145deg, rgba(13, 34, 58, 0.995), rgba(7, 20, 38, 0.995));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(125, 211, 252, 0.06) inset;
  text-align: center;
}

.ca-boot-mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(103, 213, 255, 0.6);
  border-radius: 21px;
  background: rgba(8, 145, 178, 0.24);
  color: #f8fbff;
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 34px rgba(8, 145, 178, 0.24);
}

.ca-boot-card h2,
.ca-boot-card p {
  margin: 0;
}

.ca-boot-card h2 {
  color: #f8fbff;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}

.ca-boot-card p {
  max-width: 410px;
  color: #d7e5f3;
  line-height: 1.6;
}

.ca-boot-progress {
  position: relative;
  overflow: hidden;
  width: min(290px, 76vw);
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08) inset;
}

.ca-boot-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67d5ff, #6ee7b7);
  animation: ca-boot-scan 0.9s ease-in-out infinite alternate;
  box-shadow: 0 0 18px rgba(103, 213, 255, 0.52);
}

/* Old bundled layers may repaint these nodes after the modern app is ready. */
body.ca-public-clean #app > .hero,
body.ca-public-clean #app > .plan-gate-hero,
body.ca-public-clean #app > .briefing-card {
  display: none !important;
}

html:not(.ca-app-booting) #caBootShell {
  display: none !important;
}

@keyframes ca-boot-scan {
  from { transform: translateX(-10%); }
  to { transform: translateX(150%); }
}

@media (max-width: 720px) {
  html.ca-app-booting #caBootShell {
    padding: 16px;
  }

  .ca-boot-card {
    padding: 34px 22px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ca-app-booting #caBootShell {
    transition: none;
  }

  .ca-boot-progress::after {
    width: 72%;
    animation: none;
  }
}
