/* ==========================================================================
   Brand Neue intro preloader (sun rises, rooster grows, wordmark rises)
   Markup + script: includes/preloader.php (pulled in from includes/nav.php)
   Only shows when JS has added .bn-preloading to <html>, so the site is never
   hidden behind it with JavaScript turned off.
   ========================================================================== */

.bn-preloader,
.bn-preloader-trail {
  display: none;
}

/* Orange layer sitting just under the preloader; it lifts 0.09s after the navy curtain */
html.bn-preloading .bn-preloader-trail {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: block;
  background: #ef4b23;
  will-change: transform;
}

html.bn-preloading,
html.bn-preloading body {
  overflow: hidden;
}
/* Keep the scrollbar's space while it's hidden, so the page doesn't get narrower when the
   preloader finishes. That width change made the page title re-wrap mid-reveal. */
html.bn-preloading body {
  scrollbar-gutter: stable;
}

html.bn-preloading .bn-preloader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background: #001023;
  will-change: transform;
}

/* Page-change shade: when an internal link is clicked an orange layer wipes in from the
   bottom with the navy layer just behind it (same timing as the slideout menu), then the next page
   opens on its (identical navy) preloader and the intro carries on from there. */
.bn-shade {
  position: fixed;
  inset: 0;
  z-index: 100001;
  overflow: hidden;
  pointer-events: none;
}

.bn-shade__layer {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  will-change: transform;
}

.bn-shade__layer--orange { background: #ef4b23; }
.bn-shade__layer--navy   { background: #001023; display: grid; place-items: center; }

.bn-shade.is-down {
  pointer-events: auto; /* swallow extra clicks while we're leaving */
}

.bn-preloader__stage {
  width: min(40vw, 230px);
}

/* Phones: 40vw gets too small (180px at 450px), so use more of the width there. */
@media (max-width: 450px) {
  .bn-preloader__stage { width: min(56vw, 230px); }
}

.bn-preloader__stage svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
