/* ==========================================================================
   preloader.css — loading screen (Figma 696:115)

   Full-screen lime field with a stadium outline that fills as the site's
   assets download, the Shift mark inside it, a live percentage below, and the
   studio credit pinned to the bottom. Sizes come straight from the design:
   256x120 pill (rx 59), 2px stroke, 24px gap, 48px figure.
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

/* Held until the assets are in; JS adds .is-done to release it. */
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.preloader-pill {
  position: relative;
  width: 256px;
  height: 120px;
}

.preloader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* The empty outline */
.preloader-track {
  fill: none;
  stroke: var(--lime-label);      /* #769015, per the design */
  stroke-width: 2;
}

/* The stroke that fills over it. No CSS transition here — preloader.js eases
   the value itself on rAF, and a transition on top would double-smooth it
   into a lag. */
.preloader-bar {
  fill: none;
  stroke: var(--black);
  stroke-width: 2;
  stroke-linecap: round;
}

.preloader-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 34px;
}

/* Design: Aeonik Regular 48, tracking -0.96px */
.preloader-pct {
  text-align: center;
  font-size: 48px;
  font-weight: var(--w-regular);
  letter-spacing: -0.96px;
  color: var(--black);
  font-variant-numeric: tabular-nums;   /* stops the width jittering 0->100 */
}

/* ---- Studio credit ---- */
.preloader-credit {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.preloader-credit-by { color: rgba(0, 0, 0, 0.5); }
.preloader-credit-studio {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--black);
  font-weight: var(--w-medium);
}
.preloader-credit-studio img {
  width: 24px;
  height: 24px;
  border-radius: 2000px;
  object-fit: cover;
}

/* The page must not scroll or flash behind the overlay while it is up. */
html.is-preloading,
html.is-preloading body {
  overflow: hidden;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .preloader-pill { width: 200px; height: 94px; }
  .preloader-mark { width: 86px; height: 27px; }
  .preloader-pct { font-size: 36px; letter-spacing: -0.72px; }
  .preloader-credit { bottom: 32px; font-size: 16px; }
  .preloader-credit-studio img { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader { transition: none; }
}
