:root{
    --myColor: rgb(99, 99, 99);
}

.selector {
    width: 100%;
    height: 100%;
    view-timeline-name: --selector;
}

.selector .parralax {
    animation: indexer linear forwards;
    animation-range: entry 0% exit 100%;
    animation-timeline: --selector;
}

/* ── SUB-FOOTER (The Info Panels) ──────────────────────────── */
.sub-footer {
    font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Console', monospace;
    width: 100%;
    height: 45%;
    background-color: black;
    border-bottom: 0.01vw solid var(--myColor);
    display: flex;
    flex-direction: row;

    /* 1. Use a very dark, 85% opaque background */
    background: rgba(0, 0, 0, 0.75) !important; 
        
    /* 2. Optional: Add a slight blur to frost the topographic lines underneath */
    backdrop-filter: blur(6px) !important; 
    -webkit-backdrop-filter: blur(6px) !important; 
    
    /* 3. Add a subtle top border to separate it from the content above */
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Removed the hardcoded gap: 5% so flex can distribute space dynamically */
}

.subFooter-container {
    flex: 1; /* This tells all 4 columns to equally share the width of the screen */
    height: 100%;
    border-left: 0.01vw solid var(--myColor);
    display: flex;
    flex-direction: column;
    color: white;
    
    /* Use padding instead of margin to keep text away from the borders safely */
    padding-left: 2%; 
    padding-right: 2%;
    box-sizing: border-box; 
}

.subFooter-container .top {
    font-size: clamp(12px, 0.7vw, 16px) !important;
    margin-top: 10%;
    height: 35%;
    /* Removed width: 80% to stop the text from getting cut off */
}

.subFooter-container .bottom {
    font-size: clamp(13px, 1vw, 18px) !important;
    height: 45%;
    /* Removed width: 80% to stop the text from getting cut off */
}

/* ── First Column Specifics ── */
.subFooter-container#sfc1 {
    border-left: none;
    color: var(--myColor);
    flex: 1.5; /* Gives this specific column a little extra room for the long codes */
}

.subFooter-container#sfc1 .bottom {
    font-size: clamp(11px, 0.75vw, 14px) !important;
    /* This forces those super long JPG/WAV text strings to drop to the next line instead of clipping */
    word-wrap: break-word; 
    white-space: normal;
}

/* ── MAIN FOOTER (Where the Canvas Lives) ──────────────────── */
.footer {
    view-timeline-name: --footer;
    width: 100%;
    height: 100%;
}

.footer .parralax {
    z-index: -2;
    top: 0;
    /* IMPORTANT: Made this transparent so the canvas isn't blocked */
    background-color: transparent; 
    position: fixed;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0; 
    padding: 0; 
    border: none;
}

.footer-container {
    height: 100%;
    width: 100%;
    font-size: 40vw;
    color: white;
    /* CHANGE HERE: Force this container to be black instead of transparent */
    background-color: #000; 
    position: relative;
    overflow: hidden;
}

/* ── PERLIN NOISE CANVAS INTEGRATION ───────────────────────── */
#res-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
    pointer-events: auto; 
    display: block; 
    /* CHANGE HERE: Paint the canvas background black just to be absolutely foolproof */
    background-color: #000; 
}

/* ── THE TEXT ON TOP OF THE CANVAS ─────────────────────────── */
.footer-content {
    position: relative;
    z-index: 1; /* Puts the text on top of the canvas */
    pointer-events: none; /* Lets your mouse "click through" the text to warp the canvas */
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.footer .brand {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@keyframes indexer {
    0% {
        z-index: -1;
    }
    89% {
        z-index: -1;
    }
    90% {
        z-index: -3;
    }
    100% {
        z-index: -3;
    }
}

/* ═══════════════════════════════════════════════
   GLOBAL FIX — REMOVE DEAD SPACE BELOW FOOTER
═══════════════════════════════════════════════ */

/* 1. Remove any hidden margins pushing the page down */
html, body {
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Force the footer to hug its content and hide anything that spills out */
#footer {
    position: relative !important;
    height: auto !important; 
    min-height: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important; /* CRITICAL: Acts as scissors to cut off excess canvas */
}

/* 3. Lock the topographic canvas inside the footer boundaries */
#res-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important; /* Forces it to match the footer height, not the screen height */
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Ensure the sub-footer isn't secretly creating a gap */
.sub-footer {
    margin-bottom: 0 !important;
}

/* ═══════════════════════════════════════════════
   MOBILE OPTIMIZATION — FOOTER (FIXED SCALING)
═══════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    /* 1. Stack the 4 columns vertically instead of side-by-side */
    .sub-footer {
        flex-direction: column !important;
        height: auto !important;
        padding-bottom: 20px !important;
    }

    /* 2. Make each section take up the full width of the phone */
    .subFooter-container {
        width: 100% !important;
        border-left: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 30px 5% !important;
        box-sizing: border-box !important;
        min-height: auto !important;
    }

    /* 3. Rescale the microscopic fonts to readable Pixel (px) sizes */
    .subFooter-container .top {
        font-size: 16px !important;
        margin-bottom: 15px !important;
        height: auto !important;
        margin-top: 0 !important;
    }

    .subFooter-container .bottom {
        font-size: 14px !important;
        line-height: 1.8 !important;
        height: auto !important;
    }

    /* 4. Fix the specific console text block so long file names don't break the screen */
    .subFooter-container#sfc1 .bottom {
        font-size: 12px !important;
        word-wrap: break-word !important; 
        white-space: normal !important;
    }

    /* 5. Shrink the bottom-most canvas container so it doesn't leave a massive void */
    #footer {
        height: auto !important;
        min-height: 120px !important;
    }

    /* 1. Stop the Glitch Animation from slicing your text! */
    .subFooter-container .top,
    .subFooter-container .bottom,
    .subFooter-container .tglitch-animation {
        white-space: normal !important; /* Forces text to drop to a new line */
        word-wrap: break-word !important;
        overflow: visible !important;
    }

    /* 2. Shrink the header font slightly so long words fit better */
    .subFooter-container .top {
        font-size: 13px !important; /* Scaled down from 16px */
        letter-spacing: 0.1em !important; /* Slightly tighter spacing */
        margin-bottom: 15px !important;
        height: auto !important;
        margin-top: 0 !important;
    }

    /* 3. Absolutely crush any remaining space in the bottom footer container */
    #footer, 
    .parralax, 
    .footer-container {
        position: relative !important;
        height: auto !important;
        min-height: 0 !important; /* Kills the artificial height */
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 4. Ensure the canvas doesn't stretch past its container on mobile */
    #res-canvas {
        height: 100% !important;
        max-height: 100% !important;
        display: block !important;
    }
}

/* ═══════════════════════════════════════════════
   GLOBAL FIX — THE PERFECT FOOTER CLAMP
═══════════════════════════════════════════════ */

/* 1. The Footer container tightly hugs the text inside it */
#footer {
    position: relative !important;
    height: auto !important; 
    min-height: 0 !important; /* No artificial heights! */
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important; 
}

/* 2. The Canvas stretches to exactly match the text height */
#res-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

/* 3. The Text floats on top, dictating the exact height of the page */
.sub-footer {
    position: relative !important;
    z-index: 10 !important;
    padding-top: 60px !important; /* Provides breathing room inside the clamp */
    padding-bottom: 60px !important;
    margin-bottom: 0 !important;
    background: rgba(8, 10, 14, 0.10) !important; /* The smoked glass effect */
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}