/* =====================================================
   SPLASH ANIMATION - CLEAN REWRITE
   Simple, clear animation structure
   ===================================================== */

/* =====================================================
   1. CSS VARIABLES
   ===================================================== */
:root {
    --splash-bg: #0a0a0f;
    --splash-primary: #40E0D0;
    --splash-secondary: #1E6B6B;
    --splash-dark: #0D3D3D;
}

/* =====================================================
   2. SPLASH OVERLAY CONTAINER
   ===================================================== */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--splash-bg);
    overflow: hidden;
}

/* =====================================================
   3. SPLIT PANELS (TOP / BOTTOM)
   ===================================================== */
.splash-top,
.splash-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background: var(--splash-bg);
    z-index: 10;
}

.splash-top {
    top: 0;
}

.splash-bottom {
    bottom: 0;
}

/* Split animation */
.splash-overlay.splitting .splash-top {
    animation: splitTop 0.6s ease-in-out forwards;
}

.splash-overlay.splitting .splash-bottom {
    animation: splitBottom 0.6s ease-in-out forwards;
}

@keyframes splitTop {
    to { transform: translateY(-100%); }
}

@keyframes splitBottom {
    to { transform: translateY(100%); }
}

/* Matrix background in panels */
.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.3;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--splash-primary);
    text-shadow: 0 0 10px rgba(64, 224, 208, 0.6);
    writing-mode: vertical-rl;
    animation: matrixFall linear infinite;
}

@keyframes matrixFall {
    to { transform: translateY(200vh); }
}

/* Circuit lines */
.circuit-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        linear-gradient(var(--splash-primary) 1px, transparent 1px),
        linear-gradient(90deg, var(--splash-primary) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* =====================================================
   4. LIGHT LINE
   ===================================================== */
.light-line {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 20%,
        white 50%,
        rgba(255,255,255,0.3) 80%,
        transparent 100%
    );
    transform: scaleX(0) translateY(-50%);
    opacity: 0;
    z-index: 50;
    box-shadow: 0 0 30px 10px rgba(255,255,255,0.5);
}

.splash-overlay.light-active .light-line {
    animation: lightExpand 0.3s ease-out forwards;
}

@keyframes lightExpand {
    to { 
        transform: scaleX(1) translateY(-50%);
        opacity: 1;
    }
}

/* =====================================================
   5. LOGO CONTAINER
   ===================================================== */
.logo-container {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.splash-logo {
    width: 300px;
    height: 350px;
    filter: drop-shadow(0 0 20px rgba(64, 224, 208, 0.6));
    opacity: 0;
    animation: logoAppear 1s ease-out forwards;
}

@keyframes logoAppear {
    to { 
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(64, 224, 208, 0.6));
    }
}

/* Logo fade out */
.splash-logo.fading-out {
    animation: logoDisappear 0.3s ease-out forwards;
}

@keyframes logoDisappear {
    to { 
        opacity: 0;
        filter: drop-shadow(0 0 50px white);
    }
}

/* =====================================================
   6. RING ANIMATIONS - Normal rotation
   SVG elements need explicit transform-origin in px
   ===================================================== */

/* Outer ring - rotates clockwise */
.logo-ring-outer {
    transform-origin: 150px 175px;
    animation: ringOuter 4s linear infinite;
}

@keyframes ringOuter {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Middle ring - rotates counter-clockwise */
.logo-ring-middle {
    transform-origin: 150px 175px;
    animation: ringMiddle 3s linear infinite;
}

@keyframes ringMiddle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* Inner ring - rotates clockwise faster */
.logo-ring-inner {
    transform-origin: 150px 175px;
    animation: ringInner 2s linear infinite;
}

@keyframes ringInner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   UNLOCK PHASE - Vault style ring rotation
   ===================================================== */
.splash-logo.unlocking .logo-ring-outer {
    animation: vaultOuter 1.2s ease-in-out forwards;
}

.splash-logo.unlocking .logo-ring-middle {
    animation: vaultMiddle 1.2s ease-in-out forwards;
}

.splash-logo.unlocking .logo-ring-inner {
    animation: vaultInner 1.2s ease-in-out forwards;
}

@keyframes vaultOuter {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(450deg); }
    50% { transform: rotate(450deg); }
    80% { transform: rotate(300deg); }
    100% { transform: rotate(360deg); }
}

@keyframes vaultMiddle {
    0% { transform: rotate(0deg); }
    35% { transform: rotate(-360deg); }
    55% { transform: rotate(-360deg); }
    85% { transform: rotate(-200deg); }
    100% { transform: rotate(-270deg); }
}

@keyframes vaultInner {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(120deg); }
    35% { transform: rotate(120deg); }
    55% { transform: rotate(240deg); }
    70% { transform: rotate(240deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   7. ARM/NEEDLE ANIMATIONS
   ===================================================== */

/* Arms start in normal position */
.logo-arm-top,
.logo-arm-left,
.logo-arm-right {
    transform: translate(0, 0);
}

/* During unlock - arms shift outward */
.splash-logo.unlocking .logo-arm-top {
    animation: armTop 1s ease-out forwards;
}

.splash-logo.unlocking .logo-arm-left {
    animation: armLeft 1s ease-out forwards;
}

.splash-logo.unlocking .logo-arm-right {
    animation: armRight 1s ease-out forwards;
}

/* Top arm: straight up */
@keyframes armTop {
    0% { transform: translate(0, 0); }
    100% { transform: translateY(-20px); }
}

/* Left arm: diagonal left-down */
@keyframes armLeft {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-15px, 12px); }
}

/* Right arm: diagonal right-down */
@keyframes armRight {
    0% { transform: translate(0, 0); }
    100% { transform: translate(15px, 12px); }
}

/* =====================================================
   8. CORE GLOW
   ===================================================== */
.logo-core {
    animation: coreGlow 1.5s ease-in-out infinite;
}

@keyframes coreGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.splash-logo.unlocking .logo-core {
    animation: coreBurst 0.8s ease-out forwards;
}

@keyframes coreBurst {
    50% { filter: drop-shadow(0 0 20px var(--splash-primary)); }
    100% { filter: none; opacity: 1; }
}

/* =====================================================
   9. DECORATIVE ELEMENTS (simplified)
   ===================================================== */
.corner-decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0.3;
    z-index: 6;
}

.corner-decoration::before,
.corner-decoration::after {
    content: '';
    position: absolute;
    background: var(--splash-primary);
}

.corner-tl { top: 20px; left: 20px; }
.corner-tl::before { width: 30px; height: 2px; }
.corner-tl::after { width: 2px; height: 30px; }

.corner-tr { top: 20px; right: 20px; }
.corner-tr::before { width: 30px; height: 2px; right: 0; }
.corner-tr::after { width: 2px; height: 30px; right: 0; }

.corner-bl { bottom: 20px; left: 20px; }
.corner-bl::before { width: 30px; height: 2px; bottom: 0; }
.corner-bl::after { width: 2px; height: 30px; bottom: 0; }

.corner-br { bottom: 20px; right: 20px; }
.corner-br::before { width: 30px; height: 2px; bottom: 0; right: 0; }
.corner-br::after { width: 2px; height: 30px; bottom: 0; right: 0; }

/* Crosshair - hidden, not needed */
.crosshair-lines { display: none; }

/* Glow behind logo - simplified */
.splash-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 224, 208, 0.3) 0%, transparent 70%);
    z-index: 1;
}

/* =====================================================
   10. LOADING TEXT
   ===================================================== */
.splash-text {
    position: absolute;
    bottom: 100px;
    color: var(--splash-primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0;
    animation: textAppear 0.5s ease-out 0.5s forwards;
    z-index: 15;
}

.splash-text::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes textAppear {
    to { opacity: 0.7; }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Hide text when splitting */
.splash-overlay.splitting .splash-text {
    opacity: 0;
}

/* =====================================================
   11. SKIP BUTTON
   ===================================================== */
.splash-skip {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--splash-primary);
    color: var(--splash-primary);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    opacity: 0;
    animation: skipAppear 0.5s ease-out 1s forwards;
    transition: all 0.3s ease;
    z-index: 100;
}

.splash-skip:hover {
    background: var(--splash-primary);
    color: var(--splash-bg);
}

@keyframes skipAppear {
    to { opacity: 0.7; }
}

.splash-overlay.splitting .splash-skip {
    opacity: 0 !important;
    pointer-events: none;
}

/* =====================================================
   12. WHITE OVERLAY + BRANDING
   ===================================================== */
.white-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    z-index: 99998;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* When active, white bg is visible (revealed by split) */
.white-overlay.visible {
    opacity: 1;
}

/* Fade out to reveal app */
.white-overlay.fading {
    animation: whiteFadeOut 0.8s ease-out forwards;
}

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

/* Branding container */
.branding-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3vw;
}

.branding-logo {
    width: 10vw;
    min-width: 60px;
    max-width: 120px;
    height: auto;
}

.branding-text {
    font-family: 'Segoe UI', -apple-system, sans-serif;
    font-size: 10vw;
    font-weight: 300;
    letter-spacing: 0.3vw;
    display: flex;
    align-items: center;
}

.branding-text .text-cogyn {
    color: #000000;
}

.branding-text .text-a {
    color: #40E0D0;
}

.branding-text .text-i {
    color: #1E6B6B;
}

/* =====================================================
   13. APP REVEAL (simple fade)
   ===================================================== */
.app-layout.hidden {
    opacity: 0;
}

.app-layout.revealing {
    animation: appReveal 0.6s ease-out forwards;
}

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

/* =====================================================
   14. RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .splash-logo {
        width: 200px;
        height: 240px;
    }
    
    .splash-glow {
        width: 300px;
        height: 300px;
    }
    
    .branding-text {
        font-size: 12vw;
    }
    
    .branding-logo {
        width: 12vw;
    }
}

/* =====================================================
   15. UTILITY - FADE OUT OVERLAY
   ===================================================== */
.splash-overlay.fade-out {
    animation: overlayFadeOut 0.3s ease-out forwards;
}

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