/* ===== VARIABLES — DARK CYBER THEME ===== */
:root {
    --bg: #0a0a12;
    --surface: rgba(16, 16, 26, 0.75);
    --surface-hover: rgba(22, 22, 38, 0.9);
    --border: rgba(0, 229, 255, 0.1);
    --border-hover: rgba(0, 229, 255, 0.3);
    --connector: rgba(0, 229, 255, 0.15);
    --connector-bright: rgba(0, 229, 255, 0.4);
    --cyan: #00e5ff;
    --violet: #b388ff;
    --red: #ff5252;
    --green: #69f0ae;
    --amber: #ffd740;
    --text-1: #e8eaed;
    --text-2: #9aa0a6;
    --text-3: #5f6368;
    --font: 'Inter', 'Space Grotesk', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --r: 8px;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    cursor: none;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

button {
    cursor: none;
}

code {
    font-family: var(--mono);
    font-size: 0.8em;
    background: rgba(0, 229, 255, 0.08);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    color: var(--cyan);
}

/* ===== CUSTOM CURSOR ===== */
.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px var(--cyan), 0 0 12px rgba(0, 229, 255, 0.4);
    transition: width 0.15s, height 0.15s, background 0.15s;
}

.cursor-dot.is-hover {
    width: 10px;
    height: 10px;
    background: #fff;
    box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(0, 229, 255, 0.5);
}

.cursor-glow {
    position: fixed;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.12), transparent 70%);
    border: 1px solid rgba(0, 229, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s;
}

.cursor-glow.is-hover {
    width: 44px;
    height: 44px;
    border-color: rgba(0, 229, 255, 0.2);
}

/* ===== PARTICLE CANVAS ===== */
#particleCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== TOP BAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(10, 10, 18, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0, 229, 255, 0.25);
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-1);
}

.brand-sub {
    display: block;
    font-family: var(--mono);
    font-size: 0.55rem;
    color: var(--cyan);
    letter-spacing: 0.08em;
}

.topbar-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
}

.topbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== SEARCH ===== */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 5px 10px 5px 24px;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 5px;
    color: var(--text-1);
    outline: none;
    width: 130px;
    transition: all 0.2s;
    cursor: none;
}

.search-input:focus {
    width: 180px;
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(0, 229, 255, 0.08);
}

.search-input::placeholder {
    color: var(--text-3);
}

.search-icon {
    position: absolute;
    left: 7px;
    font-size: 0.7rem;
    color: var(--text-3);
    pointer-events: none;
}

/* ===== ACTION BUTTONS ===== */
.btn-action {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.18);
    border-radius: 5px;
    color: var(--cyan);
    transition: all 0.15s;
}

.btn-action:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

/* ===== VIEWPORT ===== */
.mm-viewport {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.mm-viewport.is-dragging * {
    user-select: none !important;
}

/* ===== CANVAS ===== */
.mm-canvas {
    position: absolute;
    display: flex;
    align-items: flex-start;
    padding: 60px 60px 200px 60px;
    min-width: 2400px;
    min-height: 2000px;
    transform-origin: 0 0;
    will-change: transform;
}

/* ===== SVG OVERLAY ===== */
.mm-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.mm-svg path {
    fill: none;
    stroke: var(--connector);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mm-svg path.mm-path-active {
    stroke: var(--connector-bright);
}

/* COLOR-CODED CONNECTORS */
.mm-svg path.mm-conn-red {
    stroke: rgba(255, 82, 82, 0.35);
}

.mm-svg path.mm-conn-red.mm-path-active {
    stroke: rgba(255, 82, 82, 0.55);
}

.mm-svg path.mm-conn-violet {
    stroke: rgba(179, 136, 255, 0.35);
}

.mm-svg path.mm-conn-violet.mm-path-active {
    stroke: rgba(179, 136, 255, 0.55);
}

.mm-svg path.mm-conn-amber {
    stroke: rgba(255, 215, 64, 0.35);
}

.mm-svg path.mm-conn-amber.mm-path-active {
    stroke: rgba(255, 215, 64, 0.55);
}

.mm-svg path.mm-conn-green {
    stroke: rgba(105, 240, 174, 0.35);
}

.mm-svg path.mm-conn-green.mm-path-active {
    stroke: rgba(105, 240, 174, 0.55);
}

/* ===== ROOT NODE ===== */
.mm-root {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(179, 136, 255, 0.06));
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    user-select: none;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.04);
    animation: rootPulse 4s ease-in-out infinite;
}

@keyframes rootPulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 229, 255, 0.04);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 229, 255, 0.08), 0 0 60px rgba(0, 229, 255, 0.03);
    }
}

.mm-root-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0, 229, 255, 0.2);
}

.mm-root-title {
    font-family: 'Space Grotesk', var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-1);
    white-space: nowrap;
}

.mm-root-sub {
    font-family: var(--mono);
    font-size: 0.5rem;
    color: var(--text-3);
    letter-spacing: 0.06em;
    margin-top: 1px;
}

/* ===== BRANCHES CONTAINER ===== */
.mm-branches {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-left: 90px;
    position: relative;
    z-index: 2;
}

/* ===== BRANCH ===== */
.mm-branch {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* ===== NODE (shared) ===== */
.mm-node {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: none;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mm-node:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.06);
    transform: translateY(-1px);
}

/* ===== EMOJI ===== */
.mm-emoji {
    font-size: 0.9rem;
    flex-shrink: 0;
    line-height: 1;
}

/* ===== COUNT BADGE ===== */
.mm-count {
    font-family: var(--mono);
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-3);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ===== SALARY BADGE ===== */
.mm-badge {
    font-family: var(--mono);
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    background: rgba(105, 240, 174, 0.08);
    border: 1px solid rgba(105, 240, 174, 0.15);
    color: var(--green);
}

/* ===== CATEGORY NODE ===== */
.mm-cat {
    padding: 11px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 200px;
}

.mm-cat em {
    font-style: italic;
    opacity: 0.8;
}

.mm-cat-red {
    border-color: rgba(255, 82, 82, 0.12);
}

.mm-cat-red:hover {
    border-color: rgba(255, 82, 82, 0.3);
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.06);
}

.mm-cat-violet {
    border-color: rgba(179, 136, 255, 0.12);
}

.mm-cat-violet:hover {
    border-color: rgba(179, 136, 255, 0.3);
    box-shadow: 0 0 20px rgba(179, 136, 255, 0.06);
}

.mm-cat-amber {
    border-color: rgba(255, 215, 64, 0.12);
}

.mm-cat-amber:hover {
    border-color: rgba(255, 215, 64, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 64, 0.06);
}

.mm-cat-green {
    border-color: rgba(105, 240, 174, 0.12);
}

.mm-cat-green:hover {
    border-color: rgba(105, 240, 174, 0.3);
    box-shadow: 0 0 20px rgba(105, 240, 174, 0.06);
}

.mm-branch.is-open>.mm-cat {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.05);
}

.mm-branch.is-open>.mm-cat-red {
    border-color: rgba(255, 82, 82, 0.35);
    box-shadow: 0 0 25px rgba(255, 82, 82, 0.06);
}

.mm-branch.is-open>.mm-cat-violet {
    border-color: rgba(179, 136, 255, 0.35);
    box-shadow: 0 0 25px rgba(179, 136, 255, 0.06);
}

.mm-branch.is-open>.mm-cat-amber {
    border-color: rgba(255, 215, 64, 0.35);
    box-shadow: 0 0 25px rgba(255, 215, 64, 0.06);
}

.mm-branch.is-open>.mm-cat-green {
    border-color: rgba(105, 240, 174, 0.35);
    box-shadow: 0 0 25px rgba(105, 240, 174, 0.06);
}

/* ===== FORK ICON ===== */
.mm-fork {
    font-size: 0.7rem;
    color: var(--text-3);
    padding-left: 8px;
    font-weight: 700;
    transition: transform 0.25s, opacity 0.25s;
}

.mm-branch.is-open>.mm-cat .mm-fork {
    transform: rotate(180deg);
    opacity: 0.5;
}

/* ===== TOPICS ===== */
.mm-topics {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 70px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 2;
}

.mm-branch.is-open>.mm-topics {
    opacity: 1;
    pointer-events: all;
    position: relative;
    left: 0;
    top: 0;
    transform: none;
}

/* ===== TOPIC NODE ===== */
.mm-topic {
    padding: 8px 14px;
    font-size: 0.74rem;
    font-weight: 400;
    white-space: nowrap;
}

.mm-topic small {
    font-family: var(--mono);
    font-size: 0.52rem;
    color: var(--text-3);
    margin-left: 4px;
}

.mm-topic-red {
    border-color: rgba(255, 82, 82, 0.1);
}

.mm-topic-red:hover {
    border-color: rgba(255, 82, 82, 0.25);
    box-shadow: 0 0 16px rgba(255, 82, 82, 0.05);
}

.mm-topic-violet {
    border-color: rgba(179, 136, 255, 0.1);
}

.mm-topic-violet:hover {
    border-color: rgba(179, 136, 255, 0.25);
    box-shadow: 0 0 16px rgba(179, 136, 255, 0.05);
}

.mm-topic-amber {
    border-color: rgba(255, 215, 64, 0.1);
}

.mm-topic-amber:hover {
    border-color: rgba(255, 215, 64, 0.25);
    box-shadow: 0 0 16px rgba(255, 215, 64, 0.05);
}

.mm-topic-green {
    border-color: rgba(105, 240, 174, 0.1);
}

.mm-topic-green:hover {
    border-color: rgba(105, 240, 174, 0.25);
    box-shadow: 0 0 16px rgba(105, 240, 174, 0.05);
}

.mm-link {
    text-decoration: none;
}

.mm-link:hover {
    border-color: rgba(0, 229, 255, 0.3);
    color: var(--cyan);
}

.mm-tw.is-open>.mm-topic {
    border-color: rgba(0, 229, 255, 0.3);
    background: var(--surface-hover);
}

/* ===== SOCIAL ICONS ===== */
.social-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mm-social {
    gap: 9px;
}

.mm-social:hover .social-icon {
    filter: brightness(1.3);
}

/* ===== DETAIL PANEL ===== */
.mm-detail {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
    margin-top: 0;
}

.mm-tw.is-open>.mm-detail {
    opacity: 1;
    margin-top: 4px;
}

.mm-detail p,
.mm-detail ul {
    font-size: 0.72rem;
    line-height: 1.65;
    color: var(--text-2);
    padding: 10px 14px;
    background: rgba(0, 229, 255, 0.02);
    border: 1px solid rgba(0, 229, 255, 0.05);
    border-radius: 6px;
    max-width: 380px;
}

.mm-detail strong {
    color: var(--text-1);
    font-weight: 600;
}

.mm-detail em {
    color: var(--text-3);
}

.mm-detail ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mm-detail li {
    padding-left: 10px;
    position: relative;
}

.mm-detail li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-weight: 700;
}

/* ===== SEARCH HIGHLIGHT ===== */
.mm-node.search-match {
    border-color: rgba(0, 229, 255, 0.5) !important;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.12) !important;
}

.mm-node.search-dim {
    opacity: 0.3;
}

/* ===== STAGGERED TOPIC ANIMATION ===== */
.mm-branch.is-open .mm-tw {
    animation: topicIn 0.3s ease both;
}

.mm-branch.is-open .mm-tw:nth-child(1) {
    animation-delay: 0.04s;
}

.mm-branch.is-open .mm-tw:nth-child(2) {
    animation-delay: 0.08s;
}

.mm-branch.is-open .mm-tw:nth-child(3) {
    animation-delay: 0.12s;
}

.mm-branch.is-open .mm-tw:nth-child(4) {
    animation-delay: 0.16s;
}

.mm-branch.is-open .mm-tw:nth-child(5) {
    animation-delay: 0.20s;
}

.mm-branch.is-open .mm-tw:nth-child(6) {
    animation-delay: 0.24s;
}

.mm-branch.is-open .mm-tw:nth-child(7) {
    animation-delay: 0.28s;
}

.mm-branch.is-open .mm-tw:nth-child(8) {
    animation-delay: 0.32s;
}

.mm-branch.is-open .mm-tw:nth-child(9) {
    animation-delay: 0.36s;
}

@keyframes topicIn {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== PAGE LOAD ANIMATION ===== */
.mm-root {
    animation: nodeIn 0.5s ease both;
}

.mm-branch {
    animation: nodeIn 0.4s ease both;
}

.mm-branch:nth-child(1) {
    animation-delay: 0.08s;
}

.mm-branch:nth-child(2) {
    animation-delay: 0.12s;
}

.mm-branch:nth-child(3) {
    animation-delay: 0.16s;
}

.mm-branch:nth-child(4) {
    animation-delay: 0.20s;
}

.mm-branch:nth-child(5) {
    animation-delay: 0.24s;
}

.mm-branch:nth-child(6) {
    animation-delay: 0.28s;
}

.mm-branch:nth-child(7) {
    animation-delay: 0.32s;
}

.mm-branch:nth-child(8) {
    animation-delay: 0.36s;
}

.mm-branch:nth-child(9) {
    animation-delay: 0.40s;
}

.mm-branch:nth-child(10) {
    animation-delay: 0.44s;
}

@keyframes nodeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ZOOM CONTROLS ===== */
.zoom-controls {
    position: fixed;
    bottom: 50px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 300;
    background: rgba(10, 10, 18, 0.85);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.zoom-btn {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 5px;
    color: var(--cyan);
    transition: all 0.15s;
    cursor: none;
}

.zoom-btn:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.3);
}

.zoom-level {
    font-family: var(--mono);
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--text-2);
    padding: 2px 0;
    letter-spacing: 0.05em;
}

/* ===== STATUS BAR ===== */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(10, 10, 18, 0.88);
    border-top: 1px solid rgba(0, 229, 255, 0.06);
    z-index: 300;
    font-family: var(--mono);
    font-size: 0.5rem;
    color: var(--text-3);
    letter-spacing: 0.06em;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-keys {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-keys kbd {
    font-family: var(--mono);
    font-size: 0.45rem;
    padding: 1px 4px;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 3px;
    color: var(--cyan);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    body {
        cursor: auto;
    }

    a,
    button,
    .mm-node {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-glow {
        display: none;
    }

    .topbar-title {
        display: none;
    }

    .search-wrap {
        display: none;
    }

    .mm-canvas {
        padding: 40px 30px 200px 30px;
    }

    .mm-branches {
        margin-left: 50px;
    }

    .mm-topics {
        margin-left: 40px;
    }

    .mm-cat {
        min-width: auto;
        font-size: 0.75rem;
    }

    .mm-topic {
        white-space: normal;
        font-size: 0.7rem;
    }

    .mm-detail p,
    .mm-detail ul {
        max-width: 240px;
    }

    .zoom-controls {
        display: none;
    }

    .status-keys {
        display: none;
    }
}