* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg-dark: #0f1012;
    --color-text-light: #C0C0C0;
    --color-accent-neon: #00FF99;
    --color-accent-blue: #00CFFF;
    --color-accent-red: #FF00FF;
    --color-border-grid: #2e3034;
    --font-mono: 'Inconsolata', 'Courier New', monospace;
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;
    padding: 20px;
    line-height: 1.6;
}

h1, h2 {
    font-weight: normal;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent-blue);
    text-shadow: 0 0 5px rgba(0, 207, 255, 0.4);
}

h1 { font-size: 1.8em; margin-bottom: 0.5em; }
h2 { font-size: 1.2em; margin-bottom: 0.8em; }
p, li { font-size: 0.9em; }

#grid-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: 
        repeating-linear-gradient(0deg, var(--color-border-grid), var(--color-border-grid) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(90deg, var(--color-border-grid), var(--color-border-grid) 1px, transparent 1px, transparent 20px);
    opacity: 0.15;
    animation: pulseGrid 20s infinite alternate linear;
}

@keyframes pulseGrid {
    from { background-size: 100% 100%; }
    to { background-size: 102% 102%; }
}

#main-header {
    border-bottom: 1px solid var(--color-border-grid);
    padding-bottom: 15px;
    margin-bottom: 30px;
}



#main-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

#main-nav a, #main-nav p {
    color: var(--color-text-light);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 1.2rem;
}

#main-nav a:hover,
#main-nav a.active {
    color: var(--color-accent-neon);
    border-bottom: 1px solid var(--color-accent-neon);
    background-color: rgba(0, 255, 153, 0.01);
}

#main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.module {
    padding: 20px;
    border: 2px solid var(--color-border-grid);
    background-color: rgba(15, 16, 18, 0.6);
    backdrop-filter: blur(2px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(0, 255, 153, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 90% 90%, rgba(0, 207, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


.module ul {
    list-style: none;
    margin-top: 10px;
}
.module ul li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--color-border-grid);
}
.module ul li:last-child {
    border-bottom: none;
}

/* ** NEW BIOS MENU STYLES ** */
.bios-menu-item {
    display: block;
    color: var(--color-text-light);
    text-decoration: none;
    padding: 2px 5px;
    margin: -2px -5px; /* To make padding part of the hover/focus area */
    transition: all 0.1s ease;
}

/* Styles for active/focused menu item (keyboard and mouse) */
.bios-menu-item:focus,
.bios-menu-item.selected {
    outline: none; /* Remove default focus outline */
    background-color: var(--color-accent-neon);
    color: var(--color-bg-dark); /* Dark text on neon background for that classic BIOS look */
    text-shadow: none;
    box-shadow: 0 0 5px var(--color-accent-neon);
    font-weight: bold;
}

/* Styles for list items in the core status module (Module B) - no need for strong tags anymore */
#bios-menu li strong {
    color: inherit;
    text-shadow: none;
}
/* ************************** */

/* Glitch Effect Styles */
.glitch-text {
    position: relative;
    display: inline-block;
    color: var(--color-accent-neon);
    text-shadow: 0 0 5px var(--color-accent-neon);
    overflow: hidden;
    /* This animation handles the aggressive distortion and color flicker */
    animation: data-corrupt-main 4s infinite alternate; 
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ensure the pseudo-elements are ready for the JS animation control */
    animation-play-state: paused; 
}

/* ::before layer - Blue channel shift and distortion */
.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--color-accent-blue);
    /* Faster vertical slice/clip path animation */
    animation: clip-slice 0.6s infinite linear alternate-reverse, data-corrupt-color 4s infinite alternate;
}

/* ::after layer - Red channel shift and distortion */
.glitch-text::after {
    left: -2px;
    text-shadow: 2px 0 var(--color-accent-red);
    /* Different speed for more chaotic overlap */
    animation: clip-slice 0.7s infinite linear alternate-reverse, data-corrupt-color 4s infinite alternate;
}

#main-title {
    display: flex;
    justify-content: center;
    /* Use the same core distortion animation for the main element */
    animation: data-corrupt-main 4s infinite alternate;
}

#main-title::before, #main-title::after {
    display: flex;
    justify-content: center;
}

/* --- Keyframe Definitions --- */

/* 1. Core Distortion/Corrupt Effect (Jitter and Skew) */
@keyframes data-corrupt-main {
    0%, 100% {
        transform: translate(0, 0) skewX(0deg);
        opacity: 1;
    }
    10% {
        transform: translate(2px, 1px) skewX(1deg);
        opacity: 0.95;
    }
    10.1% {
        transform: translate(-3px, 0) skewX(-2deg);
        opacity: 0.3; /* Quick black-out flash */
    }
    10.2% {
        transform: translate(0, 0) skewX(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(1px, -1px) skewX(0.5deg);
    }
    50.5% {
        transform: translate(-5px, 2px) skewX(4deg); /* Aggressive distortion jump */
        opacity: 0.8;
    }
    51% {
        transform: translate(0, 0) skewX(0deg);
        opacity: 1;
    }
}

/* 2. Color/Layer Corruption Effect (Faster Vertical Slices) */
@keyframes clip-slice {
    0% { clip-path: inset(80% 0 0 0); }
    10% { clip-path: inset(5% 0 85% 0); }
    20% { clip-path: inset(25% 0 65% 0); }
    30% { clip-path: inset(90% 0 0 0); }
    40% { clip-path: inset(10% 0 70% 0); }
    50% { clip-path: inset(55% 0 35% 0); }
    52% { clip-path: inset(0 0 100% 0); }
    54% { clip-path: inset(70% 0 10% 0); }
    100% { clip-path: inset(80% 0 0 0); }
}

/* 3. Text Jitter/Flicker (Used for H2s and P/LI elements) */
@keyframes dataFlicker {
    0%, 100% { opacity: 1; text-shadow: none; }
    1% { opacity: 0.5; text-shadow: 0 0 4px var(--color-accent-neon); }
    1.5% { opacity: 1; text-shadow: none; }
    4% { opacity: 0.3; text-shadow: 0 0 5px var(--color-accent-blue); }
    4.2% { opacity: 1; text-shadow: none; }
    10% { transform: translate(1px, 0); }
    10.1% { transform: translate(-1px, 0); }
    10.2% { transform: translate(0, 0); }
    15% { color: var(--color-accent-neon); }
    15.1% { color: var(--color-text-light); }
}