/* transition.css */
.transition-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    z-index: 10000;
    pointer-events: none; /* Only block clicks when active */
}

.transition-tile {
    width: 17.5vw;
    margin-left: -0.5vw; /* Overlap to perfectly eliminate flexbox sub-pixel gaps */
    flex-shrink: 0;
    height: 100%;
    background-color: #ffffff; /* pure white flash for motion feel */
    position: relative;
    overflow: hidden; /* natively masks the video! */
}

.transition-tile:first-child {
    margin-left: 0;
}

.transition-tile canvas {
    position: absolute;
    width: 50vw;
    height: 50vh;
    object-fit: contain; /* ensures the entire glyph fits nicely at half size */
    pointer-events: none;
    filter: grayscale(1) brightness(6) contrast(10) invert(1); /* Mathematically perfect CSS threshold: pushes the dim glyph above 50% luminance, crushes contrast to separate it from the black background, and inverts! */
}



/* Global Navigation Styling */
.global-nav {
    position: fixed;
    top: 2rem;
    right: 2.5rem;
    z-index: 9998;
    display: flex;
    gap: 2rem;
    mix-blend-mode: exclusion;
    pointer-events: none;
}

.global-nav a {
    color: white;
    text-decoration: none;
    font-family: 'BitcountGridDouble', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-variation-settings: "wght" 100, "ELXP" 0;
    transition: opacity 0.3s ease, font-variation-settings 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto;
}

.global-nav a:hover {
    opacity: 0.8;
    font-variation-settings: "wght" 800, "ELXP" 100;
}

/* Global Home Button (Tusc) inherits from .global-nav a, so no extra CSS needed except removing the old fixed block */

@keyframes glitch-flicker {
    0% { opacity: 0; }
    5% { opacity: 1; }
    15% { opacity: 0.1; }
    20% { opacity: 1; }
    30% { opacity: 0.4; }
    40% { opacity: 1; }
    50% { opacity: 0; }
    65% { opacity: 1; }
    75% { opacity: 0.2; }
    85% { opacity: 0.9; }
    100% { opacity: 1; }
}
.flicker-char {
    opacity: 0;
}

.flicker-char.triggered {
    /* 1.0 seconds exact, using steps for a blocky digital feel */
    animation: glitch-flicker 1s steps(1) forwards;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .global-nav {
        top: 1.5rem;
        right: 1.5rem;
        gap: 1rem;
    }
    .global-nav a {
        font-size: 0.9rem;
    }
    .transition-tile canvas {
        width: 80vw;
        height: 80vh;
    }
}
