:root {
  color-scheme: light;
  --boot-bg: #f4f7fb;
  --boot-surface: rgba(255, 255, 255, 0.88);
  --boot-border: rgba(148, 163, 184, 0.24);
  --boot-text: #0f172a;
  --boot-muted: #64748b;
  --boot-accent: #2563eb;
  --boot-accent-soft: rgba(37, 99, 235, 0.16);
}

html.is-dark {
  color-scheme: dark;
  --boot-bg: #09111f;
  --boot-surface: rgba(15, 23, 42, 0.82);
  --boot-border: rgba(148, 163, 184, 0.18);
  --boot-text: #f8fafc;
  --boot-muted: #94a3b8;
  --boot-accent: #60a5fa;
  --boot-accent-soft: rgba(96, 165, 250, 0.18);
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, var(--boot-accent-soft), transparent 24%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28%),
    var(--boot-bg);
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app {
  min-height: 100vh;
}

html:not(.app-ready) #app {
  visibility: hidden;
}

#boot-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, var(--boot-accent-soft), transparent 24%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28%),
    var(--boot-bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#boot-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.boot-loader__card {
  box-sizing: border-box;
  width: min(100%, 24rem);
  padding: 1.5rem;
  border: 1px solid var(--boot-border);
  border-radius: 1.5rem;
  background: var(--boot-surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
  text-align: center;
  backdrop-filter: blur(14px);
}

.boot-loader__mark {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--boot-accent), #38bdf8);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  animation: boot-float 1.6s ease-in-out infinite;
}

.boot-loader__title {
  margin: 0;
  color: var(--boot-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.boot-loader__copy {
  margin: 0.45rem 0 1.15rem;
  color: var(--boot-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.boot-loader__progress {
  position: relative;
  overflow: hidden;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.boot-loader__progress::after {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--boot-accent), #38bdf8);
  content: "";
  animation: boot-load 1.1s ease-in-out infinite;
}

@keyframes boot-load {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

@keyframes boot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader__mark,
  .boot-loader__progress::after {
    animation: none;
  }
}
