.history-section {
    --timeline-gap: clamp(16px, 2.4vw, 36px);
    --timeline-gutter: calc((100% - var(--wrap)) / 2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-block-size: calc(100dvh - var(--header-height));
    background: linear-gradient(rgb(245 249 251 / 98%), rgb(245 249 251 / 84%)),
        url("assets/company-history-background.jpg") center bottom / cover;
}

.history-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: clamp(28px, 4vw, 50px);
}

.history-heading p {
    margin-top: 12px;
    color: var(--muted);
}

.history-controls {
    display: flex;
    flex: none;
    gap: 8px;
}

.history-controls button {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #bfcdd0;
    border-radius: 50%;
    background: transparent;
    font-size: 1.35rem;
    transition: color .2s, background-color .2s;
}

.history-controls button:hover:enabled {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.history-controls button:disabled {
    opacity: .4;
}

.history-track {
    position: relative;
    display: flex;
    gap: var(--timeline-gap);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--timeline-gutter);
    padding: 5px var(--timeline-gutter) 12px;
    scrollbar-width: none;
    cursor: grab;
}

.history-track::-webkit-scrollbar {
    display: none;
}

.history-track:focus-visible {
    outline-offset: -4px;
}

.history-track.is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

.history-card {
    display: flex;
    flex: 0 0 calc((100% - var(--timeline-gap) * 3) / 3.3);
    flex-direction: column;
    position: relative;
    min-width: 0;
    padding-top: 32px;
    scroll-snap-align: start;
}

.history-card::before {
    position: absolute;
    top: 7px;
    inset-inline: 0 calc(-1 * var(--timeline-gap));
    height: 1px;
    background: #c4d5d8;
    content: '';
}

.history-card:last-child::before {
    inset-inline-end: 0;
}

.history-card::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border: 2px solid #f5f9fb;
    border-radius: 50%;
    background: #b5c7cb;
    box-shadow: 0 0 0 1px #b5c7cb;
    content: '';
}

.history-card.is-active::after,
.history-card.is-active h3 {
    color: var(--accent);
}

.history-card.is-active::after {
    background: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

.history-card h3 {
    font: 300 1.625rem/1.4 var(--light-font);
}

.history-card p {
    margin-block: 10px 18px;
    color: var(--muted);
}

.history-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    margin-top: auto;
    border-radius: 8px;
    object-fit: cover;
}

@media (max-width: 950px) {
    .history-card {
        flex-basis: calc((100% - var(--timeline-gap) * 2) / 2.25);
    }
}

@media (max-width: 600px) {
    .history-heading {
        align-items: flex-start;
    }

    .history-controls button {
        width: 44px;
        height: 44px;
    }

    .history-card {
        flex-basis: 82%;
    }
}
