/* IntegriQ — Global performance, responsiveness & cross-browser polish.
   Purely additive: does NOT alter colors, layout, typography or behavior.
   Loaded on all standalone HTML pages. */

/* 1. Responsive safety — prevent accidental horizontal scroll */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }

/* 2. Smooth scrolling + iOS momentum */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-overflow-scrolling: touch; }

/* 3. Font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 4. Touch optimization — remove 300ms tap delay, smoother taps */
a, button, [role="button"], input[type="button"], input[type="submit"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 5. GPU hint for common animated/transform layers (safe no-op otherwise) */
.iq-gpu, .modal, .modal-content, [data-iq-gpu] {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

/* 6. Modal-open scroll lock (opt-in via class) */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* 7. Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 8. iOS safe-area padding helper (opt-in) */
.iq-safe-area {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
