/* ============================================================
   SECTION EXPÉRIENCE — Timeline horizontale
   ============================================================ */
.section-experience {
  padding: var(--section-pad) 0;
  background: var(--c-dark);
  border-top: 0.5px solid var(--c-border);
  position: relative;
  overflow: visible; /* ne pas couper le contenu */
}

/* Image de fond */
.section-experience::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/exp-bg.jpg');
  background-size: cover;
  background-position: center 40%;
  opacity: 0.07;
  filter: grayscale(0.6);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Contenu au-dessus du fond */
.section-experience .container {
  position: relative;
  z-index: 1;
}

/* Header : tag + titre sur deux lignes normales */
.experience-header {
  padding: 0 var(--container-pad, clamp(20px,5vw,80px));
  margin-bottom: clamp(32px, 4vw, 52px);
}

.experience-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px); /* taille raisonnable */
  font-weight: 900;
  color: var(--c-teal);
  
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 8px;
}

/* ---- Timeline ---- */
/* ---- Timeline — override horizontal via ID ---- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* L'ID #timeline-track force le mode horizontal pleine largeur */
#timeline-track {
  display: flex !important;
  flex-direction: row !important;
  overflow: hidden;
  align-items: stretch;
  width: calc(100% + 2 * clamp(20px, 5vw, 80px));
  margin-left: calc(-1 * clamp(20px, 5vw, 80px));
}

/* Row — mode vertical (ancienne version, ignorée) */
.timeline-row {
  display: grid;
  grid-template-columns: 120px 32px 1fr;
  align-items: flex-start;
  gap: 0;
  position: relative;
  padding-bottom: clamp(32px, 4vw, 52px);
}


/* ---- Année ---- */
.timeline-year {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 0;
  padding-top: 2px;
}

.timeline-year-num {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 900;
  color: var(--c-white);
  line-height: 1;
  letter-spacing: -0.01em;
}
.timeline-year-num--dim {
  color: rgba(160, 180, 210, 0.35);
  font-size: clamp(16px, 2vw, 22px);
}
.timeline-year-sep {
  font-size: 10px;
  color: rgba(58, 143, 255, 0.5);
  margin: 3px 0;
  text-align: right;
}

.timeline-line {
  width: 28px;
  height: 1px;
  background: var(--c-blue);
  margin-top: 10px;
  flex-shrink: 0;
}

/* ---- Dot ---- */
.timeline-dot {
  position: relative;
  z-index: 2;
  width: 32px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.timeline-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-blue);
  display: block;
  box-shadow: 0 0 10px rgba(58, 143, 255, 0.4);
}

/* ---- Items ---- */
.timeline-items {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-items li {
  font-size: clamp(14px, 1.5vw, 17px);
  color: rgba(160, 180, 210, 0.75);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}

.timeline-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 1px;
  background: var(--c-blue);
  opacity: 0.6;
}

/* Mettre en avant les items avec émoji (records, titres) */
.timeline-items li:first-child {
  color: rgba(160, 200, 255, 0.9);
  font-weight: 500;
}

/* Hover sur chaque row */
.timeline-row:hover .timeline-year-num { color: var(--c-blue); transition: color 0.2s; }
.timeline-row:hover .timeline-dot::before {
  transform: scale(1.4);
  transition: transform 0.2s;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .timeline-row {
    grid-template-columns: 80px 24px 1fr;
  }
  .timeline-row:not(:last-child)::after {
    left: calc(80px + 11px);
  }
  .timeline-line { width: 20px; }
  .timeline-year-num { font-size: 20px; }
}

/* ============================================================
   TIMELINE HORIZONTALE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(58,143,255,0.3) transparent;
}
.timeline::-webkit-scrollbar { height: 3px; }
.timeline::-webkit-scrollbar-track { background: transparent; }
.timeline::-webkit-scrollbar-thumb { background: rgba(58,143,255,0.3); border-radius: 2px; }

.timeline {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  align-items: stretch; /* hauteur égale sur toutes les colonnes */
}

.timeline-row {
  display: flex;
  flex-direction: column;   /* année en haut, dot+contenu en dessous */
  align-items: flex-start;
  position: relative;
  width: 50%;
  flex-shrink: 0;
  flex-grow: 0;
  min-width: 0;
  padding: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 48px) clamp(20px, 3vw, 40px) clamp(16px, 2vw, 32px);
}

.timeline-row:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,0.07);
}

/* Année — affichée en haut de la colonne */
.timeline-year {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

/* Dot horizontal aligné avec l'année */
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-blue);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(58,143,255,0.5);
}

/* Colonne contenu — prend toute la largeur restante */
.timeline-col {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
}
.timeline-items {
  flex: 1;
}

/* Vignette cliquable */
.tl-thumb {
  position: relative;
  border-radius: 5px 5px 0 0;  /* coins ronds seulement en haut */
  overflow: hidden;
  aspect-ratio: 16/9;
  width: 100%;
  margin-top: 16px;
  flex-shrink: 0;
  cursor: zoom-in;
}
/* Effet image déclenché dès le survol de la ROW entière */
.tl-thumb-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.1) brightness(0.84);
  transition: filter 4s ease;
  display: block;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
}
/* Survol de la ROW = couleur, sans zoom */
.timeline-row:hover .tl-thumb-img {
  filter: grayscale(0) contrast(1.05) brightness(1) saturate(1.3);
  transform: translateZ(0);
}
/* Survol direct de la vignette = couleur, sans zoom */
.tl-thumb:hover .tl-thumb-img {
  filter: grayscale(0) contrast(1.05) brightness(1) saturate(1.3);
  transform: translateZ(0);
}
/* Icône zoom visible au survol de la row */
.timeline-row:hover .tl-thumb::before { opacity: 1; }
/* Pas d'overlay sur la photo — la légende est en dessous */
.tl-thumb::after { display: none; }

/* Légende SOUS la photo */
.tl-thumb-cap {
  display: block;
  position: static;
  background: rgba(2, 104, 111, 0.15);
  border: 0.5px solid rgba(2, 104, 111, 0.4);
  border-top: none;
  border-radius: 0 0 5px 5px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
}
/* Icône zoom */
.tl-thumb::before {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  background: rgba(58,143,255,0.18) url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 9l4 4M1 6a5 5 0 1 0 10 0A5 5 0 0 0 1 6zM6 4v4M4 6h4' stroke='%233a8fff' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  border-radius: 3px;
  border: 0.5px solid rgba(58,143,255,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 3;
  pointer-events: none;
}
.tl-thumb:hover::before { opacity: 1; }

.exp-photo-stage { display: none; }

/* Mobile — 1 colonne, tous accessibles */
@media (max-width: 640px) {
  .timeline-row { width: 100%; padding-right: 0; }
  .timeline-row:not(:last-child)::after { display: none; }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.tl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(4, 6, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tl-lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.tl-lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tl-lightbox-img {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  transform: scale(0.94);
  transition: transform 0.3s ease;
}
.tl-lightbox.open .tl-lightbox-img { transform: scale(1); }
.tl-lightbox-cap {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(58,143,255,0.75);
  text-align: center;
}
.tl-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px; height: 36px;
  background: rgba(10,14,20,0.92);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(160,180,210,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px; line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}
.tl-lightbox-close:hover { color: #f0f4f8; border-color: rgba(255,255,255,0.35); }


.timeline-year {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: 0;
  padding-top: 0;
  margin-bottom: 12px;
}
.timeline-line {
  width: 28px;
  height: 1px;
  background: var(--c-blue);
  margin-top: 8px;
  margin-left: 0;
}

.timeline-dot {
  width: auto;
  display: block;
  padding: 0;
  margin-bottom: 14px;
}
.timeline-dot::before {
  width: 8px; height: 8px;
  margin: 0;
}

.timeline-items li {
  font-size: clamp(14px, 1.5vw, 17px);
}

/* ---- Nav boutons timeline ---- */
.timeline-wrapper {
  position: relative;
}

/* Nav centré horizontalement, flottant juste au-dessus du trait vertical */
.timeline-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* Centré sur le trait de séparation (à 50% de la largeur) */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Juste au-dessus de la timeline */
  top: 0;
  z-index: 10;
  /* Décaler vers le bas du header, juste au-dessus du trait */
  margin-top: 0;
  background: var(--c-dark);
  padding: 6px 10px;
  border-radius: 6px;
  border: 0.5px solid rgba(255,255,255,0.08);
}

/* Compenser l'espace pris par le nav positionné en absolu */
#timeline-track {
  padding-top: 64px; /* hauteur nav + espace */
}

.tl-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(58,143,255,0.08);
  border: 1px solid rgba(58,143,255,0.35);
  border-radius: 4px;
  color: rgba(58,143,255,0.8);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.tl-btn:hover:not(:disabled) {
  background: rgba(58,143,255,0.2);
  border-color: var(--c-blue);
  color: var(--c-white);
  transform: scale(1.05);
}
.tl-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.1);
  color: rgba(160,180,210,0.3);
}
.tl-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(160,180,210,0.5);
  min-width: 80px;
  text-align: center;
  padding: 0 4px;
}

/* Timeline horizontale — sans scrollbar visible */
.timeline {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden; /* pas de scrollbar */
  scroll-behavior: smooth;
}

/* ============================================================
   PHOTO DYNAMIQUE sous la timeline
   ============================================================ */
.exp-photo-stage {
  position: relative;
  margin-top: clamp(32px, 4vw, 52px);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 21 / 8;   /* panoramique */
  background: var(--c-dark);
}

.exp-photo-slide {
  position: absolute;
  inset: 0;
  transition: opacity 0.7s ease;
}

.exp-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  filter: brightness(0.82) saturate(0.88);
  transition: filter 4s ease;
}
.exp-photo-slide.active .exp-photo-img {
  filter: brightness(0.88) saturate(0.95);
}

/* Overlay dégradé bas */
.exp-photo-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(8,10,13,0.88) 0%,
    rgba(8,10,13,0.25) 35%,
    transparent 65%
  );
  pointer-events: none;
}

.exp-photo-caption {
  position: absolute;
  bottom: 20px;
  left: 28px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.exp-photo-year {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  color: var(--c-white);
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.exp-photo-label {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(58, 143, 255, 0.85);
}

@media (max-width: 640px) {
  .exp-photo-stage { aspect-ratio: 16 / 9; }
}

/* Block photo + légende */
.tl-photo-block {
  margin-top: 16px;
  flex-shrink: 0;
  cursor: zoom-in;
}
.tl-photo-block .tl-thumb {
  margin-top: 0;
  cursor: zoom-in;
}

.timeline-year-range {
  font-size: 0.55em;
  opacity: 0.45;
  letter-spacing: 0;
  margin-left: 3px;
}

/* Ligne de détail ↳ sous les items principaux */
.timeline-items li:has(> *:first-child) { color: inherit; }
.timeline-items li[data-sub],
.timeline-items li.tl-sub {
  padding-left: 24px;
  font-size: 0.88em;
  color: rgba(58,143,255,0.6) !important;
  margin-top: -4px;
}

/* GPU compositing pour les vignettes — cohérence Edge/Chrome */
.tl-thumb-img {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ---- Animation automatique timeline par scroll ---- */
/* État initial : N&B */
#timeline-track .tl-thumb-img {
  filter: grayscale(1) contrast(1.1) brightness(0.84);
  transition: filter 4s ease;
}
/* Quand la row est active (classe ajoutée par JS) */
#timeline-track .timeline-row.tl-active .tl-thumb-img {
  filter: grayscale(0) contrast(1.05) brightness(1) saturate(1.3);
}
/* Délai échelonné : col gauche d'abord, col droite 0.6s après */
#timeline-track .timeline-row:nth-child(odd).tl-active  .tl-thumb-img { transition-delay: 0s; }
#timeline-track .timeline-row:nth-child(even).tl-active .tl-thumb-img { transition-delay: 0.6s; }

/* Header expérience — titre + boutons sur la même ligne */
.section-header--exp { margin-bottom: 32px; }
.exp-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.timeline-nav--inline {
  position: static !important;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
