/* timeslip.css */

/* The overlay that covers the whole screen */
#time-slip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* When active, fade in the black screen */
#time-slip-overlay.active {
    opacity: 1;
    animation: slipFade 2s forwards;
}

/* The glowing green time portal core */
.slip-core {
    width: 10px;
    height: 10px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 50px 20px #00ff00;
    opacity: 0;
}

/* Rapidly zoom the green portal towards the user */
#time-slip-overlay.active .slip-core {
    animation: slipZoom 1.8s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}

/* The glitchy text in the center */
.slip-text {
    position: absolute;
    font-family: 'Pirata One', cursive;
    color: #00ff00;
    font-size: 2rem;
    text-shadow: 2px 0 #ff0000, -2px 0 #0000ff; /* RGB glitch split */
    opacity: 0;
    z-index: 2;
}

/* Glitch the text rapidly */
#time-slip-overlay.active .slip-text {
    animation: slipGlitch 1.8s steps(4) forwards;
}

@keyframes slipFade {
    0% { opacity: 1; background-color: #000; }
    20% { background-color: #002200; }
    40% { background-color: #000; }
    60% { background-color: #001100; }
    100% { opacity: 1; background-color: #000; }
}

@keyframes slipZoom {
    0% { width: 10px; height: 10px; opacity: 0; }
    20% { width: 50px; height: 50px; opacity: 1; }
    50% { width: 500px; height: 500px; opacity: 0.8; }
    80% { width: 5000px; height: 5000px; opacity: 1; }
    100% { width: 10000px; height: 10000px; opacity: 1; }
}

@keyframes slipGlitch {
    0% { opacity: 0; transform: translate(0, 0) scale(1); clip-path: inset(40% 0 40% 0); }
    10% { opacity: 1; transform: translate(-10px, 0) scale(1.1); clip-path: inset(10% 0 80% 0); }
    20% { transform: translate(10px, 0) scale(0.9); clip-path: inset(80% 0 10% 0); }
    30% { opacity: 1; transform: translate(-5px, 0) scale(1.2); clip-path: inset(40% 0 40% 0); }
    40% { transform: translate(5px, 0) scale(0.8); clip-path: inset(20% 0 20% 0); }
    50% { opacity: 0.8; transform: translate(0, 0) scale(1.5); clip-path: inset(0 0 0 0); }
    80% { opacity: 0; transform: scale(3); }
    100% { opacity: 0; }
}

/* Screen shake on the desktop while slipping */
.shaking {
    animation: screenShake 0.1s infinite !important;
}

@keyframes screenShake {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    25% { transform: translate(-2px, -1px) rotate(-1deg); }
    50% { transform: translate(-1px, 2px) rotate(1deg); }
    75% { transform: translate(1px, -2px) rotate(0deg); }
    100% { transform: translate(2px, 1px) rotate(0deg); }
}
