/* Canvas Background */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind content but in front of gradient/noise if needed, or replace them. 
                    -2 is gradient, -1 is noise. Let's make canvas -1 and noise 0 but pointer-events none?
                    Actually, let's put canvas at -1. */
    pointer-events: none;
    opacity: 0.6;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 9999;
    box-shadow: 0 0 10px rgba(20, 241, 149, 0.5);
    transition: width 0.1s ease-out;
}

/* Boot Loader */
#boot-loader {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.loader-terminal {
    width: 90%;
    max-width: 500px;
    font-family: 'Courier New', Courier, monospace;
    color: #888;
}

.loader-line {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typing 0.5s steps(30, end) forwards;
}

.loader-line:nth-child(2) {
    animation-delay: 0.5s;
}

.loader-line:nth-child(3) {
    animation-delay: 1.0s;
}

.loader-line:nth-child(4) {
    animation-delay: 1.5s;
}

.highlight {
    color: var(--accent-primary);
    font-weight: bold;
}

.highlight-alt {
    color: var(--accent-secondary);
    font-weight: bold;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.progress-bar-container {
    width: 100%;
    height: 2px;
    background: #1a1a1a;
    margin-top: 1.5rem;
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-primary);
    animation: load 2s ease-in-out forwards;
}

@keyframes load {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

#boot-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Cursor Glow */
#cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 241, 149, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    /* In front of bg elements, behind glass panels */
    transform: translate(-50%, -50%);
    transition: background 0.5s ease;
    mix-blend-mode: screen;
}

/* Marquee Section */
.marquee-section {
    padding: 2rem 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 40s linear infinite;
}

.marquee-content span {
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    opacity: 0.7;
    transition: all 0.3s;
}

.marquee-content span:hover {
    color: var(--accent-primary);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Terminal Footer */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    /* Glass panel styles inherited but overridden margins */
    margin: auto;
    padding: 3rem;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 50px rgba(20, 241, 149, 0.1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-primary);
}

.modal-content h2 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    font-size: 1rem;
    color: var(--text-primary);
}

/* Link Trigger in Carousel */
.modal-trigger {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    margin-top: 1rem;
    text-decoration: underline;
    text-decoration-color: var(--accent-primary);
    text-underline-offset: 4px;
    cursor: pointer;
    padding: 0;
}

.modal-trigger:hover {
    color: var(--text-primary);
}


/* Timeline Live Connection */
.timeline-wrapper {
    position: relative;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    /* Updated via JS */
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 15px var(--accent-primary);
    z-index: 5;
    transition: height 0.1s ease-out;
}

/* Reveal Animations */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay classes for staggered effect */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

/* Magnetic Button helper */
.primary-btn,
.secondary-btn,
.cta-button,
.reveal-btn {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}