/**
 * NeuroCRM - Splash Page Styles (Minimal - Animation Only)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.splash-page {
    background: #000;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html,
body.splash-page {
    background: #000;
}

/* ============================================
   CONTAINER
   ============================================ */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CANVAS
   ============================================ */
#brain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ============================================
   STATIC FALLBACK (reduced motion)
   ============================================ */
.static-brain {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(ellipse at 35% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 65% 50%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(100, 100, 200, 0.15) 0%, transparent 70%);
    border-radius: 45% 45% 40% 40%;
    filter: blur(2px);
    z-index: 1;
}

/* ============================================
   TITLE (centered on brain)
   ============================================ */
.hero-brand {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: min(92vw, 900px);
    text-align: center;
    pointer-events: none;
}

.brain-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #f4f1ff;
    text-shadow: 0 0 24px rgba(165, 180, 252, 0.45), 0 0 60px rgba(120, 100, 255, 0.3);
    transition: color 0.6s ease, text-shadow 0.6s ease;
}

/* When the particle canvas runs, it draws the name; the h1 stays for SEO/screen readers */
.splash-container.has-particles .brain-title {
    color: transparent;
    text-shadow: none;
}

.hero-tagline {
    margin-top: 0.9rem;
    font-family: 'Noto Sans Georgian', 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    letter-spacing: 0.04em;
    color: rgba(225, 220, 255, 0.78);
    opacity: 0;
    animation: taglineIn 1.4s ease 1.8s forwards;
}

@keyframes taglineIn {
    to { opacity: 1; }
}

.hero-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9;
    pointer-events: none;
}

/* ============================================
   ENTER BUTTON (bottom center)
   ============================================ */
.enter-button {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 16px 42px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 40px rgba(118, 75, 162, 0.2);
    animation: enterBtnPulse 3s ease-in-out infinite;
}

@keyframes enterBtnPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 40px rgba(118, 75, 162, 0.2);
        border-color: rgba(167, 139, 250, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.5), 0 0 60px rgba(118, 75, 162, 0.35), 0 0 80px rgba(167, 139, 250, 0.2);
        border-color: rgba(167, 139, 250, 0.6);
    }
}

.enter-button:hover {
    color: white;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.6), 0 0 80px rgba(118, 75, 162, 0.4), 0 0 100px rgba(167, 139, 250, 0.25);
    transform: translateX(-50%) scale(1.05);
    animation: none;
}

.enter-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.enter-button:active {
    transform: translateX(-50%) scale(0.98);
}

/* ============================================
   VIGNETTE OVERLAY
   ============================================ */
.vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* ============================================
   EXIT TRANSITION
   ============================================ */
.splash-container.is-leaving .vignette-overlay {
    opacity: 1;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 50%, #000 100%);
}

.splash-container.is-leaving .hero-brand {
    animation: fadeOutTitle 0.5s ease forwards;
}

.splash-container.is-leaving .enter-button {
    pointer-events: none;
    animation: fadeOutBtn 0.5s ease forwards;
}

@keyframes fadeOutTitle {
    to {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 20px));
    }
}

@keyframes fadeOutBtn {
    to {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

.splash-container.is-leaving {
    animation: finalFade 0.3s ease 0.8s forwards;
}

@keyframes finalFade {
    to {
        opacity: 0;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .enter-button {
        transition: none;
    }

    .hero-tagline {
        animation: none;
        opacity: 1;
    }

    .splash-container.is-leaving .enter-button {
        animation: simpleFade 0.5s ease forwards;
    }

    @keyframes simpleFade {
        to { opacity: 0; }
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .brain-title {
        font-size: clamp(2.6rem, 13vw, 4rem);
    }

    .hero-tagline {
        font-size: 0.92rem;
    }

    .enter-button {
        bottom: 40px;
        padding: 14px 32px;
        font-size: 0.95rem;
    }

    .static-brain {
        width: 280px;
        height: 280px;
    }
}

/* ============================================
   MOBILE TOUCH OPTIMIZATION
   ============================================ */
@media (hover: none) {
    .enter-button:hover {
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.08);
    }

    .enter-button:active {
        transform: translateX(-50%) scale(0.9);
        background: rgba(102, 126, 234, 0.3);
    }
}
