/*
 * Autonomous Prime boot and route loading visual.
 * Intentionally self-contained: no Tailwind, app tokens, fonts, or JS required.
 */
#app-boot-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
}

#app-boot-loading .ap-loading-screen {
  height: 100%;
}

.ap-loading-screen {
  --ap-loading-ink: #17243a;
  --ap-loading-muted: #637188;
  --ap-loading-paper: #f6f8fb;
  --ap-loading-blue: #2559a8;
  --ap-loading-violet: #7664c8;
  --ap-loading-line: rgba(70, 94, 135, 0.17);

  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(28px, env(safe-area-inset-top, 0px)) 22px max(28px, env(safe-area-inset-bottom, 0px));
  color: var(--ap-loading-ink);
  background:
    radial-gradient(ellipse at 50% 43%, rgba(224, 231, 246, 0.62), transparent 35%),
    radial-gradient(ellipse at 83% 14%, rgba(218, 225, 248, 0.42), transparent 32%),
    var(--ap-loading-paper);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: center;
}

.ap-loading-screen *,
.ap-loading-screen *::before,
.ap-loading-screen *::after {
  box-sizing: border-box;
}

.ap-loading-screen::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image: radial-gradient(rgba(65, 84, 119, 0.12) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  mask-image: linear-gradient(transparent 8%, #000 45%, transparent 92%);
}

.ap-loading-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 460px);
  flex-direction: column;
  align-items: center;
  padding: 28px 0;
  animation: ap-loading-arrive 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.ap-loading-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #425570;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.ap-loading-brand img {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(79, 91, 125, 0.12);
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 3px 9px rgba(41, 55, 84, 0.09);
}

.ap-loading-visual {
  width: 144px;
  height: 144px;
  margin: 40px 0 27px;
  overflow: visible;
}

.ap-loading-orbit {
  transform-origin: 72px 72px;
  animation: ap-loading-orbit 22s linear infinite;
}

.ap-loading-ring {
  fill: none;
  stroke: rgba(74, 98, 143, 0.16);
  stroke-width: 1;
}

.ap-loading-ring-inner {
  stroke: rgba(89, 106, 151, 0.2);
}

.ap-loading-arc {
  fill: none;
  stroke: rgba(100, 117, 163, 0.45);
  stroke-dasharray: 1 6;
  stroke-linecap: round;
  stroke-width: 1.3;
}

.ap-loading-link {
  fill: none;
  stroke: #9aaac5;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.ap-loading-core {
  fill: #fff;
  stroke: rgba(83, 107, 151, 0.28);
  stroke-width: 1;
}

.ap-loading-core-mark {
  fill: var(--ap-loading-blue);
}

.ap-loading-node {
  fill: #7189b2;
  stroke: #f6f8fb;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: ap-loading-breathe 2.8s ease-in-out infinite;
}

.ap-loading-node-violet {
  fill: #8d80c8;
  animation-delay: 0.65s;
}

.ap-loading-node-soft {
  fill: #9aaac5;
  animation-delay: 1.3s;
}

.ap-loading-copy {
  margin: 0;
  color: var(--ap-loading-ink);
  font-size: clamp(21px, 4vw, 25px);
  font-weight: 610;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.ap-loading-description {
  max-width: 330px;
  margin: 11px 0 0;
  color: var(--ap-loading-muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.65;
}

.ap-loading-rule {
  width: 34px;
  height: 1px;
  margin-top: 29px;
  background: linear-gradient(90deg, #8a9dbc, #8a82bd);
  opacity: 0.75;
}

.ap-loading-screen.ap-loading-compact {
  min-height: 260px;
  padding: 26px 18px;
  overflow: visible;
  border: 1px solid rgba(70, 94, 135, 0.12);
  border-radius: 9px;
}

.ap-loading-compact .ap-loading-content {
  padding: 10px 0;
}

.ap-loading-compact .ap-loading-brand {
  font-size: 12px;
}

.ap-loading-compact .ap-loading-brand img {
  width: 29px;
  height: 29px;
  border-radius: 8px;
}

.ap-loading-compact .ap-loading-visual {
  width: 92px;
  height: 92px;
  margin: 23px 0 18px;
}

.ap-loading-compact .ap-loading-copy {
  font-size: 18px;
}

.ap-loading-compact .ap-loading-description {
  margin-top: 7px;
  font-size: 12px;
}

.ap-loading-compact .ap-loading-rule {
  margin-top: 19px;
}

@keyframes ap-loading-arrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ap-loading-orbit {
  to { transform: rotate(360deg); }
}

@keyframes ap-loading-breathe {
  0%, 100% { opacity: 0.64; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 480px) {
  .ap-loading-content {
    width: min(100%, 360px);
  }

  .ap-loading-visual {
    width: 128px;
    height: 128px;
    margin-top: 33px;
  }

  .ap-loading-description {
    max-width: 285px;
    font-size: 13px;
  }
}

@media (max-height: 560px) and (min-width: 481px) {
  .ap-loading-content {
    padding: 10px 0;
  }

  .ap-loading-visual {
    width: 96px;
    height: 96px;
    margin: 16px 0 12px;
  }

  .ap-loading-rule {
    margin-top: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ap-loading-content,
  .ap-loading-orbit,
  .ap-loading-node {
    animation: none !important;
  }
}
