/* Mobile AAA performance — kill heavy paint/FX on phones */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
[role="button"],
.zx-btn,
.zx-choice,
.cq-opt,
.btn-buy,
.header-icon-btn {
  touch-action: manipulation;
}
html,
body {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

/* ===== MOBILE KILL SWITCH (<768px) ===== */
@media (max-width: 767px) {
  html {
    scroll-behavior: auto;
  }

  /* No canvas / particle backgrounds */
  #tai-matrix,
  #codes-matrix,
  canvas.zx-gl,
  #zx-gl,
  .zx-world canvas {
    display: none !important;
  }
  .tai-bg,
  .codes-bg {
    background:
      radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 196, 255, 0.12), transparent 55%),
      radial-gradient(ellipse 70% 45% at 90% 80%, rgba(124, 92, 255, 0.1), transparent 50%),
      #0a0b10 !important;
  }
  .tai-bg canvas,
  .codes-glow,
  .codes-grid-overlay,
  .cv-scan,
  .cv-dust,
  .hero-glow {
    display: none !important;
    animation: none !important;
  }

  /* Kill expensive filters */
  .site-header,
  .zim-dock,
  .sidebar-menu,
  #sidebar-overlay,
  .zx-media-card,
  .hero-card,
  .hero-rank-board,
  .news-ticker,
  .zx-depot-card,
  .zx-gate-card,
  .passport-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }

  /* Skip off-screen work */
  #about,
  #skills,
  #contact,
  #zim-hub,
  .cv-stage,
  .section-block,
  footer,
  .hub-grid,
  .reviews-grid,
  .work-card,
  .book-card,
  .product-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 420px;
  }
  .hero-rank-board {
    content-visibility: auto;
    contain-intrinsic-size: 1px 260px;
    min-height: 200px;
    animation: none !important;
  }
  .hero-rank-board::before,
  .hero-rank-live i,
  .zim-spark {
    animation: none !important;
  }

  /* Lighter motion — decorative only (keep UI transitions) */
  .codes-glow,
  .hero-glow,
  .hero-rank-board::before,
  .hero-rank-live i,
  .zim-spark,
  .cv-scan,
  .cv-dust,
  .news-ticker-track,
  .zx-cta-pulse {
    animation: none !important;
  }

  /* Don't promote layers */
  .zx-world,
  .zx-depot-mesh,
  .cq-engine,
  .iq-cube,
  [data-zx-gl] {
    will-change: auto !important;
    transform: none !important;
  }

  .news-ticker-track {
    animation: none !important;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  button,
  .btn-buy,
  .header-icon-btn,
  .zx-btn {
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* Desktop / shared GPU hints (kept light) */
body.tai-page,
.zx-stage,
#zx-stage,
.zx-choice,
.cq-opt {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.zx-hub-nav a,
.zx-btn,
.zx-choice,
.cq-opt,
.zx-depot-cta,
.zx-gem,
button,
a.zx-card {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .zx-stage.is-live,
  .cq-engine,
  .zx-result {
    animation: none !important;
  }
}
