/* ==========================================================================
   PRESSWALL. — SPLASH / LOADING SCREEN
   Square soft-bounce dot (squish in air / settle back to square)
   ========================================================================== */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  transition: opacity 0.55s var(--ease-cinematic), visibility 0.55s ease;
}

.splash-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.splash-active {
  overflow: hidden;
}

.splash-mark {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.2rem, 0.55vw, 0.4rem);
  transform: translate3d(0, 6px, 0);
  opacity: 0;
  animation: splashMarkIn 0.7s var(--ease-cinematic) 0.1s forwards;
}

.splash-logo-word {
  display: block;
  height: clamp(2.4rem, 7vw, 4.2rem);
  width: auto;
  max-width: min(70vw, 400px);
  object-fit: contain;
  object-position: left bottom;
}

.splash-logo-dot {
  display: block;
  flex-shrink: 0;
  width: clamp(0.42rem, 1.1vw, 0.7rem);
  height: clamp(0.42rem, 1.1vw, 0.7rem);
  margin-bottom: clamp(0.08rem, 0.25vw, 0.18rem);
  background-color: var(--text-main);
  border-radius: 0;
  transform-origin: center bottom;
  will-change: transform;
  animation: splashDotBounce 1.05s cubic-bezier(0.33, 0.01, 0.2, 1) infinite;
}

/* Fin du loading : stop bounce, settle to perfect square */
.splash-logo-dot.is-settled {
  animation: splashDotSettle 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes splashMarkIn {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/*
  Soft square bounce:
  - squash on takeoff / landing (mou)
  - stretch in mid-air
  - back to clean 1×1 square at rest
*/
@keyframes splashDotBounce {
  0% {
    transform: translate3d(0, 0, 0) scale(1, 1);
  }
  12% {
    transform: translate3d(0, 0, 0) scale(1.28, 0.62);
  }
  18% {
    transform: translate3d(0, 0, 0) scale(0.88, 1.18);
  }
  42% {
    transform: translate3d(0, -1.2em, 0) scale(0.78, 1.28);
  }
  55% {
    transform: translate3d(0, -1.22em, 0) scale(0.82, 1.22);
  }
  78% {
    transform: translate3d(0, 0, 0) scale(1.22, 0.68);
  }
  88% {
    transform: translate3d(0, 0, 0) scale(0.92, 1.1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1, 1);
  }
}

@keyframes splashDotSettle {
  0% {
    transform: translate3d(0, 0, 0) scale(1.18, 0.72);
  }
  55% {
    transform: translate3d(0, 0, 0) scale(0.94, 1.08);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-mark {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .splash-logo-dot {
    animation: none;
    transform: none;
  }
}
