.a2-timeline {
  --rail-h: 3rem;
  --gap: 2rem;
  position: relative;
}
.a2-timeline__rail {
  position: relative;
  height: var(--rail-h);
  display: flex;
}
.a2-timeline__section {
  position: relative;
  flex: 0 0 var(--w);
  background: var(--color);
}
.a2-timeline__hit {
  position: absolute;
  inset: -24px 0 -24px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.a2-timeline__label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  
  width: 100%;
  
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.a2-timeline__label--above {
  bottom: calc(100% + var(--gap));
}
.a2-timeline__label--below {
  top: calc(100% + var(--gap));
}
.a2-timeline__tick {
  position: absolute;
  left: 50%;
  width: 4px;
  background: #fff;
  height: 1.5rem;
}
.a2-timeline__tick--above {
  bottom: 100%;
}
.a2-timeline__tick--below {
  top: 100%;
}

/* Marker (now SVG) */
.a2-timeline__marker {
  position: absolute;
  z-index: 4; /* above sections/handles, below modal */
  bottom: 25%;
  background: url("../img/marker.svg") 50% 100% / contain no-repeat;
  width: 70px; /* adjust to taste */
  height: 95px;
  pointer-events: auto;
  transition: all 250ms ease;
}

.a2-timeline__marker:hover {
  transform-origin: 50% 100%;
  transform: scale(1.2);
}

/* Tooltip */
.a2-tooltip {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  width: 300px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  
  font-size: .9rem;
  line-height: 1.3rem;
  
  transition: all 150ms ease;
  
  &::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 1rem;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
    
    transition: all 150ms ease;
  }
}

/* Mobile vertical layout */
@media (max-width: 768px) {
  
  .a2-tooltip {
    top: 50%;
    transform: translate(-50%, -50%); 
  }
  
  .a2-timeline__rail {
    margin: 0 auto;
    flex-direction: column;
    height: 700px;
    max-hight: 900px;
    width: 3rem;
  }
  .a2-timeline__section {
    height: calc(var(--w) * 2px);
    width: 3rem;
  }
  
  .a2-timeline__label {
    left: auto;
    transform: none;
    width: 40vw;
    padding: 0 20px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  
  .a2-timeline__label--above {
    right: calc(100% + var(--gap));
    text-align: right;
    
  }
  
  .a2-timeline__label--below {
    left: calc(100% + var(--gap));
    text-align: left;
  }
  
  .a2-timeline__tick {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #fff;
    width: 1.5rem;
    transform: translateY(-50%);
  }
  
  .a2-timeline__tick--above {
    right: 100%;
    left: auto;
  }
  
  .a2-timeline__tick--below {
    left: 100%;
    right: auto;
  }
  
  .a2-timeline__marker {
    left: 50%;
    top: auto;
    transform: translate(-50%, 0);
  }
  
  .a2-timeline__marker:hover {
    transform-origin: 50% 100%;
    transform: translate(-50%, 0) scale(1.2) ;
  }
}

/* Focus & accessibility */
.a2-timeline__hit:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  clip-path: inset(50%);
}
