:root {
    --bg: #e5e5e7;
    --surface: #f5f5f5;
    --ink: #212121;
    --muted: #6d6d6d;

    --primary: #3f51b5;
    --primaryDark: #303f9f;
    --primaryLight: #c5cae9;
    --accent: #ff4081;

    --cardShadow: 0 22px 30px -18px rgba(0, 0, 0, 0.35);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    overflow-x: hidden;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

.timeline {
    padding: 90px 0 110px;
    position: relative;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
    position: relative;
}

.hero {
    text-align: center;
    margin-bottom: 70px;
}

.heroBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(63, 81, 181, 0.25);
    background: rgba(63, 81, 181, 0.1);
    color: var(--primaryDark);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.hero h1 {
    margin-top: 14px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 0.6px;
}

.hero p {
    margin: 10px auto 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.6;
}

.timelineRail {
    position: absolute;
    top: 190px;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        rgba(197, 202, 233, 0.65),
        rgba(63, 81, 181, 0.25)
    );
    box-shadow: 0 0 0 6px rgba(197, 202, 233, 0.12);
}

.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(--primary);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 28px;
    box-shadow: 0 0 0 6px rgba(197, 202, 233, 0.35),
        0 18px 40px rgba(63, 81, 181, 0.25);
}

.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.42);
}

.cardTop {
    position: relative;
}

.imgWrap {
    width: 100%;
    height: 190px;
    background: linear-gradient(
        135deg,
        rgba(63, 81, 181, 0.12),
        rgba(255, 64, 129, 0.08)
    );
    overflow: hidden;
}

.imgWrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 0.35s ease;
}

.card:hover .imgWrap img {
    transform: scale(1.06);
}

.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;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 64, 129, 0.92);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.3px;
    box-shadow: 0 14px 28px rgba(255, 64, 129, 0.25);
}

.cardBody {
    padding: 18px 18px 16px;
}

.cardBody h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.cardBody p {
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 12px;
}

.meta {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.meta li {
    position: relative;
    padding-left: 18px;
    color: rgba(33, 33, 33, 0.82);
    font-size: 14px;
}

.meta li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(63, 81, 181, 0.85);
    position: absolute;
    left: 0;
    top: 7px;
}

.footerNote {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(63, 81, 181, 0.85);
    box-shadow: 0 0 0 0 rgba(63, 81, 181, 0.35);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 81, 181, 0.35);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(63, 81, 181, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(63, 81, 181, 0);
    }
}

/* 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);
}

/* little arrow pointers like classic timeline */
.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 */
.toTop {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(245, 245, 245, 0.92);
    color: rgba(33, 33, 33, 0.88);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toTop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toTop:hover {
    transform: translateY(-2px);
}

/* responsive */
@media (max-width: 840px) {
    .timelineRail {
        left: 44px;
        transform: none;
    }
    .timelineDot {
        left: 44px;
        transform: none;
    }

    .timelineItem {
        justify-content: flex-start !important;
    }

    .card {
        width: calc(100% - 74px);
        margin-left: 74px;
    }

    .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;
    }
}
