/* ============================================================
   SignalOS — perf.css · fluidité (Safari / iPad / mobile)
   Chargé EN DERNIER sur toutes les pages
   ============================================================ */

/* ─────────────────────────────────────────────
   1. Pause des animations hors écran
   (classe .anim-off posée par perf.js)
   ───────────────────────────────────────────── */
.anim-off, .anim-off * { animation-play-state: paused !important; }

/* ─────────────────────────────────────────────
   2. Appareils tactiles / Safari : allègement lourd
   ───────────────────────────────────────────── */
@media (hover: none), (max-width: 1100px) {
  /* — orbes floutés en position fixed : le pire coût de repaint au scroll.
       On les remplace par un fond dégradé statique, zéro filtre. — */
  .orb, .grain { display: none !important; }
  .ambient {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(60% 42% at 12% 4%, rgba(232,25,60,0.16), transparent 62%),
      radial-gradient(52% 38% at 92% 32%, rgba(37,244,238,0.07), transparent 66%),
      radial-gradient(56% 40% at 34% 96%, rgba(232,25,60,0.1), transparent 64%);
  }
  html[data-theme="light"] .ambient {
    background:
      radial-gradient(60% 42% at 12% 4%, rgba(232,25,60,0.09), transparent 62%),
      radial-gradient(52% 38% at 92% 32%, rgba(37,244,238,0.05), transparent 66%),
      radial-gradient(56% 40% at 34% 96%, rgba(232,25,60,0.06), transparent 64%);
  }
  .grid-overlay { opacity: 0.35; }

  /* — backdrop-filter : on ne le garde que sur la nav et le menu mobile — */
  .vb, .v3-mband, .tc, .pl, .v3-note, .faq-item, .v3-cta,
  .ccm-rail .rs, .dk i, .anat-pt, .pipe-st, .tp, .fxb, .nch,
  .tree-count, .tree-leaf .ltag, .sw-last, .sw-legend span,
  .h2-stats, .v3-badge, .v3-ticker, .fx-chip, .jrny-ph, .cmp-strip,
  .glass-card, .ov-card, .stat-box, .niche-card, .profile-card,
  .pl-item, .fresh-item, .metric-item, .testi-card, .plan-card,
  .pricing-note, .pricing-link, .vcard, .h-badge, .demo-tag,
  .btn-s, .dash-float, .sw-tag, .ab-card, .v3-step, .cp-row,
  .swarm-foot, .jrny-hud, .sw-center, .lang-cur, .theme-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* fonds compensés (le verre sans flou doit rester lisible) */
  html:not([data-theme="light"]) .vb, html:not([data-theme="light"]) .v3-mband,
  html:not([data-theme="light"]) .tc, html:not([data-theme="light"]) .pl,
  html:not([data-theme="light"]) .v3-note, html:not([data-theme="light"]) .faq-item,
  html:not([data-theme="light"]) .v3-cta, html:not([data-theme="light"]) .fxb,
  html:not([data-theme="light"]) .anat-pt, html:not([data-theme="light"]) .pipe-st,
  html:not([data-theme="light"]) .tp { background: rgba(22,20,30,0.72); }
  html[data-theme="light"] .vb, html[data-theme="light"] .v3-mband,
  html[data-theme="light"] .tc, html[data-theme="light"] .pl,
  html[data-theme="light"] .v3-note, html[data-theme="light"] .faq-item,
  html[data-theme="light"] .v3-cta, html[data-theme="light"] .fxb,
  html[data-theme="light"] .anat-pt, html[data-theme="light"] .pipe-st,
  html[data-theme="light"] .tp { background: rgba(255,255,255,0.86); }
  /* dans le bandeau sombre, on reste sombre */
  .dark-band .vb, .dark-band .v3-badge, .dark-band .h2-stats,
  .dark-band .nch, .dark-band .fx-chip { background: rgba(255,255,255,0.06) !important; }

  /* nav : flou réduit (22px → 12px, saturate retiré) */
  nav#navbar { backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
  .top-banner { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

  /* — animations décoratives coûteuses : coupées — */
  html.v3x .df-1, html.v3x .df-2, html.v3x .dash-toast,
  html.v3x .tl-node i, html.v3x .fresh-tag, html.v3x .pipe-arr i,
  html.v3x .tree.in .tree-root, html.v3x .v3-steps.on .v3-sdot,
  .demo-play::before, .tk-scan, .rings i, .fx-chip { animation: none !important; }
  .fx-eq i { animation: none !important; }

  /* — ombres portées géantes : simplifiées — */
  .dash, .h2-frame, .mp-tilt, .stage-card, .jrny-stage {
    box-shadow: 0 18px 40px -18px rgba(0,0,0,0.45) !important;
  }
}

/* ─────────────────────────────────────────────
   3. Isolation de rendu : chaque section se peint seule
   ───────────────────────────────────────────── */
.v3-sec, .v3-metrics, .v3-ctasec, .v3-ticker, footer,
.tree-sec, .anat-sec, .pipe-sec, .v4-swarm-sec, .v4-trust,
.fx-bento, .ccm-steps { contain: layout paint style; }

/* rendu différé du hors-écran (déjà partiel, généralisé ici) */
.v3-metrics, .v3-ctasec, footer, .anat-sec, .pipe-sec {
  content-visibility: auto; contain-intrinsic-size: auto 620px;
}

/* ─────────────────────────────────────────────
   4. Images / avatars : décodage asynchrone + calque isolé
   ───────────────────────────────────────────── */
.feed-av, .pf-card .pa, .tree-leaf .la, .anat-card .aa,
.mp-c .av, .cp-row .avv, .sw-node .sw-av, .v3-avs i {
  transform: translateZ(0);
}

/* ─────────────────────────────────────────────
   5. Scroll : pas de smooth natif sur tactile (saccadé sur iOS)
   ───────────────────────────────────────────── */
@media (hover: none) {
  html { scroll-behavior: auto; }
}
