.timeline {
  position: relative;
  padding: 150px 0 160px;
  background: #ffffff;
  overflow: hidden;
}

.timeline-container {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
}

/* =========================
       HEADER
    ========================= */

.timeline-header {
  display: flex;
  flex-direction: column;
  text-align: center;
  place-items: center;
  gap: 20px;
  margin-bottom: 120px;
}

.timeline-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 13px;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4e9f70;
}

.timeline-heading {
  max-width: 760px;
}

.timeline-heading h2 {
  margin: 20px 0;

  font-size: clamp(48px, 5vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 400;

  color: #0b2745;
}

.timeline-heading h2 strong {
  font-weight: 700;
}

/* =========================
       TIMELINE
    ========================= */

.timeline-wrapper {
  position: relative;
  padding: 20px 0;
}

/* Línea base */

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;

  width: 1px;

  background: #dce3e9;

  transform: translateX(-50%);
}

/* Línea que se va activando */

.timeline-line-progress {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 0;

  background: #123b6d;

  transition: height 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================
       ITEMS
    ========================= */

.timeline-items {
  position: relative;
}

.timeline-item {
  position: relative;

  display: grid;
  grid-template-columns: 1fr 1fr;

  min-height: 260px;

  opacity: 0;
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-item-left {
  transform: translateX(-35px);
}

.timeline-item-right {
  transform: translateX(35px);
}

.timeline-item-visible {
  opacity: 1;
  transform: translateX(0);
}

/* =========================
       MARKER
    ========================= */

.timeline-marker {
  position: absolute;
  top: 0;
  left: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;

  border: 1px solid #dce3e9;
  border-radius: 50%;

  background: #ffffff;

  transform: translateX(-50%);

  z-index: 2;

  transition: border-color 0.5s ease, box-shadow 0.5s ease,
    background-color 0.5s ease;
}

.timeline-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  color: #123b6d;

  transform: scale(0.7);
  opacity: 0;

  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease,
    color 0.4s ease;
}

.timeline-icon svg {
  width: 21px;
  height: 21px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-item-visible .timeline-marker {
  border-color: #4e9f70;

  box-shadow: 0 0 0 7px rgba(78, 159, 112, 0.08);
}

.timeline-item-visible .timeline-icon {
  opacity: 1;
  transform: scale(1);
  color: #4e9f70;
}

/* =========================
       CONTENT
    ========================= */

.timeline-content {
  position: relative;

  max-width: 390px;

  padding: 0 50px 70px;
}

.timeline-item-left .timeline-content {
  grid-column: 1;
  justify-self: end;

  text-align: right;
}

.timeline-item-right .timeline-content {
  grid-column: 2;
  justify-self: start;

  text-align: left;
}

/* Número */

.timeline-number {
  margin-bottom: 12px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;

  color: #4e9f70;
}

/* Año */

.timeline-year {
  margin-bottom: 8px;

  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;

  font-weight: 600;
  letter-spacing: -0.04em;

  color: #123b6d;
}

/* Título */

.timeline-content h3 {
  margin-bottom: 14px;

  font-size: 25px;
  line-height: 1.1;

  font-weight: 600;
  letter-spacing: -0.025em;

  color: #0b2745;
}

/* Descripción */

.timeline-content p {
  font-size: 14px;
  line-height: 1.7;

  color: #68727e;
}

/* =========================
       FINAL
    ========================= */

.timeline-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;

  margin-top: 60px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;

  color: #8a939d;
}

.timeline-end-line {
  width: 45px;
  height: 1px;

  background: #dce3e9;
}

/* =========================
       RESPONSIVE
    ========================= */

@media (max-width: 900px) {
  .timeline {
    padding: 110px 0 120px;
  }

  .timeline-container {
    width: min(100% - 50px, 700px);
  }

  .timeline-header {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 80px;
  }

  .timeline-heading h2 {
    font-size: 54px;
  }

  .timeline-line {
    left: 18px;
    transform: none;
  }

  .timeline-item {
    display: block;
    min-height: 0;
    padding-left: 55px;
    padding-bottom: 70px;
  }

  .timeline-item-left,
  .timeline-item-right {
    transform: translateY(25px);
  }

  .timeline-item-visible {
    transform: translateY(0);
  }

  .timeline-marker {
    top: 0;
    left: 18px;

    width: 38px;
    height: 38px;

    transform: translateX(-50%);
  }

  .timeline-icon svg {
    width: 17px;
    height: 17px;
  }

  .timeline-content,
  .timeline-item-left .timeline-content,
  .timeline-item-right .timeline-content {
    max-width: 100%;
    padding: 0;
    text-align: left;
  }

  .timeline-year {
    font-size: 42px;
  }

  .timeline-content h3 {
    font-size: 23px;
  }
}

@media (max-width: 600px) {
  .timeline {
    padding: 90px 0 100px;
  }

  .timeline-container {
    width: calc(100% - 40px);
  }

  .timeline-heading h2 {
    font-size: 46px;
  }

  .timeline-heading p {
    font-size: 15px;
  }

  .timeline-item {
    padding-left: 45px;
    padding-bottom: 60px;
  }

  .timeline-line {
    left: 13px;
  }

  .timeline-marker {
    left: 13px;
  }

  .timeline-year {
    font-size: 38px;
  }

  .timeline-content h3 {
    font-size: 21px;
  }

  .timeline-content p {
    font-size: 14px;
  }

  .timeline-end {
    margin-top: 30px;
  }
}

/* =========================
       REDUCED MOTION
    ========================= */

@media (prefers-reduced-motion: reduce) {
  .timeline-item,
  .timeline-marker span,
  .timeline-line-progress {
    transition: none;
  }

  .timeline-item {
    opacity: 1;
    transform: none;
  }

  .timeline-marker span {
    transform: scale(1);
  }
}
