html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    font-family: "Lucida Sans Typewriter", "Lucida Console", monospace;
    color: white;
}

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

.flesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit:fill;
    z-index: -2;
    pointer-events: none;
    opacity: 0.15;
}

.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;
}

.page-content::after {
    height: 360px;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.192));
}

.text-content {
    flex: 1;
}

.portrait {
    max-width: 350px;
    width: 100%;
    height: auto;
    opacity: 1;
    position: relative;
}

.portrait:hover {
    animation: none; /* Stop intro animation on hover */
}

.portrait:hover::before,
.portrait:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/portrat.png');
    background-size: cover;
    background-position: center;
    pointer-events: none;
}

.portrait:hover::before {
    background-color: rgba(0, 255, 255, 0.5);
    mix-blend-mode: screen;
    animation: reverse-position 0.1s infinite;
}

.portrait:hover::after {
    background-color: rgba(255, 0, 0, 0.5);
    mix-blend-mode: screen;
    animation: forward-position 0.1s infinite;
}

.promotion {
    position: absolute;
    width: 100%;
    top: 670px;
    left: 27%;
    background: rgba(0, 0, 0, 0.7);
    min-width: 450px;
    max-width: 600px;
    border: 7px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    padding-right: 250px;
    padding-left: 50px;
}

.vtuber {
    position: absolute;
    max-width: 250px;
    right: 480px;
    top: 615px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.creator {
    color: white;
    text-align: left;
}

.box {
    display: block;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    font-size: 20px;
    margin: 20px 0;
    border-radius: 12px;
    background: transparent;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
    stroke: black;
    stroke-color: black;
    stroke-width: 25px;
    color: #ffffff;
}

@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;
}

.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;
    }
}