:root {
    --primary-color: #f4bf0d;
    --glass-bg: rgba(20, 20, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #0a0a0a;
    /* Match garage dark theme */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);

    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- 3D Background --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* --- Initial Setup / Loading Screen --- */
/* Removed setup screen styles */

/* --- Portfolio Layout --- */
#portfolio-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* Sidebar */
aside {
    width: 300px;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--glass-border);
    padding: 40px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.profile-header {
    margin-bottom: 40px;
}

.profile-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.profile-header .role {
    display: block;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin-bottom: 15px;
}

nav button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    padding: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    width: 100%;
    /* Full width for mobile tap targets */
}

nav button::before {
    content: '';
    display: block;
    width: 0px;
    height: 2px;
    background: var(--primary-color);
    margin-right: 10px;
    transition: width 0.2s;
}

nav button:hover,
nav button.active {
    color: white;
}

nav button.active::before {
    width: 20px;
}

/* Mobile Menu Button - Hidden on desktop */
#mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#mobile-menu-btn:hover {
    border-color: var(--primary-color);
    background: rgba(255, 51, 51, 0.1);
}

.contact-mini {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-mini a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-top: 5px;
    transition: color 0.2s;
}

.contact-mini a:hover {
    color: white;
}

/* Language Switcher */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 30;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.lang-btn:hover:not(.active) {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Content Area */
main {
    flex: 1;
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.section-card {
    position: absolute;
    top: 50%;
    right: 50px;
    transform: translateY(-50%) translateX(50px);
    width: 450px;
    max-height: 80vh;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    box-sizing: border-box;
    pointer-events: auto;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.section-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Close Button for Mobile/Clean View */
.close-card-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: none;
}

.close-card-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* Show Info Button */
#show-info-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    font-weight: 500;
    z-index: 20;
}

#show-info-btn:hover {
    border-color: var(--primary-color);
}

/* Scrollbar styling */
.section-card::-webkit-scrollbar {
    width: 6px;
}

.section-card::-webkit-scrollbar-track {
    background: transparent;
}

.section-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

h2 {
    margin-top: 0;
    font-weight: 300;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    padding-right: 20px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: white;
}

.subtitle {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: block;
}

p {
    line-height: 1.6;
    color: #ddd;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.tag:hover {
    border-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 30px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.loaded #portfolio-ui {
    opacity: 1;
}

/* --- Debug UI --- */
#debug-ui {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    color: #0f0;
    border: 1px solid #0f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
}

.fps-counter {
    font-size: 1.2rem;
    font-weight: bold;
}

.quality-selector {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    cursor: pointer;
}

.loaded aside {
    transform: translateX(0);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    aside {
        width: 100%;
        height: auto;
        position: absolute;
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        transform: translateY(100%);
        flex-direction: row;
        padding: 15px 20px;
        align-items: center;
        justify-content: space-between;
        z-index: 20;
    }

    .loaded aside {
        transform: translateY(0);
    }

    .contact-mini {
        display: none;
    }

    .profile-header {
        margin: 0;
    }

    .profile-header h1 {
        font-size: 1.1rem;
    }

    .profile-header .role {
        font-size: 0.75rem;
    }

    /* Mobile Nav Styling */
    nav {
        display: none;
        position: absolute;
        bottom: 100%;
        /* Pop up from bottom bar */
        left: 0;
        width: 100%;
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border);
        padding: 20px;
        box-sizing: border-box;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    nav.mobile-visible {
        display: block;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    nav ul li {
        margin-bottom: 10px;
    }

    nav button {
        padding: 10px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Show Hamburger on Mobile */
    #mobile-menu-btn {
        display: block;
    }

    .section-card {
        width: 90%;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -55%) scale(0.95);
        max-height: 60vh;
        padding: 25px;
    }

    .section-card.active {
        transform: translate(-50%, -55%) scale(1);
    }

    .close-card-btn {
        display: block;
    }

    /* Fix Language Switcher Overlap */
    .lang-switch {
        top: auto;
        bottom: 100%;
        right: 20px;
        margin-bottom: 15px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}