/* ============================================================
   exp-timeline.css — timeline de la page Expériences (v2, 2026-10-12).
   Trois colonnes : année (collante le long de la carte) · rail · carte.
   Le rail se remplit en bleu au défilement (--tl-p, 0→1, posé par
   assets/js/exp-timeline.js) et chaque repère s'allume (.is-on) quand il
   passe le milieu de l'écran. Sans animations (pas de html.m-on) : rail
   plein et repères allumés d'office. Couleur du type : --tl-c (inline).
   ============================================================ */
.tl {
  --tl-year-w: 150px; --tl-rail-w: 44px; --tl-top: 30px;
  position: relative; list-style: none; margin: 0; padding: 0;
}
/* Piste + remplissage, centrés dans la colonne du rail */
.tl::before, .tl::after {
  content: ''; position: absolute; top: var(--tl-top); bottom: 40px;
  left: calc(var(--tl-year-w) + var(--tl-rail-w) / 2 - 1px); width: 2px; border-radius: 2px;
}
.tl::before { background: var(--ng-inner-hover); }
.tl::after {
  background: linear-gradient(180deg, var(--v3-blue-soft), var(--v3-blue) 60%, #2f47e6);
  box-shadow: 0 0 18px rgba(77,107,255,.55);
  transform-origin: top; transform: scaleY(1);
}
html.m-on .tl::after { transform: scaleY(var(--tl-p, 0)); }

.tl-item {
  position: relative; display: grid;
  grid-template-columns: var(--tl-year-w) var(--tl-rail-w) minmax(0, 1fr);
  align-items: start; padding-bottom: 28px;
}
.tl-item:last-child { padding-bottom: 0; }

/* ── Colonne des dates ── */
.tl-when {
  position: sticky; top: 110px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  padding: calc(var(--tl-top) - 14px) 18px 0 0; text-align: right;
}
.tl-year {
  font-family: var(--v3-serif); font-style: italic; font-weight: 400;
  font-size: 46px; line-height: .9; letter-spacing: -.02em; color: var(--ng-t35);
  transition: color .5s ease;
}
.tl-item.is-on .tl-year, html:not(.m-on) .tl-year { color: var(--ng-heading); }
.tl-to { font-size: 12px; color: var(--ng-t45); letter-spacing: .04em; }
.tl-live {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  padding: 4px 9px; border-radius: 999px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--v3-green); background: color-mix(in srgb, var(--v3-green) 12%, transparent);
}
.tl-live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
html.m-on .tl-live i { animation: tlPing 2s ease-out infinite; }

/* ── Repère sur le rail ── */
.tl-node { position: relative; height: 100%; display: flex; justify-content: center; padding-top: calc(var(--tl-top) - 7px); }
.tl-node i {
  position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ng-html-bg); box-shadow: inset 0 0 0 2px var(--ng-t30);
  transition: box-shadow .45s ease, background .45s ease, transform .45s cubic-bezier(.34,1.56,.64,1);
}
.tl-item.is-on .tl-node i, html:not(.m-on) .tl-node i {
  background: var(--tl-c); box-shadow: 0 0 0 4px var(--ng-html-bg), 0 0 0 5px color-mix(in srgb, var(--tl-c) 45%, transparent), 0 0 18px var(--tl-c);
  transform: scale(1.05);
}
.tl-item.is-now .tl-node i::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--tl-c); opacity: 0;
}
html.m-on .tl-item.is-now .tl-node i::after { animation: tlRing 2.4s ease-out infinite; }

/* ── Carte ── */
.tl-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3.4vw, 30px);
  border-radius: 22px; background: var(--v3-s1); box-shadow: var(--v3-shadow);
  -webkit-backdrop-filter: var(--v3-glass, none); backdrop-filter: var(--v3-glass, none);
  transition: background .3s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
/* Lueur de la couleur du type, en haut à gauche, qui s'avive au survol */
.tl-card::before {
  content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: radial-gradient(420px 180px at 0% 0%, color-mix(in srgb, var(--tl-c) 16%, transparent), transparent 70%);
  opacity: .55; transition: opacity .4s ease;
}
.tl-item:hover .tl-card { background: var(--v3-s2); transform: translateX(4px); }
.tl-item:hover .tl-card::before { opacity: 1; }

.tl-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tl-logo {
  flex: none; width: 46px; height: 46px; border-radius: 13px; background: #fff;
  display: grid; place-items: center; overflow: hidden; box-shadow: 0 4px 14px -6px rgba(0,0,0,.35);
}
.tl-logo img { width: 34px; height: 34px; object-fit: contain; }
.tl-id { flex: 1; min-width: 0; }
.tl-title { margin: 0; font-size: 18.5px; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; color: var(--ng-heading); }
.tl-sub { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; color: var(--ng-t55); }
.tl-loc { display: inline-flex; align-items: center; gap: 4px; color: var(--ng-t45); }
.tl-loc svg { width: 13px; height: 13px; }
.tl-type {
  flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 999px; background: var(--ng-inner);
  font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ng-t65);
}
.tl-type i { width: 7px; height: 7px; border-radius: 50%; background: var(--tl-c); box-shadow: 0 0 8px var(--tl-c); }

.tl-desc { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ng-t60); max-width: 68ch; }

.tl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 0; border-radius: 999px;
  background: var(--ng-inner); color: var(--ng-t70); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .2s, color .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
}
.tl-btn svg { width: 14px; height: 14px; }
.tl-btn:hover { background: var(--ng-inner-hover); color: var(--ng-heading); transform: translateY(-1px); }
.tl-btn:focus-visible { outline: 2px solid var(--v3-blue); outline-offset: 2px; }

@keyframes tlPing { 0% { box-shadow: 0 0 0 0 currentColor; } 80%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes tlRing { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.7); } }

/* ── Mobile : rail à gauche, dates en ligne au-dessus de la carte ── */
@media (max-width: 720px) {
  .tl { --tl-year-w: 0px; --tl-rail-w: 26px; --tl-top: 10px; }
  .tl-item { grid-template-columns: var(--tl-rail-w) minmax(0, 1fr); column-gap: 10px; row-gap: 10px; padding-bottom: 26px; }
  .tl-when { position: static; grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0; text-align: left; }
  .tl-year { font-size: 30px; }
  .tl-live { margin: 0; align-self: center; }
  .tl-node { grid-column: 1; grid-row: 1 / span 2; padding-top: var(--tl-top); }
  .tl-card { grid-column: 2; grid-row: 2; }
  .tl-item:hover .tl-card { transform: none; }
  .tl-head { flex-wrap: wrap; }
  .tl-type { order: -1; flex-basis: auto; }
  .tl-id { flex-basis: calc(100% - 60px); }
}

/* Contraste noir */
body.a11y-hc .tl-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
body.a11y-hc .tl-card::before, body.a11y-hc .tl::after { box-shadow: none; }
