.timeline {
  background-color: var(--color-bg-secondary);
  padding-block: clamp(5rem, 10vw, 9rem);
}

.timeline__header {
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--space-20);
}

.timeline__intro {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-top: var(--space-4);
  margin-bottom: 0;
}

/* ─── Track (desktop: horizontal) ───────────────── */
.timeline__track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: var(--space-6);
}

/* ─── Connecting line ────────────────────────────── */
.timeline__line {
  position: absolute;
  top: calc(var(--space-6) + 19px); /* center of 40px node */
  left: calc(50px / 2);
  right: calc(50px / 2);
  height: 2px;
  background: var(--color-metallic-dark);
}

.timeline__line-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--color-accent-red), rgba(204, 34, 34, 0.6));
  transform-origin: left center;
}

/* ─── Individual item ────────────────────────────── */
.timeline__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Alternate label positioning: odd items label below, even above */
.timeline__item:nth-child(odd) .timeline__label {
  order: 2;
  margin-top: var(--space-4);
  text-align: center;
}

.timeline__item:nth-child(even) .timeline__label {
  order: 0;
  margin-bottom: var(--space-4);
  text-align: center;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ─── Node ───────────────────────────────────────── */
.timeline__node {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-metallic-dark);
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--duration-base) ease,
    background-color var(--duration-base) ease;
  order: 1;
  flex-shrink: 0;
}

.timeline__node-inner {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--color-metallic-mid);
  transition: color var(--duration-base) ease;
}

/* Active node state (added by JS) */
.timeline__item.is-active .timeline__node {
  border-color: var(--color-accent-red);
  background: var(--color-accent-red);
  box-shadow: var(--shadow-glow-sm);
}
.timeline__item.is-active .timeline__node-inner {
  color: #fff;
}

/* ─── Upcoming (stage 5) ─────────────────────────── */
.timeline__item--upcoming {
  opacity: 0.55;
}

.timeline__item--upcoming .timeline__node {
  border-style: dashed;
  border-color: var(--color-metallic-mid);
}

/* ─── Label ──────────────────────────────────────── */
.timeline__label {
  max-width: 110px;
}

.timeline__label strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-1);
}

.timeline__label span {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ─── Mobile (vertical) ──────────────────────────── */
@media (max-width: 767px) {
  .timeline__track {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0;
    padding-left: 22px;
    gap: 0;
  }

  .timeline__line {
    top: 0;
    left: 21px;
    right: auto;
    bottom: 0;
    width: 2px;
    height: auto;
  }

  .timeline__line-fill {
    width: 100%;
    height: 0;
    transform-origin: top center;
  }

  .timeline__item {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-5);
    padding-bottom: var(--space-10);
    flex: none;
    width: 100%;
  }

  .timeline__item:last-child { padding-bottom: 0; }

  .timeline__item:nth-child(odd) .timeline__label,
  .timeline__item:nth-child(even) .timeline__label {
    order: 2;
    margin-top: 0;
    margin-bottom: 0;
    min-height: auto;
    text-align: left;
    justify-content: flex-start;
  }

  .timeline__node { order: 0; flex-shrink: 0; }
}
