/* Living grain. Every grain overlay on the site drifts by a pixel or two along one slow, shared
   path, so the texture never sits still. Only `translate` animates, which the compositor handles:
   no repaint, smooth sub-pixel motion. When adding a new grain overlay, add its selector here
   and make sure its host clips it (overflow:hidden). */
@keyframes grain-drift{
  0%,100%{translate:0 0}
  22%{translate:1.6px -1.1px}
  47%{translate:-.9px 1.7px}
  71%{translate:-1.7px -.7px}
  88%{translate:.8px 1px}
}

@media(prefers-reduced-motion:no-preference){
  /* Homepage and shared footer */
  :is(.impression-grain,.hero-grain-bridge),
  :is(.home-intro,.project-covers,.team-section,.network-section,.partner-artwork,.advisory-portrait,.team-portrait,.scene,.orbital-fallback)::after,
  /* Case pages */
  :is(.recomore-content,.schaer-content,.editorial-content,.case-aidvisors .aid-content,.case-smart-ai .smart-hero,.case-smart-ai .smart-content,.case-digital-hospitality .dhd-content,.reco-partner-link)::before,
  /* Glass buttons (case-buttons.css) */
  body[class] :is(.recomore-button,.schaer-button,.aid-button,.smart-site-link,.editorial-button,.dhd-link,.back-link,.preview-link,.directory-actions a,.directory-dialog-close,.aid-book-controls button,.aid-view-switch button,.directory-filters button,.recomore-play-circle,.testimonial-play-circle,.dhd-play-circle,.recomore-preview-toggle)::before{
    animation:grain-drift 14s ease-in-out infinite;
  }
}

/* Small hosts that did not clip yet keep the drifting grain inside their edges. Page-wide content
   wrappers are left as they are: their grain is too faint (≤ 7.5 %) for a 2px edge to show. */
.team-portrait,.reco-partner-link,
body[class] :is(.recomore-button,.schaer-button,.aid-button,.smart-site-link,.editorial-button,.dhd-link,.back-link,.preview-link,.directory-actions a,.directory-dialog-close,.aid-book-controls button,.aid-view-switch button,.directory-filters button,.recomore-play-circle,.testimonial-play-circle,.dhd-play-circle,.recomore-preview-toggle){overflow:hidden}

/* The Smart AI hero overlay also carries its dark gradient; oversize it inside the clipped hero
   so a drifting edge never shows. */
.case-smart-ai .smart-hero::before{inset:-2px}
