/* Job timeline. Host keeps its own .glass background; only layout is set here. */

.timeline.timeline {
  --tl-dot: 14px;
  --tl-hit: 36px;
  padding: 16px 28px 8px;
  overflow: visible;
  box-sizing: border-box;
}

.timeline .timeline__track {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 48px;
}

/* Base line and accent fill, centred on the dots (hit area is 36px, so centre = 18px). */
.timeline .timeline__track::before,
.timeline .timeline__track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--tl-hit) / 2 - 1px);
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
}

.timeline .timeline__track::before {
  background: rgba(11, 26, 42, 0.16);
}

.timeline .timeline__track::after {
  background: var(--accent, #ff5a1f);
  transform: scaleX(var(--tl-progress, 0));
  transform-origin: left center;
  will-change: transform;
}

.timeline .timeline__item {
  position: absolute;
  top: 0;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline .timeline__item.is-active { z-index: 2; }
.timeline .timeline__item:hover,
.timeline .timeline__item:focus-within { z-index: 3; }

.timeline .timeline__stop {
  position: relative;
  display: block;
  width: var(--tl-hit);
  height: var(--tl-hit);
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.timeline .timeline__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tl-dot);
  height: var(--tl-dot);
  margin: calc(var(--tl-dot) / -2) 0 0 calc(var(--tl-dot) / -2);
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(11, 26, 42, 0.25);
  transform: scale(1);
  transition:
    transform 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    background-color 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.timeline .is-passed .timeline__dot {
  background: var(--accent, #ff5a1f);
  border-color: #fff;
  box-shadow: 0 1px 4px rgba(11, 26, 42, 0.22);
}

.timeline .timeline__stop:hover .timeline__dot,
.timeline .timeline__stop:focus-visible .timeline__dot {
  transform: scale(1.22);
}

.timeline .is-active .timeline__dot,
.timeline .is-active .timeline__stop:hover .timeline__dot,
.timeline .is-active .timeline__stop:focus-visible .timeline__dot {
  transform: scale(1.45);
  box-shadow:
    0 0 0 6px var(--accent-soft, rgba(255, 90, 31, 0.14)),
    0 2px 8px rgba(255, 90, 31, 0.35);
}

.timeline .timeline__stop:focus-visible .timeline__dot {
  outline: 2px solid var(--accent, #ff5a1f);
  outline-offset: 3px;
}

.timeline .timeline__year {
  position: absolute;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  font: 500 11px/14px var(--mono, "JetBrains Mono", ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--ink-3, #6a7f94);
  white-space: nowrap;
  pointer-events: none;
  transition:
    opacity 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    color 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.timeline .is-active .timeline__year {
  color: var(--ink, #0b1a2a);
}

/* Floating tag */
.timeline .timeline__tag {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  display: block;
  width: max-content;
  max-width: min(60vw, 320px);
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(11, 26, 42, 0.86);
  color: #fff;
  white-space: nowrap;
  text-align: left;
  font-family: var(--sans, "Inter Tight", system-ui, sans-serif);
  box-shadow: 0 8px 24px rgba(11, 26, 42, 0.22);
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition:
    opacity 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    transform 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.timeline .timeline__tag::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: inherit;
  border-radius: 2px;
  transform: rotate(45deg);
  z-index: -1;
}

.timeline .timeline__tag-label,
.timeline .timeline__tag-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline .timeline__tag-label {
  font-size: 13px;
  line-height: 17px;
  font-weight: 600;
}

.timeline .timeline__tag-sub {
  font-size: 11px;
  line-height: 15px;
  font-weight: 400;
  color: #9fb3c6;
  color: color-mix(in srgb, var(--ink-3, #6a7f94), #fff 45%);
}

/* Keep the tag inside the host near either end. Stop centre sits 18px from the button edge. */
.timeline .is-start .timeline__tag {
  left: -10px;
  transform: translate(0, 4px);
}
.timeline .is-start .timeline__tag::after {
  left: 28px;
}

.timeline .is-end .timeline__tag {
  left: auto;
  right: -10px;
  transform: translate(0, 4px);
}
.timeline .is-end .timeline__tag::after {
  left: auto;
  right: 28px;
  margin: -4px -4px 0 0;
}

/* Visible: active, hovered, keyboard focus */
.timeline .is-active .timeline__tag,
.timeline .timeline__stop:hover .timeline__tag,
.timeline .timeline__stop:focus-visible .timeline__tag {
  opacity: 1;
  transform: translate(-50%, 0);
}
.timeline .is-start.is-active .timeline__tag,
.timeline .is-start .timeline__stop:hover .timeline__tag,
.timeline .is-start .timeline__stop:focus-visible .timeline__tag,
.timeline .is-end.is-active .timeline__tag,
.timeline .is-end .timeline__stop:hover .timeline__tag,
.timeline .is-end .timeline__stop:focus-visible .timeline__tag {
  transform: translate(0, 0);
}

/* While previewing another stop, tuck the active tag away so they never overlap. */
.timeline .timeline__track:has(.timeline__stop:hover) .is-active:not(:hover) .timeline__tag,
.timeline .timeline__track:has(.timeline__stop:focus-visible) .is-active:not(:focus-within) .timeline__tag {
  opacity: 0;
}

/* Narrow screens */
@media (max-width: 559.98px) {
  .timeline.timeline {
    --tl-dot: 12px;
  }
  .timeline .timeline__year {
    opacity: 0;
  }
  .timeline .is-active .timeline__year,
  .timeline .timeline__item:first-child .timeline__year,
  .timeline .timeline__item:last-child .timeline__year {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline .timeline__dot,
  .timeline .timeline__year,
  .timeline .timeline__tag {
    transition: none;
  }
}
