html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    font-family: "Lucida Sans Typewriter", "Lucida Console", monospace;
    color: white;
}
.grass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit:fill;
    z-index: -2;
    pointer-events: none;
    opacity: 0.35;
}

body::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Infinite scrolling animation */
    animation: scrollBackdrop 20s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1000;
    transform: translateY(-100%);
    animation: slideDown 0.45s ease forwards;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.topbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.topbar-inner {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 14px 20px;
}

.topbar-button {
    color: rgb(62, 226, 29);
    text-decoration: none;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.topbar-button:hover {
    background-color: rgb(23, 107, 15);
    transform: translateY(-1px);
}

.page-content {
    position: relative;
    overflow: hidden;
    padding: 100px 40px 40px;
    width: 100%;
    margin: 0;
    background-image: url('assets/portbg.png'), linear-gradient(transparent, rgba(0, 0, 0, 0.89));
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 40px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes portraitIntro {
    0% {
        transform: translateX(100%);
        opacity: 0;
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    25% {
        transform: translateX(30%) skewX(-2deg);
        opacity: 0.6;
        filter: contrast(1.8) saturate(1.4) hue-rotate(12deg) blur(1px);
        clip-path: inset(8% 0 20% 0);
    }
    50% {
        transform: translateX(12%) skewX(2deg);
        opacity: 0.85;
        filter: contrast(1.3) saturate(1.2) hue-rotate(-8deg) blur(0.5px);
        clip-path: inset(0 12% 8% 0);
    }
    75% {
        transform: translateX(4%) skewX(-1deg);
        opacity: 0.95;
        filter: contrast(1.1) saturate(1.1) hue-rotate(2deg) blur(0.2px);
        clip-path: inset(0 0 0 0);
    }
    100% {
        transform: translateX(0);
        opacity: 1;
        filter: none;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes scrollBackdrop {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .page-content {
        flex-direction: column;
        padding: 100px 20px 40px;
        gap: 20px;
    }
    
    .portrait {
        max-width: 250px;
        order: -1; /* Move portrait above text on mobile */
    }
}

/* Collaborative Cursor Styles */
#remote-cursors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.remote-cursor {
    position: absolute;
    pointer-events: none;
    transition: all 0.1s ease-out;
    display: none;
}

.cursor-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.contact-content {
    top: 200px;
    text-align: center;
    
    z-index: 1; /* Ensure content is above background */
}

.contact-content p {
    position: absolute;
    left: 30%;
    font-size: 2.2em;
    max-width: 600px;
    margin: 0 auto;
    top: 700px;
}

.contact-content h1 {
    font-family: 'Courier New', Courier, monospace;
    position: absolute;
    left: 15%;
    top: 70px;
    font-size: 5em;
    margin-bottom: 0.5em;
    animation: flicker 3s linear infinite;
}
@keyframes flicker {
    0%, 100% { opacity: 1; }
    10%, 30%, 50%, 70% { opacity: 0.5; }
    20%, 40%, 60%, 80% { opacity: 0.8; }
}
.cursor-label {
    display: none; /* Hide user labels */
}

.cursor-active {
    animation: cursorPulse 0.2s ease-out;
}

@keyframes cursorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Hide cursors on mobile for performance */
@media (max-width: 768px) {
    #remote-cursors {
        display: none;
    }
}

.tv1 {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 350px;
    animation: tvFloat1 6s ease-in-out infinite;
}

@keyframes tvFloat1 {
    0%, 100% { transform: translateX(-10%) translateY(0); }
    50% { transform: translateX(-10%) translateY(-20px); }
}
.tv2 {
    position: absolute;
    top: 20%;
    left: 40%;
    width: 350px;
    animation: tvFloat2 8s ease-in-out infinite;
}

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

.tv3 {
    position: absolute;
    top: 20%;
    left: 80%;
    width: 350px;
    animation: tvFloat3 10s ease-in-out infinite;
}

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

.yt-link {
    position: absolute;
    top: 30%; /* Adjust as needed to align inside TV */
    left: 15%;
    width: 75px;
    transform: rotate(-20deg);
    height: auto;
    display: block;
    cursor: pointer;
    z-index: 2; /* above TV */
    animation: tvFloat1 6s ease-in-out infinite;
}

.twitter-link {
    position: absolute;
    top: 40%; /* Adjust as needed to align inside TV */
    left: 43%;
    width: 70px;
    height: auto;
    display: block;
    cursor: pointer;
    z-index: 2;
    animation: tvFloat2 8s ease-in-out infinite;
}

.twitch-link {
    position: absolute;
    top: 36%; /* Adjust as needed to align inside TV */
    left: 85%;
    max-width: 65px;
    height: auto;
    display: block;
    cursor: pointer;
    z-index: 2;
    animation: tvFloat3 10s ease-in-out infinite;
}
.tv1::after, .tv2::after, .tv3::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('assets/static.png'); /* static noise pattern image */
    background-repeat: repeat;
    opacity: 0.2; /* adjust for effect strength */
    pointer-events: none; /* allow clicks to pass through */
    mix-blend-mode: screen; /* optional for effect blending */
}


.scrolling-background {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 200%;
    height: 200%;
    background-image: url('assets/static_noise.gif');
    background-repeat: repeat;
    background-size: contain;
    animation: scrollUpLeft 2s linear infinite;
    z-index: -2;
    pointer-events: none;
}

/* Animate background to scroll up and left */
@keyframes scrollUpLeft {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -5000px -5000px; /* large value for continuous scrolling */
    }
}