/* ============================================================
   IRON CAPITAL MARKETS — Premium Preloader
   ============================================================
   Strategy:
   • Full-screen dark overlay (#0a0a0a) with the logo centred.
   • Two concentric rings counter-rotate around the logo,
     one in brand-red (#C41E24) and one in a translucent white.
   • A thin progress bar sweeps across the very bottom.
   • On page-load the overlay slides up and out of view.
   ============================================================ */

/* ── Core overlay ────────────────────────────────────────── */
#page-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  overflow: hidden;
  /* exit animation – triggered by JS adding class .loaded */
  transition: transform 0.85s cubic-bezier(0.77, 0, 0.18, 1),
              opacity  0.85s cubic-bezier(0.77, 0, 0.18, 1);
}

#page-preloader.loaded {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* ── Inner wrapper ───────────────────────────────────────── */
.page-load-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.preloader-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

/* ── Logo ────────────────────────────────────────────────── */
.preloader-logo {
  width: 140px;
  height: auto;
  opacity: 0;
  transform: translateY(12px);
  animation: preloader-logo-in 0.9s ease forwards 0.2s;
  position: relative;
  z-index: 2;
}

@keyframes preloader-logo-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Ring spinner ────────────────────────────────────────── */
.preloader-rings {
  position: absolute;           /* sits behind/around the logo */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 190px;
}

/* Outer ring – brand red, clockwise */
.preloader-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #C41E24;
  border-right-color: rgba(196,30,36,0.35);
  animation: spin-cw 1.6s linear infinite;
}

/* Inner ring – white, counter-clockwise */
.preloader-ring-inner {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: rgba(255,255,255,0.55);
  border-left-color: rgba(255,255,255,0.15);
  animation: spin-ccw 2.2s linear infinite;
}

/* Dot on the outer ring tip */
.preloader-ring-outer::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C41E24;
  box-shadow: 0 0 8px 2px rgba(196,30,36,0.8);
}

@keyframes spin-cw {
  to { transform: rotate(360deg); }
}
@keyframes spin-ccw {
  to { transform: rotate(-360deg); }
}

/* ── Brand tagline text ──────────────────────────────────── */
.preloader-tagline {
  font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  opacity: 0;
  animation: preloader-logo-in 0.9s ease forwards 0.6s;
}

/* ── Bottom progress bar ─────────────────────────────────── */
.preloader-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #C41E24, #ff6b6b);
  animation: preloader-bar 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.1s;
  box-shadow: 0 0 10px rgba(196,30,36,0.6);
}

@keyframes preloader-bar {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}

/* ── Light-mode / reduced-motion overrides ───────────────── */
@media (prefers-color-scheme: light) {
  #page-preloader {
    background: #ffffff;
  }
  .preloader-ring-outer {
    border-top-color: #C41E24;
    border-right-color: rgba(196,30,36,0.25);
  }
  .preloader-ring-inner {
    border-top-color: rgba(0,0,0,0.3);
    border-left-color: rgba(0,0,0,0.1);
  }
  .preloader-tagline {
    color: rgba(0,0,0,0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-ring-outer,
  .preloader-ring-inner {
    animation: none;
  }
  .preloader-progress {
    animation: none;
    width: 100%;
  }
}
