/*
 * The screen shown while the simulator starts, before any script runs. It
 * matches <teskooano-loading-screen> (src/core/components/loading-screen):
 * a full-bleed screenshot, the name of what is happening and a sweeping bar.
 * index.html and the site's SimulatorShell.astro both link it and pick a
 * random screenshot for it. Once the app is up, the loading screen takes over:
 * #loading stays on top until that screen has its own screenshot up, then
 * fades away, so start-up and the first system read as one load.
 *
 * The text's font comes with this file, under its own name: the design
 * system's copy arrives with the app, too late for the first paint. The block
 * keeps the text hidden until it's here, so it never changes shape. Changing
 * the font means copying it to public/fonts (skill teskooano-fonts).
 */
@font-face {
  font-family: "Teskooano Startup";
  src: url("fonts/TeskooanoDisplay-Regular.woff2") format("woff2");
  font-display: block;
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  background: #12121e;
  color: #e8e8f0;
  font-family: "Teskooano Startup", Inter, system-ui, sans-serif;
}
#loading .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  animation:
    startup-fade 1.4s ease forwards,
    startup-drift 9s ease-out forwards;
  opacity: 0;
}
#loading .shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgb(0 0 0 / 0.85) 0%,
      rgb(0 0 0 / 0.35) 28%,
      transparent 55%
    ),
    linear-gradient(to bottom, rgb(0 0 0 / 0.45) 0%, transparent 18%);
}
#loading .caption {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  left: 16px;
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8a8b8;
}
#loading .hud {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 32px calc(32px + env(safe-area-inset-bottom, 0px));
}
#loading .title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a8a8b8;
}
#loading .current {
  margin: 4px 0 12px;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#loading .bar {
  height: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  overflow: hidden;
}
#loading .fill {
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: #6a8cff;
  box-shadow: 0 0 8px #6a8cff;
  animation: startup-sweep 1.4s ease-in-out infinite;
}
/* Written by TeskooanoApp when start-up fails */
#loading .error {
  max-width: 60rem;
  margin: 0 0 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #ef5350;
  overflow-wrap: anywhere;
}
#loading .hint {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: #a8a8b8;
}

@media (max-width: 600px) {
  #loading .hud {
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }
}
@keyframes startup-fade {
  to {
    opacity: 1;
  }
}
@keyframes startup-drift {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.1);
  }
}
@keyframes startup-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(400%);
  }
}
@media (prefers-reduced-motion: reduce) {
  #loading .slide {
    animation: startup-fade 0s forwards;
    transform: none;
  }
  #loading .fill {
    animation: none;
  }
}
