/* Shared inner-page hero motion: quiet, consistent and performant. */
html body:not(.home) :is(
  .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
  .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
  .kt-page-heading, .kt-archive-heading, .kt-cat-heading
) {
  --kt-page-hero-x: 78%;
  --kt-page-hero-y: 18%;
}

html body:not(.home) :is(
  .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
  .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
  .kt-page-heading, .kt-archive-heading, .kt-cat-heading
)::before {
  opacity: .58;
  background-size: 62px 62px;
  animation: ktPageHeroGrid 30s linear infinite;
  will-change: background-position;
}

html body:not(.home) :is(
  .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
  .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
  .kt-page-heading, .kt-archive-heading, .kt-cat-heading
)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -55% -25%;
  pointer-events: none;
  background: linear-gradient(106deg, transparent 43%, rgba(114, 226, 249, .095) 49%, transparent 56%);
  transform: translate3d(-38%, 0, 0);
  animation: ktPageHeroSweep 12s cubic-bezier(.4, 0, .2, 1) infinite;
  will-change: transform;
}

html body:not(.home).kt-hero-motion-ready :is(
  .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
  .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
  .kt-page-heading, .kt-archive-heading, .kt-cat-heading
) > * {
  animation: ktPageHeroEnter .66s cubic-bezier(.2, .76, .2, 1) both;
}

/* Reduce visual density while preserving every useful action. */
html body:not(.home) :is(.kt-services-hero, .kt-about-hero, .kt-contact-hero, .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero) {
  padding-block: clamp(34px, 4.6vw, 62px) !important;
}

html body:not(.home) :is(.kt-services-hero, .kt-about-hero, .kt-contact-hero, .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero) h1 {
  line-height: 1.42 !important;
}

@keyframes ktPageHeroGrid {
  to { background-position: 62px 31px, 31px 62px; }
}

@keyframes ktPageHeroSweep {
  0%, 48% { transform: translate3d(-38%, 0, 0); opacity: 0; }
  58% { opacity: .7; }
  74%, 100% { transform: translate3d(38%, 0, 0); opacity: 0; }
}

@keyframes ktPageHeroEnter {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 860px) {
  html body:not(.home) :is(.kt-services-hero, .kt-about-hero, .kt-contact-hero, .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero) {
    padding-block: 30px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body:not(.home) :is(
    .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
    .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
    .kt-page-heading, .kt-archive-heading, .kt-cat-heading
  )::before,
  html body:not(.home) :is(
    .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
    .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
    .kt-page-heading, .kt-archive-heading, .kt-cat-heading
  )::after,
  html body:not(.home).kt-hero-motion-ready :is(
    .kt-learning-heading, .kt-services-hero, .kt-about-hero, .kt-contact-hero,
    .kt-editorial-hero, .kt-shop-hero, .kt-portfolio-hero, .kt-case-hero,
    .kt-page-heading, .kt-archive-heading, .kt-cat-heading
  ) > * { animation: none !important; }
}
