.timeline {
  margin-block-start: var(--section);
}

.timeline .h1 {
  margin-block-end: var(--gutter);
}

.timeline__body {
  display: grid;
  gap: var(--gutter);
}

.timeline__rail {
  position: relative;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--text-secondary);
}

.timeline__rail::-webkit-scrollbar {
  display: none;
}

.timeline__year {
  position: relative;
  flex: 1 0 64px;
  padding: 12px 4px 16px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  color: var(--text-secondary);
  transition: color var(--fast) var(--ease);
}

.timeline__year::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 8px;
  background: var(--text-secondary);
}

.timeline__year:focus-visible {
  outline-offset: -2px;
}

.timeline__year:hover,
.timeline__year[aria-selected="true"] {
  color: var(--text);
}

.timeline__year[aria-selected="true"] {
  font-style: italic;
}

.timeline__year[aria-selected="true"]::after {
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
}

.timeline__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}

.timeline__photos {
  display: flex;
  gap: 8px;
  aspect-ratio: 3 / 2;
}

.timeline__photos > * {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.timeline__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-alt);
}

.timeline__number {
  margin-block-end: 24px;
  font-family: var(--serif);
  font-size: clamp(64px, 9vw, 120px);
  font-style: italic;
  line-height: 1;
  letter-spacing: -2px;
}

.timeline__events li {
  padding-block: 12px;
  border-top: 1px solid var(--hairline);
}

.timeline__note {
  display: block;
  margin-top: 4px;
}

.timeline__events a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

@media (max-width: 887px) {
  .timeline__stage {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .timeline__year {
    flex-basis: 56px;
    font-size: 16px;
  }
}
