body {
    background-color: #050505;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    color: #0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

html {
    height: -webkit-fill-available;
}

/* Base CRT effects */
.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

#matrixCanvas {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    z-index: -3;
    opacity: 0.7;
}

.scanlines, .noise, .vignette {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.scanlines {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.3));
    background-size: 100% 6px;
    z-index: -2;
    animation: scroll-scanlines 10s linear infinite;
}

@keyframes scroll-scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 100vh; }
}

.noise {
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.07;
    z-index: -1;
}

.vignette {
    background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
    z-index: -1;
}

/* Boot Screen */
#boot-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    font-size: 1rem;
    color: #0f0;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    word-break: break-word;
}
#boot-text {
    line-height: 1.5;
}

/* Fake Terminal Logs */
.fake-terminal {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 350px;
    font-size: 0.75rem;
    color: rgba(0, 255, 0, 0.4);
    z-index: -1;
    pointer-events: none;
    line-height: 1.4;
    text-shadow: 0 0 2px #0f0;
}

main {
    background: rgba(5, 5, 5, 0.85);
    padding: 30px;
    border: 1px solid #0f0;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.15), inset 0 0 15px rgba(0, 255, 0, 0.1);
    border-radius: 2px;
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 850px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    margin: max(5vh, 30px) auto;
}

/* Corner decorations for main box */
main::before, main::after {
    content: '';
    position: absolute;
    width: 15px; height: 15px;
    border: 2px solid #0f0;
    pointer-events: none;
}
main::before {
    top: -2px; left: -2px;
    border-right: none; border-bottom: none;
}
main::after {
    bottom: -2px; right: -2px;
    border-left: none; border-top: none;
}

.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-wrap {
    position: relative;
    padding: 3px;
    border: 1px dashed #0f0;
    border-radius: 50%;
    display: inline-block;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar {
    width: 180px;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    filter: grayscale(100%) contrast(150%) sepia(100%) hue-rotate(80deg) brightness(0.8);
    transition: filter 0.3s;
}

.avatar-wrap:hover .avatar,
.avatar-wrap:active .avatar {
    filter: grayscale(100%) contrast(200%) sepia(100%) hue-rotate(0deg) brightness(1.2); 
}

/* Avatar glitch effect overlay */
.avatar-glitch-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('avatar.jpg') center/cover;
    filter: grayscale(100%) contrast(150%) sepia(100%) hue-rotate(300deg);
    mix-blend-mode: exclusion;
    opacity: 0;
    pointer-events: none;
}
.avatar-wrap:hover .avatar-glitch-layer,
.avatar-wrap:active .avatar-glitch-layer {
    animation: img-glitch 0.2s steps(2) infinite;
}

@keyframes img-glitch {
    0% { transform: translate(2px, -2px); opacity: 0.5; }
    50% { transform: translate(-2px, 2px); opacity: 0.8; }
    100% { transform: translate(0, 0); opacity: 0.3; }
}

.main-text {
    margin-top: 20px;
    color: #0f0;
    font-size: 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-shadow: 0 0 8px #0f0;
    text-align: center;
    font-weight: bold;
}

.terminal-prompt {
    color: #0f0;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
}

.text-content {
    word-break: break-word;
}

.quote-container {
    margin-top: 15px;
    color: #00aa00;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
}

.terminal-comment {
    color: #0a0;
    text-shadow: none;
    font-style: normal;
    opacity: 0.8;
    word-break: break-word;
}

.cyber-divider {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(90deg, #0f0, #0f0 10px, transparent 10px, transparent 20px);
    margin: 25px 0;
    opacity: 0.5;
}

.buttons-div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hacker-btn {
    cursor: pointer;
    width: 160px;
    height: 50px;
    background: transparent;
    border: 1px solid #0f0;
    font-size: 0.9rem;
    color: #0f0;
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    box-shadow: 0 0 5px rgba(0,255,0,0.1);
    position: relative;
    overflow: hidden;
}

.hacker-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: rgba(0, 255, 0, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.hacker-btn:hover::before, .hacker-btn:active::before {
    left: 0;
}

.hacker-btn:hover, .hacker-btn:active {
    color: #fff;
    box-shadow: 0 0 20px #0f0, inset 0 0 10px #0f0;
    text-shadow: 0 0 5px #fff;
}

.hacker-btn:active {
    transform: scale(0.95);
    background: #0f0;
    color: #000;
}

#lang-btn {
    width: 100px;
}

.cursor {
    display: inline-block;
    width: 10px;
    animation: blink 1s step-end infinite;
    background: #0f0;
    color: transparent;
    margin-left: 5px;
}

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

/* Full Screen Glitch Effect on Lang Change */
.glitch-screen {
    animation: screen-glitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
    filter: invert(1) hue-rotate(180deg);
}
@keyframes screen-glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-5px, 5px) skewX(5deg) }
    40% { transform: translate(5px, -5px) skewX(-5deg) }
    60% { transform: translate(-5px, -5px) skewX(2deg) }
    80% { transform: translate(5px, 5px) skewX(-2deg) }
    100% { transform: translate(0) }
}

.glitch-text {
    position: relative;
    display: inline-block;
    color: #fff;
    text-shadow: 0 0 10px #0f0;
    word-break: break-word;
    white-space: normal;
}

.glitch-anim {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: transparent;
}
.glitch-anim::before, .glitch-anim::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #0f0;
    white-space: nowrap;
}
.glitch-anim::before {
    left: 2px;
    text-shadow: -2px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}
.glitch-anim::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes glitch-anim {
    0% { clip: rect(13px, 9999px, 86px, 0); }
    20% { clip: rect(61px, 9999px, 12px, 0); }
    40% { clip: rect(31px, 9999px, 52px, 0); }
    60% { clip: rect(98px, 9999px, 21px, 0); }
    80% { clip: rect(3px, 9999px, 80px, 0); }
    100% { clip: rect(33px, 9999px, 19px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(3px, 9999px, 75px, 0); }
    40% { clip: rect(15px, 9999px, 11px, 0); }
    60% { clip: rect(59px, 9999px, 85px, 0); }
    80% { clip: rect(41px, 9999px, 92px, 0); }
    100% { clip: rect(89px, 9999px, 21px, 0); }
}
@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-10deg); }
    40% { transform: skew(10deg); }
    60% { transform: skew(-5deg); }
    80% { transform: skew(5deg); }
    100% { transform: skew(0deg); }
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    body {
        align-items: flex-start; /* Better for tall scrolling content */
    }
    
    main {
        width: 92%;
        padding: 20px 15px;
        margin: 20px auto;
    }

    .main-text {
        font-size: 1.1rem;
        flex-direction: column; /* Stack prompt and name */
        gap: 5px;
    }

    .terminal-prompt {
        margin-right: 0;
        font-size: 0.9rem;
        opacity: 0.8;
    }
    
    .text-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .quote-container {
        font-size: 0.85rem;
    }

    .avatar {
        width: 140px;
        height: 140px;
    }

    .buttons-div {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .hacker-btn {
        width: 100%;
        max-width: none;
    }

    #lang-btn {
        width: 100%;
        max-width: none;
    }

    .fake-terminal {
        display: none !important;
    }
    
    #boot-screen {
        font-size: 0.85rem;
    }
}