/* Aucune règle de thème : les jetons de `style.css` couvrent clair et sombre.
   Séquence unique : roule 0→26 % · barres 26→50 % · cage 46→54 % · frappe 51→72 %
   · chute 72→83 % · rebond 83→93 % · mot 86→100 %. */

.pl-splash {
  position: fixed;
  inset: 0;
  /* Au-dessus des overlays applicatifs (10000). */
  z-index: 10001;
  display: grid;
  place-items: center;
  background: var(--bg);
  opacity: 1;
  transition: opacity 320ms ease;

  /* Effacement sans JavaScript. Hors de `.pl-loader`, dont le module attend les animations. */
  animation: pl-failsafe 1ms linear 15s forwards;
}

.pl-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 45%, var(--halo), transparent 70%);
  pointer-events: none;
}

.pl-splash--done {
  opacity: 0;
  pointer-events: none;
}

@keyframes pl-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.pl-defs {
  position: absolute;
}

.pl-stop-a {
  stop-color: var(--lime);
}

.pl-stop-b {
  stop-color: var(--emerald);
}

.pl-loader {
  --pl-dur: 3.31s;
  font-size: clamp(2rem, 7vw, 3.4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6em;
  position: relative;
}

.pl-word {
  position: relative;
  color: var(--ink);
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1;
  white-space: nowrap;
}

/* Emplacement du « o », calé sur le glyphe de --disp (Space Grotesk 700) : à remesurer s'il change. */
.pl-slot {
  position: relative;
  display: inline-block;
  width: .52em;
  height: .52em;
  vertical-align: -.01em;
  margin: 0 .02em;
}

/* Ballon noir utilisé en masque sur le dégradé ; `--pl-ball-src` vient du partial. */
.pl-ball {
  position: absolute;
  inset: 0;
  background: var(--grad);
  -webkit-mask: var(--pl-ball-src) center / contain no-repeat;
  mask: var(--pl-ball-src) center / contain no-repeat;
  animation: pl-ball var(--pl-dur) linear 1 both;
  will-change: transform;
}

/* 1 unité de `viewBox` = 0.1em, origine sur l'emplacement du « o ».
   `max-width: none` annule le `svg { max-width: 100% }` global, qui écraserait la scène. */
.pl-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9em;
  max-width: none;
  height: 3.8em;
  margin-left: -4.5em;
  margin-top: -2.8em;
  overflow: visible;
  pointer-events: none;
}

.pl-bar {
  fill: url(#pl-g-bars);
  transform-box: fill-box;
  transform-origin: bottom;
}

.pl-bar1 { animation: pl-bar1 var(--pl-dur) cubic-bezier(.2, .9, .3, 1.4) 1 both; }
.pl-bar2 { animation: pl-bar2 var(--pl-dur) cubic-bezier(.2, .9, .3, 1.4) 1 both; }
.pl-bar3 { animation: pl-bar3 var(--pl-dur) cubic-bezier(.2, .9, .3, 1.4) 1 both; }

.pl-trail {
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 2 3.4;
  animation: pl-trail var(--pl-dur) linear 1 both;
}

.pl-goal {
  transform-box: fill-box;
  transform-origin: 88% 6%;
}

.pl-goal-a {
  animation: pl-goal var(--pl-dur) cubic-bezier(.2, .8, .3, 1) 1 both;
}

.pl-frame {
  fill: url(#pl-g-goal);
}

.pl-pron,
.pl-lulu {
  display: inline-block;
}

.pl-pron {
  animation: pl-pron var(--pl-dur) cubic-bezier(.2, .8, .25, 1) 1 both;
}

.pl-lulu {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pl-lulu var(--pl-dur) cubic-bezier(.2, .8, .25, 1) 1 both;
}

@keyframes pl-ball {
  0% {
    transform: translate(-4em, 0) rotate(0deg);
    opacity: 0;
  }
  4.17% {
    transform: translate(-3.75em, 0) rotate(56deg);
    opacity: 1;
  }
  26.39% {
    transform: translate(-2.4em, 0) rotate(300deg);
    opacity: 1;
    animation-timing-function: cubic-bezier(.3, 0, .6, 1);
  }
  51.39% {
    transform: translate(-2.4em, 0) rotate(300deg);
    opacity: 1;
    animation-timing-function: cubic-bezier(.3, .1, .5, 1);
  }
  /* Points échantillonnés sur la courbe B(t), pas sur son point de contrôle. */
  56.6% {
    transform: translate(-1.875em, -.633em) rotate(355deg);
    opacity: 1;
  }
  61.81% {
    transform: translate(-1.3em, -1.13em) rotate(410deg);
    opacity: 1;
  }
  67.01% {
    transform: translate(-.675em, -1.492em) rotate(465deg);
    opacity: 1;
  }
  72.22% {
    transform: translate(0, -1.72em) rotate(520deg);
    opacity: 1;
    animation-timing-function: cubic-bezier(.55, 0, .9, .6);
  }
  83.33% {
    transform: translate(0, 0) rotate(566deg);
    opacity: 1;
    animation-timing-function: cubic-bezier(.3, 0, .4, 1);
  }
  88.19% {
    transform: translate(0, -.14em) rotate(576deg);
    opacity: 1;
  }
  93.06% {
    transform: translate(0, 0) rotate(580deg);
    opacity: 1;
  }
  100% {
    transform: translate(0, 0) rotate(580deg);
    opacity: 1;
  }
}

@keyframes pl-bar1 {
  0%, 26.39% { transform: scaleY(0); }
  34.72% { transform: scaleY(1); }
  79.17% { transform: scaleY(1); }
  86.11% { transform: scaleY(0); }
  100% { transform: scaleY(0); }
}

@keyframes pl-bar2 {
  0%, 34.72% { transform: scaleY(0); }
  42.36% { transform: scaleY(1); }
  80.56% { transform: scaleY(1); }
  87.5% { transform: scaleY(0); }
  100% { transform: scaleY(0); }
}

@keyframes pl-bar3 {
  0%, 42.36% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  81.94% { transform: scaleY(1); }
  88.89% { transform: scaleY(0); }
  100% { transform: scaleY(0); }
}

@keyframes pl-trail {
  0%, 51.39% { stroke-dashoffset: 32; opacity: 0; }
  54.17% { stroke-dashoffset: 26; opacity: .9; }
  72.22% { stroke-dashoffset: 0; opacity: .9; }
  79.17% { stroke-dashoffset: 0; opacity: .9; }
  87.5% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes pl-goal {
  0%, 45.83% { opacity: 0; transform: scale(.86); }
  54.17% { opacity: 1; transform: scale(1); }
  79.17% { opacity: 1; transform: scale(1); }
  88.89% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes pl-pron {
  0%, 86.11% {
    clip-path: inset(0 0 0 100%);
    transform: translateX(.28em);
  }
  100% {
    clip-path: inset(0 -.1em 0 0);
    transform: translateX(0);
  }
}

@keyframes pl-lulu {
  0%, 86.11% {
    clip-path: inset(0 100% 0 0);
    transform: translateX(-.28em);
  }
  100% {
    clip-path: inset(0 -.1em 0 0);
    transform: translateX(0);
  }
}

/* Logo posé : le module ne trouve aucune animation à attendre et sort dès que la page est prête. */
@media (prefers-reduced-motion: reduce) {
  .pl-ball,
  .pl-bar,
  .pl-trail,
  .pl-goal-a,
  .pl-pron,
  .pl-lulu {
    animation: none;
  }

  .pl-bar,
  .pl-trail,
  .pl-goal-a {
    opacity: 0;
  }

  .pl-pron,
  .pl-lulu {
    clip-path: none;
  }
}
