/*
 * Boot splash, deliberately kept out of styles.css.
 *
 * Vite folds styles.css into the JS bundle and injects it at runtime, which is
 * far too late for a splash — the set would show an unstyled logo on white for
 * as long as the bundle takes to arrive. Living in public/ keeps this a plain
 * stylesheet the browser applies before anything else runs.
 *
 * Tizen 5.0 is Chromium 63: no `inset`, no `gap`.
 */
html,
body {
  background-color: #111111;
}

#tibo-splash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  background-color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 260ms ease-out;
}

#tibo-splash.is-hidden {
  opacity: 0;
}

.tibo-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*
 * Height is stated, not left to `auto`. The wordmark is 508×199, but until it
 * is decoded the browser does not know that, so an auto height starts at zero
 * and the centred column jumps the moment the logo appears. 420 × 199 / 508 = 165.
 */
.tibo-splash-logo {
  display: block;
  width: 420px;
  height: 165px;
  object-fit: contain;
}

.tibo-splash-bar {
  position: relative;
  width: 320px;
  height: 4px;
  margin-top: 64px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

/*
 * Indeterminate — boot progress is not measurable, so do not fake a percentage.
 *
 * Animate transform, never `left`. Boot is exactly when the main thread is
 * busiest (parsing the bundle, starting WebGL, decoding two font files), and a
 * `left` animation needs layout on every frame, so it visibly stutters. A
 * transform stays on the compositor and keeps moving through all of it.
 */
.tibo-splash-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  border-radius: 2px;
  background-color: #99cc00;
  will-change: transform;
  animation: tibo-splash-slide 1000ms ease-in-out infinite;
}

@keyframes tibo-splash-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

/*
 * Fixed line box, and no reliance on a font that is still loading.
 *
 * The renderer registers Roboto with `document.fonts` once it has it, so asking
 * for Roboto here means this line silently reflows from the fallback the moment
 * that lands — mid-splash, now that the faces are preloaded. In a column that is
 * centred vertically, a couple of pixels of line height moves everything above
 * it, which read as the logo twitching out of place.
 */
#tibo-splash-text {
  margin: 28px 0 0;
  height: 30px;
  line-height: 30px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.55);
}
