.timeline-section {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: white;
    font-family: 'Poppins', sans-serif;
}

section:has(+ .timeline-section),
section:has(+ .pin-spacer > .timeline-section) {
    margin-bottom: 0 !important;
}

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

.timeline-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.timeline-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3530px;
    min-width: 3530px;
    will-change: transform;
}

.timeline-svg {
    position: absolute;
    left: 32px; /* fallback; overschreven door JS (containerInset) zodra timeline-slider.js draait */
    margin-top: 5.5%;
    width: 3181px;
    height: auto;
    overflow: visible;
}

#path-bg {
    fill: none;
    stroke: #d9d9d9;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1 15;
}

#path-active {
    fill: none;
    stroke: #a12c2c;
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(161, 44, 44, 0.25));
}

.start-btn {
    position: absolute;
    left: calc((100vw - 1344px) / 2 + 12px); /* zelfde inset als .container, zie _grid.scss */
    top: 26%;
    transform: translateY(-50%);
    background: #a12c2c;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(161, 44, 44, 0.25);
    z-index: 10;
}

@media (min-width: 768px) and (max-width: 1383px) {
    .start-btn {
        left: 32px;
    }
}

@media (max-width: 767px) {
    .start-btn {
        left: 20px;
    }
}

.end-btn {
    position: absolute;
    right: 230px;
    top: 62%;
    transform: translateY(-50%);
    background: #a12c2c;
    color: #fff;
    border: none;
    padding: 14px 34px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    z-index: 20;
    margin: 26px -51px;
}

.marker {
    position: absolute;
    z-index: 20;
}

.marker-dot {
    display: none;
}

.phase-badge {
    position: absolute;
    background: #f6ecd9;
    border: 2px solid #e7d9bd;
    color: #15212b;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 0 0 #efe2cb;
    transition: 0.4s;
}

.marker.active .phase-badge {
    background: #a12c2c;
    border-color: #a12c2c;
    color: #fff;
}

.timeline-card {
    position: absolute;
    width: 260px;
    background: #f6ecd9;
    border: 2px solid #e7d9bd;
    border-radius: 20px;
    padding: 24px 26px !important;
    box-shadow:
        0 2px 0 0 #efe2cb,
        0 14px 30px rgba(60, 40, 10, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(30px);
    transition:
        opacity 0.45s ease,
        transform 0.45s ease,
        visibility 0.45s;
    will-change: transform, opacity;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #15212b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.marker.active .timeline-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.timeline-card h3 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #15212b;
}

.timeline-card p {
    font-size: 14px;
    line-height: 1.55;
    color: #5b5b5b;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

@media (max-width: 640px) {
    .timeline-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 100px 0;
    }

    .timeline-wrapper {
        overflow: visible;
        height: auto;
    }

    .timeline-track {
        position: relative;
        width: 100% !important;
        min-width: 100% !important;
        height: auto;
        transform: none !important;
        padding-bottom: 40px;
    }

    .timeline-svg {
        display: none;
    }

    .start-btn {
        position: relative;
        left: auto;
        right: auto;
        top: -6px;
        bottom: auto;
        transform: none;
        display: block;
        margin: 0 auto 70px;
    }

    .end-btn {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: -120px;
        transform: none;
        display: block;
        margin: 0 auto 70px;
    }

    .mobile-line-wrap {
        position: absolute;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 120px;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    }

    .mobile-line-svg {
        width: 120px;
        height: 100%;
        overflow: visible;
    }

    #mobile-path-bg {
        fill: none;
        stroke: #b8b8b8;
        stroke-width: 3;
        stroke-linecap: round;
        stroke-dasharray: 2 14;
        opacity: 0.8;
    }

    #mobile-path-active {
        fill: none;
        stroke: #a12c2c;
        stroke-width: 5;
        stroke-linecap: round;
        filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.35));
    }

    .marker {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100%;
        margin-bottom: 75px;
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: 3;
    }

    .phase-badge {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none;
        margin: 0 0 18px !important;
        z-index: 3;
    }

    .timeline-card {
        position: relative;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: calc(100% - 40px);
        max-width: 340px;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
    }
}
