.mew-timeline {
    --mew-accent: #4f46e5;
    --mew-line: #dce3fb;
    --mew-line-w: 2px;
    --mew-dot: 34px;
    --mew-btn: 52px;
    --mew-card-bg: #f1f2f8;
    --mew-pv: 3;
    --mew-total: 5;
}

.mew-timeline__scroll {
    overflow: hidden;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.mew-timeline__track {
    position: relative;
    display: flex;
    width: calc(var(--mew-total) * 100% / var(--mew-pv));
    will-change: transform;
    transition: transform 0.4s ease;
}

.mew-timeline__node {
    appearance: none;
    flex: 0 0 calc(100% / var(--mew-total));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none !important;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mew-timeline__node:focus-visible {
    outline: 2px solid var(--mew-accent);
    outline-offset: 4px;
    border-radius: 6px;
}

.mew-timeline__year {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1b1b3a;
    transition: color 0.2s ease;
}

.mew-timeline__node.is-active .mew-timeline__year {
    color: var(--mew-accent);
}

.mew-timeline__node:hover .mew-timeline__year {
    color: var(--mew-accent);
}

.mew-timeline__row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--mew-dot);
}

.mew-timeline__row::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--mew-line-w);
    background: var(--mew-line);
    transform: translateY(-50%);
}

.mew-timeline__dot {
    position: relative;
    box-sizing: border-box;
    z-index: 1;
    display: grid;
    place-items: center;
    width: var(--mew-dot);
    height: var(--mew-dot);
    border-radius: 50%;
    background: #eef2ff;
    box-shadow: inset 0 0 0 2px #c7d2fe;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.mew-timeline__dot::after {
    content: '';
    width: 46%;
    height: 46%;
    border-radius: 50%;
    background: #a5b4fc;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mew-timeline__node.is-active .mew-timeline__dot {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #c7d2fe;
}

.mew-timeline__node.is-active .mew-timeline__dot::after {
    background: var(--mew-accent);
    transform: scale(1.15);
}

.mew-timeline__node:hover .mew-timeline__dot::after {
    background: var(--mew-accent);
}

.mew-timeline__card {
    box-sizing: border-box;
    max-width: 700px;
    margin: 40px auto 0;
    padding: 40px 48px 32px;
    background: var(--mew-card-bg);
    border-radius: 18px;
}

.mew-timeline__panels {
    text-align: center;
}

.mew-timeline__panel {
    display: none;
    color: #1b1b3a;
    font-size: 1.25rem;
    line-height: 1.6;
}

.mew-timeline__panel.is-active {
    display: block;
    animation: mew-timeline-in 0.3s ease;
}

@keyframes mew-timeline-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mew-timeline__title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
}

.mew-timeline__text {
    overflow-wrap: anywhere;
}

.mew-timeline__nav {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.mew-timeline__btn {
    appearance: none;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: var(--mew-btn);
    height: var(--mew-btn);
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease,
        color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.mew-timeline__btn:hover {
    transform: translateY(-2px);
}

.mew-timeline__btn:focus-visible {
    outline: 2px solid var(--mew-accent);
    outline-offset: 3px;
}

.mew-timeline__btn:disabled {
    cursor: default;
    opacity: 0.4;
    transform: none;
}

.mew-timeline__btn--prev {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #1b1b3a;
}

.mew-timeline__btn--next {
    background-color: var(--mew-accent)!important;
    border-color: var(--mew-accent)!important;
    color: #ffffff!important;
}

.mew-timeline__btn svg {
    display: block;
}

@media (max-width: 767px) {
    .mew-timeline {
        --mew-pv: 1;
    }

    .mew-timeline__track {
        width: 100%;
        transform: none !important;
    }

    .mew-timeline__node {
        display: none;
    }

    .mew-timeline__node.is-active {
        display: flex;
        flex: 1 1 100%;
        gap: 30px;
    }

    .mew-timeline__row {
        height: calc(var(--mew-dot) + 12px);
    }

    .mew-timeline__dot {
        width: calc(var(--mew-dot) + 12px);
        height: calc(var(--mew-dot) + 12px);
    }

    .mew-timeline__card {
        padding: 32px 22px 28px;
        margin-top: 36px;
    }

    .mew-timeline__panel {
        font-size: 1.15rem;
        line-height: 1.6;
    }

    .mew-timeline__year {
        font-size: clamp(32px, 10vw, 44px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mew-timeline__track,
    .mew-timeline__panel.is-active {
        transition: none;
        animation: none;
    }

    .mew-timeline__btn,
    .mew-timeline__year,
    .mew-timeline__dot,
    .mew-timeline__dot::after {
        transition: none;
    }

    .mew-timeline__btn:hover {
        transform: none;
    }
}
