/* ═══════════════════════════════════════════════════════════════════════════
   FIHARY — PAGE DÉMONSTRATION : onglets verticaux auto-advance (08/09/2026)
   - Rail vertical à gauche : carrousel d'onglets — la piste glisse (friction)
     pour toujours garder le rôle actif au centre de la fenêtre
   - Barre de progression sur l'onglet actif (temps restant avant le slide suivant)
   - Filmstrip vertical à droite : les écrans défilent avec un easing doux
   - Panneau d'explication synchronisé : nom du rôle + « il voit » + « il peut »
   - Pause au survol / focus / clic · reprise automatique · reduced-motion respecté
   Règles brand : Inter exclusif · radius ≤ 12px · zéro ombre sur cartes ·
                  Teal = argent entrant · Purple = premium uniquement.
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-stage { background: var(--lp-white); padding: 90px 0 110px; }
.demo-stage .section-head { margin-bottom: 56px; }

.demo-shell {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* ── Rail vertical (carrousel d'onglets) ── */
.demo-rail {
  background: var(--lp-pale);
  border: 1px solid var(--lp-line);
  border-radius: 12px;
  padding: 16px 14px 14px;
}
.demo-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lp-navy);
}
.demo-rail-note {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--lp-faint);
}
.demo-rail-viewport {
  overflow: hidden;
  /* 7 onglets visibles × 76px — la piste glisse derrière cette fenêtre */
  height: 532px;
  position: relative;
}
.demo-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  will-change: transform;
  transition: transform 780ms cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-slide { flex: none; }

.demo-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 68px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--lp-white);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease;
}
.demo-tab:hover { border-color: var(--lp-line-strong); }
.demo-tab-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(34, 33, 123, 0.07);
  color: var(--lp-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 220ms ease, color 220ms ease;
}
.demo-tab-ico svg { width: 17px; height: 17px; }
.demo-tab-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demo-tab-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--lp-navy-deep);
  line-height: 1.25;
  transition: color 220ms ease;
}
.demo-tab-sub {
  font-size: 12px;
  line-height: 1.35;
  color: var(--lp-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 220ms ease;
}

/* Onglet actif : fond navy, icône teal, barre de progression */
.demo-tab.is-active {
  background: var(--lp-navy);
  border-color: var(--lp-navy);
}
.demo-tab.is-active .demo-tab-ico { background: rgba(255, 255, 255, 0.10); color: #7FD8EC; }
.demo-tab.is-active .demo-tab-name { color: #FFFFFF; }
.demo-tab.is-active .demo-tab-sub { color: rgba(230, 233, 255, 0.62); }
.demo-tab-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(187, 192, 252, 0.18);
  opacity: 0;
  transition: opacity 220ms ease;
}
.demo-tab.is-active .demo-tab-progress { opacity: 1; }
.demo-tab-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--lp-teal);
  border-radius: 0 2px 2px 0;
}

/* ── Contrôles du rail ── */
.demo-rail-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 4px;
}
.demo-ctrl {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--lp-line);
  background: var(--lp-white);
  color: var(--lp-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.demo-ctrl:hover { border-color: var(--lp-navy); }
.demo-ctrl svg { width: 15px; height: 15px; }
.demo-ctrl-play { background: var(--lp-navy); border-color: var(--lp-navy); color: #FFFFFF; }
.demo-ctrl-play:hover { background: var(--lp-navy-deep); }
.demo-ctrl .ico-play { display: none; }
.demo-ctrl.is-paused .ico-play { display: block; }
.demo-ctrl.is-paused .ico-pause { display: none; }
.demo-counter {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lp-faint);
  font-variant-numeric: tabular-nums;
}

/* ── Écran (filmstrip vertical) ── */
.demo-screen { min-width: 0; }
.demo-shot-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--lp-line);
  border-radius: 12px;
  background: var(--lp-pale);
  overflow: hidden;
}
.demo-filmstrip {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  will-change: transform;
  transition: transform 820ms cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-shot {
  flex: none;
  width: 100%;
  height: 100%;
  margin: 0;
}
.demo-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.demo-fs {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(187, 192, 252, 0.32);
  background: rgba(10, 13, 20, 0.62);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 250ms ease, transform 250ms ease, background 150ms ease;
}
.demo-fs svg { width: 13px; height: 13px; flex: none; }
.demo-shot-frame:hover .demo-fs,
.demo-shot-frame.is-fullscreen .demo-fs { opacity: 1; transform: translateY(0); }
.demo-fs:hover { background: rgba(10, 13, 20, 0.88); }
@media (hover: none) { .demo-fs { opacity: 1; transform: none; } }
.demo-shot-frame.is-fullscreen,
.demo-shot-frame:fullscreen {
  position: fixed !important;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  border: none !important;
  border-radius: 0 !important;
  background: #0A0F2E;
  z-index: 9999;
}
.demo-shot-frame.is-fullscreen .demo-filmstrip,
.demo-shot-frame:fullscreen .demo-filmstrip {
  height: 100% !important;
  transition: none !important;
}
.demo-shot-frame.is-fullscreen .demo-shot img,
.demo-shot-frame:fullscreen .demo-shot img { object-fit: contain !important; background: #0A0F2E; }
.demo-shot-frame.is-fullscreen .demo-fs,
.demo-shot-frame:fullscreen .demo-fs { opacity: 1; transform: none; }
body.demo-fs-open { overflow: hidden; }

/* ── Panneau d'explication (synchronisé au slide) ── */
.demo-explain {
  margin-top: 22px;
  border: 1px solid var(--lp-line);
  border-radius: 12px;
  background: var(--lp-white);
  padding: 22px 24px;
  transition: opacity 300ms ease, transform 300ms ease;
}
.demo-explain.is-switching { opacity: 0; transform: translateY(8px); }
.demo-explain-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.demo-explain-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--lp-teal);
}
.demo-explain-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--lp-navy-deep);
}
.demo-explain-see {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--lp-body);
  margin-bottom: 12px;
}
.demo-explain-see b { color: var(--lp-ink); }
.demo-explain-do {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.demo-explain-do li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--lp-muted);
}
.demo-explain-do li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lp-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%2322217B' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center no-repeat;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .demo-shell { grid-template-columns: 1fr; gap: 28px; }
  .demo-rail-viewport { height: auto; overflow: hidden; }
  .demo-track {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .demo-track::-webkit-scrollbar { display: none; }
  .demo-slide { width: 240px; }
  .demo-rail-controls { justify-content: flex-start; }
  .demo-counter { margin-left: auto; }
}
@media (max-width: 560px) {
  .demo-stage { padding: 64px 0 80px; }
  .demo-slide { width: 200px; }
  .demo-tab { height: 62px; padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-track, .demo-filmstrip { transition: none !important; }
  .demo-tab-progress-fill { display: none; }
}
