/* 
 * Jesse Rodriguez - V5: Chromatic Timeline
 * "Rich Visual Experience"
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* Rich Color Palette */
    --bg-base: #0f0f23;
    --indigo: #6366f1;
    --purple: #8b5cf6;
    --amber: #f59e0b;
    --teal: #14b8a6;
    --rose: #f43f5e;
    --cyan: #06b6d4;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-display: 'Supercharge', var(--font-main);
}

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

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    scrollbar-width: none;
    position: relative;
}

body::-webkit-scrollbar {
    display: none;
}

/* --- Animated Gradient Background --- */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg,
            #0f0f23 0%,
            #1a1a3e 25%,
            #2d1b4e 50%,
            #1e3a5f 75%,
            #0f0f23 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Grain texture overlay */
.gradient-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* --- Canvas Background --- */
#chromatic-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* --- Intro Splash --- */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

.intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.intro-year {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 6px;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.intro-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: 3px;

    /* Lighting/Shine Effect */
    background: linear-gradient(to right,
            #4d4d4d 0%,
            #fff 10%,
            #4d4d4d 20%);
    background-size: 200% auto;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    animation: shine 3s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* --- Timeline Layout --- */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 15vh 20px 10vh;
}

/* Central Line */
.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent,
            rgba(255, 255, 255, 0.1) 10%,
            rgba(255, 255, 255, 0.1) 90%,
            transparent);
    transform: translateX(-50%);
    z-index: 0;
}

/* Timeline Node */
.timeline-node {
    position: relative;
    margin-bottom: 60px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-node:nth-child(odd) {
    flex-direction: row-reverse;
}

/* Marker on the line */
.timeline-marker {
    position: absolute;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--bg-base);
    border: 2px solid var(--indigo);
    border-radius: 50%;
    transform: translate(-50%, 0);
    z-index: 1;
    box-shadow: 0 0 10px var(--indigo);
}

/* Content Card */
.timeline-content {
    width: 45%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    /* Default border */
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.5s ease, border-color 0.5s ease;
    transform-style: preserve-3d;
    transform: perspective(1000px);

    /* Default glow color fallback */
    --glow-color: var(--indigo);
}

/* Active State (triggered by JS on scroll) */
.timeline-content.active-glow {
    border-color: var(--glow-color);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px var(--glow-color),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Spacing from center */
.timeline-node:nth-child(odd) .timeline-content {
    margin-left: 40px;
    /* Pushes it to the right */
    margin-right: 0;
}

.timeline-node:nth-child(even) .timeline-content {
    margin-right: 40px;
    /* Pushes it to the left */
    margin-left: 0;
}

/* Hover Effects */
.timeline-content:hover {
    z-index: 10;
    /* Enhance the glow on hover */
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px var(--glow-color),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Glow Effect */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            var(--glow-color) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
    /* Changed from overlay for better color visibility */
    border-radius: 16px;
}

.timeline-content:hover .card-glow {
    opacity: 0.15;
    /* Subtle inner glow */
}

/* Typography inside Timeline Card */
.timeline-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--indigo);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.timeline-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.timeline-link:hover {
    background: var(--indigo);
    border-color: var(--indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* --- Footer --- */
.footer-node {
    text-align: center;
    padding: 60px 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.footer-node p:first-child {
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    .timeline-container {
        padding: 12vh 20px 8vh;
    }

    .timeline-line {
        left: 20px;
        /* Move line to the left */
        transform: none;
    }

    .timeline-node {
        flex-direction: column !important;
        /* Stack vertically always */
        align-items: flex-start;
        margin-left: 0;
    }

    .timeline-marker {
        left: 20px;
        /* Align marker with line */
        transform: translate(-50%, 0);
    }

    .timeline-content {
        width: calc(100% - 50px);
        /* Full width minus space for line */
        margin-left: 50px !important;
        /* Push content right of line */
        margin-right: 0 !important;
    }

    .intro-title {
        font-size: 2.5rem;
    }
}