/* Animation d'ouverture du studio 45427, la même dans tous les jeux.
   Logo du site : « 45427 » sur « STUDIO », Raleway Black, encre #151b3d,
   trait de surligneur jaune #ffc83a sous STUDIO. */

@font-face {
  font-family: "Raleway 45427";
  src: url("raleway.woff2") format("woff2");
  font-weight: 100 900;
  font-display: block;
}

#intro45 {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #151b3d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.i45-logo {
  --t: min(21vw, 15vh, 150px);
  display: flex;
  flex-direction: column;
  font: 900 var(--t)/.88 "Raleway 45427", "Raleway", sans-serif;
  font-feature-settings: "lnum" 1;
  letter-spacing: .035em;
  opacity: 0;
}

/* chaque chiffre monte dans sa fente */
.i45-ligne {
  display: flex;
  overflow: hidden;
  padding: .08em .06em;
  margin: -.08em -.06em;
}
.i45-c {
  display: inline-block;
  transform: translateY(125%);
}

.i45-studio {
  position: relative;
  isolation: isolate;
  align-self: flex-start;
  margin-top: .05em;
  font-size: .745em;
  letter-spacing: .075em;
}
.i45-studio span {
  display: block;
  clip-path: inset(-20% 100% -20% 0);
}
.i45-marque {
  position: absolute;
  z-index: -1;
  left: -.14em;
  right: -.06em;
  top: 50%;
  height: 40%;
  background: #ffc83a;
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- déroulé : 0 s chiffres, 0,6 s trait jaune, 0,8 s STUDIO, 2,7 s sortie ---------- */

.i45-go .i45-logo { animation: i45-recul 2.8s cubic-bezier(.2, .7, .25, 1) forwards; }
.i45-go .i45-c { animation: i45-monte .56s cubic-bezier(.2, .95, .3, 1.18) forwards; }
.i45-go .i45-c:nth-child(2) { animation-delay: .07s; }
.i45-go .i45-c:nth-child(3) { animation-delay: .14s; }
.i45-go .i45-c:nth-child(4) { animation-delay: .21s; }
.i45-go .i45-c:nth-child(5) { animation-delay: .28s; }
.i45-go .i45-marque { animation: i45-trait .42s .6s cubic-bezier(.6, 0, .2, 1) forwards; }
.i45-go .i45-studio span { animation: i45-ecrit .4s .78s cubic-bezier(.4, 0, .2, 1) forwards; }

@keyframes i45-recul {
  0% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes i45-monte { to { transform: none; } }
@keyframes i45-trait { to { transform: scaleX(1); } }
@keyframes i45-ecrit { to { clip-path: inset(-20% -10% -20% 0); } }

/* sortie : le logo s'efface en montant, puis le fond blanc laisse voir le jeu */
#intro45.i45-fin { animation: i45-efface .45s .12s ease forwards; }
#intro45.i45-fin .i45-logo { animation: i45-part .35s ease-in forwards; }
#intro45.i45-fin-vite { animation: i45-efface .25s ease forwards; }

@keyframes i45-part {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: translateY(-5%) scale(.98); }
}
@keyframes i45-efface { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .i45-c { transform: none; }
  .i45-marque { transform: none; }
  .i45-studio span { clip-path: none; }
  .i45-go .i45-logo { animation: i45-apparait .5s ease forwards; }
  .i45-go .i45-c, .i45-go .i45-marque, .i45-go .i45-studio span { animation: none; }
  #intro45.i45-fin .i45-logo { animation: none; opacity: 1; }
}
@keyframes i45-apparait { to { opacity: 1; } }
