/* =========================================================
   fatshot — landing intro
   Aim the sight at the figure, click, the figure morphs into the thin version, the logo fills the
   screen, the sight in the "o" becomes a hole, and the camera dives through it
   into the site.  Everything lives inside #intro and is removed when it finishes.
   ========================================================= */

:root {
  --intro-bg: #E35525;
  --intro-accent: #F5BE0B;
  --intro-fig-bottom: 19.5%;
  --intro-fig-height: 66%;
}

/* no page scrolling underneath while the intro is up (JS also sets this, for browsers without :has) */
html:has(#intro) { overflow: hidden; }

.intro {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--intro-bg);
  overflow: hidden; cursor: none;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.intro.is-leaving { opacity: 0; transition: opacity .4s ease; pointer-events: none; }
/* during the zoom the canvas takes over and the layer must be see-through */
.intro.is-zooming { background: transparent; }
.intro.is-zooming .intro__scene { visibility: hidden; }

/* the site's global img { max-width: 100% } would squash the absolutely positioned figures */
.intro img { max-width: none; }

/* scene fades in once the images are decoded, so nothing pops in */
.intro__scene { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.intro.is-ready .intro__scene { opacity: 1; }

/* ---------- figures ---------- */
.intro__figs {
  position: absolute; left: 50%; bottom: var(--intro-fig-bottom); height: var(--intro-fig-height);
  transform: translateX(-50%); pointer-events: none; z-index: 2;
  opacity: 1; transition: opacity .6s ease;
}
.ifig { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); -webkit-user-drag: none; }
.ifig--fat  { z-index: 2; transition: opacity .2s ease; }
.ifig--thin { z-index: 3; clip-path: inset(0 0 100% 0); transition: clip-path .35s ease; }
/* The morph: a canvas (added by js/intro.js) redraws the outline frame by frame, between the two pictures */
.ifig-morph { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); z-index: 3; opacity: 0; pointer-events: none; }
.intro.is-morphing .ifig--fat { opacity: 0; transition: none; }
.intro.is-morphing .ifig-morph { opacity: 1; }
.intro.is-morphed .ifig--thin { clip-path: inset(0 0 0% 0); transition: none; }
.intro.is-morphed .ifig-morph { opacity: 0; }
/* without the morph (if it could not be built) the old wipe is used */
.intro:not(.has-morph).is-transforming .ifig--fat, .intro:not(.has-morph).is-transformed .ifig--fat { opacity: 0; }
.intro:not(.has-morph).is-transforming .ifig--thin, .intro:not(.has-morph).is-transformed .ifig--thin { clip-path: inset(0 0 0% 0); transition: clip-path .85s cubic-bezier(.45,0,.2,1); }
.intro.is-revealed .intro__figs { opacity: 0; }

/* the flash at the moment of the "shot" */
.intro__flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.intro.is-transforming .intro__flash { animation: introFlash .35s ease-out forwards; }
@keyframes introFlash { 0% { opacity: 0; } 12% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- logo ---------- */
.intro__logo { position: absolute; left: 50%; top: 50%; width: min(92%, 1500px); transform: translate(-50%, -50%); z-index: 3; opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.intro__logo img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.intro.is-revealed .intro__logo { opacity: 1; }

/* ---------- the clickable area over the figure ---------- */
.intro__hotspot { position: absolute; left: 50%; bottom: var(--intro-fig-bottom); height: var(--intro-fig-height); width: max(22%, 150px); transform: translateX(-50%); z-index: 5; }
.intro.is-transforming .intro__hotspot, .intro.is-transformed .intro__hotspot { pointer-events: none; }

/* ---------- the sight (it IS the cursor) ---------- */
.intro__reticle { position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none; z-index: 10; opacity: 0; transition: opacity .25s ease; will-change: transform; }
.intro.is-pointer .intro__reticle { opacity: 1; }
.intro.is-over-ui .intro__reticle { opacity: 0; }
.intro.is-transforming .intro__reticle { opacity: 0; }
.intro.is-transformed .intro__reticle { opacity: 1; }                       /* reappears, then glides into the logo's "o" */
.intro.is-docking .intro__reticle { transition: transform 1.3s cubic-bezier(.4,0,.2,1), opacity .25s ease; }
.intro.is-revealed .intro__reticle { opacity: 0; transition: opacity .5s ease; }
.intro__reticle-in { position: absolute; top: 0; left: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; transition: width .18s ease, height .18s ease, margin .18s ease; }
.intro__reticle-in img { display: block; width: 100%; height: 100%; }
.intro.is-armed .intro__reticle-in { width: 150px; height: 150px; margin: -75px 0 0 -75px; animation: introPulse .7s ease-in-out infinite; }
.intro.is-docking .intro__reticle-in { transition: width 1.3s cubic-bezier(.4,0,.2,1), height 1.3s cubic-bezier(.4,0,.2,1), margin 1.3s cubic-bezier(.4,0,.2,1); animation: none; }
@keyframes introPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- magnifier lens inside the sight ---------- */
.intro__mag { position: absolute; top: 0; left: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; overflow: hidden; pointer-events: none; z-index: 9; opacity: 0; background: var(--intro-bg); box-shadow: 0 0 0 2px rgba(255,255,255,.5); transition: opacity .25s ease, width .18s ease, height .18s ease, margin .18s ease; }
.intro.is-pointer .intro__mag { opacity: 1; }
.intro.is-over-ui .intro__mag { opacity: 0; }
.intro.is-armed .intro__mag { width: 150px; height: 150px; margin: -75px 0 0 -75px; }
.intro.is-transforming .intro__mag, .intro.is-transformed .intro__mag { opacity: 0; }
.intro__magstage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }

/* ---------- hint + skip ---------- */
.intro__hint { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); z-index: 4; margin: 0; white-space: nowrap; pointer-events: none;
  font-family: var(--display, "Anton", "Impact", sans-serif); text-transform: uppercase; letter-spacing: .08em; font-size: clamp(15px, 1.6vw, 22px); color: var(--intro-accent);
  transition: opacity .3s ease; animation: introHint 1.8s ease-in-out infinite; }
@keyframes introHint { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.intro.is-started .intro__hint { opacity: 0; animation: none; }

.intro__skip { position: absolute; right: clamp(14px, 2vw, 28px); top: clamp(14px, 2vw, 28px); z-index: 20; cursor: pointer;
  font-family: var(--display, "Anton", "Impact", sans-serif); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; line-height: 1;
  color: #fff; background: rgba(22,19,46,.35); border: 2px solid rgba(255,255,255,.85); padding: .7em 1em .6em; transition: background .15s ease; }
.intro__skip:hover, .intro__skip:focus-visible { background: #16132E; }

/* ---------- the dive: a canvas draws the logo, the hole and the zoom ---------- */
.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
.intro.is-zooming .intro__canvas { display: block; }

@media (max-width: 640px) {
  .intro__hotspot { width: 48%; }
}
