.timeline-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 60px;
}

.timeline-title .dot {
  color: #e53935;
}

.timeline {
  border-radius: 24px;
  padding: 60px 10px;
  width: var(--rn-width1);
  margin: 40px auto;
  position: relative;
  background-color: #f5f5f5;
}

.timeline-container {
  position: relative;
  padding: 20px 0;
}

.timeline-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ddd;
  transform: translateX(-50%);
}

.timeline-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background-color: #e53935;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  animation: fill-progress linear, line-color-shift linear;
  animation-timeline: view(), view();
  animation-range: entry 0% cover 100%, entry 0% cover 100%;
}

@keyframes fill-progress {
  to { transform: translateX(-50%) scaleY(1); }
}

@keyframes line-color-shift {
  0%   { background-color: #e53935; }
  50%  { background-color: #ff7043; }
  100% { background-color: #c62828; }
}

.timeline-item {
  width: 50%;
  position: relative;
  padding: 20px 40px;
  box-sizing: border-box;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

@keyframes reveal-left {
  from { opacity: 0; transform: translateX(-50px) scale(0.92); filter: blur(6px); }
  to   { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes reveal-right {
  from { opacity: 0; transform: translateX(50px) scale(0.92); filter: blur(6px); }
  to   { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 30px;
  width: 16px;
  height: 16px;
  background-color: #e53935;
  border-radius: 50%;
  border: 3px solid #f5f5f5;
  box-shadow: 0 0 0 2px #f5f5f5;
  z-index: 1;
  animation: dot-pop linear both, dot-color-shift linear, dot-pulse 1.8s ease-out 1.6s infinite;
  animation-timeline: view(), view(), auto;
  animation-range: entry 10% cover 35%, entry 0% cover 100%, normal;
}

@keyframes dot-pop {
  from { transform: scale(0); }
  60%  { transform: scale(1.15); }
  to   { transform: scale(1); }
}

@keyframes dot-color-shift {
  0%   { background-color: #e53935; }
  50%  { background-color: #ff7043; }
  100% { background-color: #c62828; }
}

@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 2px #f5f5f5, 0 0 0 0 rgba(229, 57, 53, 0.5); }
  70%  { box-shadow: 0 0 0 2px #f5f5f5, 0 0 0 10px rgba(229, 57, 53, 0); }
  100% { box-shadow: 0 0 0 2px #f5f5f5, 0 0 0 0 rgba(229, 57, 53, 0); }
}

.timeline-item.left::before {
  right: -11px;
}

.timeline-item.right::before {
  left: -11px;
}

.timeline-content {
  padding: 20px;
  border-radius: 10px;
  margin-top: -12px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 8px 28px rgba(229, 57, 53, 0.12);
  transform: translateY(-3px);
}

.timeline-item.left .timeline-content {
  animation: reveal-left linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 35%;
}

.timeline-item.right .timeline-content {
  animation: reveal-right linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 35%;
}

.timeline-content .step {
  display: inline-block;
  background-color: #e53935;
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  animation: dot-color-shift linear;
  animation-timeline: view();
  animation-range: entry 0% cover 100%;
}

.timeline-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  clip-path: inset(0 100% 0 0);
  animation: text-reveal linear both;
  animation-timeline: view();
  animation-range: entry 10% cover 45%;
}

.timeline-content p {
  clip-path: inset(0 100% 0 0);
  animation: text-reveal linear both;
  animation-timeline: view();
  animation-range: entry 20% cover 55%;
}

@keyframes text-reveal {
  to { clip-path: inset(0 0% 0 0); }
}

@media (max-width: 768px) {
  .timeline-container::before,
  .timeline-container::after {
    left: 8px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 40px;
    padding-right: 20px;
    margin-bottom: 40px;
  }

  .timeline-item.left,
  .timeline-item.right {
    left: 0;
    text-align: left;
  }

  .timeline-item::before {
    left: -3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content,
  .timeline-item::before,
  .timeline-container::after,
  .timeline-content h2,
  .timeline-content p,
  .timeline-content .step {
    animation: none !important;
  }
  .timeline-container::after { transform: translateX(-50%) scaleY(1); }
  .timeline-content h2,
  .timeline-content p {
    clip-path: none;
  }
}

/* end section3 */
