/* ---------------------------------------------------------------------
   Page loader -- a full-screen splash shown from first paint (plain HTML/
   CSS, no JS needed to become visible, so there's no flash-of-unstyled
   content) until `window.load` fires, then faded out and removed by the
   inline script right after its markup in index.html.

   Deliberately not tied to the hero's own frame-sequence preloading (the
   `.hero-loader` bar CoffeeHero/ProcessSection show inside their own
   sticky viewport) -- those frames load on demand well after this point
   and would keep visitors staring at a splash far longer than necessary.
   This only waits for the page's own initial-paint assets (logo, hero
   background/product images, fonts, stylesheets).
--------------------------------------------------------------------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, var(--coffee-black-soft) 0%, var(--coffee-black) 70%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-mark {
  position: relative;
  width: 6rem;
  height: 6rem;
  display: grid;
  place-items: center;
}

.page-loader-logo {
  width: 3.6rem;
  height: auto;
  animation: page-loader-pulse 1.6s ease-in-out infinite;
}

.page-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(200, 168, 118, 0.18);
  border-top-color: var(--coffee-tan);
  animation: page-loader-spin 1s linear infinite;
}

@keyframes page-loader-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader-logo,
  .page-loader-ring {
    animation: none;
  }

  .page-loader {
    transition: none;
  }
}
