/**
 * Rocket Timeline - Work Experience
 * Vertical timeline with rocket SVG and alternating cards
 */

.rocket-timeline {
  position: relative;
  /* max-width: 900px; */
  margin: 0 auto;
  padding: 2rem 5%;
  overflow: hidden;
  /* width: 100%; */
}

/* Central vertical line */
.rocket-timeline__line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    var(--purple) 0%,
    rgba(104, 42, 233, 0.3) 40%,
    rgba(104, 42, 233, 0.1) 100%
  );
}

/* Animated trail glow */
.rocket-timeline__trail {
  position: absolute;
  top: 0;
  left: -2px;
  width: 6px;
  height: 60px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--purple),
    transparent
  );
  border-radius: 3px;
  animation: trailMove 4s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes trailMove {
  0% { top: 0%; }
  100% { top: 90%; }
}

/* Rocket at top */
.rocket-timeline__rocket {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.rocket-svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 12px var(--purple-glow));
  animation: rocketHover 3s ease-in-out infinite;
}

@keyframes rocketHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Timeline cards */
.tl-card {
  position: relative;
  width: 44%;
  margin-bottom: 3rem;
}

.tl-card--right {
  margin-left: 56%;
}

.tl-card--left {
  margin-left: 0;
  text-align: right;
}

.tl-card--left .tl-card__body {
  text-align: left;
}

/* Dot on the timeline */
.tl-card__dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid rgba(104, 42, 233, 0.5);
  top: 1.5rem;
  z-index: 3;
}

.tl-card--right .tl-card__dot {
  left: calc(-56% / 0.44 * 0.5 - 7px);
  left: -13.6%;
}

.tl-card--left .tl-card__dot {
  right: -13.6%;
}

/* Recompute: card is 44% wide, margin-left 56%. Dot should sit at 50% of the container = center of timeline */
.tl-card--right .tl-card__dot {
  left: 0;
  transform: translateX(calc(-100% - ((56% - 50%) / 0.44 * 100%)));
}

/* Simpler approach: use absolute from the card edge */
.tl-card--right .tl-card__dot {
  left: -38px;
}

.tl-card--left .tl-card__dot {
  right: -38px;
}

.tl-card__dot--active {
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 0 12px var(--purple-glow);
  animation: dotPulse 2s ease-in-out infinite;
}

.tl-card__dot--edu {
  background: transparent;
  border-color: rgba(168, 192, 255, 0.5);
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 12px var(--purple-glow); }
  50% { box-shadow: 0 0 24px var(--purple-glow), 0 0 48px rgba(104, 42, 233, 0.1); }
}

/* Date label */
.tl-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

/* Card body */
.tl-card__body {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.4s ease;
}

.tl-card__body:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 40px rgba(104, 42, 233, 0.1);
  transform: translateY(-3px);
}

.tl-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.tl-card__company {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--purple);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.tl-card__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tl-card__list li {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
}

.tl-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--purple);
  opacity: 0.5;
}

.tl-card__list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tl-card__stack {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Education card variant */
.tl-card--edu .tl-card__body {
  background: transparent;
  border-style: dashed;
  border-color: rgba(168, 192, 255, 0.15);
}

.tl-card--edu .tl-card__list li::before {
  background: var(--light-purple);
}

/* Timeline end */
.rocket-timeline__end {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .rocket-timeline__line {
    left: 10px;
  }

  .tl-card {
    width: calc(100% - 20px);
    margin-left: 28px !important;
    text-align: left !important;
  }

  .tl-card--left .tl-card__body,
  .tl-card--right .tl-card__body {
    text-align: left;
  }

  .tl-card--right .tl-card__dot,
  .tl-card--left .tl-card__dot {
    left: -43px;
    right: auto;
  }

  .rocket-timeline__rocket {
    justify-content: flex-start;
    left: -10px;
  }

  .rocket-timeline__end {
    justify-content: flex-start;
    padding-left: 16px;
  }

  .tl-card__body {
    padding: 0.5rem;
  }

  .tl-card__title {
    font-size: 1.2rem;
  }
}
