/* ---------- Logo loader (loader/loader.js) – the 3D site's intro logo, as a page loader ---------- */
/* black screen over everything while the page loads; then it slides up and the website is there */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #0b0b0b;
}

/* the two logo pictures (1248 × 324 each): the icon, and the line + name */
.loader__mark { position: relative; width: min(483px, 80vw); aspect-ratio: 1248 / 324; }
.loader__move,
.loader__icon,
.loader__name { position: absolute; top: 0; height: 100%; max-width: none; will-change: transform; }
.loader__move { left: 0; width: 100%; }
.loader__icon { left: 0; width: 100%; transform-origin: 11.18% 48.15%; } /* the icon's centre */
/* the line + name are clipped at the icon's right edge, so they seem to slide out from behind it */
.loader__clip { position: absolute; top: 0; left: 21.39%; width: 78.61%; height: 100%; overflow: hidden; }
.loader__name { left: -27.22%; width: 127.22%; }

/* transform + opacity only: smooth on the GPU while the page loads */
.loader__icon { animation: loaderIcon 0.75s 0.15s var(--ease) both; }
.loader__move { animation: loaderMove 0.6s 1s var(--ease) both; }
.loader__name { animation: loaderSlide 0.75s 1.15s var(--ease) both; }

/* 1: the icon zooms forward from the centre – from a dot to slightly bigger than its size, then settles */
@keyframes loaderIcon {
  0% { opacity: 0; transform: scale(0.15); }
  70% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: none; }
}
/* 2: it moves aside (it starts where it would be centred on its own) */
@keyframes loaderMove { from { transform: translateX(38.7%); } to { transform: none; } }
/* 3: the line + name slide out from behind it */
@keyframes loaderSlide { from { transform: translateX(-79.33%); } to { transform: none; } }

/* the end: the logo lifts away a little ahead of the black screen, which slides up and off */
.loader.is-out {
  transform: translateY(-100%);
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}

.loader.is-out .loader__mark {
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

/* under the loader the page stays still, and the header and hero wait with their own entrance until they are visible */
.page-loading,
.page-loading body { overflow: hidden; }
.page-loading .header,
.page-loading .hero,
.page-loading .hero * { animation-play-state: paused !important; }

/* the loader plays even when the computer asks for less motion (style.css switches every other animation off
   then) – the owner wants it on every load */
@media (prefers-reduced-motion: reduce) {
  .loader .loader__icon { animation: loaderIcon 0.75s 0.15s var(--ease) both !important; }
  .loader .loader__move { animation: loaderMove 0.6s 1s var(--ease) both !important; }
  .loader .loader__name { animation: loaderSlide 0.75s 1.15s var(--ease) both !important; }
  .loader.is-out { transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1) !important; }
  .loader.is-out .loader__mark { transition: opacity 0.4s ease, transform 0.6s var(--ease) !important; }
}
