:root {
    --bg-color: #000000;
    --text-color: #f0f0f0;
    --accent-color: #483D8B;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* The Layout */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 50vw;
    height: 100vh;
    z-index: 1;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.webgl-canvas {
    flex: 1;
    /* take up remaining space below the header */
    width: 100%;
    position: relative;
}

.webgl-canvas canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Sidebar Details */
.sidebar-header {
    padding: 3rem 4rem 1rem 4rem;
    z-index: 10;
}

.sidebar-header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-top {
    display: block;
    margin-bottom: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    /* Hidden on desktop */
}

.header-collapsible {
    display: block;
    /* Visible on desktop */
}

.sidebar-header .subtitle {
    font-size: 0.95rem;
    color: #808080;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toc a {
    color: #b0b0b0;
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.toc a:hover {
    color: var(--text-color);
}

.content-container {
    position: relative;
    margin-left: 50vw;
    width: 50vw;
    z-index: 2;
}

/* Profile Hero Image */
.profile-header {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.profile-photo {
    width: 300px;
    height: auto;
    max-height: 55vh;
    object-fit: cover;
    object-position: center;
    /* Keep face in view if cropped */
    display: block;
    margin: 0 auto;
}

.profile-divider {
    border: none;
    border-top: 1px solid #ffffff;
    width: 100%;
    margin: 0;
}

.step {
    padding: 0 4rem;
    display: flex;
    flex-direction: column;
}

#geomodelling {
    padding-top: 0rem;
}

h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #b0b0b0;
    text-align: justify;
    margin-bottom: 2rem;
}

/* Academic Paper Cards */
.paper-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.paper-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.paper-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.paper-journal {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.paper-doi {
    color: #88ccff;
    font-size: 0.85rem;
    font-family: monospace;
}

/* Copyright Certificates */
.certificate {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.certificate:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.cert-title {
    color: #ffffff;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.cert-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cert-badge {
    background: rgba(136, 204, 255, 0.12);
    /* Subtle accent flare */
    color: #88ccff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
    border: 1px solid rgba(136, 204, 255, 0.25);
}

/* Project Cards */
.project-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.project-title {
    color: #ffffff;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.project-tag {
    background: rgba(25, 204, 128, 0.12);
    /* Green tint for variety */
    color: #19cc80;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
    border: 1px solid rgba(25, 204, 128, 0.25);
}

.project-link {
    color: #88ccff;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .canvas-container {
        width: 100vw;
        height: auto;
        min-height: 0;
        z-index: 10;
        background-color: var(--bg-color);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header {
        padding: 1rem 1.5rem;
    }

    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
    }

    .sidebar-header h1 {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 4px;
        color: var(--text-color);
        cursor: pointer;
        padding: 0.4rem;
        transition: background 0.2s ease;
    }

    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .header-collapsible {
        display: none;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1rem;
    }

    .sidebar-header.menu-open .header-collapsible {
        display: block;
    }

    .sidebar-header .subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .toc {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        margin-bottom: 0.5rem;
    }

    .webgl-canvas {
        height: 25vh;
        /* Much smaller fixed height on mobile */
        flex: none;
    }

    .content-container {
        margin-left: 0;
        width: 100vw;
        margin-top: 0;
        padding-top: calc(25vh + 80px);
        /* rough approx of collapsed header + small canvas */
        background-color: transparent;
        box-shadow: none;
        z-index: 1;
    }

    .step {
        padding: 0 2rem;
    }

    h2 {
        font-size: 2.5rem;
    }
}

/* Legend Overlay */
.legend-overlay {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    max-width: 60%;
    /* Ensure it does not overflow on small mobiles */
}

.legend-overlay h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #a0a0a0;
}

.legend-overlay ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.legend-overlay li {
    margin-bottom: 0.15rem;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}