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

body {
    background-color: #000;
    color: #fff;
    font-family: 'Minecraftia', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.dither-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.1;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgNCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSIyIiB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSIxIiB5PSIyIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSIzIiB5PSIzIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K");
    background-repeat: repeat;
    mix-blend-mode: overlay;
}

#p5-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 830px;
    height: 333px;
    z-index: 0;
    pointer-events: auto;
    background-color: transparent;
    flex-grow: 1;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
}

.title-section {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 100px;
    gap: 40px;
    padding-top: 50px;
}

.title-text {
    padding-top: 10px;
    flex-shrink: 0;
}

h1 {
    font-size: 48px;
    margin-bottom: 5px;
    position: relative;
    overflow: hidden;
}

h1::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.subtitle {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.description {
    font-size: 14px;
    opacity: 0.9;
}

h2 {
    font-size: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #555;
    padding-bottom: 5px;
    position: relative;
    overflow: hidden;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: underlineMove 3s ease-in-out infinite;
}

.content {
    display: flex;
    gap: 60px;
    margin-top: 40px;
}

.languages {
    flex: 1;
}

.language-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.language {
    background-color: #111;
    padding: 10px;
    text-align: center;
    border: 2px solid #333;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: bold;
    cursor: pointer;
}

.language:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.2);
    border-color: #555;
    box-shadow: 0 4px 8px rgba(255,255,255,0.1);
}

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

.language:hover::before {
    left: 100%;
}

.language:nth-child(1) {
    background: linear-gradient(45deg, #306998, #FFD43B, #646464);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 1px rgba(255,255,255,0.1);
}

.language:nth-child(2) {
    background: linear-gradient(135deg, 
        #E8E8E8 0%,
        #E8E8E8 25%,
        #A0A0A0 25%,
        #A0A0A0 50%,
        #C0C0C0 50%,
        #C0C0C0 75%,
        #B0B0B0 75%,
        #B0B0B0 100%
    );
    background-size: 16px 16px;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pixelShimmer 3s steps(8) infinite;
    text-shadow: 
        0 0 1px rgba(255,255,255,0.2),
        0 1px 2px rgba(0,0,0,0.3);
}

.language:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.2), 
        transparent
    );
    transform: translateX(-100%);
}

.language:nth-child(3) {
    background: linear-gradient(45deg, #f89820, #E76F00, #5382A1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 1px rgba(255,255,255,0.1);
}

.filter-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #111;
    color: #fff;
    border: 2px solid #333;
    padding: 5px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    border-color: #555;
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: #333;
    border-color: #555;
}

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

.filter-btn:hover::before {
    left: 100%;
}

.projects {
    flex: 2;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project {
    background-color: #111;
    padding: 15px;
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
}

.project.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.project:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #555;
    box-shadow: 0 8px 16px rgba(255,255,255,0.1);
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.project:hover::before {
    left: 100%;
}

.project-image-container {
    width: 100%;
    height: 160px;
    overflow: hidden;
    margin-bottom: 15px;
    padding: 3px;
    background-color: #181818;
    border: 1px solid #333;
    position: relative;
    z-index: 2;
}

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transition: transform 0.3s ease;
    filter: grayscale(0.3);
}

.project-image-container:hover .project-image {
    transform: scale(1.1);
    filter: grayscale(0);
}

.placeholder-bg-1 {
    background-color: #2d3748;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
}

.placeholder-bg-2 {
    background-color: #744210;
    background-image: linear-gradient(90deg, #8b5a2b 50%, transparent 50%), linear-gradient(#a0612c 50%, #744210 50%);
    background-size: 20px 20px;
}

.placeholder-bg-3 {
    background: conic-gradient(from 0deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe, #667eea);
    background-size: 200% 200%;
    animation: rotateGradient 4s linear infinite;
}

.project h3 {
    margin-bottom: 10px;
    font-size: 16px;
    z-index: 2;
    position: relative;
}

.project p {
    margin-bottom: 15px;
    font-size: 12px;
    flex-grow: 1;
    z-index: 2;
    position: relative;
}

.project-tags {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    z-index: 2;
    position: relative;
}

.tag {
    background-color: #333;
    color: #fff;
    padding: 2px 6px;
    font-size: 10px;
    border: 1px solid #555;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #444;
    transform: scale(1.05);
}

.project-link {
    display: inline-block;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    font-size: 12px;
    align-self: flex-start;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.project-link:hover {
    background-color: #444;
    transform: translateY(-1px);
}

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

.project-link:hover::before {
    left: 100%;
}

.collabs-section {
    margin-top: 70px;
}

.collab-carousel {
    overflow: hidden;
    position: relative;
}

.collab-carousel::before,
.collab-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 70px;
    z-index: 3;
    pointer-events: none;
}

.collab-carousel::before {
    left: 0;
    background: linear-gradient(90deg, #000, transparent);
}

.collab-carousel::after {
    right: 0;
    background: linear-gradient(270deg, #000, transparent);
}

.collab-track {
    display: flex;
    gap: 20px;
    will-change: transform;
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.collab-card {
    flex: 0 0 300px;
    position: relative;
    overflow: visible;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    padding: 14px;
    min-height: 230px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.collab-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.045), transparent 58%);
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.collab-card img {
    width: 100%;
    height: 170px;
    object-fit: contain;
    display: block;
    filter: grayscale(1) contrast(1.35) brightness(0.82);
    image-rendering: pixelated;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease, opacity 0.45s ease;
    transform: scale(1);
    opacity: 0.82;
}

.collab-card:hover {
    transform: translateY(-2px);
}

.collab-card:hover::before {
    opacity: 0;
}

.collab-card:hover img {
    filter: grayscale(0) contrast(1) brightness(1);
    image-rendering: auto;
    transform: scale(1.08);
    opacity: 1;
}

.collab-popup {
    position: relative;
    width: 100%;
    transform: translateY(8px);
    z-index: 4;
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    text-align: center;
    text-shadow: 0 2px 4px #000, 0 0 8px #000;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.collab-card:hover .collab-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.social-links {
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
    color: #666;
}

.social-links a {
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.social-links a:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

.separator {
    margin: 0 5px;
    opacity: 0.7;
}

.game-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.control-btn {
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    border: 1px solid #333;
    padding: 5px 8px;
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: rgba(51,51,51,0.9);
    border-color: #555;
    transform: scale(1.05);
}

.bottom-gif-section {
    width: 100%;
    margin: 70px auto 0;
    display: flex;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.bottom-gif-section img {
    display: block;
    width: min(100%, 750px);
    height: auto;
    image-rendering: auto;
    filter: saturate(1.05) contrast(1.02);
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 16%,
        black 84%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 16%,
        black 84%,
        transparent 100%
    );
}

footer {
    margin-top: auto;
    padding-top: 40px;
    font-size: 12px;
    opacity: 0.7;
    text-align: center;
    transition: opacity 0.3s ease;
}

footer:hover {
    opacity: 1;
}

footer p {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .content {
        flex-direction: column;
        gap: 40px;
    }

    h1 {
        font-size: 36px;
        text-align: center;
    }

    .subtitle, .description {
        text-align: center;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-image-container {
        height: 140px;
    }

    .collabs-section {
        margin-top: 45px;
    }

    .collab-card {
        flex-basis: 220px;
        min-height: 190px;
    }

    .collab-card img {
        height: 130px;
    }

    .collab-popup {
        font-size: 11px;
    }

    .bottom-gif-section {
        margin-top: 45px;
    }

    .title-section {
        margin-bottom: 60px;
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding-top: 30px;
    }

    #p5-container {
        position: relative;
        flex-grow: 0;
        width: 90%;
        max-width: 400px;
        height: 250px;
        top: auto;
        right: auto;
        min-width: auto;
    }

    .game-controls {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 10px;
        justify-content: center;
    }
}

@keyframes titleShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes underlineMove {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes shimmer {
    0% { background-position: -200% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes shine {
    100% {
        transform: translateX(100%);
    }
}

@keyframes pixelShimmer {
    0% { background-position: 0 0; }
    100% { background-position: 32px 32px; }
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes terminalBlink {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0.55; }
}

.discord-button, .kofi-button {
    display: none;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#p5-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    filter: brightness(1.2);
}
