/* =====================================================
   Loader — minimal % counter only (mosaic scrapped)
===================================================== */

#loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  transition: opacity 0.6s ease, visibility 0.6s;
}

/* Brand wordmark. ANZ in display serif, "Travel Services" sits below
   it in the small uppercase tracking treatment we use elsewhere. */
#loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  text-align: center;
}
#loader-brand .lb-anz {
  display: inline-block;
  font-family: "Dream Avenue", serif;
  font-size: clamp(70px, 11vw, 180px);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 0.9;
  transform: translateY(110%);
  animation: loadBrandIn 1.1s var(--ease-out) 0.05s forwards;
}
#loader-brand .lb-rest {
  display: inline-block;
  font-family: "Basis Grotesque", sans-serif;
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 700;
  opacity: 0;
  animation: loadRestIn 0.9s var(--ease-out) 0.55s forwards;
}
@keyframes loadBrandIn { to { transform: translateY(0); } }
@keyframes loadRestIn  { to { opacity: 1; } }

#loader-count {
  font-family: "Basis Grotesque", sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  font-feature-settings: "tnum";
  font-weight: 400;
}

/* The bar reads its width from the `--pct` custom property, which the
   JS in app.js keeps in lock-step with the counter on every tick. The
   short transition smooths each step so the bar always rides just
   behind the number. */
#loader-bar {
  width: clamp(220px, 28vw, 440px);
  height: 1px;
  background: rgba(244, 237, 224, 0.16);
  position: relative;
  overflow: hidden;
}
#loader-bar::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--pct, 0%);
  background: var(--accent);
  transition: width 0.12s linear;
}
#loader.is-finishing #loader-bar::after { width: 100%; }

#loader.is-finishing {
  opacity: 0;
  visibility: hidden;
}

/* Hide page until loader done (home only) */
body[data-page="home"]:not(.is-ready) #page { opacity: 0; }
