.company-timeline {
    position: relative;
    padding: 35px 10px 20px;
}

/* ── Burst overlay anchored to the dot, scrolls with the page ── */
.timeline-burst-overlay {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.timeline-burst-particle {
    position: absolute;
}

@keyframes timeline-burst-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(var(--rot-start)) scale(1);
    }

    60% {
        opacity: 0.85;
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot-end)) scale(0.3);
    }
}

/* Vertical centre line */
.company-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
            transparent 0,
            rgba(205, 214, 224, .15) 15px,
            rgba(205, 214, 224, .6) 35px,
            #cdd6e0 50px,
            #cdd6e0 calc(100% - 50px),
            rgba(205, 214, 224, .6) calc(100% - 35px),
            rgba(205, 214, 224, .15) calc(100% - 15px),
            transparent 100%);
}

/* Each item spans full width */
.timeline-item {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    min-height: 80px;
}

/* On desktop, JS controls vertical spacing via margin-top (dot-to-dot gap = 100px) */
@media (min-width: 769px) {
    .timeline-item {
        margin-bottom: 0;
    }
}

/* ── Scroll animations ── */
.timeline-item .timeline-card,
.timeline-item .timeline-dot,
.timeline-item .timeline-date {
    transition-property: opacity, transform;
    transition-duration: 0.55s;
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Card: slide from its side */
.timeline-item--left .timeline-card {
    opacity: 0;
    transform: translateX(-40px);
    transition-delay: 0s;
}

.timeline-item--right .timeline-card {
    opacity: 0;
    transform: translateX(40px);
    transition-delay: 0s;
}

/* Dot: scale up from centre */
.timeline-item .timeline-dot {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition-delay: 0.2s;
}

/* Date: fade + small nudge */
.timeline-item--left .timeline-date {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
    transition-delay: 0.32s;
}

.timeline-item--right .timeline-date {
    opacity: 0;
    transform: translateY(-50%) translateX(-10px);
    transition-delay: 0.32s;
}

/* Visible state — added by Intersection Observer */
.timeline-item.is-visible .timeline-card {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item.is-visible .timeline-dot {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.timeline-item.is-visible .timeline-date {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* LEFT item — card on the left half */
.timeline-item--left .timeline-card {
    width: 46%;
    margin-right: auto;
}

.timeline-item--left .timeline-date {
    position: absolute;
    left: 54%;
    top: 50%;
    transform: translateY(-50%);
}

/* RIGHT item — card on the right half */
.timeline-item--right .timeline-card {
    width: 46%;
    margin-left: auto;
}

.timeline-item--right .timeline-date {
    position: absolute;
    right: 54%;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
}

/* Dot on the centre line */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: #1e5ba6;
    border-radius: 50%;
    z-index: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot-icon {
    font-size: 11px;
    color: #fff;
    line-height: normal;
    user-select: none;
}

/* Event type dot colours */
.timeline-item--type-news .timeline-dot {
    background: #1e5ba6;
}

.timeline-item--type-milestone .timeline-dot {
    background: #e10b7e;
}

/* ── Milestone: ripple ring ── */
@keyframes timeline-ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 11, 126, 0.7);
    }

    70% {
        box-shadow: 0 0 0 16px rgba(225, 11, 126, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(225, 11, 126, 0);
    }
}

.timeline-item--type-milestone.is-visible .timeline-dot {
    animation: timeline-ripple 1.1s ease-out 0.8s 2;
}

/* ── Celebration: glow burst + sparkle stars ── */

/* ── Button ── */
.timeline-card-btn {
    display: inline-block;
    margin-top: 5px;
    padding: 7px 18px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: #2997d4;
    transition: background 0.2s;
}

.timeline-card-btn:hover {
    background: #1477af;
    color: #fff;
}

.timeline-item--type-milestone .timeline-card-btn {
    background: #e10b7e;
}

.timeline-item--type-milestone .timeline-card-btn:hover {
    background: #a10056;
}

.timeline-date {
    font-weight: 600;
    color: #1e5ba6;
    font-size: 17px;
    white-space: nowrap;
}

/* Card */
.timeline-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 1px 1px 14px -3px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Background image at the top of the card */
.timeline-card-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.timeline-card-body {
    padding: 20px 25px 25px;
}

.timeline-card-body h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.timeline-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.timeline-description {
    font-size: 14px;
    color: #333;
    white-space: pre-line;
}

@media (max-width: 768px) {

    .company-timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item,
    .timeline-item--left,
    .timeline-item--right {
        width: 100%;
        margin-left: 0;
        padding-left: 35px;
        padding-right: 0;
    }

    .timeline-item::before {
        left: 11px;
        right: auto;
    }

    .timeline-item--left .timeline-card,
    .timeline-item--right .timeline-card {
        width: 100%;
        margin-top: 25px;
    }

    .timeline-dot {
        position: absolute;
        left: 12px;
        top: 0;
        transform: translate(-50%, -50%);
        width: 22px;
        height: 22px;
        background: #1e5ba6;
        border-radius: 50%;
        z-index: 1;
        flex-shrink: 0;
    }

    .timeline-item--left .timeline-date {
        position: absolute;
        left: auto;
        top: 0;
        transform: translateY(-50%);
    }

    .timeline-item--right .timeline-date {
        position: absolute;
        right: unset;
        top: 0;
        transform: translateY(-50%);
    }

    /* Override animation initial states for mobile */
    .timeline-item--left .timeline-card,
    .timeline-item--right .timeline-card {
        opacity: 0;
        transform: translateY(20px);
    }

    .timeline-item--left .timeline-date,
    .timeline-item--right .timeline-date {
        opacity: 0;
        transform: translateY(-50%) translateX(0);
    }

    .timeline-item.is-visible .timeline-date {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    .timeline-item.is-visible .timeline-card {
        opacity: 1;
        transform: translateY(0);
    }

    .timeline-dot {
        transform: translate(-50%, -50%) scale(0);
    }

    .timeline-item.is-visible .timeline-dot {
        transform: translate(-50%, -50%) scale(1);
    }

}