/* ==========================================================================
   Atlas Intel wave page loader (css/loader.css)
   Companion to js/loader.js. The loader self-mounts #atl-loader and also
   injects a minimal inline style guard, so the rules here refine (fade
   timing, exit states) rather than bootstrap the cover.
   The old odometer preloader markup stays in the HTML; it is retired here.
   ========================================================================== */

/* retire the odometer preloader sitewide */
#preloader { display: none !important; }

/* full-viewport cover, above all fixed chrome (header 9000, cursor 9998,
   old preloader 9999) */
#atl-loader {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: #000;
  overflow: hidden;
  opacity: 1;
  transition: opacity .52s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity;
}
#atl-loader.atl-hidden {
  opacity: 0;
  pointer-events: none;
}

#atl-loader canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* nav-mode percent counter: DOM element blended with the canvas below it,
   difference blending self-inverts it against the white plate and the
   black base */
#atl-loader .atl-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-52%);
  text-align: center;
  color: #fff;
  mix-blend-mode: difference;
  font-family: "Aeonik", "IBMPlexMono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: min(18vw, 220px);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

/* exit sweep: transparent base so the page shows through while the white
   plate rises to cover it; no opacity transition may soften the plate */
#atl-loader.atl-exit {
  background: transparent;
  transition: none;
  opacity: 1;
}
#atl-loader.atl-exit .atl-num { display: none; }

/* reduced-motion exit: quick fade to a black cover instead of the sweep */
#atl-loader.atl-exit-fade {
  background: #000;
  opacity: 0;
  transition: opacity .26s ease;
}
#atl-loader.atl-exit-fade.atl-cover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #atl-loader { transition: opacity .3s ease; }
}
