/* Animation d'accueil (≈ 4,6 s, jouée une fois par session) : le titre CARDS / & / FREAKS se dessine au centre, une rafale de cartes est
   distribuée par-dessus, puis chaque lettre aspire des cartes et se remplit de leur illustration ; l'écran zoome enfin vers le visiteur.
   Du CSS pur (les cartes sont posées par le petit script de index.html). */
#splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
    background: radial-gradient(circle at 50% 40%, #4f46e5 0%, #2b2680 42%, #0f0d2e 100%); color: #fff; cursor: pointer; overflow: hidden; will-change: transform, opacity; }
#splash.done { opacity: 0; visibility: hidden; transform: scale(3.4); transition: opacity .7s ease-in, transform .7s cubic-bezier(.5, 0, .9, .4), visibility .7s; }

/* Fond : étoiles qui scintillent, et flash de lumière quand les lettres ont aspiré les cartes. */
#splash::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(2px 2px at 12% 22%, #fff, transparent), radial-gradient(2px 2px at 82% 18%, #a5f3fc, transparent),
        radial-gradient(1.5px 1.5px at 25% 78%, #fde68a, transparent), radial-gradient(2px 2px at 70% 70%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 90% 52%, #fff, transparent), radial-gradient(1.5px 1.5px at 6% 55%, #a5f3fc, transparent),
        radial-gradient(2px 2px at 50% 10%, #fde68a, transparent), radial-gradient(1.5px 1.5px at 42% 90%, #fff, transparent);
    animation: splash-twinkle 1.4s ease-in-out infinite alternate; }
#splash::after { content: ""; position: absolute; left: 50%; top: 40%; width: 120vmax; height: 120vmax; transform: translate(-50%, -50%) scale(.2);
    background: radial-gradient(circle, rgba(255,255,255,.9) 0%, rgba(103,232,249,.45) 22%, transparent 55%); opacity: 0; pointer-events: none;
    animation: splash-flash .9s ease-out 3.35s forwards; }

.splash-tag { color: #c7d2fe; opacity: 0; margin: 1.3rem 0 0; padding: 0 1rem; text-align: center; animation: splash-rise .6s ease-out 3.5s forwards; }

@keyframes splash-rise { to { opacity: 1; transform: none; } }
@keyframes splash-twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes splash-flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

@media (prefers-reduced-motion: reduce) { #splash { display: none; } }


.sb-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center;
    will-change: transform; animation: sb-shake .1s linear 2.1s 14; }
.sb-line { display: flex; justify-content: center; font-family: Impact, "Arial Black", system-ui, sans-serif; font-weight: 900; line-height: .98; letter-spacing: .02em;
    font-size: clamp(3.6rem, 25vw, 9rem); }
.sb-line.amp { font-size: clamp(2.2rem, 14vw, 5.4rem); }
.sb-l { position: relative; display: inline-block; color: transparent; }
.sb-l::before, .sb-l::after { content: attr(data-ch); position: absolute; inset: 0; }
/* Fin contour cyan, qui apparaît lettre après lettre. */
.sb-l::before { color: transparent; -webkit-text-stroke: 2.5px #a5f3fc; opacity: 0; will-change: opacity; animation: sb-draw .3s ease-out var(--d) forwards; }
/* La lettre capture une carte : son illustration remplit la lettre (apparaît quand la première carte est absorbée). */
.sb-l::after { background: var(--img) var(--bp, 50% 26%) / 240% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    opacity: 0; transform-origin: 50% 60%; will-change: transform, opacity; animation: sb-fill .4s ease-out var(--fd) forwards; }

/* Cartes distribuées depuis tous les bords, empilées au centre, puis aspirées chacune par une lettre.
   Légèreté : seules les propriétés « transform » et « opacity » sont animées (elles tournent sur le processeur graphique, donc restent fluides
   même quand le navigateur est occupé à démarrer l'appli), sans filtre ni gros flou d'ombre. */
.sb-cards { position: absolute; inset: 0; z-index: 3; pointer-events: none; perspective: 900px; }
.sb-card { position: absolute; left: 50%; top: 50%; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: 8px; border: 2px solid rgba(255,255,255,.85);
    background: #14123c center / cover; box-shadow: 0 3px 8px rgba(0,0,0,.5); opacity: 0; will-change: transform, opacity;
    transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) rotate(var(--sr)) rotateY(var(--ry)) scale(1);
    animation: sb-deal .4s cubic-bezier(.1, .75, .2, 1) var(--dd) forwards, sb-absorb .55s cubic-bezier(.55, 0, .85, .4) var(--ad) forwards; }

@keyframes sb-draw { to { opacity: 1; } }
@keyframes sb-fill { 0% { opacity: 0; transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes sb-deal { 0% { opacity: 1; } 100% { opacity: 1; transform: translate(-50%, -50%) translate(var(--lx), var(--ly)) rotate(var(--lr)) rotateY(0deg) scale(1); } }
@keyframes sb-absorb { 0% { opacity: 1; transform: translate(-50%, -50%) translate(var(--lx), var(--ly)) rotate(var(--lr)) rotateY(0deg) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(calc(var(--lr) + 320deg)) rotateY(0deg) scale(.1); } }
@keyframes sb-shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(4px, -3px); } 50% { transform: translate(-4px, 3px); } 75% { transform: translate(3px, 4px); } }
