:root {
    --spacing: 20px;
    --padding: 20px;
    --font-scale: 1;
    --card-width: 44%;
    --year-size: 80px;
    --glow-intensity: 0.3;
    --card-opacity: 0.8;
    --border-radius: 16px;
    --timeline-width: 1400px;
}

.timeline, .timeline * {
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

main > h2 {
    width: 90%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.timeline-intro {
    text-align: left;
    color: #b0b0b0;
    font-size: 1rem;
    margin: 0 auto 0.5rem;
    width: 90%;
    max-width: 600px;
}

.timeline-intro:last-of-type {
    margin-bottom: 2.5rem;
}

/* Vertical line */
.timeline {
    position: relative;
    max-width: var(--timeline-width);
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg,
    transparent 0%,
    #1a5a7a 5%,
    #3a0a2a 90%,
    transparent 100%);
    box-shadow: 0 0 calc(20px * var(--glow-intensity)) rgba(42, 154, 191, calc(0.5 * var(--glow-intensity)));
}

.timeline-item {
    position: relative;
    width: 100%;
    margin-bottom: calc(var(--spacing) * -15);
    padding-left: 20px;
    padding-right: 20px;
    pointer-events: none;
}

.timeline-content,
.year {
    pointer-events: auto;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-content {
    position: relative;
    width: var(--card-width);
    padding: var(--padding) calc(var(--padding) * 1.5);
    background: rgba(15, 15, 35, var(--card-opacity));
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
}

.timeline-item:nth-child(odd) .timeline-content {
    border-color: #2a9abf;
    margin-left: 0;
    margin-right: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    border-color: #b84090;
    margin-left: auto;
    margin-right: 0;
}

.year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: var(--year-size);
    height: var(--year-size);
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    border: 3px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: calc(1.1rem * var(--font-scale));
    font-weight: 700;
    box-shadow:
            0 0 16px rgba(42, 154, 191, 0.25),
            inset 0 0 8px rgba(42, 154, 191, 0.08);
    z-index: 10;
    transition: all 0.4s;
}

.timeline-item:nth-child(odd) .year {
    left: 48%;
    border-color: #40c8f0;
    color: #40c8f0;
    box-shadow:
        0 0 20px rgba(64, 200, 240, 0.55),
        inset 0 0 10px rgba(64, 200, 240, 0.15);
}

.timeline-item:nth-child(even) .year {
    left: 52%;
    border-color: #e055bb;
    color: #e055bb;
    box-shadow:
        0 0 20px rgba(224, 85, 187, 0.55),
        inset 0 0 10px rgba(224, 85, 187, 0.15);
}

.category {
    display: block;
    width: fit-content;
    margin: 0 auto;
    padding: calc(4px * var(--font-scale)) calc(12px * var(--font-scale));
    background: rgba(106, 128, 144, 0.12);
    border: 1px solid #6a8090;
    border-radius: 20px;
    font-size: calc(0.75rem * var(--font-scale));
    font-weight: 600;
    color: #6a8090;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: calc(1.6rem * var(--font-scale));
    font-weight: 700;
    margin-bottom: calc(10px * var(--font-scale));
    color: #fff;
    line-height: 1.2;
    text-align: center;
}

.creator {
    font-size: calc(0.95rem * var(--font-scale));
    color: #7ab8cc;
    margin-bottom: calc(10px * var(--font-scale));
    font-weight: 400;
    font-style: italic;
    text-align: center;
}

.description {
    font-size: calc(1rem * var(--font-scale));
    line-height: 1.5;
    color: #d0d0d0;
    font-weight: 300;
    border-bottom: 1px solid rgba(42, 154, 191, 0.15);
    margin-bottom: calc(12px * var(--font-scale));
    padding-bottom: calc(12px * var(--font-scale));
}

.impact {
    margin-top: calc(12px * var(--font-scale));
    padding-top: calc(12px * var(--font-scale));
    border-bottom: 1px solid rgba(42, 154, 191, 0.15);
    font-size: calc(0.9rem * var(--font-scale));
    color: #2a9abf;
    font-weight: 400;
}


@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        margin-bottom: calc(var(--spacing) * 2);
    }

    .timeline-content {
        width: calc(100% - 40px);
        margin-left: 40px !important;
        margin-right: 0 !important;
    }

    .year {
        left: 30px;
        transform: translateX(-50%);
        width: 80px;
        height: 80px;
        font-size: 1.1rem;
    }

    /* Override higher-specificity nth-child left values for mobile */
    .timeline-item:nth-child(odd) .year,
    .timeline-item:nth-child(even) .year {
        left: 45px;
    }

    h2 {
        font-size: 1.5rem;
    }
}

.timeline-content img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 10px auto 14px;
    border-radius: 4px;
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
    border-top: 1px solid rgba(42, 154, 191, 0.15);
}

.footer p {
    color: #666;
    font-size: 0.85rem;
    font-weight: 300;
}

/* Control Panel */
.control-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(10, 10, 30, 0.95);
    border: 2px solid #2a9abf;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 280px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(42, 154, 191, 0.3);
}

.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #2a9abf;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

.control-panel h3 {
    font-family: 'Orbitron', sans-serif;
    color: #00d4ff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.control-group {
    margin-bottom: 1.2rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #2a9abf;
    font-size: 0.9rem;
    font-weight: 600;
}

.control-value {
    color: #ff00ff;
    font-family: 'Orbitron', monospace;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #16213e;
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #2a9abf;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px #2a9abf;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #2a9abf;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px #2a9abf;
}

@media (max-width: 768px) {
    .control-panel {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
}
