/* ==========================================================================
   Preloader (components/preloader.php, driven by usap/common.js)
   ========================================================================== */

/* no scrolling underneath while it's up; lifts by itself once the overlay is removed */
body:has(.preloader_area) {
  overflow: hidden;
}

.preloader_area {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #FFFFFF;
  will-change: clip-path;
}

/* the mask the wordmark lifts out of on the way out */
.preloader_logo_area {
  overflow: hidden;
  padding: 4px 0;
}

.preloader_logo_inner {
  position: relative;
  width: 240px;
}

.preloader_logo_inner img {
  display: block;
  width: 100%;
  height: auto;
}

/* the dim copy underneath, which the white one fills in over */
.preloader_logo_inner > img {
  opacity: 0.16;
}

.preloader_logo_fill {
  position: absolute;
  inset: 0;
  -webkit-clip-path: inset(0% 100% 0% 0%);
  clip-path: inset(0% 100% 0% 0%);
}

.preloader_meta_area {
  position: absolute;
  right: 40px;
  bottom: 36px;
  left: 40px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-family: "New Grotesk Mono", monospace;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* the counter: mono, so its width never changes while it counts */
.preloader_meta_area span:first-child {
  font-size: 14px;
  color: #FFFFFF;
}

.preloader_line_area {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.preloader_line_area span {
  display: block;
  width: 100%;
  height: 100%;
  background: #AD7300;
  transform: scaleX(0);
  transform-origin: left center;
}

/* a later page of the same visit: the mark is already whole and only the lift plays */
.preloader_area.is_quick .preloader_logo_fill {
  -webkit-clip-path: inset(0% 0% 0% 0%);
  clip-path: inset(0% 0% 0% 0%);
}

.preloader_area.is_quick .preloader_meta_area,
.preloader_area.is_quick .preloader_line_area {
  display: none;
}

@media (max-width: 575px) {
  .preloader_logo_inner {
    width: 170px;
  }

  .preloader_meta_area {
    right: 20px;
    bottom: 24px;
    left: 20px;
  }
}
