.timeline-page {
    padding-bottom: 96px;
}

.timeline-hero {
    position: relative;
    overflow: hidden;
}

.timeline-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top center, rgba(20, 155, 159, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 55%);
    pointer-events: none;
}

.timeline-lead {
    max-width: 820px;
}

.timeline-overview,
.timeline-legend-section,
.timeline-section {
    position: relative;
    z-index: 1;
}

.timeline-overview-card {
    text-align: left;
}

.timeline-overview-card h3 {
    margin-bottom: 12px;
}

.timeline-controls {
    display: grid;
    gap: 24px;
    padding: 32px;
}

.timeline-controls-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.timeline-controls-head h2 {
    margin-bottom: 0;
    text-align: left;
}

.timeline-controls-head .section-label {
    margin-bottom: 10px;
    text-align: left;
}

.timeline-summary {
    color: rgba(232, 255, 251, 0.62);
    white-space: nowrap;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.timeline-tag,
.timeline-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #e8fffb;
    font-size: 0.88rem;
    line-height: 1;
}

.timeline-filter {
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.timeline-filter:hover,
.timeline-filter:focus-visible,
.timeline-filter.is-active {
    transform: translateY(-2px);
    border-color: rgba(232, 255, 251, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.timeline-tag-world {
    background: rgba(86, 142, 92, 0.18);
    border-color: rgba(86, 142, 92, 0.34);
}

.timeline-tag-politics {
    background: rgba(74, 112, 181, 0.18);
    border-color: rgba(74, 112, 181, 0.34);
}

.timeline-tag-war {
    background: rgba(20, 155, 159, 0.22);
    border-color: rgba(20, 155, 159, 0.38);
}

.timeline-tag-build {
    background: rgba(199, 145, 63, 0.18);
    border-color: rgba(199, 145, 63, 0.34);
}

.timeline-tag-culture {
    background: rgba(114, 91, 179, 0.18);
    border-color: rgba(114, 91, 179, 0.34);
}

.timeline-era-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.timeline-era-link {
    display: grid;
    gap: 6px;
    padding: 18px 20px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.025);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.timeline-era-link span {
    color: rgba(232, 255, 251, 0.62);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.timeline-era-link strong {
    font-size: 1rem;
    font-weight: 600;
}

.timeline-era-link:hover,
.timeline-era-link:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(20, 155, 159, 0.34);
    background: rgba(20, 155, 159, 0.12);
}

.timeline-stack {
    display: grid;
    gap: 28px;
}

.timeline-era {
    padding: 34px 32px;
}

.timeline-era-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.timeline-era-head h2 {
    margin-bottom: 0;
    text-align: left;
}

.timeline-era-label {
    margin-bottom: 10px;
    color: var(--color-accent);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.timeline-era-range {
    color: rgba(232, 255, 251, 0.62);
    white-space: nowrap;
}

.timeline-events {
    position: relative;
    display: grid;
    gap: 24px;
    padding-left: 24px;
}

.timeline-events::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 7px;
    width: 2px;
    background: linear-gradient(180deg, rgba(20, 155, 159, 0.8), rgba(232, 255, 251, 0.14));
}

.timeline-event {
    position: relative;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 18px;
}

.timeline-marker {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-top: 10px;
    border: 3px solid rgba(20, 155, 159, 0.9);
    border-radius: 999px;
    background: #e8fffb;
    box-shadow: 0 0 0 6px rgba(20, 155, 159, 0.12);
}

.timeline-event-body {
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.025);
}

.timeline-event-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.timeline-date {
    color: rgba(232, 255, 251, 0.62);
    font-size: 0.92rem;
}

.timeline-event-body h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.timeline-event-body p {
    color: rgba(232, 255, 251, 0.78);
    line-height: 1.75;
}

.timeline-era-empty {
    padding: 34px 32px;
}

.timeline-empty-copy {
    color: rgba(232, 255, 251, 0.78);
    line-height: 1.75;
}

@media (max-width: 860px) {
    .timeline-controls {
        padding: 26px 22px;
    }

    .timeline-controls-head {
        align-items: start;
        flex-direction: column;
    }

    .timeline-summary {
        white-space: normal;
    }

    .timeline-era {
        padding: 26px 22px;
    }

    .timeline-era-head {
        align-items: start;
        flex-direction: column;
    }

    .timeline-era-range {
        white-space: normal;
    }

    .timeline-events {
        padding-left: 18px;
    }
}

@media (max-width: 640px) {
    .timeline-controls {
        padding: 24px 20px;
    }

    .timeline-event {
        gap: 14px;
    }

    .timeline-event-body {
        padding: 18px;
    }
}
