/* ============================================================
   Experience: the vertical timeline of roles.
   Markup: <section id="experience"> in index.html. JS: experience.js.
   ============================================================ */

/* ======================================================
   Experience — vertical timeline
   ====================================================== */

.xp-timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 46px;
}

/* the rail the dots sit on */

.xp-timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3), transparent);
  opacity: 0.55;
}

.xp-item {
  position: relative;
}

.xp-item + .xp-item {
  margin-top: 22px;
}

.xp-dot {
  position: absolute;
  left: -40px;
  top: 30px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 120, 255, 0.12);
}

/* the current role pulses gently */

.xp-dot-live {
  background: var(--accent);
  animation: xp-pulse 2.4s var(--ease) infinite;
}

@keyframes xp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 120, 255, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(0, 120, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 120, 255, 0);
  }
}

.xp-card {
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.xp-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.xp-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* lets the role/company block take the slack so the date stays right-aligned */

.xp-id {
  flex: 1;
  min-width: 220px;
}

.xp-role {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.3;
}

.xp-role-sep {
  color: var(--accent);
  font-weight: 400;
}

.xp-company {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--accent);
}

.xp-company i {
  font-size: 1.05rem;
  opacity: 0.85;
}

.xp-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  background: var(--gradient-soft);
}

.xp-badge-live {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.12);
}

.xp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  flex-shrink: 0;
}

.xp-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.xp-duration {
  font-size: 0.8rem;
  color: var(--muted);
}

.xp-points {
  display: grid;
  gap: 11px;
}

.xp-points li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
}

/* custom marker so the bullet colour follows the accent */

.xp-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.xp-points strong {
  color: var(--text);
  font-weight: 600;
}

.xp-points code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--accent);
  background: var(--gradient-soft);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 1px 6px;
}

.xp-stack {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.xp-stack .skill-chip {
  font-size: 0.8rem;
  padding: 5px 11px;
}

@media (max-width: 720px) {
  .xp-timeline {
      padding-left: 32px;
    }

  .xp-timeline::before {
      left: 7px;
    }

  .xp-dot {
      left: -31px;
      top: 26px;
      width: 14px;
      height: 14px;
      border-width: 3px;
    }

  .xp-card {
      padding: 20px 18px;
    }

  .xp-top {
      flex-direction: column;
    }

  .xp-meta {
      align-items: flex-start;
      text-align: left;
    }

  .xp-role {
      font-size: 1.08rem;
    }
}

@media (prefers-reduced-motion: reduce) {
  .xp-dot-live {
      animation: none !important;
    }

  .xp-card {
      transition: none !important;
    }
}
