/* ── Timeline wrapper ─────────────────────────────────────────────────────── */
.tl-wrap {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

/* Vertical line — grows down on scroll */
.tl-wrap::before {
    content: '';
    position: absolute;
    left: calc(50% - 1px);
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #4A7C59, #70A9A1 60%, #9EC1A3);
    transform: scaleY(0);
    transform-origin: top;
    pointer-events: none;
    z-index: 0;
}

.tl-wrap.line-visible::before {
    animation: tl-line 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tl-line {
    to { transform: scaleY(1); }
}

/* ── Row ──────────────────────────────────────────────────────────────────── */
.tl-item {
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    align-items: start;
    margin-bottom: 2.5rem;
    position: relative;
}

/* Force all three children into the same row regardless of DOM order */
.tl-item > * {
    grid-row: 1;
}

/* ── Node — dot pinned at a fixed offset from card top ───────────────────── */
.tl-node {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding-top: 1.85rem; /* aligns dot with the card's title area */
}

/* Horizontal connector toward the card — hardcoded to dot centre */
.tl-node::before,
.tl-node::after {
    content: '';
    position: absolute;
    top: calc(1.85rem + 7px); /* padding-top + dot radius */
    height: 1px;
    width: 28px;
    background: #9EC1A3;
}

/* left-card items: connector points left */
.tl-left .tl-node::before { right: calc(50% + 7px); }
.tl-left .tl-node::after  { display: none; }

/* right-card items: connector points right */
.tl-right .tl-node::before { display: none; }
.tl-right .tl-node::after  { left: calc(50% + 7px); }

.tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #40798C;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #40798C;
    flex-shrink: 0;
    display: block;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.tl-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
    opacity: 0;
    position: relative;
}

.tl-left .tl-card  { grid-column: 1; }
.tl-left .tl-node  { grid-column: 2; }
.tl-left .tl-gap   { grid-column: 3; }

.tl-right .tl-gap  { grid-column: 1; }
.tl-right .tl-node { grid-column: 2; }
.tl-right .tl-card { grid-column: 3; }

/* Pop-in — subtle slide + fade */
.tl-card.is-visible {
    animation: tl-pop-left 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--tl-delay, 0s);
}

.tl-right .tl-card.is-visible {
    animation-name: tl-pop-right;
}

@keyframes tl-pop-left {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes tl-pop-right {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Card internals ───────────────────────────────────────────────────────── */
.tl-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    background: #4A7C59;
    color: #fff;
    padding: 0.28rem 0.7rem;
    border-radius: 99px;
    margin-bottom: 0.65rem;
}

.tl-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a2e1f;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

.tl-body {
    font-size: 0.875rem;
    color: #4a5e50;
    line-height: 1.7;
    margin: 0;
}

.tl-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

.tl-stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: #4A7C59;
    line-height: 1;
    letter-spacing: -0.02em;
}

.tl-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #70A9A1;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .tl-wrap::before { transform: scaleY(1); animation: none; }
    .tl-card { opacity: 1; animation: none !important; }
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .tl-wrap::before {
        left: 19px;
    }

    .tl-item {
        grid-template-columns: 40px 1fr;
        margin-bottom: 1.75rem;
    }

    .tl-left .tl-card,
    .tl-right .tl-card  { grid-column: 2; grid-row: 1; }
    .tl-left .tl-node,
    .tl-right .tl-node  { grid-column: 1; grid-row: 1; }
    .tl-left .tl-gap,
    .tl-right .tl-gap   { display: none; }

    .tl-left .tl-node::before,
    .tl-right .tl-node::before { display: none; }
    .tl-left .tl-node::after,
    .tl-right .tl-node::after  { display: block; left: calc(50% + 7px); width: 12px; }

    .tl-right .tl-card.is-visible {
        animation-name: tl-pop-left;
    }
}
