/* ==========================================================================
   Section — Experience (two-column: sticky timeline nav + detail cards)
   ========================================================================== */

/* Override section width — fill available width like the demo */
#experience {
  max-width: none;
  padding: 3.5rem 4vw;
}

/* ── Two-column layout ── */
.exp-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0 48px;
  align-items: start;
}

/* ── LEFT: sticky timeline nav ── */
.exp-timeline {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 40px;
}
.exp-timeline::-webkit-scrollbar { display: none; }

.tl-inner {
  position: relative;
  padding-left: 24px;
}

/* vertical line — matches demo gradient */
.tl-inner::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent) 0%, #2a2a4a 100%);
}

.tl-item {
  position: relative;
  margin-bottom: 4px;
  cursor: pointer;
}

/* dot — solid visible grey like demo */
.tl-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e2235;
  border: 2px solid #3a4060;
  transition: all 0.25s ease;
  z-index: 1;
}
.tl-item.active::before,
.tl-item:hover::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px rgba(var(--color-accent-rgb), 0.55);
}

.tl-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s;
  /* ensure child spans can ellipsis correctly */
  min-width: 0;
}
.tl-btn:hover            { background: rgba(var(--color-accent-rgb), 0.06); }
.tl-item.active .tl-btn  { background: rgba(var(--color-accent-rgb), 0.08); }

/* Line 1 — year range */
.tl-year {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
  opacity: 0.75;
}
.tl-item.active .tl-year,
.tl-item:hover .tl-year  { opacity: 1; }

/* Line 2 — trimmed role, single row with ellipsis */
.tl-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-item.active .tl-role { color: var(--color-heading); }
.tl-item:hover .tl-role  { color: #ccc; }

/* Line 3 — application / client, single row with ellipsis */
.tl-employer {
  font-size: 0.65rem;
  color: var(--color-text-subtle);
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-item.active .tl-employer { color: var(--color-text-muted); }
.tl-item:hover .tl-employer  { color: #666; }

/* employer group label — centred over the line */
.tl-group-label {
  display: block;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-subtle);
  padding: 14px 0 6px;
  margin-left: -24px;
  position: relative;
  z-index: 1;
  background: var(--color-bg);
}

/* ── RIGHT: detail cards ── */
.exp-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  border-radius: var(--card-radius);
  padding: 2rem 2.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  scroll-margin-top: 100px;
}
.experience-card.active,
.experience-card:hover {
  border-left-color: var(--color-accent);
  box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb), 0.1), 0 4px 24px rgba(var(--color-accent-rgb), 0.06);
  background: rgba(var(--color-accent-rgb), 0.03);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.exp-role { font-size: 1.15rem; color: var(--color-heading); font-weight: 600; margin-bottom: 0.4rem; }

.exp-company {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.exp-company .company-name { color: var(--color-accent); font-weight: 500; }

.exp-duration {
  background: rgba(var(--color-accent-rgb), 0.1);
  border: 1px solid rgba(var(--color-accent-rgb), 0.2);
  color: var(--color-accent);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exp-achievements       { margin-bottom: 1.25rem; }
.exp-achievements h4    { font-size: 0.75rem; color: var(--color-text-subtle); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.exp-achievements ul    { padding: 0; }

.exp-achievements li {
  color: #a0b0c0;
  font-size: 0.93rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.exp-achievements li::before {
  content: '•';
  color: var(--color-accent);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.exp-techs    { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.exp-techs h4 { font-size: 0.75rem; color: var(--color-text-subtle); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; width: 100%; }

.tech-tag {
  background: rgba(var(--color-secondary-rgb), 0.15);
  color: #b088e0;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(var(--color-secondary-rgb), 0.2);
}

/* ── Mobile: stack timeline above cards ── */
@media (max-width: 768px) {
  .exp-layout {
    grid-template-columns: 1fr;
    gap: 24px 0;
  }
  .exp-timeline {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
  }
}

