/* ══════════════════════════════════════
   PROJECT TIMELINE
   ══════════════════════════════════════ */

/* Section wrapper */
.timeline-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  text-align: center;
}

.timeline-title {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  background: linear-gradient(180deg, var(--ll-gold) 0%, var(--ll-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(255, 180, 0, 0.3));
  margin: 0 0 8px;
}

.timeline-subtitle {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.06em;
  margin: 0 0 60px;
}

/* ── Timeline structure ── */
.timeline {
  position: relative;
  padding: 20px 0;
}

/* Vertical amber line */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 180, 0, 0.4) 5%,
    rgba(255, 180, 0, 0.4) 95%,
    transparent 100%
  );
  transform: translateX(-50%);
}

/* ── Timeline item ── */
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 72px;
  /* Scroll animation — starts hidden */
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Left items: card on left side */
.timeline-item--left {
  justify-content: flex-start;
  padding-right: calc(50% + 32px);
  text-align: right;
  transform: translateX(-40px);
}

/* Right items: card on right side */
.timeline-item--right {
  justify-content: flex-end;
  padding-left: calc(50% + 32px);
  text-align: left;
  transform: translateX(40px);
}

/* Visible state (triggered by IntersectionObserver) */
.timeline-item--visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Marker (circle on the line) ── */
.timeline-marker {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #141414;
  border: 2px solid rgba(255, 180, 0, 0.35);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Small horizontal lines extending from the marker */
.timeline-marker::before,
.timeline-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  width: 16px;
  background: rgba(255, 180, 0, 0.3);
  transform: translateY(-50%);
}

.timeline-marker::before {
  right: 100%;
  margin-right: 4px;
}

.timeline-marker::after {
  left: 100%;
  margin-left: 4px;
}

.timeline-number {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  color: var(--ll-amber);
  font-weight: 600;
}

/* Active marker (current project) */
.timeline-marker--active {
  border-color: var(--ll-amber);
  box-shadow: 0 0 16px rgba(255, 180, 0, 0.3), 0 0 40px rgba(255, 180, 0, 0.1);
  animation: marker-pulse 2s ease-in-out infinite alternate;
}

@keyframes marker-pulse {
  0%   { box-shadow: 0 0 16px rgba(255, 180, 0, 0.3), 0 0 40px rgba(255, 180, 0, 0.1); }
  100% { box-shadow: 0 0 20px rgba(255, 180, 0, 0.5), 0 0 60px rgba(255, 180, 0, 0.15); }
}

/* New project marker */
.timeline-marker--new {
  border-color: var(--ll-cyan);
  box-shadow: 0 0 16px rgba(0, 255, 200, 0.2);
}

.timeline-marker--new .timeline-number {
  color: var(--ll-cyan);
}

/* ── Card ── */
.timeline-card {
  background: rgba(18, 18, 18, 0.9);
  border: 2px solid rgba(255, 180, 0, 0.18);
  border-radius: 16px;
  padding: 24px 28px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 400px;
}

.timeline-item--left .timeline-card {
  margin-left: auto;
}

.timeline-item--right .timeline-card {
  margin-right: auto;
}

.timeline-card:hover {
  border-color: rgba(255, 180, 0, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Active card (current project) */
.timeline-card--active {
  border-color: rgba(255, 180, 0, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background: rgba(35, 28, 10, 0.92);
}

/* New card */
.timeline-card--new {
  border-color: rgba(0, 200, 180, 0.3);
  background: rgba(10, 28, 25, 0.92);
}

.timeline-card--new:hover {
  border-color: rgba(0, 200, 180, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Broken card */
.timeline-card--broken {
  border-color: rgba(255, 70, 70, 0.25);
  background: rgba(32, 12, 12, 0.92);
}

.timeline-card--broken:hover {
  border-color: rgba(255, 70, 70, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── Tags ── */
.timeline-tag {
  display: inline-block;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  color: var(--ll-amber);
  background: rgba(255, 180, 0, 0.08);
  border: 1px solid rgba(255, 180, 0, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.timeline-tag--new {
  color: var(--ll-cyan);
  background: rgba(0, 255, 200, 0.08);
  border-color: rgba(0, 255, 200, 0.2);
  margin-right: 6px;
  animation: new-tag-glow 2s ease-in-out infinite alternate;
}

@keyframes new-tag-glow {
  0%   { box-shadow: 0 0 6px rgba(0, 255, 200, 0.1); }
  100% { box-shadow: 0 0 12px rgba(0, 255, 200, 0.25); }
}

/* ── Card title ── */
.timeline-card-title {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ── Card description ── */
.timeline-card-desc {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
  margin: 0;
}

/* ══════════════════════════════════════
   RESPONSIVE — Stack on mobile
   ══════════════════════════════════════ */
@media (max-width: 720px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-marker {
    left: 20px;
    width: 30px;
    height: 30px;
  }

  .timeline-number {
    font-size: 0.7rem;
  }

  .timeline-item--left,
  .timeline-item--right {
    padding-left: 56px;
    padding-right: 0;
    text-align: left;
    justify-content: flex-start;
  }

  .timeline-item--left {
    transform: translateX(0);
  }

  .timeline-item--right {
    transform: translateX(0);
  }

  .timeline-item--left .timeline-card,
  .timeline-item--right .timeline-card {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
  }

  /* On mobile, all items slide in from bottom */
  .timeline-item {
    transform: translateY(30px);
  }

  .timeline-item--visible {
    transform: translateY(0);
  }
}
