/*
 * The loader index.html shows while the app's wasm downloads (src/boot.js drives it).
 *
 * Plain markup in the page itself, so it paints as soon as the stylesheets have — before
 * a byte of wasm has arrived. Fixed over the page, so the app can mount beneath it; the
 * boot script fades it out once `main` has run, and removes it.
 */

.boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--bg-subtle);
  font-family: var(--font-sans);
  color: var(--fg);
  transition: opacity 0.2s ease;
}

.boot--done {
  opacity: 0;
  pointer-events: none;
}

.boot__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: min(320px, 100%);
}

.boot__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.boot__product {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.boot__track {
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--border);
}

.boot__fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.15s linear;
}

.boot__status {
  min-height: 1.4em;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.boot--failed .boot__fill {
  background: var(--danger);
}

.boot--failed .boot__status {
  color: var(--danger);
}

.boot__reload {
  align-self: flex-start;
  height: var(--btn-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-base);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: var(--text-base);
  cursor: pointer;
}

.boot__reload:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  .boot,
  .boot__fill {
    transition: none;
  }
}
