/* Tek. — Splash screen (signal broadcast) */

.tek-splash {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000814;
    overflow: hidden;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 1s;
}

.tek-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tek-splash.is-done {
    display: none;
}

body.tek-splash-lock {
    overflow: hidden;
}

html.tek-splash-pending .app-layout {
    visibility: hidden;
}

/* ─── Fond animé ─── */
.tek-splash-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.tek-splash-aurora {
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(ellipse 50% 40% at 30% 40%, rgba(0, 196, 180, 0.18), transparent 55%),
        radial-gradient(ellipse 45% 35% at 70% 60%, rgba(0, 61, 143, 0.45), transparent 50%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(249, 200, 14, 0.08), transparent 45%);
    animation: tekSplashAurora 8s ease-in-out infinite alternate;
}

@keyframes tekSplashAurora {
    0% { transform: scale(1) rotate(0deg); opacity: 0.85; }
    100% { transform: scale(1.08) rotate(3deg); opacity: 1; }
}

.tek-splash-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
    animation: tekSplashGridDrift 12s linear infinite;
}

@keyframes tekSplashGridDrift {
    0% { transform: perspective(600px) rotateX(58deg) translateY(0); }
    100% { transform: perspective(600px) rotateX(58deg) translateY(48px); }
}

/* Radar / signal */
.tek-splash-radar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(90vw, 520px);
    height: min(90vw, 520px);
    transform: translate(-50%, -52%);
    pointer-events: none;
}

.tek-splash-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(249, 200, 14, 0.25);
    border-radius: 50%;
    opacity: 0;
    animation: tekSplashRing 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.tek-splash-ring:nth-child(2) { animation-delay: 0.55s; }
.tek-splash-ring:nth-child(3) { animation-delay: 1.1s; }

@keyframes tekSplashRing {
    0% { transform: scale(0.35); opacity: 0.7; border-color: rgba(0, 196, 180, 0.5); }
    100% { transform: scale(1.15); opacity: 0; border-color: rgba(249, 200, 14, 0.05); }
}

.tek-splash-sweep {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(249, 200, 14, 0.12) 40deg, transparent 80deg);
    animation: tekSplashSweep 2.8s linear infinite;
    opacity: 0.6;
}

@keyframes tekSplashSweep {
    to { transform: rotate(360deg); }
}

.tek-splash-orbs span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--yellow, #F9C80E);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(249, 200, 14, 0.8);
    animation: tekSplashOrb 3s ease-in-out infinite;
}

.tek-splash-orbs span:nth-child(1) { top: 22%; left: 18%; animation-delay: 0s; }
.tek-splash-orbs span:nth-child(2) { top: 68%; right: 20%; animation-delay: 0.9s; background: #00c4b4; box-shadow: 0 0 12px rgba(0, 196, 180, 0.8); }
.tek-splash-orbs span:nth-child(3) { bottom: 24%; left: 42%; animation-delay: 1.6s; width: 4px; height: 4px; }

@keyframes tekSplashOrb {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    50% { transform: translate(8px, -12px) scale(1.4); opacity: 1; }
}

/* ─── Logo ─── */
.tek-splash-stage {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
}

.tek-splash-logo-wrap {
    position: relative;
    display: inline-block;
}

.tek-splash-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 14vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0;
}

.tek-splash-word {
    display: inline-flex;
    color: #fff;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.15));
}

.tek-splash-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(28px) scale(0.85);
    animation: tekSplashCharIn 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
    animation-delay: calc(0.35s + var(--i) * 0.1s);
}

@keyframes tekSplashCharIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tek-splash-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.28em;
    height: 0.28em;
    margin-left: 0.02em;
    opacity: 0;
    animation: tekSplashDotIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s forwards;
}

.tek-splash-dot-core {
    width: 100%;
    height: 100%;
    background: #F9C80E;
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(249, 200, 14, 0.9), 0 0 60px rgba(249, 200, 14, 0.35);
}

.tek-splash-dot-pulse {
    position: absolute;
    inset: -180%;
    border: 2px solid rgba(249, 200, 14, 0.6);
    border-radius: 50%;
    animation: tekSplashDotPulse 1.2s ease-out 1.1s infinite;
}

@keyframes tekSplashDotIn {
    0% { opacity: 0; transform: scale(0); }
    70% { transform: scale(1.35); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes tekSplashDotPulse {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

.tek-splash-live {
    position: absolute;
    top: -8px;
    right: -12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
    opacity: 0;
    animation: tekSplashFadeUp 0.4s ease 1.15s forwards;
}

.tek-splash-live-dot {
    width: 6px;
    height: 6px;
    background: #ff3b3b;
    border-radius: 50%;
    animation: tekSplashLiveBlink 1s step-end infinite;
}

@keyframes tekSplashLiveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.tek-splash-tagline {
    margin: 20px 0 28px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    opacity: 0;
    animation: tekSplashFadeUp 0.5s ease 1.25s forwards;
}

@keyframes tekSplashFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Waveform audio/vidéo */
.tek-splash-waveform {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 32px;
    opacity: 0;
    animation: tekSplashFadeUp 0.4s ease 1.35s forwards;
}

.tek-splash-waveform span {
    width: 3px;
    height: 8px;
    background: linear-gradient(to top, #003D8F, #00c4b4);
    border-radius: 2px;
    animation: tekSplashBar 0.9s ease-in-out infinite;
    animation-delay: calc(var(--b) * 0.04s);
}

@keyframes tekSplashBar {
    0%, 100% { height: 6px; opacity: 0.35; }
    50% { height: 28px; opacity: 1; }
}

/* Loader */
.tek-splash-loader {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: min(200px, 40vw);
    opacity: 0;
    animation: tekSplashFadeUp 0.4s ease 0.5s forwards;
}

.tek-splash-loader-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.tek-splash-loader-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #003D8F, #F9C80E, #00c4b4);
    border-radius: 2px;
    animation: tekSplashLoad 4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes tekSplashLoad {
    to { width: 100%; }
}

/* Sortie — zoom portal */
.tek-splash.is-exiting {
    animation: tekSplashExit 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tek-splash.is-exiting .tek-splash-stage {
    animation: tekSplashLogoExit 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tekSplashExit {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes tekSplashLogoExit {
    0% { transform: scale(1); opacity: 1; filter: blur(0); }
    100% { transform: scale(1.08); opacity: 0; filter: blur(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .tek-splash *,
    .tek-splash *::before,
    .tek-splash *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
    .tek-splash-loader-fill { width: 100% !important; }
    .tek-splash-char,
    .tek-splash-dot,
    .tek-splash-tagline,
    .tek-splash-live,
    .tek-splash-waveform,
    .tek-splash-loader { opacity: 1 !important; transform: none !important; }
}
