/* ─────────────────────────────────────────
   9. TIMELINE — Historia de ANDESSA
   Reemplazo completo del bloque anterior
───────────────────────────────────────── */

/* ── Sección base ── */
#timeline {
  background: var(--gray-900);
  overflow:   hidden;
  position:   relative;
  padding:    100px 5%;
}

/* Fondo decorativo con gradiente radial */
#timeline::before {
  content:  '';
  position: absolute;
  inset:    0;
  background:
    radial-gradient(ellipse 900px 500px at 15% 50%, rgba(27,108,168,.18) 0%, transparent 65%),
    radial-gradient(ellipse 600px 400px at 85% 20%, rgba(13,59,110,.22) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Patrón de puntos suave */
#timeline::after {
  content:  '';
  position: absolute;
  inset:    0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='1' fill='rgba(79,168,220,0.07)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index:  0;
}

/* ── Wrapper ── */
#timeline .inner {
  position: relative;
  z-index:  1;
}

/* ── Header ── */
.tl2-header {
  display:       grid;
  grid-template-columns: 1fr 1fr;
  gap:           60px;
  align-items:   center;
  margin-bottom: 72px;
}

.tl2-eyebrow {
  display:        inline-flex;
  align-items:    center;
  gap:            8px;
  font-size:      .72rem;
  font-weight:    700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:          var(--blue-300);
  margin-bottom:  14px;
}
.tl2-eyebrow::before {
  content:       '';
  display:       block;
  width:         20px;
  height:        2px;
  background:    var(--blue-300);
}

.tl2-title {
  font-family:    'Playfair Display', serif;
  font-size:      clamp(2rem, 4vw, 3rem);
  font-weight:    700;
  line-height:    1.15;
  letter-spacing: -.5px;
  color:          var(--white);
  margin-bottom:  0;
}

.tl2-lead {
  font-size:   1rem;
  color:       rgba(255,255,255,.55);
  line-height: 1.75;
}

/* Progreso global de hitos */
.tl2-progress-wrap {
  margin-top: 24px;
}
.tl2-progress-label {
  display:         flex;
  justify-content: space-between;
  font-size:       .72rem;
  color:           rgba(255,255,255,.4);
  font-weight:     600;
  margin-bottom:   8px;
  letter-spacing:  .04em;
}
.tl2-progress-bar {
  height:        4px;
  background:    rgba(255,255,255,.08);
  border-radius: 2px;
  overflow:      hidden;
}
.tl2-progress-fill {
  height:        100%;
  width:         0%;
  background:    linear-gradient(90deg, var(--blue-700), var(--blue-300));
  border-radius: 2px;
  transition:    width 1.2s cubic-bezier(.4,0,.2,1);
}
.tl2-progress-fill.animated { width: 100%; }

/* ── Layout principal: lista + panel ── */
.tl2-body {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap:     32px;
  align-items: start;
}

/* ── Lista de hitos ── */
.tl2-list {
  display:        flex;
  flex-direction: column;
  gap:            0;
  position:       relative;
}

/* Línea vertical continua */
.tl2-list::before {
  content:     '';
  position:    absolute;
  left:        19px;
  top:         20px;
  bottom:      20px;
  width:       2px;
  background:  linear-gradient(
    to bottom,
    transparent 0%,
    rgba(79,168,220,.3) 8%,
    rgba(79,168,220,.3) 92%,
    transparent 100%
  );
}

/* ── Cada hito en la lista ── */
.tl2-item {
  display:    flex;
  align-items: flex-start;
  gap:        20px;
  padding:    16px 18px 16px 0;
  cursor:     pointer;
  position:   relative;
  border-radius: 14px;
  transition: background .22s;
}
.tl2-item:hover       { background: rgba(255,255,255,.04); }
.tl2-item.is-active   { background: rgba(27,108,168,.14); }

/* Punto / nodo */
.tl2-node {
  width:          40px;
  height:         40px;
  border-radius:  50%;
  border:         2px solid rgba(79,168,220,.35);
  background:     var(--gray-900);
  display:        flex;
  align-items:    center;
  justify-content: center;
  flex-shrink:    0;
  position:       relative;
  z-index:        1;
  transition:     border-color .25s, background .25s, box-shadow .25s;
  font-size:      1.1rem;
  line-height:    1;
}
.tl2-item:hover .tl2-node,
.tl2-item.is-active .tl2-node {
  border-color: var(--blue-300);
  background:   rgba(27,108,168,.25);
  box-shadow:   0 0 0 6px rgba(79,168,220,.12);
}
/* Anillo pulsante en el item activo */
.tl2-item.is-active .tl2-node::after {
  content:       '';
  position:      absolute;
  inset:         -6px;
  border-radius: 50%;
  border:        1.5px solid rgba(79,168,220,.4);
  animation:     tl-pulse 2s ease-in-out infinite;
}
@keyframes tl-pulse {
  0%,100% { opacity: 1; transform: scale(1);   }
  50%     { opacity: 0; transform: scale(1.35); }
}

/* Texto del hito en la lista */
.tl2-item-text { flex: 1; padding-top: 8px; }
.tl2-item-year {
  font-family:    'Playfair Display', serif;
  font-size:      1.05rem;
  font-weight:    700;
  color:          rgba(255,255,255,.4);
  letter-spacing: -.3px;
  line-height:    1;
  margin-bottom:  4px;
  transition:     color .22s;
}
.tl2-item:hover .tl2-item-year,
.tl2-item.is-active .tl2-item-year { color: var(--blue-300); }

.tl2-item-title {
  font-size:   .88rem;
  font-weight: 600;
  color:       rgba(255,255,255,.55);
  line-height: 1.45;
  transition:  color .22s;
}
.tl2-item:hover .tl2-item-title,
.tl2-item.is-active .tl2-item-title { color: var(--white); }

/* Tag de estado */
.tl2-item-tag {
  align-self:     center;
  font-size:      .62rem;
  font-weight:    800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding:        3px 9px;
  border-radius:  50px;
  background:     rgba(79,168,220,.12);
  color:          rgba(79,168,220,.6);
  border:         1px solid rgba(79,168,220,.18);
  white-space:    nowrap;
  transition:     background .22s, color .22s, border-color .22s;
}
.tl2-item.is-active .tl2-item-tag {
  background:  rgba(79,168,220,.2);
  color:       var(--blue-300);
  border-color: rgba(79,168,220,.4);
}
.tl2-item-tag.is-future {
  background:  rgba(255,255,255,.05);
  color:       rgba(255,255,255,.3);
  border-color: rgba(255,255,255,.1);
}

/* ── Panel de detalle ── */
.tl2-panel {
  position:    sticky;
  top:         96px;           /* debajo del nav */
  background:  rgba(255,255,255,.04);
  border:      1px solid rgba(79,168,220,.2);
  border-radius: 24px;
  overflow:    hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height:  440px;
}

/* Barra de color en la parte superior */
.tl2-panel-bar {
  height:     4px;
  background: linear-gradient(90deg, var(--blue-900), var(--blue-300), var(--blue-700));
  transition: background .4s ease;
}

.tl2-panel-inner {
  padding:    48px 44px;
  height:     100%;
  position:   relative;
}

/* Número de año decorativo grande */
.tl2-panel-year-bg {
  position:      absolute;
  top:           -10px;
  right:         28px;
  font-family:   'Playfair Display', serif;
  font-size:     8rem;
  font-weight:   700;
  color:         rgba(255,255,255,.04);
  line-height:   1;
  pointer-events: none;
  letter-spacing: -6px;
  user-select:   none;
  transition:    opacity .4s ease;
}

/* Badge de categoría */
.tl2-panel-cat {
  display:        inline-flex;
  align-items:    center;
  gap:            7px;
  font-size:      .68rem;
  font-weight:    800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color:          var(--blue-300);
  background:     rgba(79,168,220,.1);
  border:         1px solid rgba(79,168,220,.25);
  padding:        5px 12px;
  border-radius:  50px;
  margin-bottom:  20px;
}
.tl2-panel-cat::before {
  content:       '';
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--blue-300);
}

/* Año activo en el panel */
.tl2-panel-year {
  font-family:    'Playfair Display', serif;
  font-size:      clamp(2.5rem, 5vw, 4rem);
  font-weight:    700;
  color:          var(--white);
  letter-spacing: -2px;
  line-height:    1;
  margin-bottom:  12px;
}

/* Título del hito en el panel */
.tl2-panel-title {
  font-size:     1.25rem;
  font-weight:   700;
  color:         var(--white);
  line-height:   1.35;
  margin-bottom: 16px;
}

/* Descripción larga */
.tl2-panel-desc {
  font-size:   .95rem;
  color:       rgba(255,255,255,.6);
  line-height: 1.75;
  margin-bottom: 28px;
}

/* Métricas / stats del hito */
.tl2-panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap:     12px;
  margin-top: auto;
}
.tl2-panel-stat {
  background:    rgba(255,255,255,.05);
  border:        1px solid rgba(79,168,220,.15);
  border-radius: 12px;
  padding:       14px 12px;
  text-align:    center;
}
.tl2-ps-val {
  font-family:   'Playfair Display', serif;
  font-size:     1.4rem;
  font-weight:   700;
  color:         var(--blue-300);
  letter-spacing: -.5px;
  line-height:   1;
}
.tl2-ps-lbl {
  font-size:   .67rem;
  color:       rgba(255,255,255,.4);
  margin-top:  4px;
  font-weight: 500;
}

/* Transición de contenido del panel */
.tl2-panel-content {
  transition: opacity .3s ease, transform .3s ease;
}
.tl2-panel-content.is-exiting {
  opacity:   0;
  transform: translateY(8px);
}
.tl2-panel-content.is-entering {
  opacity:   0;
  transform: translateY(-8px);
}

/* Navegación de flechas del panel */
.tl2-panel-nav {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  margin-top:      32px;
  padding-top:     20px;
  border-top:      1px solid rgba(255,255,255,.07);
}
.tl2-nav-btn {
  display:       flex;
  align-items:   center;
  gap:           6px;
  font-size:     .78rem;
  font-weight:   700;
  color:         rgba(255,255,255,.4);
  background:    transparent;
  border:        1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding:       8px 14px;
  cursor:        pointer;
  transition:    color .2s, border-color .2s, background .2s;
}
.tl2-nav-btn:hover {
  color:        var(--white);
  border-color: rgba(79,168,220,.4);
  background:   rgba(27,108,168,.12);
}
.tl2-nav-btn:disabled {
  opacity:       .25;
  cursor:        default;
  pointer-events: none;
}
.tl2-nav-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.tl2-nav-dots {
  display: flex;
  gap:     6px;
}
.tl2-nav-dot {
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    rgba(255,255,255,.2);
  border:        none;
  cursor:        pointer;
  transition:    all .22s;
}
.tl2-nav-dot.is-active {
  width:      20px;
  border-radius: 4px;
  background: var(--blue-300);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .tl2-header {
    grid-template-columns: 1fr;
    gap:                   28px;
    margin-bottom:         48px;
  }
  .tl2-body {
    grid-template-columns: 1fr;
    gap:                   24px;
  }
  .tl2-panel {
    position: static;
    order:    -1;              /* panel arriba, lista abajo en móvil */
  }
  .tl2-panel-stats { grid-template-columns: repeat(3, 1fr); }
  .tl2-list::before { left: 19px; }
}

@media (max-width: 600px) {
  .tl2-panel-inner      { padding: 28px 22px; }
  .tl2-panel-year-bg    { font-size: 5rem; }
  .tl2-panel-stats      { grid-template-columns: 1fr 1fr; }
  .tl2-item             { padding: 12px 12px 12px 0; }
  .tl2-panel-year       { font-size: 2.2rem; }
  .tl2-panel-title      { font-size: 1.05rem; }
}
