:root {
    --bg-color: #000000;
    --bg-card: #252526;
    --bg-modal: #1e1e1e;
    --bg-hud: rgba(0, 0, 0, 0.7);
    --bg-overlay: rgba(0, 0, 0, 0.95);

    --text-primary: #d4d4d4;
    --text-light: #ffffff;
    --text-muted: #999999;
    --text-copyright: rgba(1, 1, 1, 0.5);

    --accent: #e2d8cf;
    --border-color: #333;
    --neon-green: #00ff00;

    --font-main: 'Montserrat', sans-serif;
    --font-pixel: 'Coral Pixels', monospace;
    --font-jersey: 'Jersey 10', sans-serif;

    --header-height: auto;
    --nav-size: 50px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 15px;

    --sprite-url: url('assets/hud-sprites.png');
    --sprite-size: 250px 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
    padding-right: 15px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

.coral-pixels-regular { font-family: var(--font-pixel); }
.jersey-10-regular { font-family: var(--font-jersey); }
.montserrat { font-family: var(--font-main); }
.highlight { color: var(--text-muted); }

header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--header-height);
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2.5rem;
    border-bottom: 2px solid var(--accent);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
}

.hud-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
}

#dialogue-box {
    background-color: rgb(226, 216, 207);
    border: 3px solid var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    color: black;
    font-size: 1.2rem;
    width: 93%;
    height: 40px;
    display: flex;
    align-items: center;
    font-family: var(--font-pixel);
}

.rpg-nav {
    display: flex;
    gap: 15px;
    background-color: var(--bg-hud);
    padding: 10px;
    border-radius: var(--radius-lg);
}

.nav-item,
.nav-button {
    display: block;
    width: var(--nav-size);
    height: var(--nav-size);
    background-image: var(--sprite-url);
    background-size: var(--sprite-size);
    background-repeat: no-repeat;
    background-position: 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-button {
    border-radius: 50%;
    border: none;
    background-color: transparent;
}

.nav-item.active,
.nav-item.active .nav-button {
    background-position-y: -50px;
}

#btn-home, #btn-home .nav-button         { background-position-x: 0; }
#btn-projects, #btn-projects-container .nav-button { background-position-x: -50px; }
#btn-contact                             { background-position-x: -100px; }
#btn-cv, #btn-cv-container .nav-button   { background-position-x: -150px; }
#btn-lang, #btn-lang-container .nav-button { background-position-x: -200px; }

.nav-item.has-submenu {
    position: relative;
    font-family: var(--font-pixel);
}

.submenu {
    position: absolute;
    top: 60px; left: 50%;
    transform: translateX(-50%);
    width: 150px;
    max-height: 300px;
    background-color: var(--accent);
    border: 2px solid var(--text-light);
    border-radius: 5px;
    padding: 5px 0;
    z-index: 1010;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;

    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.submenu::-webkit-scrollbar { display: none; }

.nav-item.open .submenu {
    opacity: 1;
    visibility: visible;
}

.submenu li { padding: 5px 10px; }
.submenu a { display: block; color: var(--text-light); font-size: 0.9rem; }
.submenu li.active,
.submenu li:hover { background-color: rgba(153, 153, 153, 0.3); }

main {
    padding: 140px 20px 0;
    max-width: 1400px;
    margin: 0 auto;
}

#hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    margin-bottom: 80px;
    min-height: 50vh;
    overflow: hidden;
    filter: brightness(0.8);
    flex-wrap: wrap;
}

#hero::before {
    content: "";
    position: absolute; inset: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-left, .hero-right {
    position: relative;
    z-index: 2;
}

.hero-left {
    width: 250px;
    flex-shrink: 0;
}

.profile-pic {
    width: 100%; height: 250px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid var(--text-light);
}

.hero-right {
    flex-grow: 1;
    max-width: 500px;
}

.hero-right h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-light);
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.hero-right p {
    padding-top: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

#projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.project-card {
    background-color: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.project-card:hover { transform: translateY(-3px); }

.gif-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    background: #000;
    overflow: hidden;
}

.project-gif {
    width: 100%; height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-light);
    padding: 8px 12px;
    font-size: 0.85rem;
    border-top: 2px solid #555;
    font-family: var(--font-pixel);
}

.project-title {
    margin-top: 15px;
    font-size: 1.4rem;
}
.project-title a { color: var(--text-light); }

footer {
    background-color: var(--accent);
    border-top: 3px solid var(--text-light);
    padding: 30px 20px;
    margin-top: 100px;
    text-align: center;
    color: black;
    font-size: 18px;
    font-family: var(--font-pixel);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-contact {
    display: inline-flex;
    background-color: #333;
    color: var(--text-light);
    padding: 12px 30px;
    font-weight: bold;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease-out;
    font-family: var(--font-main);
}
.btn-contact:hover { transform: scale(1.1); }

.footer-image {
    width: 45px; height: 45px;
    filter: brightness(1.2);
    margin: 0 5px;
    transition: transform 0.2s ease-out;
}
.footer-image:hover { transform: scale(1.1); }

.copyright {
    font-size: 0.9rem;
    color: var(--text-copyright);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(2px);
    overflow: auto;
    padding: 20px 0;
}

.modal-content {
    background-color: var(--bg-modal);
    margin: 3vh auto;
    padding: 20px;
    border: 2px solid #555;
    width: 90%; max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--radius-md);
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-view-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: 20px;
    background: #000;
}
.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
}

.scrollable-content {
    overflow-y: auto;
    padding-right: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    flex-grow: 1;
}

.close-btn {
    position: absolute;
    top: 10px; right: 20px;
    background: none; border: none;
    color: var(--text-light);
    font-size: 30px;
    cursor: pointer;
    z-index: 25;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(80, 80, 80, 0.7);
    color: var(--text-light);
    border: none;
    padding: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    border-radius: 5px;
    transition: background 0.2s;
}
.nav-arrow:hover { background: rgba(120, 120, 120, 0.9); }
.nav-arrow.left { left: -50px; }
.nav-arrow.right { right: -50px; }

#project-features-container { margin-top: 20px; }

.feature-block {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #1c1c1c;
}

.feature-block h4 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.feature-image {
    width: 100%;
    height: auto;
    border: 2px solid var(--neon-green);
    border-radius: var(--radius-sm);
    object-fit: cover;
}

@media (max-width: 768px) {
    #projects {
        grid-template-columns: 1fr; 
        gap: 30px; 
    }

    .logo {
        font-size: 1.2rem;
        line-height: 1.2; 
        text-align: center;
        width: 100%;
    }

    .hero-left {
        width: auto; 
    }

    .profile-pic {
        width: 200px;  
        height: 200px;
        border-width: 2px;
    }

    header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    .rpg-nav {
        width: 100%;
        justify-content: center;
    }
    main {
        padding-top: 220px;
    }
    #hero {
        margin-top: 20px;
        flex-direction: column;
        text-align: center;
        gap: 20px; 
        padding: 20px;
    }
    .hero-right h1 { font-size: 1.5rem; }
    
    .nav-arrow.left { left: -10px; }
    .nav-arrow.right { right: -10px; }
    .modal-content { width: 95%; margin: 1vh auto; }
}