:root {
    --bg: #e5e5e7;
    --surface: #FEF8F2;
    --ink: #212121;
    --muted: #6d6d6d;

    --primary: #ABB690;
    --primaryDark: #303f9f;
    --primaryLight: #c5cae9;
    --accent: #ff4081;
    --brownish: #b6a890;

    --cardShadow: 0 22px 30px -18px rgba(0, 0, 0, 0.35);
    --radius: 16px;
}



.timelineRail {
    position: absolute;
    top: 235px;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgb(229 233 219), rgb(211 210 210));
    box-shadow: 0 0 0 6px rgb(244 246 240);
}

.timelineItem {
    position: relative;
    width: 100%;
    margin: 0 0 70px;
    display: flex;
    justify-content: flex-start;
}

.timelineItem.right {
    justify-content: flex-end;
}

.timelineDot {
    width: 28px;
    height: 28px;
    background: var(--brownish);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 28px;
    box-shadow: 0 0 0 6px rgba(197, 202, 233, 0.15),
        0 18px 40px rgba(63, 81, 181, 0.15);
}

.card {
    width: min(520px, 92%);
    background: var(--surface);
    border-radius: var(--radius);
    /* box-shadow: var(--cardShadow); */
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 38px -18px rgba(0, 0, 0, 0.05);
}

.cardTop {
    position: relative;
}

.cardTop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.2)
    );
    pointer-events: none;
}

.date {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 50%;
    background: #889868;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.3px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cardBody {
    padding: 18px 18px 16px;
}

.cardBody h2 {
    font-size: 30px;
    margin-bottom: 8px;
    margin-top: 1em;
    text-align: left;
}

.cardBody p {
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 12px;
    transform: translateY(0);
}

.cardBody a {
    color: var(--primary);
}


/* reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.left {
    transform: translate(-56px, 16px);
}
.reveal.right {
    transform: translate(56px, 16px);
}

.reveal.show {
    opacity: 1;
    transform: translate(0, 0);
}

.timelineItem.left .card::after,
.timelineItem.right .card::after {
    content: "";
    position: absolute;
    top: 36px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timelineItem.left .card::after {
    right: -14px;
    border-width: 10px 0 10px 14px;
    border-color: transparent transparent transparent var(--surface);
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.15));
}

.timelineItem.right .card::after {
    left: -14px;
    border-width: 10px 14px 10px 0;
    border-color: transparent var(--surface) transparent transparent;
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.15));
}

/* Go top button not needed*/
.toTop {display: none;}

video {
    width: 100%;
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top; 
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    transition: max-height 0.4s ease-in-out, 
                opacity 0.4s ease-in-out, 
                transform 0.4s ease-in-out;
}

video.show-video {
    max-height: 500px; 
    opacity: 1;
    transform: scaleY(1);
}

#video-button {
    position: relative;
}

#video-button img {
    width: 40px;
    position: absolute;
    background: var(--surface);
    border-radius: 8px;
    padding: 4px;
    top: 18px;
    left: 14px;
    z-index: 1000;
}

/* responsive */
@media (max-width: 840px) {
    .timelineRail {
        left: 44px;
        transform: none;
        top: 200px;
    }
    .timelineDot {
        left: 14px;
        transform: none;
    }

    .timelineItem {
        justify-content: flex-start !important;
    }

    .card {
        width: calc(100% - 74px);
        margin-left: 55px;
    }
    .date {
        padding: 5px 13px;
    }

    .timelineItem.left .card::after,
    .timelineItem.right .card::after {
        left: -14px;
        right: auto;
        border-width: 10px 14px 10px 0;
        border-color: transparent var(--surface) transparent transparent;
    }
}

@media(min-width: 770px) and (max-width: 1140px) {
    .card {
        width: min(425px, 92%);
    }
}

@media(width: 768px) {
    .timelineDot {
        left: -4px;
        transform: none;
    }
}

@media(max-width: 591px) {
    .timelineDot {
        left: 20px;
        transform: none;
    }
    .cardBody h2 {
        font-size: 25px;
    }
}
