/* Loading screen (owner request 2026-11-16).
 *
 * index.html paints #learner-content-status before any script runs, so the first
 * frame a visitor sees is this screen rather than an unfinished app shell.
 * assets/remote-learner-content.js sets --boot-progress (0 to 1), switches the
 * screen to .is-error when the question library cannot be loaded, and adds
 * .is-leaving to fade it out once the app has started underneath.
 *
 * Colours are the Comet Camp tokens from styles.css written out as literals, so
 * this screen never depends on a later stylesheet:
 *   paper #fff5df with a #e9d9b6 dot grid; forest #2f6b4f, #1e4634, shadow #24523d;
 *   gold #f7c94b; cream surface #fff8e7; line #e6d3ab; card shadow #ece0c2.
 */
.boot-screen {
  --boot-progress: .06;
  --boot-head: 44px;
  position: fixed; inset: 0; z-index: 2147483647;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 24px 16px;
  background: #fff5df radial-gradient(#e9d9b6 1.4px, transparent 1.4px) 0 0 / 22px 22px;
  color: #1e4634; text-align: center;
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  transition: opacity .26s cubic-bezier(.16, 1, .3, 1);
}
.boot-screen.is-leaving { opacity: 0; pointer-events: none; }

.boot-title {
  margin: 0; max-width: 20ch;
  font-family: "Manrope", "Figtree", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(24px, 4vw, 32px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em;
  color: #1e4634;
}

/* The one memorable element: Nova's beacon travels a gold trail along a
   camp-paper track. The beacon's centre stays inside the track at 0 and 1. */
.boot-track {
  position: relative; width: min(360px, 100%); height: 20px; border-radius: 999px;
  background: #fff8e7; border: 2px solid #e6d3ab; box-shadow: 0 4px 0 #ece0c2;
}
.boot-trail {
  position: absolute; top: 2px; bottom: 2px; left: 2px;
  width: calc(var(--boot-head) / 2 + var(--boot-progress) * (100% - var(--boot-head)) - 2px);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(247, 201, 75, .2), #f7c94b 75%);
  transition: width .45s cubic-bezier(.16, 1, .3, 1);
}
.boot-mark {
  position: absolute; top: 50%;
  left: calc(var(--boot-head) / 2 + var(--boot-progress) * (100% - var(--boot-head)));
  width: var(--boot-head); height: var(--boot-head);
  margin: calc(var(--boot-head) / -2) 0 0 calc(var(--boot-head) / -2);
  filter: drop-shadow(0 3px 0 #24523d);
  transition: left .45s cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-reduced-motion: no-preference) {
  .boot-mark { animation: boot-bob 1.6s ease-in-out infinite; }
}
@keyframes boot-bob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-screen, .boot-trail, .boot-mark { transition: none; }
}

/* Failure: the beacon rests above a plain explanation and one retry. The retry
   uses the shared .btn.btn-coral style (the one next action). The beacon comes
   last in the markup, so the title stays the first thing a screen reader meets. */
.boot-screen.is-error { gap: 14px; }
.boot-mark-rest {
  order: -1; width: 64px; height: 64px; margin-bottom: 12px;
  filter: drop-shadow(0 4px 0 #24523d);
}
.boot-note { margin: 0; max-width: 34ch; font-size: 16px; line-height: 1.55; color: #4a5c4e; }
.boot-retry { margin-top: 10px; }
.boot-retry:focus-visible { outline: 3px solid #2f6b4f; outline-offset: 3px; }
