/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */

#experience {
  padding: var(--section-padding) 0;
  border-top: 1px solid var(--color-border);
}

/* ── Timeline container ── */
.timeline {
  position: relative;
  margin-top: var(--space-16);
}

/* ── Vertical center line ── */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
  transform: translateX(-50%);
}

/* ── Single entry ── */
.timeline-entry {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0 var(--space-8);
  margin-bottom: var(--space-12);
  align-items: start;
}

.timeline-entry:last-child { margin-bottom: 0; }

/* Even entries flip sides */
.timeline-entry:nth-child(odd)  .timeline-entry__card { grid-column: 1; text-align: right; }
.timeline-entry:nth-child(odd)  .timeline-entry__spacer { grid-column: 3; }
.timeline-entry:nth-child(even) .timeline-entry__card { grid-column: 3; }
.timeline-entry:nth-child(even) .timeline-entry__spacer { grid-column: 1; order: -1; }

/* ── Center dot ── */
.timeline-entry__dot {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border-2);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--color-accent-2);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all var(--t-base);
  flex-shrink: 0;
}

.timeline-entry:hover .timeline-dot {
  border-color: var(--color-accent-2);
  background: var(--color-accent-dim);
  color: var(--color-accent);
}

/* ── Card ── */
.timeline-entry__card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base);
}

.timeline-entry__card:hover {
  border-color: var(--color-border-2);
  background: var(--color-surface-2);
  transform: translateY(-3px);
}

.timeline-entry__role {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.timeline-entry__company {
  font-size: var(--text-sm);
  color: var(--color-accent-2);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.timeline-entry__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-5);
}

/* ── Achievements ── */
.timeline-entry__achievements {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.timeline-achievement {
  display: flex;
  align-items: start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  text-align: left;
}

.timeline-achievement::before {
  content: '→';
  color: var(--color-accent-2);
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.8em;
}

.timeline-achievement strong {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* ── Stack badges ── */
.timeline-entry__stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── Spacer (empty col) ── */
.timeline-entry__spacer {}

/* ── Mobile: single column ── */
@media (max-width: 768px) {
  .timeline::before { left: 18px; }

  .timeline-entry {
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto;
    gap: 0 var(--space-5);
  }

  .timeline-entry__dot { grid-column: 1; grid-row: 1; }
  .timeline-entry__card {
    grid-column: 2;
    grid-row: 1;
    text-align: left !important;
  }
  .timeline-entry__spacer { display: none; }

  /* Reset nth-child rules */
  .timeline-entry:nth-child(odd)  .timeline-entry__card,
  .timeline-entry:nth-child(even) .timeline-entry__card {
    grid-column: 2;
  }
  .timeline-entry:nth-child(even) .timeline-entry__spacer { display: none; }

  .timeline-achievement { text-align: left; }
}
