.timeline-container {
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 80px auto auto auto;
}

.timeline-steps-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 60px;
  transition: transform 0.5s ease-out;
  z-index: 2;
}

.step-indicator {
  width: 70px;
  height: 70px;
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  box-shadow: none;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  filter: drop-shadow(4px 4px 0 #0033a0);
  overflow: visible;
}
.step-indicator::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #0033a0;
  clip-path: polygon(
    10% 0%,
    90% 0%,
    90% 10%,
    100% 10%,
    100% 90%,
    90% 90%,
    90% 100%,
    10% 100%,
    10% 90%,
    0% 90%,
    0% 10%,
    10% 10%
  );
}
.step-indicator::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #e6f3ff;
  clip-path: polygon(
    10% 0%,
    90% 0%,
    90% 10%,
    100% 10%,
    100% 90%,
    90% 90%,
    90% 100%,
    10% 100%,
    10% 90%,
    0% 90%,
    0% 10%,
    10% 10%
  );
}
.step-indicator.active {
  transform: scale(1.1);
}
.step-indicator.active::after {
  background-color: #ffdc00;
}
.step-indicator.completed {
  transform: scale(0.8);
 
}
.step-indicator.future {
  transform: scale(0.8);
  
}
.step-number {
  font-size: 2rem;
  font-weight: 600;
  font-family: "bitcount-prop-single-square", sans-serif;
  color: #0033a0;
  z-index: 1;
  line-height: 1;
  margin: 2px 0 0 2px;
}
.step-label {
  font-size: 12px;
  font-weight: 700;
  color: #0033a0;
  z-index: 1;
  font-family: "Usual", sans-serif;
  line-height: 1;
  margin: 0;
}

.timeline-line {
  position: relative;
  width: 100%;
  height: 2px;
  background-color: #0033a0;
  margin: 0;
  z-index: 1;
}
.timeline-viewport {
  position: absolute;
  left: 43px;
  right: 43px;
  top: 50%;
  height: 90px;
  transform: translateY(-50%);
  overflow: hidden;
  z-index: 2;
}
.timeline-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-color: #0033a0;
}
.timeline-line.step-1-or-later::before {
  width: 43px;
  height: 44px;
  background-image: url(assets/pixel-step-arrow.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(-50%) rotate(180deg);
}
.timeline-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 43px;
  height: 44px;
  background-color: #0033a0;
  background-image: url(assets/pixel-step-arrow.svg);
}
.timeline-start-button,
.timeline-arrow-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 43px;
  height: 44px;
  cursor: pointer;
  z-index: 10;
  background: rgba(0, 51, 160, 0.2);
  border: 2px solid #0033a0;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}
.timeline-start-button:hover,
.timeline-arrow-button:hover {
  background: rgba(0, 51, 160, 0.4);
  border-color: #002080;
}
.timeline-start-button:focus:not(:focus-visible),
.timeline-arrow-button:focus:not(:focus-visible) {
  outline: none;
}
.timeline-start-button:focus-visible,
.timeline-arrow-button:focus-visible {
  background: rgba(0, 51, 160, 0.5);
  border-color: #001f66;
  outline: 3px solid #FFDC00;
  outline-offset: 2px;
}
.timeline-start-button {
  left: 0;
  width: 16px;
  height: 16px;
}
.timeline-line.step-1-or-later .timeline-start-button {
  width: 43px;
  height: 44px;
}
.timeline-arrow-button {
  right: 0;
}

.timeline-connection {
  width: 2px;
  height: 60px;
  background-color: #0033a0;
  margin: 0;
}

.timeline-carousel {
  width: 100%;
  position: relative;
  z-index: 3;
  padding-bottom: 140px;
}
.timeline-card {
  background: transparent;
  border: none;
  margin: 0 auto;
  padding: 15px;
  text-align: center;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transform: translateY(80px);
  transition:
    transform 0.5s ease-out,
    opacity 0.4s ease-out;
}
.timeline-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #0033a0;
  clip-path: polygon(
    0 10px,
    5px 10px,
    5px 5px,
    10px 5px,
    10px 0,
    calc(100% - 10px) 0,
    calc(100% - 10px) 5px,
    calc(100% - 5px) 5px,
    calc(100% - 5px) 10px,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 5px) calc(100% - 10px),
    calc(100% - 5px) calc(100% - 5px),
    calc(100% - 10px) calc(100% - 5px),
    calc(100% - 10px) 100%,
    10px 100%,
    10px calc(100% - 5px),
    5px calc(100% - 5px),
    5px calc(100% - 10px),
    0 calc(100% - 10px)
  );
  z-index: -1;
}
.timeline-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff;
  clip-path: polygon(
    0 10px,
    5px 10px,
    5px 5px,
    10px 5px,
    10px 0,
    calc(100% - 10px) 0,
    calc(100% - 10px) 5px,
    calc(100% - 5px) 5px,
    calc(100% - 5px) 10px,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 5px) calc(100% - 10px),
    calc(100% - 5px) calc(100% - 5px),
    calc(100% - 10px) calc(100% - 5px),
    calc(100% - 10px) 100%,
    10px 100%,
    10px calc(100% - 5px),
    5px calc(100% - 5px),
    5px calc(100% - 10px),
    0 calc(100% - 10px)
  );
  z-index: -1;
}
.timeline-card > img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.timeline-card.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.timeline-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 20px auto 10px 10px;
  text-align: left;
  z-index: 1;
}
.timeline-card-title {
  color: #0033a0;
  font-size: 3rem;
  margin: 0;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 6px;
  font-weight: 900;
}
.timeline-card-description {
  color: #1b365d;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
.learn-more {
  color: #1b365d;
  text-decoration: none;
  margin-top: 20px;
  font-family: "bitcount-prop-single-square", sans-serif;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.owl-nav,
.owl-dots {
  display: none;
}

.next-step-indicator,
.next-step-indicator-2 {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  border: 2px solid #0033a0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
  cursor: pointer;
  opacity: 0;
}
.next-step-indicator {
  left: 60%;
  width: 60px;
  height: 60px;
  background-color: #e6f3ff;
}
.next-step-indicator-2 {
  left: 75%;
  width: 55px;
  height: 55px;
  background-color: #f0f8ff;
}
.next-step-indicator.animate-in {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.next-step-indicator-2.animate-in {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.next-step-indicator,
.next-step-indicator-2 {
  display: none !important;
}
.next-step-number {
  font-size: 20px;
  font-weight: 700;
  color: #0033a0;
}
.next-step-label {
  font-size: 12px;
  color: #0033a0;
}
.next-step-number-2 {
  font-size: 18px;
  font-weight: 700;
  color: #0033a0;
}
.next-step-label-2 {
  font-size: 12px;
  color: #0033a0;
}

/* Accessibility: Screen reader only class */
.timeline-container .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
  clip-path: inset(50%);
}

/* Accessibility: Focus states for interactive elements */
.step-indicator:focus-visible,
.learn-more:focus-visible {
  outline: 3px solid #FFDC00; /* High contrast yellow */
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 220, 0, 0.5), 0 0 0 5px rgba(0, 51, 160, 0.3); /* Blue shadow for depth */
}
.step-indicator:focus:not(:focus-visible),
.learn-more:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* Accessibility: Reduced motion support (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  .timeline-steps-container,
  .step-indicator,
  .timeline-card,
  .next-step-indicator,
  .next-step-indicator-2,
  .timeline-carousel .owl-item {
    transition: none !important;
    animation: none !important;
  }
  
  .timeline-card {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  
  .step-indicator.active {
    transform: none !important;
  }
}

/* Accessibility: High contrast mode support (WCAG 1.4.11) */
@media (prefers-contrast: high) {
  .timeline-container {
    border: 2px solid CanvasText;
  }
  
  .timeline-line {
    background-color: CanvasText !important;
  }
  
  .step-indicator::before {
    background-color: CanvasText !important;
  }
  
  .step-indicator.active::after {
    background-color: Highlight !important;
  }
  
  .step-indicator.completed::after,
  .step-indicator.future::after {
    background-color: Canvas !important;
    border: 2px solid CanvasText;
  }
  
  .step-number,
  .step-label {
    color: CanvasText !important;
  }
  
  .timeline-card-title {
    color: CanvasText !important;
  }
  
  .timeline-card-description {
    color: CanvasText !important;
  }
  
  .learn-more {
    color: LinkText !important;
    text-decoration: underline;
  }
  
  .step-indicator:focus-visible,
  .learn-more:focus-visible,
  .timeline-start-button:focus-visible,
  .timeline-arrow-button:focus-visible {
    outline: 3px solid Highlight;
    box-shadow: none;
  }
}
