/* perf.css — Performance optimizations to reduce GPU/CPU load */

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pause ALL animations + blur filters when the tab is hidden.
   Tab visibility is tracked by perf.js which toggles .tab-hidden on body. */
.tab-hidden *,
.tab-hidden *::before,
.tab-hidden *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

/* Heavy background blobs: kill the animated transform entirely.
   transform + filter:blur(90px) animating every 9s is the single most
   expensive GPU operation on the page. A static placement costs ~nothing. */
body::before, body::after {
  animation: none !important;
  transform: none !important;
}

/* Reduce blur strength so compositing is cheap */
body::before, body::after {
  filter: blur(45px);
  opacity: .1;
}

/* The rotating conic-gradient ring is also GPU-heavy — freeze it. */
.focus-ring {
  animation: none !important;
}

/* Slow decorative spin behind the brain hero — freeze it too. */
.brain-hero-bg, .brain-hero-orb::before, .brain-hero-orb::after {
  animation: none !important;
}

/* Reduce blur effects on mobile for performance */
@media (max-width: 768px) {
  .glass, .chat-shell, .modal-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* Reduce shadow complexity (shadows repaint cheaply but many of them add up) */
.stat-card, .card, .note-card, .modal-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* Smooth scrolling */
.content, .sidebar, .focus-date-sessions {
  -webkit-overflow-scrolling: touch;
}
