/* ============================================================
   PROLEARN — démos produit (page produits/prolearn.html)
   PL.2 studio (storyboard animé) · PL.3 algorithmes ·
   PL.4 moteur d'évaluation · PL.5 suivi granulaire (vidéo)
   ============================================================ */

.demo-intro {
  color: var(--fg-1); font-size: 16px; max-width: 62ch;
  margin: -16px 0 36px; text-wrap: pretty;
}
.demo-intro b { color: var(--fg-0); font-weight: 500; }

.demo-cap {
  margin: 14px 0 0;
  font-family: var(--ff-mono); font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.1em;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.demo-cap b { color: var(--pl); font-weight: 500; }

/* =========================================================
   PL.2 — LE STUDIO : storyboard en lecture
   ========================================================= */
.sb-frame { margin: 0; }
.sb-wrap {
  position: relative;
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #1E1F1F;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
.sb-wrap > img { width: 100%; display: block; }

/* La scène animée, posée sur le canvas vide de la capture */
.sb-canvas {
  position: absolute;
  left: 22.05%; top: 21.15%; width: 46.0%; height: 51.4%;
  background:
    radial-gradient(60% 80% at 50% 100%, rgba(46, 230, 200, 0.05), transparent 70%),
    #101615;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.sbc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1cqw 1.3cqw 0;
}
.sbc-tag {
  font-family: var(--ff-mono); font-size: 0.62cqw; letter-spacing: 0.16em;
  color: rgba(46, 230, 200, 0.75);
}
.sbc-live {
  font-family: var(--ff-mono); font-size: 0.62cqw; letter-spacing: 0.1em;
  color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 0.5cqw;
}
.sbc-live i {
  width: 0.4cqw; height: 0.4cqw; border-radius: 999px;
  background: var(--pl); box-shadow: 0 0 8px var(--pl);
  animation: mpulse 1.4s var(--ease) infinite;
}
.sbc-live b { color: var(--pl); font-weight: 500; }
.sb-canvas svg { flex: 1; width: 100%; min-height: 0; }

/* Groupes de la scène : fondu par phase */
.sb-canvas .ph { transition: opacity 0.7s var(--ease); }
.sb-canvas[data-phase="1"] .ph2, .sb-canvas[data-phase="1"] .ph3 { opacity: 0.10; }
.sb-canvas[data-phase="2"] .ph3 { opacity: 0.10; }
.sb-canvas[data-phase="2"] .ph1-only { opacity: 0.25; }
.sb-canvas[data-phase="3"] .ph1-only, .sb-canvas[data-phase="3"] .ph2-only { opacity: 0.18; }

/* Peau tendue : lueur en phase 2 */
.sb-canvas .skin { transition: filter 0.7s var(--ease), stroke 0.7s var(--ease); }
.sb-canvas[data-phase="2"] .skin { stroke: #2EE6C8; filter: drop-shadow(0 0 6px rgba(46, 230, 200, 0.7)); }

/* Remplissage de la fissure en phase 3 */
.sb-canvas .fissure-fill { transform: scaleY(0); transform-origin: top; transform-box: fill-box; transition: transform 2.2s var(--ease); }
.sb-canvas[data-phase="3"] .fissure-fill { transform: scaleY(1); }

/* Légendes synchronisées */
.sbc-cap { position: relative; height: 3.4cqw; margin: 0 1.3cqw 0.9cqw; }
.sbc-cap p {
  position: absolute; inset: 0; margin: 0;
  font-size: 0.86cqw; line-height: 1.45; color: var(--fg-1);
  opacity: 0; transform: translateY(0.4cqw);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  text-wrap: pretty;
}
.sbc-cap p b { color: #2EE6C8; font-weight: 500; }
.sb-canvas[data-phase="1"] .sbc-cap p[data-cap="1"],
.sb-canvas[data-phase="2"] .sbc-cap p[data-cap="2"],
.sb-canvas[data-phase="3"] .sbc-cap p[data-cap="3"] { opacity: 1; transform: none; }

/* Tête de lecture sur la timeline de la capture */
.sb-playhead {
  position: absolute;
  left: 49.8%; top: 81.2%; bottom: 0.4%;
  width: 1px;
  background: var(--pl);
  box-shadow: 0 0 6px rgba(46, 230, 200, 0.8);
  pointer-events: none;
}
.sb-playhead::before {
  content: "";
  position: absolute; top: -0.1cqw; left: -0.27cqw;
  border-left: 0.3cqw solid transparent;
  border-right: 0.3cqw solid transparent;
  border-top: 0.42cqw solid var(--pl);
}

/* Pulsation du bouton lecture de la capture */
.sb-playring {
  position: absolute; left: 50.16%; top: 78.0%;
  width: 2.4cqw; height: 2.4cqw;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(46, 230, 200, 0.8);
  pointer-events: none;
  animation: sbPing 2.4s var(--ease) infinite;
}
@keyframes sbPing {
  0%   { transform: translate(-50%, -50%) scale(0.55); opacity: 0.8; }
  70%  { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-playring { animation: none; opacity: 0; }
  .sbc-cap p[data-cap="3"] { opacity: 1 !important; }
}

/* =========================================================
   PL.3 — ALGORITHMES CHIRURGICAUX
   ========================================================= */
.algo-lede {
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.4;
  max-width: 860px; margin: 0 0 48px; text-wrap: pretty;
}
.algo-lede em { font-style: normal; color: var(--pl); text-shadow: 0 0 22px var(--pl-glow); }
.algo-lede .mut { color: var(--fg-3); }

.algo-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 920px) { .algo-grid { grid-template-columns: 1fr; } }

.algo-cells { display: grid; grid-template-rows: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.algo-cell { background: var(--bg-0); padding: 24px 26px; transition: background var(--dur) var(--ease); }
.algo-cell:hover { background: var(--bg-1); }
.algo-cell .idx { font-family: var(--ff-mono); font-size: 10px; color: var(--pl); letter-spacing: 0.14em; }
.algo-cell h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 10px 0 8px; }
.algo-cell p { margin: 0; color: var(--fg-1); font-size: 14px; max-width: 56ch; text-wrap: pretty; }
.algo-cell p b { color: var(--fg-0); font-weight: 500; }

/* Profil de mémorisation détecté */
.memo-card {
  border: 1px solid var(--pl-line); border-radius: var(--r-md);
  background: radial-gradient(500px 260px at 80% -10%, var(--pl-soft), transparent 65%), var(--bg-1);
  padding: 26px 28px 24px;
  display: flex; flex-direction: column;
}
.memo-card .ttl {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--pl); margin: 0 0 6px;
}
.memo-card .sub {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--fg-3); margin: 0 0 26px;
}
.memo-bars { display: flex; flex-direction: column; gap: 18px; margin: auto 0; }
.memo-bar { display: grid; grid-template-columns: 130px 1fr 48px; gap: 14px; align-items: center; }
.memo-bar .fmt { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--fg-1); }
.memo-bar .track { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.memo-bar .fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(46, 230, 200, 0.45), var(--pl));
  box-shadow: 0 0 10px var(--pl-glow);
  width: 0;
  transition: width 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.memo-bar.is-low .fill { background: var(--bg-4); box-shadow: none; }
.memo-bar .val { font-family: var(--ff-mono); font-size: 12px; color: var(--fg-1); text-align: right; }
.memo-bar.is-top .val { color: var(--pl); }
.memo-card.is-in .fill { width: var(--w); }
.memo-note {
  margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--fg-2);
  letter-spacing: 0.06em; line-height: 1.7;
}
.memo-note b { color: var(--pl); font-weight: 500; }

/* =========================================================
   PL.4 — MOTEUR D'ÉVALUATION : liste de questions animée
   ========================================================= */
.qz-panel {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #0E1414;
  overflow: hidden;
}
.qz-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-weak);
}
.qz-top h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg-0); }
.qz-top h3 span { color: var(--pl); }
.qz-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.qz-filters span {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--fg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px;
}
.qz-filters span.on { color: var(--pl); border-color: var(--pl-line); background: var(--pl-soft); }

.qz-list { padding: 8px 10px 10px; min-height: 396px; }
.qz-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.qz-row.is-on { opacity: 1; transform: none; }
.qz-row.is-active { border-color: var(--pl-line); background: var(--pl-soft); }
.qz-row .grip { color: var(--fg-3); font-size: 10px; letter-spacing: -1px; }
.qz-row .num {
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--fg-2);
  width: 22px; height: 22px; border-radius: var(--r-xs);
  background: var(--bg-3); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qz-row .dot { width: 6px; height: 6px; border-radius: 999px; background: #D9B44A; flex-shrink: 0; }
.qz-row .txt { font-size: 13.5px; color: var(--fg-0); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qz-row .typ {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.08em;
  border-radius: var(--r-xs); padding: 2px 8px; flex-shrink: 0;
}
.qz-row .typ.vf { color: var(--pl); border: 1px solid var(--pl-line); }
.qz-row .typ.qcm { color: #0A1410; background: var(--pl); font-weight: 600; }
.qz-row .typ.qcu { color: var(--ps); border: 1px solid var(--ps-line); }
.qz-row .qid { font-family: var(--ff-mono); font-size: 9.5px; color: var(--fg-3); letter-spacing: 0.04em; flex-shrink: 0; }
@media (max-width: 760px) { .qz-row .qid, .qz-row .grip { display: none; } }

/* Détail de la question sélectionnée */
.qz-detail {
  border-top: 1px solid var(--line);
  padding: 22px;
  display: grid; grid-template-columns: 1fr 170px; gap: 24px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.qz-detail.is-on { opacity: 1; transform: none; }
@media (max-width: 760px) { .qz-detail { grid-template-columns: 1fr; } }
.qz-detail .q { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.qz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .qz-answers { grid-template-columns: 1fr; } }
.qz-ans {
  display: flex; gap: 10px; align-items: baseline;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px; color: var(--fg-1);
}
.qz-ans i {
  font-style: normal; font-family: var(--ff-mono); font-size: 10px;
  width: 18px; height: 18px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--line-strong); color: var(--fg-2);
  display: inline-flex; align-items: center; justify-content: center;
  transform: translateY(2px);
}
.qz-ans.ok { border-color: var(--pl-line); background: var(--pl-soft); color: var(--pl); }
.qz-ans.ok i { border-color: var(--pl); color: var(--pl); }
.qz-meta {
  border-left: 1px solid var(--line); padding-left: 24px;
  display: flex; flex-direction: column; gap: 4px;
}
@media (max-width: 760px) { .qz-meta { border-left: 0; padding-left: 0; } }
.qz-meta .lbl { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--fg-3); }
.qz-meta .rate { font-family: var(--ff-mono); font-size: 34px; font-weight: 600; letter-spacing: -0.03em; color: var(--pl); line-height: 1.1; }
.qz-meta .n { font-family: var(--ff-mono); font-size: 10.5px; color: var(--fg-2); }
.qz-meta .diff {
  margin-top: 12px; width: fit-content;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.08em;
  color: #D9B44A; border: 1px solid rgba(217, 180, 74, 0.35); border-radius: var(--r-sm);
  padding: 3px 9px;
}

/* =========================================================
   PL.5 — SUIVI GRANULAIRE (vidéo statistiques)
   ========================================================= */
.stats-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 980px) { .stats-grid { grid-template-columns: 1fr; gap: 28px; } }

.stats-frame { margin: 0; position: relative; }
.stats-frame video {
  width: 100%; display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
.stats-frame .live {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--pl); background: rgba(10, 16, 15, 0.85);
  border: 1px solid var(--pl-line); border-radius: var(--r-sm);
  padding: 4px 10px;
  display: inline-flex; align-items: center; gap: 7px;
  backdrop-filter: blur(6px);
}
.stats-frame .live i {
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--pl); box-shadow: 0 0 6px var(--pl);
  animation: mpulse 1.4s var(--ease) infinite;
}

.stats-args { display: flex; flex-direction: column; }
.stats-arg {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: baseline;
}
.stats-arg:last-child { border-bottom: 1px solid var(--line); }
.stats-arg .k { font-family: var(--ff-mono); font-size: 11px; color: var(--pl); letter-spacing: 0.1em; }
.stats-arg h4 { margin: 0 0 5px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.stats-arg p { margin: 0; color: var(--fg-1); font-size: 13.5px; text-wrap: pretty; }
.stats-arg p b { color: var(--fg-0); font-weight: 500; }
