:root {
    /* Base colors */
    --text-color: #F8F8F2;
    --background: #0a0a0a;

    /* Syntax highlighting */
    --syntax-pink: #FF0080;      /* keywords, operators */
    --syntax-blue: #66D9EF;      /* types */
    --syntax-yellow: #E6DB74;    /* strings */
    --syntax-green: #A6E22E;     /* methods, annotations */
    --syntax-orange: #FD971F;    /* fields */
    --syntax-gray: #6E7066;      /* comments */
    --syntax-white: #F8F8F2;     /* punctuation, identifiers */
    --syntax-purple: #8D81CE;
}

/* Base styles */
body {
    margin: 0;
    padding: 0;
    background-color: var(--background);
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-color);
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 40px;
    padding: 0;
    margin: 0;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.2s ease;
    display: inline-block;
    font-size: 1.2rem;
    padding: 8px 16px;
}

nav a:hover {
    transform: scale(1.1);
}

/* Layout */
.fading-line {
    height: 1px;
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(
        to right,
        transparent,
        var(--text-color),
        transparent
    );
}

main {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.code-editor {
    font-family: 'JetBrains Mono', monospace;
    line-height: 0.8;
    padding: 20px;
    background-color: transparent;
}

/* Code indentation */
.indent { margin-left: 20px; }
.double-indent { margin-left: 40px; }
.empty-line { height: 0.5em; }

/* Syntax highlighting - Java-like */
.keyword { 
    color: var(--syntax-pink); 
}

.type { 
    color: var(--syntax-blue);
    font-style: italic;
}

.string { 
    color: var(--syntax-yellow); 
}

.method { 
    color: var(--syntax-green); 
}

.field { 
    color: var(--syntax-pink);
}

.comment { 
    color: var(--syntax-gray); 
}

.annotation { 
    color: var(--syntax-green); 
}

.punctuation { 
    color: var(--syntax-white); 
}

.identifier { 
    color: var(--syntax-white); 
}

.operator { 
    color: var(--syntax-pink); 
}

.enum {
    color: var(--syntax-purple); 
}

/* Special syntax elements */
.package .identifier { 
    color: var(--syntax-white); 
}

.import .identifier { 
    color: var(--syntax-white); 
}

.class .identifier { 
    color: var(--syntax-blue); 
}

/* Content formatting */
.content .type { 
    color: var(--syntax-blue);
    font-style: italic;
}

.content .identifier { 
    color: var(--syntax-white); 
}

/* Project Gallery Styles */
.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.project-preview {
    width: 300px;
    height: 188px;
    border: 1px solid rgba(248, 248, 242, 0.2);  /* Softer border using your --text-color with opacity */
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    background-color: rgba(10, 10, 10, 0.5);  /* Slightly lighter than your --background */
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;  /* Make the image slightly transparent */
    transition: opacity 0.3s ease;
    filter: brightness(0.8) contrast(1.1);  /* Adjust image tone to match theme */
}

.project-tile:hover .project-preview img {
    opacity: 1;
    filter: brightness(1) contrast(1.1);
}

.project-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(10, 10, 10, 0.2) 0%,
        rgba(10, 10, 10, 0) 100%
    );
    pointer-events: none;
}

.project-tile {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
    transition: transform 0.2s ease;
}

.project-tile:hover {
    transform: translateX(10px);
}

.project-preview {
    width: 300px;
    height: 188px;
    border: 1px solid var(--text-color);
    flex-shrink: 0;
}

.project-code {
    display: flex;
    flex-direction: column;
    min-height: 188px; /* Match preview height */
    justify-content: center; /* Center content vertically */
    gap: 0.25rem;
}

.project-code p {
    margin: 0;
    line-height: 1.2;
}


.project-name {
    margin: 0.5rem 0;
    font-size: 1.25rem; /* Larger font size */
}

.project-description {
    margin: 0;
    line-height: 1.05;
    font-size: 1.1rem; /* Larger font size */
    text-align: center;
    max-width: 100%; /* Allow text to use full tile width */
    padding: 0 1rem;
}

/* Keep indentation for project code */
.project-code .double-indent {
    margin-left: 40px;
}

.project-code .triple-indent {
    margin-left: 60px;
}

/* Discord join button styling */
.join-button {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
}

.join-button:hover {
    transform: scale(1.05);
    background: rgba(165, 163, 163, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Add a subtle hint about clickability */
.join-button::before {
    content: "→";
    color: var(--syntax-gray);
    margin-right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.join-button:hover::before {
    opacity: 1;
}


/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
    display: none;
}

/* Ensure the body can scroll */
body {
    overflow-y: auto;          /* Enable vertical scrolling */
    min-height: 100vh;        /* Use full viewport height */
    position: relative;        /* Establish positioning context */
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    /* Navigation adjustments */
    nav ul {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 1rem;
        padding: 6px 12px;
    }

    /* Main content adjustments */
    main {
        padding: 0 15px;
        margin: 20px auto;
    }

    .code-editor {
        padding: 10px;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Add word-break to prevent overflow */
    .project-code p {
        word-break: break-word;
        white-space: pre-wrap;
    }    

    /* Project gallery adjustments */
    .project-tile {
        flex-direction: column;
        gap: 1rem;
    }

    .project-preview {
        width: 100%;
        height: auto;
        aspect-ratio: 16/10;
    }

    .project-code {
        min-height: auto;
    }

    /* Adjust indentation for smaller screens */
    .indent { 
        margin-left: 10px; 
    }
    
    .double-indent { 
        margin-left: 20px; 
    }
    
    .triple-indent { 
        margin-left: 30px; 
    }

    /* Adjust font sizes */
    .project-name {
        font-size: 1.1rem;
    }

    .project-description {
        font-size: 0.95rem;
    }

    /* Join button adjustments */
    .join-button {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

/* Additional adjustments for very small screens */
@media screen and (max-width: 480px) {
    nav ul {
        gap: 10px;
    }

    nav a {
        font-size: 0.9rem;
        padding: 4px 8px;
    }

    .code-editor {
        font-size: 0.8rem;
        line-height: 1.6;  /* Even larger line height for very small screens */
        padding: 8px; 
    }

    /* Minimize indentation further */
    .indent { 
        margin-left: 5px; 
    }
    
    .double-indent { 
        margin-left: 10px; 
    }
    
    .triple-indent { 
        margin-left: 15px; 
    }
}