.history-section {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 94% 0%, rgba(35, 82, 155, 0.09), transparent 58%),
    linear-gradient(180deg, #f7f9fc, #eef3f8);
}

.history-axis-frame {
  position: relative;
}

.history-axis-frame::before {
  position: absolute;
  top: 8.9375rem;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: linear-gradient(90deg, #91b1d5, var(--primary) 35%, var(--primary) 65%, #91b1d5);
  transform: translateX(-50%);
  content: "";
  pointer-events: none;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.history-toolbar h2 {
  margin: 0;
  color: var(--title);
  font-size: clamp(1.75rem, 2.3vw, 2.25rem);
}

.history-toolbar p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.history-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.history-controls[hidden] { display: none; }

.history-controls button {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(35, 82, 155, 0.3);
  border-radius: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.history-controls button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.history-controls button:disabled { opacity: 0.3; cursor: default; }
.history-controls svg { width: 1.25rem; height: 1.25rem; }

.history-section .history-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 6rem) / 4);
  gap: 2rem;
  max-width: none;
  margin: 0;
  padding: 0.5rem 0 1.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.history-section .timeline-item {
  min-width: 0;
  padding: 0 1.75rem 2rem 0;
  scroll-snap-align: start;
}

.history-section .timeline-item:last-child { padding-bottom: 2rem; }

.history-section .timeline-item::before {
  z-index: 1;
  top: 8rem;
  left: 0;
  width: 0.875rem;
  height: 0.875rem;
  border: 3px solid #f3f6fa;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(35, 82, 155, 0.55);
  transition: box-shadow 220ms ease, background-color 220ms ease;
}

.history-section .timeline-item::after {
  content: none;
}

.history-section .timeline-year {
  display: block;
  color: var(--primary);
  font-size: 2.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color 220ms ease;
}

.history-section .timeline-item h3 {
  min-height: 3.625rem;
  margin: 0.625rem 0 0;
  color: var(--title);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  transition: color 220ms ease;
}

.history-section .timeline-item p {
  margin: 2.625rem 0 0;
  color: #566579;
  font-size: 0.9375rem;
  line-height: 1.95;
}

.history-section .timeline-item:hover::before {
  background: #337fbd;
  box-shadow: 0 0 0 0.4375rem rgba(35, 82, 155, 0.1), 0 0 0 1px var(--primary);
}

.history-section .timeline-item:hover h3,
.history-section .timeline-item:hover .timeline-year { color: #176ca8; }

.history-track:focus-visible,
.history-controls button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 0.25rem;
}

@media (max-width: 1023px) {
  .history-section .history-track { grid-auto-columns: calc((100% - 3rem) / 3); gap: 1.5rem; }
}

@media (max-width: 767px) {
  .history-toolbar { margin-bottom: 2.5rem; }
  .history-section .history-track { grid-auto-columns: 100%; }
  .history-section .timeline-item h3 { font-size: 1.1875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .history-section *, .history-section *::before { transition: none; }
}
