/* ————————————————————————————————————————
   Alphabet du mouvement — étape 1
   Noir #111 · blanc #fff · gris d'annotation #8a8a8a · filet #e3e3e3
   ———————————————————————————————————————— */

:root {
  --ink: #111111;
  --paper: #ffffff;
  --note: #8a8a8a;
  --rule: #e3e3e3;
  --margin-w: 264px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  display: flex;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* ——— Zone de captation ——— */

.stage {
  position: relative;
  flex: 1;
  height: 100%;
}

#video { display: none; }

#canvas-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Ligne de base — signature du dispositif */
.baseline {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 64px;
  height: 1px;
  background: var(--rule);
}

.baseline-fill {
  position: absolute;
  top: 0;
  left: 50%;
  height: 1px;
  width: 0%;
  background: var(--ink);
  transform: translateX(-50%);
  transition: width 120ms linear;
}

/* ——— Colonne de marge ——— */

.margin {
  width: var(--margin-w);
  height: 100%;
  border-left: 1px solid var(--rule);
  padding: 40px 28px 28px;
  display: flex;
  flex-direction: column;
}

.margin-head h1 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.margin-head .step {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--note);
}

/* Tableau de données */
.data {
  margin-top: 44px;
  border-top: 1px solid var(--ink);
}

.data .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.data dt {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--note);
}

.data dd {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.message {
  margin-top: 22px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--note);
  min-height: 3em;
}

.margin-foot {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.margin-foot p {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--note);
}

.key {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 1px 5px;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .baseline-fill { transition: none; }
}

/* ——— Étape 2 : superposition des canvas ——— */

#canvas-memory {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ——— Couche silhouette Kinect : sous l'encre, sous le squelette ——— */
#canvas-silhouette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.margin-foot p { line-height: 2.1; }

/* ——— Étape 3 : encart du dernier glyphe ——— */

.glyph { margin-top: 26px; }

.glyph-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--note);
  margin-bottom: 8px;
}

.glyph-box {
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* la ligne de base du glyphe, à 80 % de la hauteur */
.glyph-box::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 80%;
  height: 1px;
  background: var(--rule);
}

.glyph-box svg {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.glyph-empty {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--note);
  text-align: center;
  line-height: 1.8;
}

.glyph-caption {
  margin-top: 7px;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 10px;
  color: var(--note);
}

/* ——— Étape 3b : la lettre lue ——— */

.glyph-letter {
  position: absolute;
  top: 6px;
  left: 9px;
  font-size: 26px;
  font-weight: 500;
  z-index: 2;
}
.glyph-score {
  position: absolute;
  top: 12px;
  right: 9px;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 10px;
  color: var(--note);
  z-index: 2;
}

/* ——— Étape 4 : bande de collection ——— */

.collection {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--paper);
}
.collection::-webkit-scrollbar { height: 0; }

.coll-cell {
  flex: 0 0 92px;
  border-right: 1px solid var(--rule);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.coll-cell svg { width: 76%; height: 76%; }
.coll-cell .tag {
  position: absolute;
  bottom: 4px; left: 6px;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 9px;
  color: var(--note);
}
.coll-cell .var {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 9px;
  color: var(--note);
}
/* la dernière trouvée : un filet noir, sans clignotement */
.coll-cell.fresh { box-shadow: inset 0 2px 0 0 var(--ink); }

/* ——— boutons d'export ——— */

.export { margin-top: 24px; }
.export-row { display: flex; gap: 6px; margin-bottom: 6px; }

.btn {
  flex: 1;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 7px 4px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-quiet { border-color: var(--rule); color: var(--note); }
.btn-quiet:hover { background: var(--note); color: var(--paper); border-color: var(--note); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
