/* ===================================================================
   SECTION: Timeline — Development roadmap
   =================================================================== */

.timeline-section {
  text-align: center;
}

.timeline-section .section-header {
  margin-bottom: var(--space-lg);
}

/* --- Timeline container --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Energy canvas --- */
.timeline-energy-canvas {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  max-width: none !important;
  height: unset;
  pointer-events: none;
  z-index: 1;
  max-width: none;
}

/* --- Vertical line — thin grey base (visible behind canvas for locked area) --- */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 10%,
    rgba(255, 255, 255, 0.06) 90%,
    transparent 100%
  );
}

/* --- Node (each entry) --- */
.timeline-node {
  position: relative;
  width: 50%;
  padding: 0 0 40px;
  z-index: 2;
}

.timeline-left {
  padding-right: 40px;
  text-align: right;
}

.timeline-right {
  margin-left: 50%;
  padding-left: 40px;
  text-align: left;
}

/* --- Junction point — tiny bright spark where tendril meets beam --- */
.timeline-dot {
  position: absolute;
  top: 8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c0e0ff;
  box-shadow: 0 0 6px rgba(88, 166, 255, 0.6);
  z-index: 3;
}

/* No ring — just the tendril connector */
.timeline-dot::before {
  display: none;
}

/* Energy tendril — horizontal connector to card */
.timeline-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  width: 36px;
  transform: translateY(-50%);
  z-index: 2;
}

.timeline-left .timeline-dot {
  right: -2px;
}

.timeline-right .timeline-dot {
  left: -2px;
}

/* Tendril direction */
.timeline-left .timeline-dot::after {
  right: 100%;
  margin-right: 1px;
  background: linear-gradient(270deg,
    rgba(140, 200, 255, 0.7),
    rgba(88, 166, 255, 0.35) 40%,
    rgba(60, 130, 255, 0.1) 75%,
    transparent
  );
  box-shadow: 0 0 6px rgba(0, 140, 255, 0.25), 0 0 2px rgba(140, 200, 255, 0.3);
}

.timeline-right .timeline-dot::after {
  left: 100%;
  margin-left: 1px;
  background: linear-gradient(90deg,
    rgba(140, 200, 255, 0.7),
    rgba(88, 166, 255, 0.35) 40%,
    rgba(60, 130, 255, 0.1) 75%,
    transparent
  );
  box-shadow: 0 0 6px rgba(0, 140, 255, 0.25), 0 0 2px rgba(140, 200, 255, 0.3);
}

/* Current node — slightly brighter spark, pulsing glow */
.timeline-dot--active {
  width: 4px;
  height: 4px;
  background: #e0f0ff;
  box-shadow:
    0 0 8px rgba(0, 200, 255, 0.8),
    0 0 18px rgba(0, 140, 255, 0.25);
  animation: junctionPulse 2.5s ease-in-out infinite;
}

.timeline-left .timeline-dot--active {
  right: -2px;
}

.timeline-right .timeline-dot--active {
  left: -2px;
}

/* Active tendril — brighter, wider */
.timeline-left .timeline-dot--active::after {
  width: 40px;
  height: 2px;
  background: linear-gradient(270deg,
    rgba(180, 220, 255, 0.85),
    rgba(100, 180, 255, 0.4) 40%,
    rgba(60, 140, 255, 0.1) 75%,
    transparent
  );
  box-shadow: 0 0 8px rgba(0, 160, 255, 0.35), 0 0 3px rgba(160, 220, 255, 0.4);
}

.timeline-right .timeline-dot--active::after {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(180, 220, 255, 0.85),
    rgba(100, 180, 255, 0.4) 40%,
    rgba(60, 140, 255, 0.1) 75%,
    transparent
  );
  box-shadow: 0 0 8px rgba(0, 160, 255, 0.35), 0 0 3px rgba(160, 220, 255, 0.4);
}

@keyframes junctionPulse {
  0%, 100% {
    box-shadow:
      0 0 6px rgba(0, 200, 255, 0.6),
      0 0 14px rgba(0, 140, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 10px rgba(0, 220, 255, 0.9),
      0 0 24px rgba(0, 140, 255, 0.35);
  }
}

/* Locked node — dim point, faint tendril */
.timeline-dot--locked {
  width: 3px;
  height: 3px;
  background: #3a3f48;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.05);
}

.timeline-left .timeline-dot--locked::after {
  background: linear-gradient(270deg,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  box-shadow: none;
  width: 20px;
}

.timeline-right .timeline-dot--locked::after {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  box-shadow: none;
  width: 20px;
}

/* --- Current badge --- */
.timeline-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0f18;
  background: #58a6ff;
  padding: 1px 8px;
  border-radius: 100px;
  margin-left: 6px;
  vertical-align: middle;
}

/* --- Card --- */
.timeline-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}

.timeline-card:hover {
  border-color: rgba(88, 166, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 12px rgba(0, 120, 255, 0.06), inset 0 0 12px rgba(0, 120, 255, 0.02);
}

/* Energy-side border accent — left cards glow on right edge, right cards on left */
.timeline-left .timeline-card {
  border-right-color: rgba(88, 166, 255, 0.12);
}

.timeline-right .timeline-card {
  border-left-color: rgba(88, 166, 255, 0.12);
}

.timeline-left .timeline-card:hover {
  border-right-color: rgba(88, 166, 255, 0.3);
}

.timeline-right .timeline-card:hover {
  border-left-color: rgba(88, 166, 255, 0.3);
}

/* Current card — subtle persistent glow */
.timeline-current .timeline-card {
  border-color: rgba(88, 166, 255, 0.12);
  box-shadow: 0 0 8px rgba(0, 120, 255, 0.05);
}

/* Locked card */
.timeline-card--locked {
  border-color: rgba(255, 255, 255, 0.03);
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.5;
}

.timeline-card--locked:hover {
  opacity: 0.65;
  border-color: rgba(255, 255, 255, 0.06);
}

/* --- Year badge --- */
.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #58a6ff;
  display: inline-block;
  margin-bottom: 6px;
}

.timeline-future .timeline-year {
  color: rgba(255, 255, 255, 0.25);
}

/* --- Title --- */
.timeline-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin: 0 0 6px;
}

.timeline-future .timeline-title {
  color: rgba(255, 255, 255, 0.4);
}

/* --- Description --- */
.timeline-card p {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.timeline-card--locked p {
  color: rgba(255, 255, 255, 0.35);
}

/* --- Progress marker --- */
.timeline-progress-marker {
  position: relative;
  height: 0;
  margin: 0;
}

/* --- Intro animation — greyed-out until beam connects --- */
.timeline-node--intro .timeline-card {
  opacity: 0.3;
  filter: saturate(0) brightness(0.5);
  transform: scale(0.97);
  transition: opacity 0.6s ease-out, filter 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-node--intro .timeline-dot {
  opacity: 0.15;
  transition: opacity 0.4s ease-out;
}

.timeline-node--intro .timeline-dot::after {
  opacity: 0;
  transition: opacity 0.5s ease-out 0.1s;
}

/* Activated state — beam has connected */
.timeline-node--intro.timeline-node--activated .timeline-card {
  opacity: 1;
  filter: saturate(1) brightness(1);
  transform: scale(1);
}

.timeline-node--intro.timeline-node--activated .timeline-dot {
  opacity: 1;
}

.timeline-node--intro.timeline-node--activated .timeline-dot::after {
  opacity: 1;
}

/* Flash effect on activation */
@keyframes nodeFlash {
  0% { box-shadow: 0 0 0 rgba(88, 166, 255, 0); }
  30% { box-shadow: 0 0 20px rgba(88, 166, 255, 0.4), 0 0 40px rgba(0, 120, 255, 0.15); }
  100% { box-shadow: 0 0 0 rgba(88, 166, 255, 0); }
}

.timeline-node--intro.timeline-node--activated .timeline-card {
  animation: nodeFlash 0.8s ease-out;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .timeline-line {
    left: 16px;
  }

  .timeline-energy-canvas {
    left: 16px;
    transform: none;
  }

  .timeline-node {
    width: 100%;
    padding-left: 36px;
    padding-right: 0;
    text-align: left;
  }

  .timeline-left {
    padding-right: 0;
    text-align: left;
  }

  .timeline-right {
    margin-left: 0;
    padding-left: 36px;
  }

  .timeline-left .timeline-dot,
  .timeline-right .timeline-dot,
  .timeline-left .timeline-dot--active,
  .timeline-right .timeline-dot--active {
    left: 15px;
    right: auto;
  }

  /* Mobile: all tendrils go right toward card */
  .timeline-left .timeline-dot::after,
  .timeline-right .timeline-dot::after,
  .timeline-left .timeline-dot--active::after,
  .timeline-right .timeline-dot--active::after {
    left: 100%;
    right: auto;
    margin-left: 1px;
    margin-right: 0;
    background: linear-gradient(90deg,
      rgba(88, 166, 255, 0.4),
      rgba(88, 166, 255, 0.1) 60%,
      transparent
    );
    width: 16px;
  }

  .timeline-left .timeline-dot--locked::after,
  .timeline-right .timeline-dot--locked::after {
    background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.06),
      transparent
    );
    width: 12px;
  }

  /* Mobile: energy accent on left edge for all cards */
  .timeline-left .timeline-card,
  .timeline-right .timeline-card {
    border-left-color: rgba(88, 166, 255, 0.12);
    border-right-color: rgba(255, 255, 255, 0.06);
  }

  .timeline-left .timeline-card:hover,
  .timeline-right .timeline-card:hover {
    border-left-color: rgba(88, 166, 255, 0.3);
    border-right-color: rgba(255, 255, 255, 0.1);
  }

  .timeline-card {
    padding: 0.8rem 1rem;
  }

  .timeline-title {
    font-size: 0.9rem;
  }

  .timeline-card p {
    font-size: 0.78rem;
  }
}
