/* ─── Flux de journaux ───
   1. canvas 2D derrière le hero (js/logflow.js) : lignes de log qui arrivent du fond
   2. compteurs du hero et du terminal (chiffres tabulaires : pas de saut de largeur)
   3. graphique d'activité tracé au scroll (animation-timeline: view(), repli IntersectionObserver) */

.log-flow {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38%;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.log-flow.is-on { opacity: 1; }
@media (max-width: 1024px) { .log-flow { height: 26%; } }

.stat-value, .sum-val { font-variant-numeric: tabular-nums; }

/* ─── Graphique d'activité ─── */
.log-chart {
  max-width: 960px; height: clamp(110px, 14vw, 180px);
  margin: -24px auto 56px;
  view-timeline-name: --lc;
}
.log-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lc-grid { fill: none; stroke: var(--border-med); stroke-width: 1; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; }
.lc-bar { fill: rgba(139, 92, 246, .38); transform-box: fill-box; transform-origin: 50% 100%; }
.lc-bar--warn { fill: rgba(245, 158, 11, .6); }
.lc-bar--err  { fill: rgba(239, 68, 68, .7); }
.lc-line {
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

@keyframes lc-grow  { from { transform: scaleY(0); } }
@keyframes lc-trace { from { stroke-dashoffset: 1; } }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .lc-live .lc-bar {
      animation: lc-grow linear both; animation-timeline: --lc;
      animation-range: cover calc(8% + var(--i, 0) * 1%) cover calc(30% + var(--i, 0) * 1%);
    }
    .lc-live .lc-line {
      animation: lc-trace linear both; animation-timeline: --lc;
      animation-range: cover 18% cover 52%;
    }
  }
  /* Repli sans scroll-driven animations : js/logflow.js ajoute .lc-io puis .is-drawn */
  .log-chart.lc-io .lc-bar { transform: scaleY(0); transition: transform .8s var(--ease) calc(var(--i, 0) * 35ms); }
  .log-chart.lc-io .lc-line { stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) .5s; }
  .log-chart.lc-io.is-drawn .lc-bar { transform: none; }
  .log-chart.lc-io.is-drawn .lc-line { stroke-dashoffset: 0; }
}

@media (max-width: 600px) {
  .log-chart { margin: -32px auto 40px; }
}
