﻿.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  background: #1A1018;
  /* Entrée: tout démarre invisible */
  opacity: 1;
  transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1);
  pointer-events: all;
  overflow: hidden;
}

/* Phase hold → visible par défaut */
.splash.hold   { opacity: 1; }

/* Phase exit → fondu vers le bas + scale léger */
.splash.exit {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
              transform 0.65s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}

/* Fallback pour navigateurs anciens */
@supports not (background-clip: text) {
  .splash.exit {
    opacity: 0;
    pointer-events: none;
  }
}

/* Réduction des animations pour les navigateurs avec prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .splash {
    transition: opacity 0.2s ease;
  }

  .splash.hold {
    opacity: 1;
    animation: none !important;
  }

  .splash.exit {
    opacity: 0;
    animation: none !important;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Fond dégradé radial ── */
.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(212,119,44,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 20% 80%, rgba(201,151,62,0.10) 0%, transparent 60%),
    linear-gradient(160deg, #2D1F17 0%, #1A1018 60%);
  animation: splashBgPulse 3s ease-in-out infinite alternate;
}
@keyframes splashBgPulse {
  from { opacity: 0.8; }
  to   { opacity: 1; }
}

/* ── Anneaux lumineux ── */
.splash-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.splash-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(212,119,44,0.25);
  animation: splashRingExpand 2.4s cubic-bezier(0.22,1,0.36,1) infinite;
}
.splash-ring-1 { width: 200px; height: 200px; animation-delay: 0s;    }
.splash-ring-2 { width: 300px; height: 300px; animation-delay: 0.5s;  border-color: rgba(201,151,62,0.15); }
.splash-ring-3 { width: 420px; height: 420px; animation-delay: 1.0s;  border-color: rgba(212,119,44,0.08); }

@keyframes splashRingExpand {
  0%   { transform: scale(0.7); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Particules flottantes ── */
.splash-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.splash-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--primary));
  opacity: 0;
  animation: splashParticleFloat 2.2s ease-in-out infinite alternate;
}
@keyframes splashParticleFloat {
  0%   { transform: translateY(0px)  scale(0.8); opacity: 0; }
  30%  { opacity: 0.9; }
  70%  { opacity: 0.6; }
  100% { transform: translateY(-28px) scale(1.2); opacity: 0; }
}

/* Fallback pour animations non supportées */
@supports not (animation-timing-function: cubic-bezier(0.22,1,0.36,1)) {
  .splash-particle {
    animation: splashParticleFloat 2.2s ease-in-out infinite alternate;
  }

  .splash-ring {
    animation: splashRingExpand 2.4s ease infinite;
  }

  .splash-logo {
    animation: splashLogoPulse 2s ease-in-out 1s infinite alternate;
  }

  .splash-logo-wrap {
    animation: splashLogoIn 0.9s ease-out 0.1s both;
  }

  .splash-text {
    animation: splashTextIn 0.8s ease-out 0.5s both;
  }

  .splash-bar-wrap {
    animation: splashTextIn 0.8s ease-out 0.7s both;
  }

  .splash-bar {
    animation: splashBarFill 2.1s ease 0.8s forwards;
  }

  .splash-logo-halo {
    animation: splashHalo 2s ease-in-out 0.8s infinite alternate;
  }
}

/* ── Logo ── */
.splash-logo-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashLogoIn 0.9s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}
@keyframes splashLogoIn {
  from { transform: scale(0.55) translateY(20px); opacity: 0; filter: blur(8px); }
  to   { transform: scale(1)    translateY(0);    opacity: 1; filter: blur(0); }
}

.splash-logo {
  height: 140px;
  width: auto;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 8px 30px rgba(212,119,44,0.5))
          drop-shadow(0 0   20px rgba(201,151,62,0.3));
  animation: splashLogoPulse 2s ease-in-out 1s infinite alternate;
}
@keyframes splashLogoPulse {
  from { filter: drop-shadow(0 8px 30px rgba(212,119,44,0.4)) drop-shadow(0 0 20px rgba(201,151,62,0.2)); }
  to   { filter: drop-shadow(0 12px 45px rgba(212,119,44,0.75)) drop-shadow(0 0 35px rgba(201,151,62,0.5)); }
}

/* Halo brillant autour du logo */
.splash-logo-halo {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,119,44,0.22) 0%, transparent 70%);
  animation: splashHalo 2s ease-in-out 0.8s infinite alternate;
  pointer-events: none;
}
@keyframes splashHalo {
  from { transform: scale(0.9); opacity: 0.6; }
  to   { transform: scale(1.3); opacity: 1;   }
}

/* ── Texte titre ── */
.splash-text {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: splashTextIn 0.8s cubic-bezier(0.22,1,0.36,1) 0.5s both;
}
@keyframes splashTextIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.splash-label {
  font-family: var(--font);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.splash-sub {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Barre de chargement ── */
.splash-bar-wrap {
  position: relative;
  z-index: 2;
  width: 160px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
  animation: splashTextIn 0.8s cubic-bezier(0.22,1,0.36,1) 0.7s both;
}
.splash-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--gold-light));
  animation: splashBarFill 2.1s cubic-bezier(0.4,0,0.2,1) 0.8s forwards;
  box-shadow: 0 0 10px rgba(212,119,44,0.6);
}
@keyframes splashBarFill {
  0%   { width: 0%;   }
  60%  { width: 75%;  }
  85%  { width: 92%;  }
  100% { width: 100%; }
}

/* ── Mobile optimizations pour splash screen ── */
@media (max-width: 768px) {
  .splash {
    gap: 1.2rem;
  }

  .splash-ring-1 { width: 140px; height: 140px; }
  .splash-ring-2 { width: 210px; height: 210px; }
  .splash-ring-3 { width: 300px; height: 300px; }

  .splash-particle {
    width: calc(2px + (var(--i, 0) % 3) * 1px);
    height: calc(2px + (var(--i, 0) % 3) * 1px);
  }

  .splash-logo {
    height: 100px;
  }

  .splash-logo-halo {
    inset: -15px;
  }

  .splash-label {
    font-size: 1.1rem;
  }

  .splash-sub {
    font-size: 0.75rem;
  }

  .splash-bar-wrap {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .splash {
    gap: 1rem;
  }

  .splash-ring-1 { width: 100px; height: 100px; }
  .splash-ring-2 { width: 150px; height: 150px; }
  .splash-ring-3 { width: 220px; height: 220px; }

  .splash-particle {
    width: calc(2px + (var(--i, 0) % 2));
    height: calc(2px + (var(--i, 0) % 2));
  }

  @keyframes splashParticleFloat {
    0%   { transform: translateY(0px)  scale(0.8); opacity: 0; }
    30%  { opacity: 0.9; }
    70%  { opacity: 0.6; }
    100% { transform: translateY(-18px) scale(1.1); opacity: 0; }
  }

  .splash-logo {
    height: 80px;
  }

  .splash-logo-halo {
    inset: -12px;
  }

  .splash-label {
    font-size: 1rem;
  }

  .splash-sub {
    font-size: 0.7rem;
  }

  .splash-bar-wrap {
    width: 100px;
  }
}
.splash.hidden { display: none !important; }
