/* ── Performance layer (load last) ─────────────────────────── */

/* Fixed full-viewport pseudo-layers repaint every scroll */
body::before,
body::after {
  display: none !important;
}

#particle-canvas,
.neural-network,
.floating-icons,
.hero-grid,
#parallax-bg {
  display: none !important;
}

/* Progress — GPU scale instead of width reflow */
#progress-bar {
  width: 100% !important;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  animation: none !important;
  background-size: 100% 100% !important;
  will-change: transform;
}

/* Kill infinite / decorative animations site-wide */
.card::after,
.hero::before,
.avatar-ring,
.float-icon,
.stat-card,
.hero-scroll-hint,
.projects-orb,
.projects-header h2.projects-title em,
.hero-left .highlight,
.pd-hero-title,
#typewriter::after {
  animation: none !important;
}

.projects-stage::after {
  display: none;
}

.projects-orb {
  filter: blur(32px);
}

/* backdrop-filter is expensive on scroll */
.card,
.glass-form,
header,
.main-nav,
.stat-card,
.projects-stat,
.hero .tech-badge,
.hero-metrics li,
.project-overlay,
body > footer,
.btn-main,
.btn-secondary {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Scroll reveal off — no hidden content waiting for JS */
.reveal-item {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Defer off-screen section layout/paint */
.perf-mode .card,
.perf-mode .projects-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.perf-mode .projects-stage {
  content-visibility: visible;
}

/* Lighter hover — avoid layout shift while scrolling */
.card:hover,
.skill-box:hover,
.timeline-item:hover .timeline-content,
.testimonial-card:hover,
.client-card:hover,
.github-card:hover,
.highlight-item:hover {
  transform: none;
}

.project-card:hover,
.project-card--hero:hover {
  transform: translateY(-3px);
}

.project-card:hover .project-image-wrapper img {
  transform: none;
}

@media (hover: hover) and (min-width: 1025px) {
  .card:hover,
  .skill-box:hover,
  .testimonial-card:hover,
  .client-card:hover,
  .github-card:hover {
    transform: translateY(-2px);
  }
}

/* FAQ — no open animation cost */
@keyframes faqOpen {
  from,
  to {
    opacity: 1;
    transform: none;
  }
}

/* reduce-effects: strip remaining motion */
html.reduce-effects {
  scroll-behavior: auto;
}

html.reduce-effects .hero-inner {
  perspective: none;
}

html.reduce-effects .reveal-item {
  opacity: 1 !important;
  transform: none !important;
}

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