/* ==========================================================================
   CALICHE PARTNERS — first-visit splash sequence
   SELF-CONTAINED AND OPTIONAL.

   ── TO REMOVE COMPLETELY ────────────────────────────────────────────────
   1. In index.html, delete the block between
        <!-- cp-splash : BEGIN -->  and  <!-- cp-splash : END -->
      (that block contains the stylesheet link, the markup and the script).
   2. Delete assets/splash.css and assets/splash.js.
   Nothing else on the site references either file. site.css, site.js and
   the other six pages are untouched by this feature.
   ─────────────────────────────────────────────────────────────────────────

   FAIL-SAFE: the overlay ships with the `hidden` attribute and the page is
   only dimmed by a class that JavaScript adds. If this CSS loads but the
   script does not, the site renders completely normally.

   Every selector below is namespaced `cp-splash` so nothing can collide
   with the site's own classes.
   ========================================================================== */

/* --- the overlay -------------------------------------------------------- */
.cp-splash{
  position:fixed;inset:0;z-index:2000;
  background:#fff;
  perspective:1500px;
  perspective-origin:50% 46%;
}
.cp-splash[hidden]{display:none!important}

/* explicit 60vh square — children need a real containing block */
.cp-splash__stage{
  position:absolute;
  left:50%;top:46%;
  width:60vh;height:60vh;
  margin-left:-30vh;margin-top:-30vh;
  transform-style:preserve-3d;
}

.cp-splash__shadow{
  position:absolute;
  left:50%;bottom:-9vh;
  width:30vh;height:4vh;
  margin-left:-15vh;
  background:radial-gradient(ellipse at 50% 50%,
              rgba(16,28,43,.40) 0%,
              rgba(16,28,43,.22) 40%,
              rgba(16,28,43,0)   72%);
  filter:blur(7px);
  opacity:0;
  will-change:transform,opacity;
}

.cp-splash__scaler{
  position:absolute;inset:0;
  transform:scale(.004);
  transform-origin:50% 50%;
  transform-style:preserve-3d;
  will-change:transform;
}

.cp-splash__spin{
  position:absolute;inset:0;
  display:grid;place-items:center;
  transform-style:preserve-3d;
  will-change:transform;
}

.cp-splash__face{
  height:60vh;width:auto;display:block;
  will-change:transform;
}

/* --- what the sequence does to the page --------------------------------
   Two root classes, both added and removed by splash.js only:
     cp-splash-run   the sequence is live  (locks scroll, arms the fade)
     cp-splash-hide  the page is held back (removed to let it fade up)
   The page itself is never wrapped or restructured.
   ----------------------------------------------------------------------- */
/* NOTE: scrolling is held during the sequence by event listeners in
   splash.js, NOT by overflow:hidden. Hiding overflow removes the page's
   scrollbar, and returning it at the end narrows the viewport by ~15px,
   which shifts every centred element sideways — a visible jolt exactly as
   the page appears. Blocking the scroll events instead changes no layout
   at all, so nothing moves. */

html.cp-splash-run body > :not(.cp-splash){
  transition:opacity 900ms cubic-bezier(.33,.02,.18,1);
}
html.cp-splash-hide body > :not(.cp-splash){opacity:0}

/* the nav mark is held by an inline style from the script, and released the
   moment the animated mark lands on it — this just smooths the swap */
html.cp-splash-run .nav .brand img{transition:opacity 240ms linear}

@media (prefers-reduced-motion:reduce){
  .cp-splash{display:none!important}
  html.cp-splash-hide body > :not(.cp-splash){opacity:1}
}
