/* Shared pin/dot timeline component: homepage "Benefits of PSO" and
   About "Our Purpose". Colour + animation values taken from the live site. */
/* Zero gap keeps each column exactly 20% wide, which puts the dots (and the
   connector segments drawn from them) on clean 10%/30%/50%/70%/90% centers. */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Pin + dot animate as one group, the body as another, mirroring the two
   stacked rows the live site staggers separately. */
.timeline-figure,
.timeline-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  opacity: 0;
}

.timeline-item.in-view .timeline-figure,
.timeline-item.in-view .timeline-body {
  animation: fade-in-up 1.25s ease-out both;
}

.timeline-item:nth-child(2).in-view .timeline-figure,
.timeline-item:nth-child(2).in-view .timeline-body {
  animation-delay: 0.2s;
}

.timeline-item:nth-child(3).in-view .timeline-figure,
.timeline-item:nth-child(3).in-view .timeline-body {
  animation-delay: 0.4s;
}

.timeline-item:nth-child(4).in-view .timeline-figure,
.timeline-item:nth-child(4).in-view .timeline-body {
  animation-delay: 0.6s;
}

.timeline-item:nth-child(5).in-view .timeline-figure,
.timeline-item:nth-child(5).in-view .timeline-body {
  animation-delay: 0.8s;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.timeline-figure {
  position: relative;
}

/* Connector runs from this dot's right edge to the next dot's left edge.
   The figure spans the whole column, so 100% - 36px is exactly the gap.
   Anchored off the bottom (dot margin 70px + half the 36px dot) so it stays
   on the dot's centreline regardless of how tall the pin SVG renders. */
.timeline-figure::after {
  content: "";
  position: absolute;
  bottom: 88px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #888;
}

.timeline-item:last-child .timeline-figure::after {
  display: none;
}

.timeline-pin {
  width: 170px;
  height: auto;
  margin-bottom: 40px;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  margin-bottom: 70px;
}

.timeline-item:nth-child(1) .timeline-dot {
  border: 8px solid rgb(213, 69, 83);
  animation: pulse-1 1.8s ease-out infinite;
}

.timeline-item:nth-child(2) .timeline-dot {
  border: 8px solid rgb(244, 223, 141);
  animation: pulse-2 1.8s ease-out infinite;
}

.timeline-item:nth-child(3) .timeline-dot {
  border: 8px solid rgb(147, 186, 207);
  animation: pulse-3 1.8s ease-out infinite;
}

.timeline-item:nth-child(4) .timeline-dot {
  border: 8px solid rgb(84, 138, 191);
  animation: pulse-4 1.8s ease-out infinite;
}

.timeline-item:nth-child(5) .timeline-dot {
  border: 8px solid rgb(15, 70, 124);
  animation: pulse-5 1.8s ease-out infinite;
}

@keyframes pulse-1 {
  0% {
    box-shadow: 0 0 0 0 rgba(215, 69, 84, 0.8), 0 0 0 4px rgba(215, 69, 84, 0.6), 0 0 0 8px rgba(215, 69, 84, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(215, 69, 84, 0.6), 0 0 0 8px rgba(215, 69, 84, 0.3), 0 0 0 14px rgba(215, 69, 84, 0.1);
  }
}

@keyframes pulse-2 {
  0% {
    box-shadow: 0 0 0 0 rgba(236, 218, 155, 0.9), 0 0 0 6px rgba(236, 218, 155, 0.8), 0 0 0 12px rgba(236, 218, 155, 0.6);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(236, 218, 155, 0.6), 0 0 0 12px rgba(236, 218, 155, 0.3), 0 0 0 18px rgba(236, 218, 155, 0);
  }
}

@keyframes pulse-3 {
  0% {
    box-shadow: 0 0 0 0 rgba(147, 186, 207, 0.8), 0 0 0 6px rgba(147, 186, 207, 0.6), 0 0 0 12px rgba(147, 186, 207, 0.4);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(147, 186, 207, 0.6), 0 0 0 12px rgba(147, 186, 207, 0.3), 0 0 0 18px rgba(147, 186, 207, 0);
  }
}

@keyframes pulse-4 {
  0% {
    box-shadow: 0 0 0 0 rgba(147, 188, 207, 0.8), 0 0 0 6px rgba(147, 188, 207, 0.6), 0 0 0 12px rgba(147, 188, 207, 0.4);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(147, 188, 207, 0.6), 0 0 0 12px rgba(147, 188, 207, 0.3), 0 0 0 18px rgba(147, 188, 207, 0);
  }
}

@keyframes pulse-5 {
  0% {
    box-shadow: 0 0 0 0 rgba(147, 188, 207, 0.8), 0 0 0 6px rgba(147, 188, 207, 0.8), 0 0 0 12px rgba(147, 188, 207, 0.6);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(147, 188, 207, 0.6), 0 0 0 12px rgba(147, 188, 207, 0.3), 0 0 0 18px rgba(147, 188, 207, 0);
  }
}

/* min-height reserves the two lines the live titles always occupy, so every
   description starts on the same baseline no matter how the title wraps. */
/* 75% rather than the live site's 55%: the fallback semi-condensed face is
   wider and would wrap to three lines. Harmless once the Adobe kit loads. */
.timeline-item h3 {
  width: 75%;
  min-height: 60px;
  font-family: var(--font-myriad-condensed);
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  color: #538baf;
  margin: 0 0 20px;
}

.timeline-item p {
  width: 90%;
  font-family: var(--font-myriad);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #052c45;
  margin: 0;
}

@media (max-width: 900px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .timeline-figure::after {
    display: none;
  }

  .timeline-dot {
    display: none;
  }

  .timeline-pin {
    margin-bottom: 20px;
  }

  .timeline-item h3 {
    width: 80%;
    min-height: 0;
    font-size: 18px;
    line-height: 26px;
  }

  .timeline-item p {
    width: 100%;
    font-size: 14px;
  }
}
