/* =========================================
   Cyberpunk Hacker Footer
========================================= */
.footer-cyberpunk {
    position: relative;
    background-color: #050505;
    border-top: 1px solid rgba(229, 9, 20, 0.3);
    overflow: hidden;
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: 0;
    z-index: 10;
}

/* Background grid overlay */
.footer-grid {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(229, 9, 20, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229, 9, 20, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 5; /* Keep it above the erase canvas so the grid doesn't disappear when erasing */
    pointer-events: none;
    opacity: 0.5;
}

/* Big Display Typography Container */
.footer-glitch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
    min-height: 25vw; /* Keeps space when text explodes */
    isolation: isolate;
}

/* Canvas for Particles */
.particle-canvas {
    position: absolute;
    inset: -50px; /* Bleed out */
    width: calc(100% + 100px);
    height: calc(100% + 100px);
    pointer-events: none;
    z-index: 6; /* Explode OVER the background grid */
}

/* Erase/Mask Canvas */
.erase-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* Glitch Effect Core */
.glitch {
    font-family: 'Orbitron', 'Impact', sans-serif;
    font-size: clamp(4rem, 15vw, 15rem); /* Oversized text */
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    cursor: pointer;
    letter-spacing: -0.05em;
    line-height: 1;
    margin: 0;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
    will-change: transform;
    
    /* Neon glow base */
    text-shadow: 
        0 0 10px rgba(229, 9, 20, 0.5),
        0 0 20px rgba(229, 9, 20, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2);
}

/* Disintegrated State */
.glitch.disintegrated {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Constant glitch pseudo elements (Red & White) */
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

/* White/Grey glitch */
.glitch::before {
    left: 4px;
    z-index: -1;
    text-shadow: -2px 0 #ffffff;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

/* Red glitch */
.glitch::after {
    left: -4px;
    z-index: -2;
    text-shadow: -2px 0 #E50914, 2px 2px rgba(255, 255, 255, 0.5);
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Animations */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
    10% { clip-path: inset(50% 0 10% 0); transform: translate(2px, -1px); }
    20% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 2px); }
    30% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(30% 0 40% 0); transform: translate(-1px, 1px); }
    50% { clip-path: inset(60% 0 20% 0); transform: translate(2px, 1px); }
    60% { clip-path: inset(15% 0 70% 0); transform: translate(-2px, -1px); }
    70% { clip-path: inset(90% 0 5% 0); transform: translate(1px, 2px); }
    80% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, -2px); }
    90% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 1px); }
    100% { clip-path: inset(25% 0 55% 0); transform: translate(-1px, -1px); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(2px, -1px); }
    15% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, 2px); }
    30% { clip-path: inset(30% 0 40% 0); transform: translate(2px, 1px); }
    45% { clip-path: inset(60% 0 20% 0); transform: translate(-1px, -1px); }
    60% { clip-path: inset(15% 0 70% 0); transform: translate(2px, 2px); }
    75% { clip-path: inset(90% 0 5% 0); transform: translate(-2px, -2px); }
    90% { clip-path: inset(40% 0 50% 0); transform: translate(1px, -1px); }
    100% { clip-path: inset(70% 0 10% 0); transform: translate(-2px, 1px); }
}

/* =========================================
   Bottom Bar 
========================================= */
.footer-bottom {
    border-top: 1px solid rgba(229, 9, 20, 0.1);
    padding: 0.85rem clamp(1rem, 4vw, 1.5rem);
    position: relative;
    background: linear-gradient(180deg, transparent, rgba(229, 9, 20, 0.05));
}

.footer-bottom__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
}

.footer-text {
    font-family: 'Courier New', Courier, monospace;
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.footer-copy {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-highlight {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 15px rgba(229, 9, 20, 0.6);
}

.footer-socials {
    align-items: center;
    justify-self: center;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 0.55rem;
    min-width: 0;
}

.footer-link-separator {
    color: #555;
    font-size: 0.75rem;
}

.footer-legal-link {
    color: #888;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-decoration: none;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    white-space: nowrap;
}

.footer-legal-link:hover,
.footer-legal-link:focus-visible {
    color: #E50914;
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.6);
}

/* Social icons override for cyberpunk theme */
.footer-social-link {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(229, 9, 20, 0);
}

.footer-social-link:hover {
    color: #E50914;
    transform: translateY(-3px) scale(1.1);
    text-shadow: 0 0 10px #E50914, 0 0 20px #E50914;
}

@media (max-width: 767px) {
    .footer-bottom__inner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }

    .footer-copy {
        white-space: normal;
    }

    .footer-socials,
    .footer-links {
        justify-self: center;
    }
}
