/* Learn hero, right side (learn/index.html): the topics as a path that climbs from the first
   to the last, each step labelled with its topic and number of guides and linking to it. It
   draws itself on load. A fixed size beside the text on wide screens; on phones the topic bar
   below does the same job. */
.ln-path {
    display: none;
}

@media (min-width: 900px) {
    .ln-path {
        position: relative;
        display: block;
        justify-self: end;
        width: min(100%, 30rem);
        aspect-ratio: 4 / 3;
    }
}

.ln-path__line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* The whole route as a faint dotted track; the bright line draws over it, from soft white at
   the first topic to mint at the last. */
.ln-path__track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 2;
    stroke-dasharray: 2 7;
    stroke-linecap: round;
}

.ln-path__seg {
    fill: none;
    stroke: url(#ln-path-glow);
    stroke-width: 3;
    stroke-linecap: round;
}

.ln-path__steps {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each step's dot sits on its point of the line (the same points as the SVG's 480 x 360);
   its label reads to the right, clear of the line. */
.ln-step {
    position: absolute;
    transform: translate(-1.5rem, -50%);
}

.ln-step--1 { left: 7.5%; top: 88.33%; }
.ln-step--2 { left: 27.5%; top: 65%; }
.ln-step--3 { left: 47.5%; top: 41.67%; }
.ln-step--4 { left: 67.5%; top: 18.33%; }

.ln-step__link {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: #FFFFFF;
    text-decoration: none;
}

.ln-step__dot {
    display: grid;
    flex: none;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 2px solid rgba(110, 231, 183, 0.75);
    border-radius: 50%;
    background: linear-gradient(160deg, #3B5590, #2A4073);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 0 0 6px rgba(42, 64, 115, 0.55), 0 10px 22px -10px rgba(8, 18, 48, 0.8);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

/* The last topic is the goal: filled mint with a soft, steady glow. */
.ln-step--last .ln-step__dot {
    border-color: var(--kd-mint-bright);
    background: var(--kd-mint-bright);
    color: #0B1B3F;
    box-shadow: 0 0 0 6px rgba(42, 64, 115, 0.55), 0 0 28px -2px rgba(52, 211, 153, 0.55);
}

.ln-step__text {
    display: grid;
    gap: 0.15rem;
    white-space: nowrap;
}

.ln-step__text strong {
    font-size: 1.02rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.ln-step__go {
    display: inline-block;
    color: var(--kd-mint-light);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ln-step__text small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.85rem;
}

.ln-step__text em {
    color: var(--kd-mint-light);
    font-style: normal;
    font-weight: 600;
}

a.ln-step__link:hover .ln-step__dot {
    border-color: var(--kd-mint-bright);
    background: var(--kd-mint-bright);
    color: #0B1B3F;
    transform: scale(1.06);
}

a.ln-step__link:hover .ln-step__text strong {
    color: var(--kd-mint-light);
}

a.ln-step__link:hover .ln-step__go {
    opacity: 1;
    transform: none;
}

/* A topic with no guides yet: a faint, dashed step with just its name, not a link. */
.ln-step--soon .ln-step__link {
    cursor: default;
}

.ln-step--soon .ln-step__dot,
.ln-step--soon.ln-step--last .ln-step__dot {
    border: 2px dashed rgba(255, 255, 255, 0.35);
    background: #2E4579;
    color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 6px rgba(42, 64, 115, 0.55);
}

.ln-step--soon .ln-step__text strong {
    color: rgba(255, 255, 255, 0.6);
}

.ln-step__link:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 6px;
    border-radius: 999px;
}

/* ---------- Draws itself: each step appears, then the line runs on to the next ---------- */
.ln-path__seg {
    stroke-dasharray: 1;
    animation: ln-path-draw 0.45s ease-out both;
}

.ln-path__seg--1 { animation-delay: 0.7s; }
.ln-path__seg--2 { animation-delay: 1.05s; }
.ln-path__seg--3 { animation-delay: 1.4s; }

.ln-step {
    animation: ln-step-in 0.45s ease-out both;
}

.ln-step--1 { animation-delay: 0.45s; }
.ln-step--2 { animation-delay: 1s; }
.ln-step--3 { animation-delay: 1.35s; }
.ln-step--4 { animation-delay: 1.7s; }

@keyframes ln-path-draw {
    from {
        stroke-dashoffset: 1;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes ln-step-in {
    from {
        opacity: 0;
        margin-top: 8px;
    }
}

.ln-path__track {
    animation: ln-track-in 0.6s ease-out 0.3s both;
}

@keyframes ln-track-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ln-path__seg,
    .ln-path__track,
    .ln-step {
        animation: none;
    }

    .ln-step__dot,
    .ln-step__go {
        transition: none;
    }

    a.ln-step__link:hover .ln-step__dot {
        transform: none;
    }
}
