/* Le PNG reste intact : inclinaison de sa surface et reflet décoratif séparé. */
:root {
  color-scheme: dark;
  background: #020307;
  color: #b8bfcd;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.waiting-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 3rem 1.5rem;
  padding-top: max(3rem, env(safe-area-inset-top));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #050914 0%, #020307 68%);
}

.identity {
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.logo-stage {
  position: relative;
  isolation: isolate;
  perspective: clamp(650px, 130vw, 1200px);
}

.logo-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28% -12%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 35% 50% at 35% 50%, rgba(41, 132, 177, 0.13), transparent 100%),
    radial-gradient(ellipse 30% 50% at 70% 50%, rgba(120, 85, 173, 0.12), transparent 100%);
  opacity: 0.5;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
}

.logo-surface {
  position: relative;
  transform-origin: 50% 50%;
}

.logo-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

h1 {
  margin: clamp(2rem, 5vw, 3.25rem) 0 0;
  color: #b8bfcd;
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.035em;
}

/* Le rendu de base est statique. L'animation est une amélioration facultative. */
@media (prefers-reduced-motion: no-preference) {
  .logo-stage::before {
    animation: halo 10s ease-in-out infinite;
  }

  .logo-surface {
    animation: card-tilt 10s ease-in-out infinite;
  }

  /* Sans masque pris en charge, le reflet reste invisible. */
  @supports (mask-image: url("assets/logo-original.png")) or
            (-webkit-mask-image: url("assets/logo-original.png")) {
    .logo-surface::after {
      background: linear-gradient(110deg,
        transparent 42%,
        rgba(132, 238, 255, 0.24) 47%,
        rgba(246, 251, 255, 0.50) 50%,
        rgba(224, 177, 255, 0.28) 53%,
        transparent 58%);
      background-size: 300% 100%;
      background-repeat: no-repeat;
      background-position: 100% 50%;
      -webkit-mask-image: url("assets/logo-original.png");
      -webkit-mask-size: 100% 100%;
      -webkit-mask-repeat: no-repeat;
      mask-image: url("assets/logo-original.png");
      mask-mode: alpha;
      mask-size: 100% 100%;
      mask-repeat: no-repeat;
      animation: holographic-sweep 5s ease-in-out infinite;
    }
  }
}

@keyframes halo {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

@keyframes card-tilt {
  0%, 100% {
    transform: rotateX(1.5deg) rotateY(-5deg) rotateZ(-0.3deg);
  }
  50% {
    transform: rotateX(-1.5deg) rotateY(5deg) rotateZ(0.3deg);
  }
}

/* Un passage de 1,6 s, puis une pause jusqu'au prochain cycle de 5 s. */
@keyframes holographic-sweep {
  0% { background-position: 100% 50%; opacity: 0; }
  5% { opacity: 0.65; }
  32% { background-position: 0% 50%; opacity: 0.65; }
  38%, 100% { background-position: 0% 50%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-stage::before {
    animation: none;
    opacity: 0.5;
  }

  .logo-surface {
    animation: none;
    transform: none;
  }

  .logo-surface::after {
    animation: none;
    opacity: 0;
  }
}

/* Garder le logo et le texte visibles sur un téléphone tenu en paysage. */
@media (max-height: 540px) and (min-width: 540px) {
  .waiting-page {
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .identity {
    max-width: min(680px, calc((100vh - 8rem) * 2));
    max-width: min(680px, calc((100svh - 8rem) * 2));
  }

  h1 {
    margin-top: 1.5rem;
  }
}
