/* The boot shell precedes the shared UI resources. Match the dark splash's
   --background, --foreground, --primary and --muted theme roles here. */
:root {
  --farsight-boot_background: #171717;
  --farsight-boot_foreground: #fafafa;
  --farsight-boot_primary: #e5e5e5;
  --farsight-boot_muted: #252525;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--farsight-boot_background);
  color: var(--farsight-boot_foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#farsight-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
  touch-action: none;
}

/* Boot cover stays visible until the engine's own splash takes over. */
#farsight-status {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--farsight-boot_background);
  font-size: 15px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

#farsight-status .logo {
  width: 96px;
  height: 96px;
}

#farsight-status .message {
  max-width: min(80vw, 640px);
  text-align: center;
  white-space: pre-wrap;
}

#farsight-status .progress {
  width: min(240px, 70vw);
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--farsight-boot_muted);
  color: var(--farsight-boot_primary);
  appearance: none;
}

#farsight-status .progress::-webkit-progress-bar {
  background: var(--farsight-boot_muted);
}

#farsight-status .progress::-webkit-progress-value {
  background: var(--farsight-boot_primary);
  transition: width 150ms linear;
}

#farsight-status .progress::-moz-progress-bar {
  background: var(--farsight-boot_primary);
}

#farsight-status .progress:indeterminate {
  background: linear-gradient(90deg, var(--farsight-boot_muted) 30%, var(--farsight-boot_primary) 50%, var(--farsight-boot_muted) 70%);
  background-size: 200% 100%;
  animation: farsight-loading 1.5s linear infinite;
}

#farsight-status .progress:indeterminate::-webkit-progress-bar {
  background: transparent;
}

@keyframes farsight-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  #farsight-status .progress:indeterminate { animation: none; }
  #farsight-status .progress::-webkit-progress-value { transition: none; }
}

#farsight-status.error {
  pointer-events: auto;
  user-select: text;
}

#farsight-status.error .message {
  color: #ff9b9b;
}

#farsight-status.error .progress {
  display: none;
}

#farsight-status[hidden] {
  display: none;
}
