/*
 * Loading screen before the app mounts (public/boot-screen.js, 30/10/2026).
 * A plain stylesheet from this origin (the CSP allows style-src 'self'),
 * loaded in the <head> so the screen is painted before any server copy.
 * Hidden unless the script set html.tb-on: robots and visitors without
 * JavaScript keep reading the server copy. Two arts, chosen by the script:
 * the official Turneli Delivery courier (public/brand/delivery-courier.webp,
 * the only courier drawing) "on its way" on the Delivery pages and menus,
 * the Turneli mark breathing on the panel, careers and the rest. The images
 * are CSS backgrounds of the visible art only, so a page downloads just
 * one. Only transform and opacity move; "reduce motion" keeps it still.
 */
#turneli-boot {
  display: none;
}
html.tb-on #turneli-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 16px;
  background: #f6f8f7;
  color: #194b3e;
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: opacity 0.26s ease;
}
html.tb-on #turneli-boot.tb-out {
  opacity: 0;
  pointer-events: none;
}
/* The page under the screen does not scroll while it is up. */
html.tb-on:has(#turneli-boot:not(.tb-out)) {
  overflow: hidden;
}
.tb-art {
  position: relative;
  display: grid;
  place-items: center;
}
.tb-mark,
.tb-courier {
  display: none;
}
.tb-word {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.tb-word .tb-d {
  display: none;
  color: #c44920;
}
.tb-bar {
  position: relative;
  width: 132px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #194b3e1f;
}
.tb-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: #2b6d56;
  animation: tb-bar 1.1s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
@keyframes tb-bar {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(250%);
  }
}

/* Turneli: the mark in its tile, breathing. */
html[data-boot="turneli"] .tb-mark {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: #e7f1ec url("/brand/turneli-mark.svg") center / 46px no-repeat;
  box-shadow: 0 10px 30px #194b3e1f;
  animation: tb-breathe 1.6s ease-in-out infinite;
}
@keyframes tb-breathe {
  50% {
    transform: scale(1.06);
  }
}
html[data-theme="dark"][data-boot="turneli"] #turneli-boot {
  background: #121614;
  color: #e2ece7;
}
html[data-theme="dark"][data-boot="turneli"] .tb-bar {
  background: #ffffff1f;
}
html[data-theme="dark"][data-boot="turneli"] .tb-bar::after {
  background: #6fbf9c;
}

/* Delivery: the courier rides in and keeps riding, speed lines behind. */
html[data-boot="delivery"] #turneli-boot {
  background: #fff8f4;
}
html[data-boot="delivery"] .tb-word .tb-d {
  display: inline;
}
html[data-boot="delivery"] .tb-courier {
  display: block;
  position: relative;
  width: min(56vw, 220px);
  aspect-ratio: 640 / 579;
  animation: tb-arrive 0.62s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
html[data-boot="delivery"] .tb-courier::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/brand/delivery-courier.webp") center / contain no-repeat;
  animation: tb-ride 0.32s ease-in-out infinite alternate;
}
.tb-lines {
  position: absolute;
  left: -16%;
  top: 50%;
  width: 16%;
  height: 34%;
  background:
    linear-gradient(#c44920, #c44920) 30% 0 / 70% 5px no-repeat,
    linear-gradient(#c44920, #c44920) 0 50% / 100% 5px no-repeat,
    linear-gradient(#c44920, #c44920) 55% 100% / 45% 5px no-repeat;
  opacity: 0.45;
  animation: tb-lines 0.6s ease-in-out infinite;
}
html[data-boot="delivery"] .tb-bar::after {
  background: #c44920;
}
@keyframes tb-arrive {
  from {
    opacity: 0;
    transform: translateX(-36vw);
  }
}
@keyframes tb-ride {
  to {
    transform: translateY(-1.5%);
  }
}
@keyframes tb-lines {
  50% {
    opacity: 0.15;
    transform: translateX(-18%);
  }
}

.tb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html.tb-on #turneli-boot,
  html.tb-on #turneli-boot *,
  html.tb-on #turneli-boot *::before,
  html.tb-on #turneli-boot *::after {
    animation: none !important;
    transition: none !important;
  }
}
