:root {
    --bg: #0a0a0f;
    --card-bg: #12121a;
    --text: #e2e2e7;
    --text-dim: #9494a0;
    /* --accent: #3b82f6; */
    --accent: #10b981;
    --code-accent: #10b981;
    --collab-accent: #3b82f6;
    --border: #23232e;
}

body,
html {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* Page Management */
.page {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tech-stack-brand {
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    color: var(--code-accent);
}

nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

/* About Page Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 3rem;
    margin-top: 3rem;
    align-items: center;
}

.profile-img {
    width: 100%;
    border-radius: 12px;
    filter: grayscale(0.5);
    border: 1px solid var(--border);
}

/* CV Styling */
.cv-section {
    margin-top: 3rem;
}

.cv-section h4 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    color: var(--accent);
}

.cv-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    margin-top: 1rem;
}

.cv-meta {
    font-family: 'JetBrains Mono';
    font-size: 0.85rem;
    color: var(--text-dim);
}

.skill-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Existing Pub Card & Grid Styles */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.pub-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.pub-card.mini {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--accent);
}

.pub-title {
    font-size: 1.1rem;
    margin: 0;
}

.pub-venue {
    font-family: 'JetBrains Mono';
    font-size: 0.75rem;
    color: var(--code-accent);
}

.pub-links {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.pub-btn {
    padding: 4px 12px;
    background: #1a1a24;
    border: 1px solid #333;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

.citation-box {
    display: none;
    background: #000;
    padding: 1rem;
    padding-top: 3rem;
    margin-top: 1rem;
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
}

#visualization-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        width: 150px;
    }
}

/* --- Social Icons Row (Web Fonts) --- */
.social-icon-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 2rem;
}

.social-icon-row a {
    font-size: 1.8rem;
    /* Sets the size of the font icons */
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.social-icon-row a:hover {
    color: var(--text);
    transform: translateY(-3px);
}

/* --- Typography Enhancements --- */
.page-title {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.pub-category h3 {
    font-size: 1.4rem;
    color: var(--accent);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* --- Visual Publications Card --- */
.pub-card.flex-layout {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
    padding: 1.5rem;
}

.pub-image {
    width: 240px;
    height: 220px;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #1a1a24;
}

.pub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.pub-card.flex-layout:hover .pub-image img {
    transform: scale(1.05);
}

.pub-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
    width: fit-content;
}

.badge-journal {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    /* Blue */
}

.badge-conf {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    /* Green */
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .pub-card.flex-layout {
        flex-direction: column;
    }

    .pub-image {
        width: 100%;
        height: 200px;
        aspect-ratio: auto;
    }

    .pub-main {
        min-width: 0;
        margin-top: 0.5rem;
    }
}

/* --- Code & GitHub Section --- */
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
}

.page-header-flex .page-title {
    margin-bottom: 0;
}

.github-profile-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.github-profile-link:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.github-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.github-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.github-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.repo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.repo-icon {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.repo-title {
    margin: 0;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 400;
}

.repo-title span {
    font-weight: 600;
}

.repo-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
    flex-grow: 1;
    /* Pushes the meta data to the bottom */
}

.repo-meta {
    display: flex;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
}

.repo-lang {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* GitHub's official C++ color */
.lang-dot.cpp {
    background-color: #f34b7d;
}

/* --- Action Buttons (BIB, PDF, CODE) --- */
.pub-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.action-btn {
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #e5e5e5;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #e5e5e5;
    color: var(--bg);
    /* Inverts color on hover */
}

/* --- Citation Box Container --- */
.citation-box {
    display: none;
    /* Hidden until toggled */
    background: #3f3f46;
    /* Lighter grey background from screenshot */
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- Syntax Highlighting Colors --- */
.citation-box pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #e5e5e5;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.bib-type {
    color: #60a5fa;
}

/* Blue for @article, @inproceedings */
.bib-key {
    color: #e5e5e5;
}

/* White for the citation key */
.bib-val {
    color: #fb923c;
}

/* Orange for the text values */
.bib-num {
    color: #2dd4bf;
}

/* Teal/Cyan for numbers/unquoted text */

/* --- Copy Button (Top Right) --- */
.copy-icon-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #27272a;
    border: none;
    color: #3b82f6;
    /* Blue icon */
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-icon-btn:hover {
    background: #18181b;
}

.copy-icon-btn.copied {
    color: #10b981;
    /* Turns green when clicked */
}

.selected-pubs h3 {
    color: var(--code-accent);
}

.pub-card.alt-border {
    border-left: 4px solid var(--collab-accent);
}