/*
 * Écran de lancement du téléphone du hero. La vraie surface Entraînement
 * apparaît progressivement dans la silhouette du cube pendant que son contour
 * s’efface, puis un cercle prend le relais et agrandit doucement l’ouverture.
 */

.trial-phone-launch {
  position: absolute;
  z-index: 5;
  inset: 12px 11px;
  overflow: hidden;
  border-radius: 47px;
  isolation: isolate;
  contain: paint;
  background: #000;
  pointer-events: none;
  transform: translateZ(0);
}

.trial-phone-launch.is-app-ready {
  background: transparent;
  animation: duello-phone-launch-hide 1ms linear 2460ms forwards;
}

.trial-phone-launch-curtain {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.trial-phone-launch-curtain-fill,
.trial-phone-launch-cube-cutout,
.trial-phone-launch-circle-cutout {
  fill: #000;
}

.trial-phone-launch-cube-cutout {
  opacity: 0;
  will-change: opacity;
}

.trial-phone-launch-circle-cutout {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.trial-phone-launch.is-app-ready .trial-phone-launch-cube-cutout {
  animation: duello-phone-cube-window-reveal 560ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards;
}

.trial-phone-launch.is-app-ready .trial-phone-launch-circle-cutout {
  animation: duello-phone-circle-reveal 1900ms cubic-bezier(0.4, 0, 0.2, 1) 430ms forwards;
}

.trial-phone-launch-logo {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  overflow: visible;
  fill: none;
  stroke: #fff;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  animation: duello-phone-cube-spin 650ms linear 1 forwards;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.trial-phone-launch.is-app-ready .trial-phone-launch-logo {
  animation-play-state: paused;
  opacity: 0;
}

@keyframes duello-phone-cube-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes duello-phone-cube-window-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes duello-phone-circle-reveal {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

@keyframes duello-phone-launch-hide {
  from {
    visibility: visible;
  }
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trial-phone-launch-logo {
    animation: none;
  }

  .trial-phone-launch.is-app-ready .trial-phone-launch-logo {
    opacity: 0;
    transition: none;
  }

  .trial-phone-launch.is-app-ready .trial-phone-launch-cube-cutout {
    opacity: 1;
    animation: none;
  }

  .trial-phone-launch.is-app-ready .trial-phone-launch-circle-cutout {
    transform: scale(1);
    animation: none;
  }

  .trial-phone-launch.is-app-ready {
    animation: duello-phone-launch-hide 120ms linear forwards;
  }
}
