#timeline {
    position: relative;
    display: grid;
    grid-template-rows: 160px 14% 2.7% 14% 2.7% 14% 2.7% 14% 2.7% 14%;
    grid-template-columns: 20% 60% 20%;
    /* box-shadow: inset 0px 10px 10px -10px rgba(0,0,0,0.75),
    inset 0px -10px 10px -10px rgba(0,0,0,0.75); */
    justify-content: center;
    align-items: center;
    height: 1660px;
    padding: 50px 0;
    flex-wrap: wrap;
}

#timeline svg {
    /* max-width: 1000px; */
    /* height: 100px; */
    color: var(--clr-text);
    position: absolute;
    z-index: 100;
    transition: stroke-dashoffset 1s ease-in-out;
    will-change: stroke-dashoffset, translateY;
    /* filter: drop-shadow( 5px 0px 2px rgba(185, 185, 185, 1)) drop-shadow( -5px 0px 2px rgba(185, 185, 185, 1)) drop-shadow( 0px 5px 2px rgba(185, 185, 185, 1)) drop-shadow( 0px -5px 2px rgba(185, 185, 185, 1)); */
}

#path-wrapper {
    width: 100%;
    height: 100%;
    /* border: 2px solid blue; */
    display: flex;
    justify-content: center;
}

#timeline .wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* border: 2px solid yellow; */
    position: relative;

    transform-style: preserve-3d;
    perspective: 1000px;
}

#timeline .wrapper.left {
    justify-content: left;
    text-align: right;
}

#timeline .wrapper.right {
    justify-content: right;
}

#timeline .container {
    /* padding: 10px; */
    position: relative;
    width: 400px;
    border: none;
    background-size: 290%;
    /* color: brown; */
    border-radius: 10px;
    box-shadow: 0 0 0px 0px rgba(0, 0, 0, 0.1);
    padding: 1.2rem 0 1.2rem 0;
    text-align: left;
    outline: none; /* Remove outline */
    z-index: 10;
    overflow: hidden;
    /* transition: background-position 1s ease-in-out; */
    transition: all 1s cubic-bezier(.76,0,.24,1);
    overflow-wrap: break-word;
    hyphens: auto;

    transform-style: preserve-3d;
    perspective: 1000px;
    transform: translateZ(1px);
}

#timeline .container.left {
    background-color: color-mix(in srgb, var(--clr-navbar-sticked-menu) 90%, var(--clr-primary));
}

#timeline .container.right {
    background-color: color-mix(in srgb, var(--clr-navbar-sticked-menu) 90%, var(--clr-secondary));
}

#timeline .container.active {
    box-shadow: 8px 8px 16px 2px rgba(0, 0, 0, 0.1);
    scale: 1.05;
}

#timeline .container.now.active {
    scale: 1.1;
}

#timeline .container .pseudo {
    position: absolute;
    top: -25%;
    width: 300%;
    height: 150%;
    background-color: white;
    z-index: -100;
    border-radius: 500px;
    transition: all 1s cubic-bezier(.76,0,.24,1);
    box-shadow: 0px 0px 10px 5px rgba(255,255,255,1);
}

#timeline .container.now .pseudo {
    background-image: radial-gradient(circle at 55% top, color-mix(in srgb, var(--clr-primary) 20%, transparent) 0%, transparent 30%),
        radial-gradient(circle at right bottom, color-mix(in srgb, var(--clr-secondary) 20%, transparent) 0%, transparent 30%);
}

#timeline .container.right .pseudo {
    left: -320%;
}

#timeline .container.right.active .pseudo {
    translate: 50% 0;
}

#timeline .container.left .pseudo {
    right: -320%;
}

#timeline .container.left.active .pseudo {
    translate: -50% 0;
}


#timeline .wrapper.center::before {
    content: attr(data-before);
    text-wrap-mode: balance;
    height: 0;
    position: absolute;
    top: 50%;
    width: 100%;
    z-index: -10;
    /* border: 2px solid #929292; */
    background-color: #929292;
    height: 4px;
    white-space: pre;
    font-size: 1rem;
    transition: background-position 1s ease-in-out;
    line-height: 1.618rem;
}

#timeline .wrapper.center.left::before {
    background: linear-gradient(to right, rgba(146,146,146,1) 0%, rgba(146,146,146,1) 49.5%, rgba(217,217,217,1) 50.5%, rgba(217,217,217,1) 100%);
    background-position: left;
    background-size: 250%;
}

#timeline .wrapper.center.right::before {
    background: linear-gradient(to left, rgba(146,146,146,1) 0%, rgba(146,146,146,1) 49.5%, rgba(217,217,217,1) 50.5%, rgba(217,217,217,1) 100%);
    background-position: right;
    background-size: 250%;
}

#timeline .wrapper.center.left:has(.container.active)::before {
    background-size: 250%;
    background-position: right;
    transition: background-position 1s ease-in-out;
}

#timeline .wrapper.center.right:has(.container.active)::before {
    background-size: 250%;
    background-position: left;
    transition: background-position 1s ease-in-out;
}

#timeline .wrapper.center::after {
    content: attr(data-after);
    font-size: 1.2944rem;
    font-weight: bold;
    line-height: 1.5;
    top: calc(50% - 1.9rem);
    width: 100%;
    position: absolute;
    white-space: pre;
}

/* #timeline .container::before {
    position: absolute;
    top: 0;
    border-radius: 100%;
    width: 100%;
    height: 100%;
    content: "";
    background-color: brown;
    z-index: -400;
} */

#timeline .container p {
    font-size: 1rem;
    padding: 0 20px;
}

#timeline .container p::first-line {
    font-size: 1.2rem;
    font-weight: bold;
}

#timeline .container p i {
    font-size: 1.618rem;
    padding-right: .5rem;
}

@media (max-width: 1000px) {
    #timeline {
        grid-template-rows: 0px 16% 5% 16% 5% 16% 5% 16% 5% 16%;
        grid-template-columns: 0 100% 0;
        max-width: 320px;
        margin-inline: auto;
        height: 1000px;
        --_expanded-height: 1000px !important;
    }

    #timeline .wrapper.center {
        justify-content: center;
    }

    #timeline .wrapper.left {
        text-align: left;
    }

    #timeline .wrapper.right {
        text-align: right;
    }

    #timeline .wrapper.center::after {
        font-size: 1.2944rem;
        margin-left: -50px;
        margin-right: -50px;
    }

    #timeline .container.left {
        margin-left: 100px;
    }

    #timeline .container.right {
        margin-right: 100px;
    }

    #timeline .container {
        max-width: 200px;
    }

    #timeline .container h1 {
        font-size: 1.2rem;
    }
    
    #timeline .container h2 {
        font-size: 1rem;
    }
    
    #timeline .container p {
        font-size: .7rem;
        padding: 0 20px;
    }

    #timeline .container p::first-line {
        font-size: 1rem;
        font-weight: bold;
    }
    
    #timeline .container p i {
        font-size: 1.2rem;
        padding-right: .5rem;
    }

}