/* Loading screen — adapted from the 2026-11-03 alfari-inspired preview.
   Hidden unless JS is running (no-JS visitors never see it: the .js class
   is only added by the inline script in <head>). The loader div sits right
   after <body> in index.html and this file is linked last in <head> so it
   applies before first paint. */
.loader {
  display: none;
}
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .5s ease, visibility 0s linear .5s;
  /* Safety net: if loader.js ever fails to load (a transient 503 was seen
     on another script in a PageSpeed run), the overlay still fades out on
     its own after 3s instead of trapping the visitor. */
  animation: loader-failsafe .5s ease 3s forwards;
}
@keyframes loader-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.js .loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader strong { font-size: 64px; }
.loader strong em { font-style: normal; color: var(--secondary); font-size: 36px; }
.loader .bar {
  width: 220px;
  height: 4px;
  background: oklch(1 0 0 / .12);
  border-radius: 99px;
  overflow: hidden;
}
.loader .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  transition: width .13s linear;
}
.loader p { color: var(--muted); font-size: 14px; margin: 0; }

/* Reduced motion: no loading screen at all — the hero shows immediately. */
@media (prefers-reduced-motion: reduce) {
  .js .loader { display: none; }
}
