* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary-color: #2196f3;
    --secondary-color: #e91e63;
    --background-color: #0a0a0a;
    --text-color: #ffffff;
    --node-size: 24px;
    --path-width: 2px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(33, 150, 243, 0.1) 0%, transparent 70%);
    opacity: 0.5;
    transform-origin: center center;
}

.parallax-layer:nth-child(2) {
    background: radial-gradient(circle at center, rgba(233, 30, 99, 0.1) 0%, transparent 70%);
}

.parallax-layer:nth-child(3) {
    background: radial-gradient(circle at center, rgba(156, 39, 176, 0.1) 0%, transparent 70%);
}

.timeline-container {
    position: relative;
    padding: 100px 0;
    min-height: 100vh;
    z-index: 1;
}

.timeline-track {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 1;
}

.timeline-path {
    position: fixed;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100vh;
    transform: translateX(-50%);
    z-index: -1;
    background: var(--primary-color);
    transform-origin: top;
    transform: translateX(-50%) scaleY(0);
    animation: initialDraw 1.5s ease forwards;
}

@keyframes initialDraw {
    to {
        transform: translateX(-50%) scaleY(1);
    }
}

.timeline-path::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: calc(var(--last-node-position) - 100vh + 2px);
    background: var(--primary-color);
    transform-origin: top;
    transform: scaleY(var(--scroll-progress, 0));
}

.main-path {
    position: fixed;
    width: var(--path-width);
    height: 100vh;
    top: 0;
}

.path-line {
    stroke: var(--primary-color);
    stroke-width: var(--path-width);
    fill: none;
    stroke-dasharray: 5000;
    stroke-dashoffset: 5000;
    transition: stroke-dashoffset 1s ease;
}

.node {
    position: relative;
    margin: 300px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.node.can-show {
    pointer-events: auto;
}

.node.can-show.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-dot {
    position: absolute;
    left: 50%;
    width: var(--node-size);
    height: var(--node-size);
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.node-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.node:hover .node-dot::before {
    transform: translate(-50%, -50%) scale(1);
}

.node-content {
    position: relative;
    width: 40%;
    margin-left: 55%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transform: translateX(20px);
    transition: all 0.5s ease;
}

.node:nth-child(even) .node-content {
    margin-left: 5%;
    margin-right: 55%;
    transform: translateX(-20px);
}

.node.visible .node-content {
    transform: translateX(0);
}

.typing-text {
    display: inline-block;
    white-space: nowrap;
    border-right: 2px solid var(--primary-color);
    animation: blink 0.75s step-end infinite;
    margin-right: 4px;
}

.typing-text.typed {
    border-right: none;
    animation: none;
}

.branch-path {
    display: none;
}

.branch-node {
    position: absolute;
    right: -10px;
    top: -44px;
    width: 20px;
    height: 20px;
}

.node:nth-child(even) .branch-node {
    right: auto;
    left: -10px;
}

.branch-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
}

.branch-content {
    position: absolute;
    top: -20px;
    left: 30px;
    min-width: 200px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.branch-node:hover .branch-content {
    opacity: 1;
    transform: translateX(0);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
}

#cursor {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, transform 0.1s;
    z-index: 9999;
}

#cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s;
}

#cursor.clickable {
    width: 24px;
    height: 24px;
}

#cursor.clickable::after {
    transform: translate(-50%, -50%) scale(1.5);
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

@media (max-width: 768px) {
    .timeline-track {
        padding: 0 10px;
    }

    .node-content {
        width: 80%;
        margin-left: 60%;
    }

    .node:nth-child(even) .node-content {
        margin-left: -40%;
        margin-right: 0;
    }

    #cursor {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .timeline-path {
        left: 20px;
        transform: none;
    }

    .timeline-path::after {
        left: 0;
        transform-origin: top;
        transform: scaleY(var(--scroll-progress, 0));
    }

    .node {
        padding-left: 30px;
        margin-right: 20px;
    }

    .node-dot {
        left: 10px;
        transform: translate(-50%, -50%);
    }

    .node-content {
        margin-left: 20px;
        max-width: calc(100% - 60px);
        left: 0 !important;
        right: auto !important;
        transform: none !important;
    }

    /* Override even node styles on mobile */
    .node:nth-child(even) .node-content {
        text-align: left;
        margin-left: 20px;
        margin-right: auto;
    }

    .custom-cursor {
        display: none;
    }
}
