/* ==========================================
   FOND COSMIQUE VIOLET SOMBRE
   ========================================== */
body {
    background: 
        radial-gradient(ellipse at top, rgba(88, 28, 135, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(109, 40, 217, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, #0f0a1a 0%, #1a0d2e 30%, #1a0d2e 70%, #0f0a1a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* Étoiles en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 40%, white, transparent),
        radial-gradient(1px 1px at 33% 60%, white, transparent),
        radial-gradient(1px 1px at 55% 25%, white, transparent),
        radial-gradient(2px 2px at 15% 80%, white, transparent),
        radial-gradient(1px 1px at 75% 55%, white, transparent),
        radial-gradient(1px 1px at 40% 15%, white, transparent),
        radial-gradient(2px 2px at 25% 45%, white, transparent),
        radial-gradient(1px 1px at 85% 75%, white, transparent),
        radial-gradient(1px 1px at 10% 60%, white, transparent),
        radial-gradient(2px 2px at 70% 20%, white, transparent),
        radial-gradient(1px 1px at 45% 85%, white, transparent),
        radial-gradient(1px 1px at 95% 30%, white, transparent),
        radial-gradient(2px 2px at 30% 10%, white, transparent),
        radial-gradient(1px 1px at 65% 50%, white, transparent),
        radial-gradient(1px 1px at 5% 40%, white, transparent),
        radial-gradient(2px 2px at 50% 90%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: starfield 60s linear infinite;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

@keyframes starfield {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ==========================================
   SYSTÈME D'ÉTINCELLES (SPARKLES)
   ========================================== */
.global-sparkles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.global-sparkles::before,
.global-sparkles::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}

.global-sparkles::before {
    background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 600'%3E%3Cdefs%3E%3CradialGradient id='ga' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='1'/%3E%3Cstop offset='60%25' stop-color='%23ffffff' stop-opacity='0.25'/%3E%3Cstop offset='100%25' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23ga)'%3E%3Ccircle cx='90' cy='110' r='1.5'/%3E%3Ccircle cx='210' cy='420' r='1.8'/%3E%3Ccircle cx='360' cy='240' r='1.4'/%3E%3Ccircle cx='520' cy='90' r='1.6'/%3E%3Ccircle cx='640' cy='380' r='1.7'/%3E%3Ccircle cx='780' cy='220' r='1.3'/%3E%3Ccircle cx='930' cy='330' r='1.6'/%3E%3Ccircle cx='860' cy='520' r='1.5'/%3E%3Ccircle cx='120' cy='540' r='1.7'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-position: center;
    opacity: 0.35;
}

.global-sparkles::after {
    background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 600'%3E%3Cdefs%3E%3CradialGradient id='gb' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='1'/%3E%3Cstop offset='60%25' stop-color='%23ffffff' stop-opacity='0.25'/%3E%3Cstop offset='100%25' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23gb)'%3E%3Ccircle cx='150' cy='60' r='1.6'/%3E%3Ccircle cx='300' cy='520' r='1.7'/%3E%3Ccircle cx='450' cy='180' r='1.5'/%3E%3Ccircle cx='610' cy='300' r='1.9'/%3E%3Ccircle cx='720' cy='80' r='1.4'/%3E%3Ccircle cx='840' cy='410' r='1.8'/%3E%3Ccircle cx='950' cy='150' r='1.6'/%3E%3Ccircle cx='70' cy='260' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-position: center;
    opacity: 0.25;
}

.sparkle-dot {
    position: absolute;
    width: var(--dot-size, 4px);
    height: var(--dot-size, 4px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.55) 60%, rgba(255,255,255,0) 100%);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.9));
    opacity: 0;
    pointer-events: none;
    animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
}

.sparkle-dot::before,
.sparkle-dot::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(var(--ray-rot, 0deg));
    width: calc(var(--dot-size, 4px) * 6);
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%);
}

.sparkle-dot::after {
    transform: translate(-50%, -50%) rotate(calc(var(--ray-rot, 0deg) + 90deg));
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.85); }
    50% { opacity: var(--maxOpacity, 1); transform: scale(1.2); }
}

/* ==========================================
   ANIMATIONS & UX
   ========================================== */
.no-select { user-select: none; }

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
.animate-logo { animation: logoFloat 5s ease-in-out infinite; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }

* { transition: all 0.2s ease-in-out; }
