:root {
    --bg-color: #000000;
    /* Deep Black */
    --text-color: #ffffff;
    /* White */
    --accent-color: #aaaaaa;
    /* Light Grey */
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-serif: 'Georgia', serif;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Main container handles scroll */
}

#main-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Background: 3D Canvas */
#canvas-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow-x: hidden;
}

#header-container {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#home-link {
    /* Removed fixed positioning as it's now in container */
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

#header-subtitle {
    font-size: 0.85rem;
    color: #888;
    font-family: var(--font-main);
    letter-spacing: 0.05em;
    pointer-events: none;
    /* Non-clickable */
}

#footer-credit {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    color: #666;
    font-size: 0.8rem;
    font-family: var(--font-main);
    z-index: 1000;
    opacity: 0.7;
}

#home-link:hover {
    opacity: 1;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

/* Foreground: Content Overlay */
#content-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    /* Occupy right half */
    height: 100%;
    overflow-y: auto;
    padding: 20vh 4rem 4rem 4rem;
    /* Increased top padding to clear navbar */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align to top to respect padding */
    z-index: 10;
    /* Optional: subtle gradient to make text readable */
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.9) 20%);
}

/* Navigation */
#main-nav {
    position: fixed;
    top: 2rem;
    right: 4rem;
    z-index: 1000;
}

#main-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

#main-nav a {
    text-decoration: none;
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon {
    display: none;
    /* Hidden on desktop */
}

.nav-text {
    display: block;
    /* Visible on desktop */
}

#main-nav a:hover,
#main-nav a.active {
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Expandable Cards (Projects & Readings) */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    /* Remove underline for links */
    color: inherit;
    /* Inherit text color */
    display: block;
    /* Ensure anchor behaves like block */
}

.card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Awards List */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.award-item {
    padding: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.02), transparent);
    transition: all 0.3s ease;
}

.award-item:hover {
    border-left-color: var(--text-color);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(5px);
}

.award-content h3 {
    font-size: 1.2rem;
    margin: 0 0 0.3rem 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.award-subtitle {
    margin: 0 0 0.8rem 0;
    font-size: 0.95rem;
    color: var(--accent-color);
    font-style: italic;
}

.award-details {
    padding-left: 1rem;
    color: #ccc;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
    list-style-type: none;
    /* Remove default bullets */
}

.award-details li {
    position: relative;
    padding-left: 1rem;
}

.award-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    color: var(--text-color);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 0.2rem;
}

.card-arrow {
    transition: transform 0.3s;
    font-size: 1rem;
    color: var(--accent-color);
}

.card:hover .card-arrow {
    transform: translate(2px, -2px);
    color: var(--text-color);
}

/* Typography */
#main-title {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: normal;
    margin: 0 0 1rem 0;
    line-height: 1;
}

#subtitle {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0 0 3rem 0;
    font-weight: normal;
}

#bio-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    color: #cccccc;
}

#bio-text p {
    margin-bottom: 1.5rem;
}

#bio-text ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

#bio-text li {
    margin-bottom: 0.5rem;
}

.cta {
    margin-top: 3rem;
    font-style: italic;
}

#social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: var(--text-color);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-underline-offset: 4px;
}

a:hover {
    color: white;
}

/* Dynamic Content Section */
#dynamic-content {
    display: none;
    /* Hidden by default */
}

#dynamic-content.visible {
    display: block;
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }

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

#back-btn {
    background: none;
    border: none;

    #reset-btn {
        position: absolute;
        bottom: 30px;
        left: 30px;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.5s;
        font-size: 0.9rem;
        border: 1px solid #333;
        padding: 10px 15px;
        background: rgba(0, 0, 0, 0.5);
    }

    #reset-btn.visible {
        opacity: 0.7;
    }

    #reset-btn:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
    }

    #instructions {
        position: absolute;
        bottom: 20px;
        width: 100%;
        text-align: center;
        font-size: 0.7rem;
        color: #555;
        pointer-events: none;
    }

    /* Scrollbar styling */
    ::-webkit-scrollbar {
        width: 5px;
    }

    ::-webkit-scrollbar-track {
        background: #000;
    }

    ::-webkit-scrollbar-thumb {
        background: #333;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    /* End of #back-btn */
}

@media (max-width: 768px) {
    #content-wrapper {
        width: 100%;
        left: 0;
        /* More subtle gradient: Transparent at top, darker at bottom */
        background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
        pointer-events: auto;
        /* Enable scrolling */
        /* Let clicks pass through to canvas where possible */
        padding: 8rem 2rem 6rem 2rem;
        /* Top clearance for header, bottom for navbar */
    }

    /* Enable interaction for content elements */
    #content-wrapper>* {
        pointer-events: auto;
    }

    #main-title {
        font-size: 3rem;
    }

    /* Mobile Bottom Navbar */
    #main-nav {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        padding: 1rem 0;
        display: flex;
        justify-content: center;
    }

    #main-nav ul {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        margin: 0;
        padding: 0;
        gap: 0;
    }

    #main-nav li {
        margin: 0;
    }

    #main-nav a {
        font-size: 0.8rem;
        padding: 0.5rem;
        color: #888;
    }

    #main-nav a.active {
        color: white;
    }

    .nav-icon {
        display: block;
        /* Visible on mobile */
        font-size: 1.5rem;
        font-weight: normal;
        /* Ensure not bold */
        -webkit-font-smoothing: antialiased;
        /* Make font look thinner */
        -moz-osx-font-smoothing: grayscale;
    }

    .nav-text {
        display: none;
        /* Hidden on mobile */
    }

    /* Hide footer credit on mobile to save space */
    #footer-credit {
        display: none;
    }

    /* Adjust header position */
    #header-container {
        top: 1.5rem;
        left: 1.5rem;
    }

    .award-content p {
        margin: 0;
        font-size: 0.9rem;
        color: #ccc;
    }
}