/* ============================================================
   APPROACH — vertical scroll-fill timeline
   Dotted spine fills solid as you scroll; active card highlights.
============================================================ */
#approach {
    padding: var(--section-pad) 0;
    background: var(--white);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* The dotted spine, centered */
.timeline-line {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    /* dotted vertical track */
    background-image: linear-gradient(var(--lightgrey) 45%, transparent 0);
    background-size: 2px 11px;
    background-repeat: repeat-y;
}

/* Solid fill that grows on scroll */
.timeline-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--green);
    border-radius: 2px;
    transition: height 0.15s linear;
}

/* Each step occupies half the width and sits on one side */
.timeline-step {
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 44px;
}
.timeline-step:last-child { margin-bottom: 0; }

.timeline-step--right {
    margin-left: 50%;
    padding-left: 52px;
}
.timeline-step--left {
    margin-right: 50%;
    padding-right: 52px;
    text-align: right;
}

/* Horizontal dotted connector from spine to card */
.timeline-step::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background-image: linear-gradient(to right, var(--lightgrey) 45%, transparent 0);
    background-size: 11px 2px;
    background-repeat: repeat-x;
    transition: background-image 0.2s var(--ease);
}
.timeline-step--right::before { left: 0; }
.timeline-step--left::before  { right: 0; }

/* Dot marker on the spine: filled centre + ring */
.timeline-dot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--lightgrey);
    display: grid;
    place-items: center;
    z-index: 2;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.timeline-dot::after {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--lightgrey);
    transition: background 0.25s var(--ease);
}
.timeline-step--right .timeline-dot { left: -9px; }
.timeline-step--left  .timeline-dot { right: -9px; }

/* The card */
.timeline-card {
    background: var(--white);
    border: 1px solid var(--whitegrey);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.timeline-num {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--whitegrey);
    margin-bottom: 10px;
    transition: color 0.3s var(--ease);
}

.timeline-eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--midgrey);
    margin-bottom: 8px;
}

.timeline-card h3 { margin-bottom: 10px; }

.timeline-card p {
    font-size: 0.92rem;
    color: var(--midgrey);
    line-height: 1.65;
    margin: 0;
}

/* ---- ACTIVE STATE (set by approach.js as the fill reaches each dot) ---- */
.timeline-step.is-active::before {
    background-image: linear-gradient(to right, var(--green) 45%, transparent 0);
}

.timeline-step.is-active .timeline-dot {
    border-color: var(--green);
    box-shadow: 0 0 0 5px var(--green-10);
}
.timeline-step.is-active .timeline-dot::after { background: var(--green); }

.timeline-step.is-active .timeline-card {
    /* Solid green edge once filled — matches the spine fill colour. The
       inset ring thickens the border visually without changing border-width
       (so the card never shifts when it activates). */
    border-color: var(--green);
    box-shadow: inset 0 0 0 1px var(--green), 0 14px 40px rgba(16,185,129,0.14);
    transform: translateY(-2px);
}

.timeline-step.is-active .timeline-num { color: var(--green); }

@media (prefers-reduced-motion: reduce) {
    .timeline-line-fill { transition: none; }
    .timeline-card,
    .timeline-num,
    .timeline-dot,
    .timeline-dot::after { transition: none; }
}
