/* Global Matrix Aesthetics */
:root {
    --matrix-green: #00FF41;
    --matrix-dark: #00CC33;
    --matrix-bg: #0a0a0a;
    --matrix-surface: #111111;
    --matrix-dim: rgba(0, 255, 65, 0.1);
    --neon-glow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.3);
    --text-glow: 0 0 5px rgba(0, 255, 65, 0.8);
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--matrix-green) var(--matrix-bg);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--matrix-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 3px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--matrix-bg);
    color: var(--matrix-green);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
}

/* Phosphorescent Text Effect */
.phosphor {
    text-shadow: var(--text-glow);
    color: var(--matrix-green);
}

/* Neon Border Utilities */
.border-neon {
    border: 1px solid var(--matrix-green);
    box-shadow: var(--neon-glow);
}

.border-neon-thin {
    border: 1px solid rgba(0, 255, 65, 0.3);
}

/* Glitch Effect Base */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(12px, 9999px, 52px, 0); }
    20% { clip: rect(65px, 9999px, 11px, 0); }
    40% { clip: rect(26px, 9999px, 89px, 0); }
    60% { clip: rect(78px, 9999px, 14px, 0); }
    80% { clip: rect(33px, 9999px, 66px, 0); }
    100% { clip: rect(55px, 9999px, 99px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 99px, 0); }
    20% { clip: rect(12px, 9999px, 52px, 0); }
    40% { clip: rect(78px, 9999px, 14px, 0); }
    60% { clip: rect(33px, 9999px, 66px, 0); }
    80% { clip: rect(26px, 9999px, 89px, 0); }
    100% { clip: rect(44px, 9999px, 11px, 0); }
}

/* Scanline Effect */
.scanlines {
    position: relative;
    overflow: hidden;
}

.scanlines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 65, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* HUD Elements */
.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--matrix-green);
}

.hud-corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* Data Stream Animation */
.data-stream {
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0, 255, 65, 0.1) 50%, 
        transparent 100%);
    animation: stream 3s linear infinite;
}

@keyframes stream {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* Agent Badge Pulse */
.agent-pulse {
    animation: agent-glow 2s ease-in-out infinite;
}

@keyframes agent-glow {
    0%, 100% { box-shadow: 0 0 5px var(--matrix-green); }
    50% { box-shadow: 0 0 20px var(--matrix-green), 0 0 40px var(--matrix-dark); }
}

/* Typing Cursor */
.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Video Container Aspect Ratio */
.video-container {
    position: relative;
    background: #000;
    overflow: hidden;
}

.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

/* Glassmorphism with Matrix tint */
.glass-matrix {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 65, 0.2);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .mobile-full {
        width: 100vw;
        height: 100vh;
    }
    
    .hide-mobile {
        display: none;
    }
}

@media (min-width: 769px) {
    .desktop-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
    }
    
    .hide-desktop {
        display: none;
    }
}

/* Binary Background Pattern */
.binary-bg {
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Loading Decryption Effect */
.decrypt-text {
    position: relative;
    display: inline-block;
}

.decrypt-text::before {
    content: attr(data-scramble);
    position: absolute;
    top: 0;
    left: 0;
    color: var(--matrix-dark);
    opacity: 0.5;
}

/* Hover States */
.hover-matrix:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Active Navigation State */
.nav-active {
    background: rgba(0, 255, 65, 0.15);
    border-left: 3px solid var(--matrix-green);
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1);
}

/* Code Block Styling */
.code-block {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--matrix-green);
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
}

.code-line {
    display: block;
    counter-increment: line;
}

.code-line::before {
    content: counter(line);
    display: inline-block;
    width: 2em;
    margin-right: 1em;
    color: rgba(0, 255, 65, 0.5);
    text-align: right;
}

.syntax-keyword { color: #ff00c1; }
.syntax-string { color: #00fff9; }
.syntax-comment { color: #666; font-style: italic; }
.syntax-function { color: #ffff00; }