:root {
    --bg-color: #0a0f1a;
    --bg-secondary: #0d1424;
    --node-bg: #1a2332;
    --node-bg-hover: #243044;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-proj: #0d9488;
    --accent-warning: #d4a24c;
    --accent-pink: #ec4899;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-bright: #ffffff;
    --line-color: #1e293b;
    --line-active: #60a5fa;
    --border-color: #293548;
    --stats-strip-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#canvas {
    position: relative;
    flex-grow: 1;
    width: 100%;
    min-height: 0;
    padding-top: 16px;
    padding-bottom: calc(var(--stats-strip-height) + 16px);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle, #334155 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 1;
}

/* Columns container - filled by JS from data.js; grows with content for vertical scroll; above SVG lines so ledges stay behind nodes */
#columns-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;
    min-height: min-content;
    min-width: 100%;
    width: 100%;
}

/* When JS has matched column widths: all columns use the tallest column's width */
#columns-container.column-widths-matched .canvas-column {
    flex: 0 0 var(--column-width);
    width: var(--column-width);
    min-width: var(--column-width);
}

/* Column layout: min 14px gap between nodes; column grows with content */
.canvas-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: min-content;
    min-width: 0;
}

.canvas-column .column-header {
    position: static;
    flex-shrink: 0;
    margin-bottom: 20px;
    align-self: center;
}

/* Minimum 14px gap between every node; use vertical scroll when content overflows */
.canvas-column .column-nodes {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-height: min-content;
}

.canvas-column {
    z-index: 1;
}

.canvas-column .node {
    position: relative;
    flex-shrink: 0;
    width: 70%;
    max-width: 70%;
    min-width: 0;
}

.canvas-column .node.skill {
    width: 55%;
    max-width: 55%;
}

/* Custom Scrollbar */
#canvas::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#canvas::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

#canvas::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#canvas::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* NODES - Compact Design with 3D effect */
.node {
    position: absolute;
    background: linear-gradient(
        145deg,
        var(--node-bg-hover) 0%,
        var(--node-bg) 100%
    );
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: visible;
    opacity: 1;
    isolation: isolate;
}

.node:hover {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent-primary);
    background: linear-gradient(145deg, #2a3650 0%, var(--node-bg-hover) 100%);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px var(--accent-primary);
    z-index: 20;
}

.node-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Roles & Education header */
.node.exp .node-header,
.node.edu .node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.node.exp .node-header h3,
.node.edu .node-header h3 {
    flex-grow: 1;
}

/* Role/degree text styled like former "Current" badge */
.node.exp .role,
.node.edu .role {
    margin-top: 6px;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.node.exp .role,
.node.edu .role {
    background: rgba(59, 130, 246, 0.28);
    color: var(--accent-primary);
}

.node-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.node h3 {
    margin: 0;
    font-size: 13px;
    color: var(--text-bright);
    font-weight: 600;
    white-space: normal;
    word-wrap: break-word;
}

.node p {
    margin: 4px 0 0 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.node .badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.28);
    border-radius: 4px;
    font-size: 9px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Skill Nodes - Compact One-liner with left border */
.node.skill {
    width: 55%;
    padding: 8px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: var(--node-bg);
    border-color: var(--border-color);
    border-left: 3px solid var(--accent-secondary);
}

.node.skill:hover {
    border-color: var(--accent-secondary);
    border-left-color: var(--accent-secondary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.node.skill .node-icon {
    width: 22px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
}

.node.skill .node-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.node.skill h3 {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    white-space: normal;
    word-wrap: break-word;
}

/* Roles & Education nodes (experience) */
.node.exp {
    width: 70%;
    border-left: 3px solid var(--accent-primary);
}

.node.exp .node-icon,
.node.edu .node-icon {
    background: transparent;
}

.node.exp .node-icon img,
.node.edu .node-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.node.exp:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-primary);
}

/* Certification Nodes */
.node.cert {
    width: 70%;
    border-left: 3px solid var(--accent-warning);
}

.node.cert .node-icon {
    background: linear-gradient(135deg, var(--accent-warning), #b45309);
}

.node.cert:hover {
    border-color: var(--accent-warning);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-warning);
}

.node.cert .badge {
    background: rgba(245, 158, 11, 0.28);
    color: var(--accent-warning);
}

.node.cert .node-icon {
    background: transparent;
}

.node.cert .node-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Project Nodes */
.node.proj {
    width: 70%;
    border-left: 3px solid var(--accent-proj);
}

.node.proj .node-icon {
    background: linear-gradient(135deg, var(--accent-proj), #0f766e);
}

.node.proj .node-icon img {
    width: 55%;
    height: 55%;
    object-fit: contain;
    border-radius: 4px;
    filter: invert(1) brightness(1.1);
}

.node.proj:hover {
    border-color: var(--accent-proj);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-proj);
}

.node.proj .badge {
    background: rgba(13, 148, 136, 0.35);
    color: #5eead4;
}

/* Education Nodes - same border/hover as Roles & Education */
.node.edu {
    width: 70%;
    border-left: 3px solid var(--accent-primary);
}

.node.edu:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-primary);
}

.node.edu .node-icon {
    background: linear-gradient(135deg, #64748b, #475569);
}

.node.edu .badge {
    background: rgba(148, 163, 184, 0.28);
    color: #94a3b8;
}

/* SVG LAYER - behind nodes so ledges never overlap node content */
#connections {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

path {
    fill: none;
    stroke: var(--line-color);
    stroke-width: 1.5;
    transition: all 0.3s ease;
    opacity: 0.35;
}

path.active {
    stroke-width: 2;
    opacity: 1;
    stroke-dasharray: 6 3;
    animation: flowDash 1.5s linear infinite;
}

@keyframes flowDash {
    to {
        stroke-dashoffset: -18;
    }
}

/* NAV BAR */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
    z-index: 100;
    position: relative;
    min-height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.nav-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.nav-info {
    min-width: 0;
}

.nav-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 2px 0;
    color: var(--text-bright);
}

.nav-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
    flex-shrink: 0;
    animation: nav-pulse 2s ease-in-out infinite;
}

@keyframes nav-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.nav-title {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 6px;
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

@property --nav-title-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.nav-title::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 7.5px;
    background: conic-gradient(
        from var(--nav-title-angle),
        var(--accent-secondary),
        var(--accent-primary),
        var(--accent-proj),
        var(--accent-secondary)
    );
    z-index: -1;
    animation: nav-title-gradient-flow 4s linear infinite;
}

@keyframes nav-title-gradient-flow {
    to {
        --nav-title-angle: 360deg;
    }
}

.nav-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

.nav-filter:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.nav-filter.active,
.nav-filter.legend-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent-primary);
}

.nav-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
}

.legend-item {
    /* kept for JS compatibility */
}

/* Column Headers */
.column-header {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Stats Bar - slides down when scrolling down, shows when up or at rest */
.stats-bar {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translate(-50%, 0);
    display: flex;
    gap: 20px;
    background: var(--node-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 20px;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stats-bar.stats-bar--hidden {
    transform: translate(-50%, calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 1200px) {
    .nav-filters {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-bar {
        padding: 12px 16px;
        gap: 12px;
        min-height: 56px;
    }

    .nav-center,
    .nav-title {
        display: none;
    }

    .nav-avatar {
        width: 36px;
        height: 36px;
    }

    .nav-name {
        font-size: 15px;
    }

    .nav-subtitle {
        font-size: 10px;
    }

    .social-links {
        display: none;
    }

    .stats-bar {
        padding: 8px 14px;
        gap: 14px;
    }
}
