/* ==========================================
   CONVERGENT TIMELINE — Two histories, one vision
   Dual-branch scroll-driven timeline merging into one
   ========================================== */

.tl-converge {
    position: relative;
    width: 100%;
    background: var(--bg-color);
    overflow: hidden;
    padding: 10rem 0 0;
}

/* ─── Section header ─── */
.tl__header {
    text-align: center;
    padding: 0 6vw 10rem;
}

.tl__eyebrow {
    display: inline-block;
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs-2);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-eyebrow);
    color: var(--gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(12px);
}

.tl__title {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-h2);
    line-height: var(--line-height-heading-relaxed);
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0;
}

.tl__title-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.12em;
}

.tl__title-word {
    display: inline-block;
    transform: translateY(110%);
    will-change: transform;
}

.tl__gold {
    color: var(--gold);
    font-style: normal;
}

/* ─── Canvas (scrollable area) ─── */
.tl__canvas {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 8rem;
}

/* ─── SVG convergent paths ─── */
.tl__paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tl__path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.tl__path--left {
    stroke: rgba(var(--color-gold-rgb), 0.5);
}

.tl__path--right {
    stroke: rgba(var(--color-sky-blue-rgb), 0.5);
}

.tl__path--merged {
    stroke: var(--gold);
    stroke-width: 2;
}

/* ─── Branch labels (plain text, centered on path) ─── */
.tl__branch-label {
    position: absolute;
    top: 0;
    z-index: 10;
    opacity: 0;
    text-align: center;
}

.tl__branch-label--left {
    left: 24%;
    transform: translateX(-50%);
}

.tl__branch-label--right {
    right: 24%;
    transform: translateX(50%);
}

.tl__branch-name {
    font-family: var(--font-family-base);
    font-size: var(--font-size-xs-3);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-section);
    white-space: nowrap;
}

.tl__branch-label--left .tl__branch-name {
    color: var(--gold);
}

.tl__branch-label--right .tl__branch-name {
    color: rgb(140, 175, 230);
}

/* ─── Events (deconstructed layout) ─── */
.tl__event {
    position: relative;
    width: 48%;
    margin-bottom: 10rem;
    z-index: 3;
    opacity: 0;
    will-change: transform, opacity;
}

.tl__event--left {
    margin-right: auto;
    margin-left: 2%;
    transform: translateX(-40px);
}

.tl__event--right {
    margin-left: auto;
    margin-right: 2%;
    transform: translateX(40px);
}

/* ─── Image block (with inner parallax) ─── */
.tl__event-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 8;
}

.tl__event-img {
    display: block;
    width: 100%;
    height: 120%;
    object-fit: cover;
    filter: brightness(0.65) saturate(0.8) contrast(1.05);
    transition: filter 0.7s ease;
    will-change: transform;
}

.tl__event:hover .tl__event-img {
    filter: brightness(0.55) saturate(0.95) contrast(1.05);
}

/* ─── Color overlay (covers image, reveals on scroll) ─── */
.tl__event-color {
    position: absolute;
    inset: 0;
    z-index: 2;
    transform-origin: top center;
    will-change: transform;
}

.tl__event--left .tl__event-color {
    background: var(--gold);
}

.tl__event--right .tl__event-color {
    background: var(--blue);
}

/* ─── Year — overlaps top of image, parallax fastest ─── */
.tl__event-year {
    position: relative;
    display: block;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-display-md);
    letter-spacing: var(--letter-spacing-title-tighter);
    line-height: var(--line-height-flat);
    /*margin-top: -1.8em;*/
    z-index: 4;
    will-change: transform;
}

.tl__event--left .tl__event-year {
    color: var(--gold);
    margin-left: 0%;
}

.tl__event--right .tl__event-year {
    color: rgba(var(--color-timeline-blue-rgb), 1);
    text-align: right;
    margin-right: 0%;
}

/* ─── Title — slightly overlaps image bottom, medium parallax ─── */
.tl__event-title {
    position: relative;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-author-title);
    color: var(--color-white);
    margin: 0.6rem 0 0.5rem;
    line-height: var(--line-height-subtitle);
    z-index: 4;
    will-change: transform;
}

.tl__event--left .tl__event-title {
    padding-left: 2%;
}

.tl__event--right .tl__event-title {
    text-align: right;
    padding-right: 2%;
}

/* ─── Text — below image, slowest parallax ─── */
.tl__event-text {
    position: relative;
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm-7);
    line-height: var(--line-height-copy-medium);
    color: rgba(var(--color-white-rgb), 0.75);
    margin: 0;
    max-width: 90%;
    z-index: 4;
    will-change: transform;
}

.tl__event--left .tl__event-text {
    padding-left: 2%;
}

.tl__event--right .tl__event-text {
    margin-left: auto;
    text-align: right;
    padding-right: 2%;
}

.tl__event-text > *,
.tl__merge-text > * {
    margin: 0;
}

.tl__event-text > * + *,
.tl__merge-text > * + * {
    margin-top: var(--space-xs);
}

/* ─── Merge point ─── */
.tl__merge {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    z-index: 5;
    opacity: 0;
    transform: scale(0.9);
}

.tl__merge-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 500px;
    height: 500px;
    border-radius: var(--round-radius);
    background: radial-gradient(circle, rgba(var(--color-gold-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.tl__merge-year {
    display: block;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-display-lg);
    color: var(--gold);
    letter-spacing: var(--letter-spacing-title-tight);
    line-height: var(--line-height-flat);
    margin-bottom: 0.5rem;
    opacity: 0;
}

.tl__merge-title {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-h3-5);
    text-transform: uppercase;
    color: var(--color-white);
    margin: 0 0 1rem;
    opacity: 0;
    transform: translateY(20px);
}

.tl__merge-text {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-copy-loose);
    color: var(--color-white);
    max-width: 480px;
    margin: 0;
    opacity: 0;
    transform: translateY(16px);
}

/* ─── Ambient glow lines (decorative) ─── */
.tl__canvas::before,
.tl__canvas::after {
    content: '';
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.tl__canvas::before {
    left: 24%;
    background: linear-gradient(180deg, transparent 0%, rgba(var(--color-gold-rgb), 0.06) 20%, rgba(var(--color-gold-rgb), 0.06) 80%, transparent 100%);
}

.tl__canvas::after {
    right: 24%;
    background: linear-gradient(180deg, transparent 0%, rgba(var(--color-sky-blue-rgb), 0.04) 20%, rgba(var(--color-sky-blue-rgb), 0.04) 80%, transparent 100%);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1023px) {
    .tl-converge {
        padding: 6rem 0 0;
    }

    .tl__header {
        padding: 0 1.5rem 3rem;
    }

    .tl__canvas {
        padding: 0 1rem 4rem;
    }

    .tl__paths {
        display: none;
    }

    .tl__canvas::before,
    .tl__canvas::after {
        display: none;
    }

    .tl__branch-label {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        display: inline-block;
        margin-bottom: 2rem;
        opacity: 1;
    }

    .tl__branch-label--right {
        float: right;
        transform: none;
    }

    .tl__branch-label--left{
        transform: none;
    }


    .tl__event {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 5rem;
        transform: none;
    }

    .tl__event-year {
        font-size: var(--font-size-h2-mobile);
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .tl__event--right .tl__event-year,
    .tl__event--right .tl__event-title,
    .tl__event--right .tl__event-text {
        text-align: left;
        padding-left: 2%;
        padding-right: 0;
        margin-left: 0;
    }

    .tl__event-card {
        aspect-ratio: 16 / 10;
    }

    /* Show branch indicator on mobile */
    .tl__event::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 3px;
        height: 100%;
        z-index: 5;
    }

    .tl__event--left::before {
        background: var(--gold);
    }

    .tl__event--right::before {
        background: rgba(var(--color-timeline-blue-rgb), 0.7);
    }

    .tl__merge {
        padding: 4rem 1rem 2rem;
    }

    .tl__merge-burst {
        width: 280px;
        height: 280px;
    }
}
