/* Learn index (learn/index.html): the about/careers blue band, a sticky topic bar, then each
   topic as a chapter with its description beside a numbered list of lessons. */
.ln-inner {
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .ln-inner {
        padding: 0 1.5rem;
    }
}

/* ---------- Hero ---------- */
.ln-hero {
    position: relative;
    overflow: hidden;
    padding: 6.5rem 0 4rem;
    background:
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px) 0 0 / 32px 32px,
        radial-gradient(40% 45% at 80% 45%, rgba(52, 211, 153, 0.1), transparent 70%),
        linear-gradient(180deg, var(--kd-brand) 0%, #354F8A 30%, var(--kd-brand-deep) 100%);
    color: #fff;
}

@media (min-width: 900px) {
    .ln-hero {
        padding: 8.5rem 0 6rem;
    }
}

/* The copy on the left; on wide screens the learning path sits on the right (learn-path.css). */
.ln-hero__inner {
    position: relative;
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 900px) {
    .ln-hero__inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }
}

.ln-hero__kicker {
    margin: 0 0 1.1rem;
    color: var(--kd-mint-soft);
    font-size: 0.95rem;
    font-weight: 600;
}

.ln-hero__title {
    max-width: 44rem;
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.035em;
}

.ln-hero__lede {
    max-width: 36rem;
    margin: 1.4rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.65;
}

.ln-hero__meta {
    margin: 1.75rem 0 0;
    color: var(--kd-mint-light);
    font-size: 0.95rem;
    font-weight: 600;
}

/* The copy rises in on load, line by line, as on the other page heroes. */
.ln-hero__copy > * {
    animation: ln-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes ln-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* ---------- Topic bar: sticks under the fixed site nav ---------- */
.ln-topics {
    position: sticky;
    top: 4rem;
    z-index: 20;
    border-bottom: 1px solid var(--kd-line);
    background: #fff;
    transition: top 0.3s ease;
}

.ln-topics__inner {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
}

.ln-topics__inner::-webkit-scrollbar {
    display: none;
}

.ln-topics__link {
    display: inline-flex;
    flex: none;
    gap: 0.45rem;
    align-items: center;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    color: var(--kd-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ln-topics__link span {
    color: var(--kd-faint);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ln-topics__link:hover {
    background: var(--kd-brand-soft);
    color: var(--kd-brand);
}

.ln-topics__link.is-current {
    background: var(--kd-brand);
    color: #fff;
}

.ln-topics__link.is-current span {
    color: rgba(255, 255, 255, 0.7);
}

/* With the script, the highlight is one pill that glides from topic to topic (learn-index.js). */
.ln-topics__inner {
    position: relative;
}

.ln-topics__pill {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 999px;
    background: var(--kd-brand);
    opacity: 0;
    pointer-events: none;
}

.ln-topics__pill.is-on {
    opacity: 1;
}

.ln-topics__pill.is-gliding {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ln-topics__link {
    position: relative;
}

.has-pill .ln-topics__link.is-current {
    background: transparent;
}

.has-pill .ln-topics__link {
    transition: background-color 0.2s ease, color 0.3s ease;
}

.ln-topics__link:focus-visible {
    outline: 2px solid var(--kd-brand);
    outline-offset: 2px;
}

/* ---------- Chapters ---------- */
.ln-chapters,
.ln-empty {
    background: #F8FAFC;
}

.ln-chapter {
    padding: 4rem 0;
    scroll-margin-top: 7.5rem;
}

.ln-chapter + .ln-chapter {
    border-top: 1px solid var(--kd-line);
}

@media (min-width: 900px) {
    .ln-chapter {
        padding: 5.5rem 0;
    }

    .ln-chapter__inner {
        display: grid;
        grid-template-columns: 17rem minmax(0, 1fr);
        gap: 4rem;
        align-items: start;
    }

    .ln-chapter__head {
        position: sticky;
        top: 9rem;
    }
}

.ln-chapter__num {
    margin: 0 0 0.6rem;
    color: var(--kd-mint-ink);
    font-size: 0.85rem;
    font-weight: 600;
}

.ln-chapter__title {
    margin: 0;
    color: var(--kd-ink);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.ln-chapter__desc {
    margin: 0.85rem 0 2rem;
    color: var(--kd-body);
    line-height: 1.6;
}

/* ---------- Lessons ---------- */
.ln-lessons {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ln-lesson {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--kd-line);
    border-radius: 1rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

@media (min-width: 640px) {
    .ln-lesson {
        grid-template-columns: 16rem minmax(0, 1fr);
    }
}

.ln-lesson:hover {
    border-color: #C9D4EA;
    box-shadow: 0 18px 40px -22px rgba(42, 64, 115, 0.35);
    transform: translateY(-2px);
}

.ln-lesson:focus-visible {
    outline: 3px solid var(--kd-brand);
    outline-offset: 3px;
}

.ln-lesson__media {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    padding: 0.75rem;
    border-bottom: 1px solid var(--kd-line);
    background: #F8FAFC;
}

@media (min-width: 640px) {
    .ln-lesson__media {
        aspect-ratio: auto;
        border-right: 1px solid var(--kd-line);
        border-bottom: 0;
    }
}

.ln-lesson__media img {
    width: 100%;
    height: 100%;
    max-height: 11rem;
    object-fit: contain;
}

/* Lessons without a hero image show the emblem on a brand panel instead. */
.ln-lesson__media:has(.ln-lesson__mark) {
    background: linear-gradient(160deg, var(--kd-brand), var(--kd-brand-deep));
}

.ln-lesson__media .ln-lesson__mark {
    width: 3.5rem;
    height: auto;
    opacity: 0.5;
}

.ln-lesson__body {
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.5rem;
}

.ln-lesson__num {
    color: var(--kd-faint);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ln-lesson__title {
    margin: 0.35rem 0 0;
    color: var(--kd-ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.ln-lesson:hover .ln-lesson__title {
    color: var(--kd-brand);
}

.ln-lesson__intro {
    display: -webkit-box;
    margin: 0.6rem 0 0;
    overflow: hidden;
    color: var(--kd-body);
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ln-lesson__meta {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: auto 0 0;
    padding-top: 1rem;
    color: var(--kd-muted);
    font-size: 0.875rem;
}

.ln-lesson__read {
    color: var(--kd-brand);
    font-weight: 600;
}

.ln-lesson__read span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.ln-lesson:hover .ln-lesson__read span {
    transform: translateX(3px);
}

/* ---------- Reveal: a topic's heading and lessons rise in, one after another, the first time
   it comes into view. Only with the script and without reduced motion (learn-index.js). ---------- */
.ln-reveal .ln-chapter__head,
.ln-reveal .ln-lessons > li {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.ln-reveal .ln-chapter.is-in .ln-chapter__head,
.ln-reveal .ln-chapter.is-in .ln-lessons > li {
    opacity: 1;
    transform: none;
}

.ln-reveal .ln-chapter.is-in .ln-lessons > li:nth-child(1) { transition-delay: 0.08s; }
.ln-reveal .ln-chapter.is-in .ln-lessons > li:nth-child(2) { transition-delay: 0.16s; }
.ln-reveal .ln-chapter.is-in .ln-lessons > li:nth-child(3) { transition-delay: 0.24s; }
.ln-reveal .ln-chapter.is-in .ln-lessons > li:nth-child(n + 4) { transition-delay: 0.32s; }

/* ---------- No articles yet ---------- */
.ln-empty {
    padding: 5rem 0;
    color: var(--kd-body);
    font-size: 1.15rem;
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.ln-topics) {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ln-hero__copy > * {
        animation: none;
    }

    .ln-topics,
    .ln-lesson,
    .ln-lesson__read span {
        transition: none;
    }

    .ln-lesson:hover {
        transform: none;
    }
}
