/* ════════════════════════════════════════════════════════════════════════
   V5 UNIFIED INTRO OVERLAY
   Replaces both the spinner preloader and the legacy v4-intro overlay.
   The brand intro IS the preloader — assets download behind the photo,
   wash slides up when window.load fires (or after min-display, whichever
   is later). First visit per session = full ritual. Subsequent navigations
   = quick wash only (sessionStorage flag).
   ════════════════════════════════════════════════════════════════════════ */

.v5-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: var(--jxm-abyss);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  visibility: visible;
  opacity: 1;
}
/* Photo is picked at random from the 13-image pool in
   /assets/imgs/intro/ by v5-intro-overlay.js and set on the .v5-intro
   element after HTML parse. The abyss background-color above is the
   fallback shown for the ~10-30ms before the defer'd JS runs. */

/* Subtle vignette to make the logo read on any photo */
.v5-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(34, 31, 50, 0.35) 100%);
  z-index: 1;
  pointer-events: none;
}

.v5-intro--gone {
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

/* ── Tusk wash that slides up over the photo ── */
.v5-intro-wash {
  position: absolute;
  inset: 0;
  background: var(--jxm-tusk);
  transform: translateY(100%);
  z-index: 5;
  will-change: transform;
}
.v5-intro--washing .v5-intro-wash {
  transform: translateY(0);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Quick mode for in-session navigation: skip the dwell, faster wash */
.v5-intro--quick .v5-intro-wash {
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
.v5-intro--quick .v5-intro-logo {
  display: none;
}

/* ── Logo overlay ── */
.v5-intro-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
}
.v5-intro--logo-in .v5-intro-logo {
  opacity: 1;
  transition: opacity 200ms ease-out;
}
.v5-intro--logo-out .v5-intro-logo {
  opacity: 0;
  transition: opacity 160ms ease-out;
}
.v5-intro-logo img,
.v5-intro-logo svg {
  width: clamp(180px, 24vw, 320px);
  height: auto;
  display: block;
  /* Logo SVG ships with abyss fills; invert renders it tusk on the dark photo */
  filter: invert(1) brightness(1.05);
}

/* ── Reduced motion: skip the photo + wash entirely, brief fade-out only ── */
@media (prefers-reduced-motion: reduce) {
  .v5-intro-logo,
  .v5-intro-wash,
  .v5-intro::before {
    display: none;
  }
  .v5-intro {
    background-image: none !important;
    background-color: var(--jxm-tusk);
    transition: opacity 180ms ease, visibility 0s linear 180ms;
  }
}

/* ── Optional: hero reveal animations triggered by body.is-loaded.
   Keep these in sync with the v4 inline rules on index — same hooks. */
body.is-loading {
  overflow: hidden;
}
