/*
 * © 2026 Code Precision. All rights reserved.
 * Copying, redistribution, modification, extraction, or reuse of this Code Precision-authored file,
 * in whole or substantial part, is prohibited without prior express written permission from Code Precision.
 * No permission is granted for AI/ML training, fine-tuning, dataset creation, text/data mining,
 * embedding/index construction for generative systems, synthetic-data generation, or image-model training.
 * NoAI · NoAIImage · NoMLTraining
 */

/* Android/Chrome mobile compositor hardening */
@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .split-background {
    -webkit-transform: none !important;
    transform: none !important;
    will-change: auto !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    /* Keep this parent flat. A 3D rendering context here
       makes the browser depth-sort siblings: while the tap-nav rotateY pulse is in
       flight, the half of #portal-canvas at negative Z is drawn behind the opaque
       .split-background__dark and half the portal disappears (left/right depending
       on which tap zone was hit). The tap tilt gets its depth from `perspective`
       on this element, which works with flat children — same as desktop hover. */
    transform-style: flat !important;
  }

  .split-background__dark,
  .split-background__glow {
    will-change: auto !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    transform-style: flat !important;
  }

  #portal-canvas,
  .portal-ring,
  .portal-surface {
    will-change: auto !important;
    /* Do not flatten the portal's 3D transform; tap-nav tilt needs depth. */
    transform-style: preserve-3d !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
  }

  .featured-cases .link {
    -webkit-transform: none !important;
    transform: none !important;
    will-change: auto !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
  }

  .featured-cases .link img:nth-child(1) {
    -webkit-transform: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  .featured-cases .link::after {
    will-change: auto !important;
  }

  .hero-cta-row > * {
    will-change: auto !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    transform-style: flat !important;
  }
}

/* Keep aggressive promotion only where it is actually useful */
@media (pointer: fine) and (orientation: landscape) and (min-width: 1024px) and (min-height: 600px) {
  .featured-cases .link:hover,
  .featured-cases .link:focus-visible {
    will-change: transform, opacity;
  }
}

/* One-frame tile-only paint invalidation after mobile scroll settles. */
@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .featured-cases .link.cp-paint-kick {
    opacity: 0.87999 !important;
  }
}
