/* Initial HTML splash: centered content and subtle corner diamond patterns. */
body.page-loading {
  margin: 0;
  padding: 0;
}

.splash-screen {
  --splash-surface: #fafcfb;
  --splash-ink: #29292b;
  --splash-muted: #7e8299;
  --splash-line: #e1e3ea;
  --splash-accent: #29292b;
  --splash-halo: #29292b0a;
  --splash-corner: #29292b;
  --diamond-rgb: 41, 41, 43;
  display: none;
}

[data-bs-theme="dark"] .splash-screen {
  --splash-surface: #151521;
  --splash-ink: #eeeef3;
  --splash-muted: #92929f;
  --splash-line: #2b2b3c;
  --splash-accent: #82cac0;
  --splash-halo: #293a4b40;
  --splash-corner: #536d79;
  --diamond-rgb: 198, 219, 229;
}

body.page-loading .splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--splash-surface);
  color: var(--splash-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.splash-screen,
.splash-screen * {
  box-sizing: border-box;
}

.splash-screen .splash-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 32px 20px;
  text-align: center;
}

.splash-screen .splash-corner {
  position: absolute;
  width: 420px;
  height: 420px;
  color: var(--splash-corner);
  opacity: .16;
  pointer-events: none;
}

.splash-screen .splash-corner-left {
  left: -205px;
  bottom: -200px;
  transform: rotate(-12deg);
}

.splash-screen .splash-corner-right {
  right: -210px;
  top: -215px;
  transform: rotate(168deg);
}

.splash-screen .splash-logo {
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.splash-screen .splash-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 160px;
  max-height: 62px;
  object-fit: contain;
}

.splash-screen .splash-jewel {
  position: relative;
  width: 260px;
  max-width: 100%;
  height: 204px;
  margin: 0 auto 14px;
}

.splash-screen .splash-jewel::before {
  content: "";
  position: absolute;
  width: 138px;
  height: 138px;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--splash-halo);
  filter: blur(31px);
}

.splash-screen canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.splash-screen .splash-eyebrow {
  margin: 0 0 15px;
  color: var(--splash-muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .29em;
  text-transform: uppercase;
}

.splash-screen h1 {
  margin: 0;
  color: var(--splash-ink);
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.splash-screen .splash-loader {
  width: 112px;
  height: 2px;
  margin: 27px auto 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--splash-line);
}

.splash-screen .splash-loader::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--splash-accent);
  animation: splash-glide 2.8s cubic-bezier(.45, 0, .3, 1) infinite;
}

@keyframes splash-glide {
  0% { transform: translateX(-120%); }
  70%, 100% { transform: translateX(330%); }
}

.splash-screen .splash-recovery[hidden] { display: none; }

.splash-screen .splash-recovery {
  max-width: 360px;
  margin: 26px auto 0;
  font-size: 12px;
  line-height: 1.5;
}

.splash-screen .splash-recovery p {
  margin: 0 0 12px;
  color: var(--splash-muted);
}

.splash-screen .splash-recovery button {
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid var(--splash-line);
  border-radius: 7px;
  background: var(--splash-ink);
  color: var(--splash-surface);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.splash-screen .splash-recovery button:focus-visible {
  outline: 2px solid var(--splash-accent);
  outline-offset: 4px;
}

.splash-screen .splash-recovery button:disabled {
  opacity: .65;
  cursor: wait;
}

.splash-screen .splash-recovery .splash-recovery-note {
  margin: 12px 0 0;
  font-size: 11px;
}

.splash-screen .splash-recovery .splash-recovery-status {
  margin: 8px 0 0;
  font-size: 11px;
}

.splash-screen .splash-recovery-status:empty { display: none; }

@media (max-width: 430px) {
  .splash-screen .splash-corner { opacity: .11; }
  .splash-screen .splash-jewel { width: 230px; height: 180px; }
  .splash-screen .splash-logo { margin-bottom: 14px; }
  .splash-screen .splash-logo img { max-height: 54px; }
  .splash-screen h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-screen .splash-loader::after {
    animation: none;
    width: 42%;
    margin: 0 auto;
  }
}
