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

:root {
    --primary-color: #00ff41;
    --secondary-color: #00d4ff;
    --dark-bg: #0a0e27;
    --darker-bg: #050814;
    --card-bg: #0f1729;
    --text-color: #e0e0e0;
    --accent-color: #ff2a6d;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--darker-bg);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Matrix Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Glitch Title Effect */
.glitch-wrapper {
    margin: 60px 0 20px;
    text-align: center;
}

.glitch {
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: var(--primary-color);
    letter-spacing: 0.5em;
    text-shadow: 
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color),
        0 0 80px var(--primary-color);
    animation: glitch 3s infinite;
}

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

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

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--secondary-color);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 3s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%, 90%, 100% {
        opacity: 1;
    }
    93% {
        opacity: 0.7;
        transform: skew(-0.5deg, -0.9deg);
    }
    95% {
        opacity: 1;
        transform: skew(0.8deg, -0.1deg);
    }
}

@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    5% { clip: rect(12px, 9999px, 59px, 0); }
    10% { clip: rect(48px, 9999px, 29px, 0); }
    15% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(63px, 9999px, 27px, 0); }
    25% { clip: rect(34px, 9999px, 55px, 0); }
    30% { clip: rect(86px, 9999px, 73px, 0); }
    35% { clip: rect(20px, 9999px, 20px, 0); }
    40% { clip: rect(26px, 9999px, 60px, 0); }
    45% { clip: rect(25px, 9999px, 66px, 0); }
    50% { clip: rect(57px, 9999px, 98px, 0); }
    55% { clip: rect(5px, 9999px, 46px, 0); }
    60% { clip: rect(82px, 9999px, 31px, 0); }
    65% { clip: rect(54px, 9999px, 27px, 0); }
    70% { clip: rect(28px, 9999px, 99px, 0); }
    75% { clip: rect(45px, 9999px, 45px, 0); }
    80% { clip: rect(23px, 9999px, 85px, 0); }
    85% { clip: rect(54px, 9999px, 96px, 0); }
    90% { clip: rect(17px, 9999px, 22px, 0); }
    95% { clip: rect(34px, 9999px, 42px, 0); }
    100% { clip: rect(25px, 9999px, 47px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

/* Subtitle */
.subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 60px;
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hex-code {
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.separator {
    color: var(--accent-color);
}

/* Assembly Box */
.assembly-box {
    background: linear-gradient(135deg, var(--card-bg) 0%, #1a1f3a 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 30px;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    animation: pulse-border 3s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 255, 65, 0.3),
            inset 0 0 20px rgba(0, 255, 65, 0.1);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(0, 255, 65, 0.5),
            inset 0 0 30px rgba(0, 255, 65, 0.2);
    }
}

.assembly-line {
    font-size: 1.5rem;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.address {
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

.opcode {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 2rem;
    text-shadow: 0 0 20px var(--primary-color);
    letter-spacing: 0.3em;
}

.instruction {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.info-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #0d1220 100%);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    transition: left 0.5s ease;
}

.info-card:hover::before {
    left: 100%;
}

.info-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(0, 255, 65, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.info-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.info-card p {
    color: var(--text-color);
    margin: 15px 0;
}

.info-card code {
    display: inline-block;
    background: rgba(0, 255, 65, 0.1);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

/* Binary Display */
.binary-display {
    background: var(--card-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 40px;
    margin: 60px auto;
    max-width: 700px;
    text-align: center;
}

.binary-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.byte {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    padding: 15px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.byte::before {
    content: attr(data-byte);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: normal;
}

.byte:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--secondary-color);
}

.binary-label {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    flex-wrap: wrap;
}

/* Disassembly Section */
.disassembly-section {
    margin: 60px 0;
}

.disassembly-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-shadow: 0 0 20px var(--primary-color);
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.breakdown-item {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.breakdown-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.4);
}

.breakdown-header {
    background: linear-gradient(135deg, var(--primary-color), #00aa33);
    color: var(--darker-bg);
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    padding: 30px;
    letter-spacing: 0.5em;
}

.breakdown-body {
    padding: 30px;
}

.breakdown-body p {
    margin: 10px 0;
}

.breakdown-body strong {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* Console Section */
.console-section {
    background: #000;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 60px auto;
    max-width: 900px;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}

.console-header {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--primary-color);
}

.console-header span:first-child {
    color: #ff5f56;
    font-size: 1.2rem;
    letter-spacing: 5px;
}

.console-body {
    padding: 20px;
    font-size: 1.1rem;
    min-height: 150px;
}

.console-line {
    margin: 10px 0;
    color: var(--text-color);
}

.console-line.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.prompt {
    color: var(--secondary-color);
    margin-right: 10px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--primary-color);
    animation: blink 1s infinite;
    margin-left: 5px;
}

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

/* Footer */
footer {
    text-align: center;
    margin-top: 80px;
    padding: 40px 20px;
    border-top: 2px solid rgba(0, 255, 65, 0.3);
}

footer p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.footer-hex {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 3rem;
    font-weight: bold;
}

.footer-hex span {
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

.footer-hex span:nth-child(1) { animation-delay: 0s; }
.footer-hex span:nth-child(2) { animation-delay: 0.2s; }
.footer-hex span:nth-child(3) { animation-delay: 0.4s; }
.footer-hex span:nth-child(4) { animation-delay: 0.6s; }
.footer-hex span:nth-child(5) { animation-delay: 0.8s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .glitch {
        font-size: 4rem;
        letter-spacing: 0.2em;
    }
    
    .subtitle {
        flex-direction: column;
        gap: 10px;
    }
    
    .assembly-line {
        flex-direction: column;
        gap: 10px;
    }
    
    .opcode {
        font-size: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .binary-row {
        flex-direction: column;
        align-items: center;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
}
