/* =========================================================
   EXPERIENCE — timeline of companies & roles
   ========================================================= */
.experience {
  position: relative;
  padding: 140px 0 140px;
  overflow: hidden;
  z-index: 1;
}

.experience__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.experience__outline-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(180px, 24vw, 400px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

.experience__glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.20;
  top: 20%;
  right: -160px;
  background: var(--accent-1);
}

.experience > .container-fluid { position: relative; z-index: 1; }

/* --- Head --- */
.experience__head { margin-bottom: 64px; }

.experience__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  max-width: 780px;
  background: linear-gradient(180deg, #ffffff 0%, #c8c8dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.experience__title-highlight {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  font-weight: 700;
}

.experience__subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 620px;
  margin: 0;
}

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding-left: 80px;
}

/* Vertical connector line */
.timeline::before {
  content: "";
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 31px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(139, 92, 246, 0.4) 8%,
    rgba(139, 92, 246, 0.15) 50%,
    rgba(34, 211, 238, 0.4) 92%,
    transparent 100%
  );
}

/* --- Entry --- */
.timeline__entry {
  position: relative;
  margin-bottom: 36px;
}

.timeline__entry:last-child { margin-bottom: 0; }

/* Marker */
.timeline__marker {
  --p1: var(--accent-1);
  --p2: var(--accent-2);
  position: absolute;
  left: -80px;
  top: 26px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  z-index: 2;
}

.timeline__marker-core {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #ffffff;
  border: 3px solid var(--bg-0);
  box-shadow:
    0 10px 30px -8px color-mix(in srgb, var(--p1) 70%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
}

/* Dashed ring around marker */
.timeline__marker::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  animation: spinSlow 18s linear infinite;
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* Optional company logo img */
.timeline__marker-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
}

/* =========================================================
   CARD
   ========================================================= */
.timeline__card {
  --p1: var(--accent-1);
  --p2: var(--accent-2);
  position: relative;
  padding: 28px 32px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.06), transparent 50%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s ease,
    border-color 0.4s ease;
}

/* Gradient border on hover */
.timeline__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

/* Horizontal arm connecting marker to card (subtle) */
.timeline__card::after {
  content: "";
  position: absolute;
  left: -24px;
  top: 46px;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border));
}

.timeline__entry:hover .timeline__card {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}

.timeline__entry:hover .timeline__card::before { opacity: 1; }

/* Head: company + period */
.timeline__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.timeline__company {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline__company-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0;
  transition: color 0.3s ease;
}

.timeline__entry:hover .timeline__company-name {
  background: linear-gradient(90deg, var(--p1), var(--p2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.timeline__role {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.timeline__role::before {
  content: "";
  width: 12px;
  height: 1px;
  background: linear-gradient(90deg, var(--p1), var(--p2));
}

/* Period pill */
.timeline__period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline__period svg {
  opacity: 0.6;
}

/* Current job variant */
.timeline__period.is-current {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.timeline__period.is-current::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  animation: pulseDot 1.6s ease-in-out infinite;
}

/* --- Tasks --- */
.timeline__tasks {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline__tasks li {
  position: relative;
  padding-left: 24px;
  color: var(--fg-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

.timeline__tasks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  height: 1px;
  background: linear-gradient(90deg, var(--p1), var(--p2));
}

.timeline__tasks li strong {
  color: var(--fg);
  font-weight: 600;
}

/* --- Tech stack --- */
.timeline__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* --- Footer CTA (view all) --- */
.experience__footer {
  margin-top: 56px;
  text-align: center;
}

.experience__footer-text {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.experience__cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    gap 0.3s var(--ease-out),
    border-color 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
}

.experience__cv-btn:hover {
  gap: 14px;
  border-color: var(--accent-3);
  color: var(--accent-3);
  background: rgba(34, 211, 238, 0.06);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 767.98px) {
  .experience { padding: 110px 0 110px; }

  .timeline {
    padding-left: 64px;
  }

  .timeline::before { left: 23px; }

  .timeline__marker {
    left: -64px;
    top: 20px;
    width: 48px;
    height: 48px;
  }

  .timeline__marker-core {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .timeline__card {
    padding: 22px 22px;
  }

  .timeline__card::after { display: none; }

  .timeline__card-head {
    gap: 12px;
  }

  .timeline__company-name { font-size: 19px; }
}

@media (max-width: 575.98px) {
  .experience { padding: 90px 0 80px; }

  .timeline__period {
    font-size: 11px;
    padding: 6px 12px;
  }

  .timeline__tasks li { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .timeline__marker::before,
  .timeline__period.is-current::before {
    animation: none !important;
  }
}
