/* Scroll-guided motion shared by all pages. */
.is-motion-page {
  --page-progress: 0;
  --flow: 0;
}

.is-motion-page .p-scroll-progress {
  position: fixed;
  top: 128px;
  right: 22px;
  z-index: 80;
  width: 2px;
  height: min(46vh, 360px);
  background: rgba(22, 94, 131, 0.16);
  pointer-events: none;
}

.is-motion-page .p-scroll-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #165e83;
  transform: scaleY(var(--page-progress));
  transform-origin: top center;
}

.is-motion-page [data-anim] {
  --reveal-x: 0px;
  --reveal-y: 46px;
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0) scale(0.985);
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--anim-order, 0) * 70ms),
    transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--anim-order, 0) * 70ms),
    box-shadow 0.35s ease,
    background-color 0.25s ease,
    color 0.25s ease;
  will-change: opacity, transform;
}

.is-motion-page [data-anim].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.is-motion-page .p-company-head,
.is-motion-page .p-section-head,
.is-motion-page .p-blog-feature__head,
.is-motion-page .p-blog-all__head {
  position: relative;
}

.is-motion-page .p-company-head::after,
.is-motion-page .p-section-head::after,
.is-motion-page .p-blog-feature__head::after,
.is-motion-page .p-blog-all__head::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 74px;
  height: 2px;
  background: #165e83;
  opacity: 0.34;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}

.is-motion-page .p-company-head.is-inview::after,
.is-motion-page .p-section-head.is-inview::after,
.is-motion-page .p-blog-feature__head.is-inview::after,
.is-motion-page .p-blog-all__head.is-inview::after {
  transform: translateX(-50%) scaleX(1);
}

.is-sub-page [class*="-hero"] {
  overflow: hidden;
}

.is-sub-page [class*="-hero__image"] {
  transform: none;
  will-change: auto;
}

.is-sub-page [class*="-hero__panel"] {
  transform: skewX(30deg) translate3d(calc(var(--flow, 0) * -30px), 0, 0);
  left: -180px;
  will-change: transform;
}

.is-sub-page [class*="-hero__inner"] {
  transform: translate3d(0, calc(var(--flow, 0) * -18px), 0);
  will-change: transform;
}

.is-sub-page [class*="-hero__breadcrumb"] {
  transform: translate3d(calc(var(--flow, 0) * 22px), 0, 0);
  will-change: transform;
}

.is-sub-page [class*="-hero__sub"],
.is-sub-page [class*="-hero__title"],
.is-sub-page [class*="-hero__text"] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  animation: subHeroTextIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.is-sub-page [class*="-hero__title"] {
  animation-delay: 0.12s;
}

.is-sub-page [class*="-hero__text"] {
  animation-delay: 0.24s;
}

.is-sub-page .p-company-profile__photo,
.is-sub-page .p-service-intro__media,
.is-sub-page .p-service__media,
.is-sub-page .p-blog-article__main-image,
.is-sub-page .p-news-article__main-image {
  --reveal-x: -52px;
  --reveal-y: 18px;
  overflow: hidden;
}

.is-sub-page .p-company-profile__body,
.is-sub-page .p-service-intro__body,
.is-sub-page .p-service__body,
.is-sub-page .p-blog-sidebar > *,
.is-sub-page .p-news-sidebar > * {
  --reveal-x: 52px;
  --reveal-y: 18px;
}

.is-sub-page .p-company-history__item,
.is-sub-page .p-company-values__item,
.is-sub-page .p-blog-rank-card,
.is-sub-page .p-blog-all-card,
.is-sub-page .p-news-card,
.is-sub-page .p-work-case,
.is-sub-page .p-works-case,
.is-sub-page .p-service-features__item,
.is-sub-page .p-service-contract__item,
.is-sub-page .p-service-faq__item,
.is-sub-page .p-contact-form__row {
  --reveal-y: 58px;
}

.is-sub-page .p-work-case__steps > li {
  --reveal-x: -56px;
  --reveal-y: 0px;
}

.is-sub-page .p-company-history__item.is-inview .p-company-history__dot {
  animation: subPulse 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.is-sub-page .p-service-intro__media img,
.is-sub-page .p-service__media img,
.is-sub-page .p-blog-rank-card img,
.is-sub-page .p-blog-all-card img,
.is-sub-page .p-news-card img,
.is-sub-page .p-work-case img,
.is-sub-page .p-works-case img,
.is-sub-page .p-company-profile__photo img,
.is-sub-page .p-company-values__media img,
.is-sub-page .p-blog-article__main-image img,
.is-sub-page .p-news-article__main-image img {
  transform: translate3d(0, calc(var(--flow, 0) * -18px), 0) scale(1.05);
  will-change: transform;
}

.is-sub-page .p-contact__bg,
.is-sub-page .p-blog-contact__bg,
.is-sub-page .p-works-contact__bg {
  transform: translate3d(0, calc(var(--flow, 0) * -46px), 0) scale(1.08);
  will-change: transform;
}

.is-sub-page .p-contact__inner,
.is-sub-page .p-blog-contact__inner,
.is-sub-page .p-works-contact__inner {
  transform: translate3d(0, calc(var(--flow, 0) * -20px), 0);
  will-change: transform;
}

.is-motion-page .c-more,
.is-motion-page .p-contact__btn,
.is-motion-page .p-blog-contact__btn,
.is-motion-page .p-works-contact__btn,
.is-motion-page .p-contact-form__submit {
  position: relative;
  overflow: hidden;
}

.is-motion-page .c-more::before,
.is-motion-page .p-contact__btn::before,
.is-motion-page .p-blog-contact__btn::before,
.is-motion-page .p-works-contact__btn::before,
.is-motion-page .p-contact-form__submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.32) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.is-motion-page .c-more:hover::before,
.is-motion-page .c-more:focus-visible::before,
.is-motion-page .p-contact__btn:hover::before,
.is-motion-page .p-contact__btn:focus-visible::before,
.is-motion-page .p-blog-contact__btn:hover::before,
.is-motion-page .p-blog-contact__btn:focus-visible::before,
.is-motion-page .p-works-contact__btn:hover::before,
.is-motion-page .p-works-contact__btn:focus-visible::before,
.is-motion-page .p-contact-form__submit:hover::before,
.is-motion-page .p-contact-form__submit:focus-visible::before {
  transform: translateX(120%);
}

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

@keyframes subPulse {
  0% {
    transform: scale(0.72);
    box-shadow: 0 0 0 0 rgba(22, 94, 131, 0.32);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 12px rgba(22, 94, 131, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 94, 131, 0);
  }
}

@media (max-width: 767.98px) {
  .l-header {
    z-index: 1000;
  }

  .p-header__toggle {
    z-index: 1002;
  }

  .p-header__list {
    top: 64px;
    right: 0;
    bottom: auto;
    left: auto;
    z-index: 1001;
    width: 0;
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
    padding-inline: 0;
    background: #fff;
    backdrop-filter: none;
    clip-path: inset(0 0 0 100%);
    pointer-events: none;
    transform: none;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    overscroll-behavior: contain;
  }

  .p-header__nav.is-open .p-header__list {
    left: 0;
    width: 100vw;
    padding-inline: 24px;
    clip-path: inset(0);
    pointer-events: auto;
  }

  .is-motion-page .p-scroll-progress {
    top: 88px;
    right: 10px;
    height: 34vh;
  }

  .is-motion-page [data-anim] {
    --reveal-x: 0px;
    --reveal-y: 34px;
  }

  .is-sub-page [class*="-hero__image"] {
    transform: none;
  }

  .is-sub-page [class*="-hero__panel"] {
    transform: skewX(-31deg) translate3d(calc(var(--flow, 0) * -16px), 0, 0);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-motion-page .p-scroll-progress,
  .is-motion-page [data-anim],
  .is-motion-page .p-company-head::after,
  .is-motion-page .p-section-head::after,
  .is-motion-page .p-blog-feature__head::after,
  .is-motion-page .p-blog-all__head::after,
  .is-sub-page [class*="-hero__sub"],
  .is-sub-page [class*="-hero__title"],
  .is-sub-page [class*="-hero__text"],
  .is-sub-page .p-company-history__item.is-inview .p-company-history__dot {
    animation: none !important;
    transition: none !important;
  }

  .is-motion-page [data-anim],
  .is-sub-page [class*="-hero__image"],
  .is-sub-page [class*="-hero__panel"],
  .is-sub-page [class*="-hero__inner"],
  .is-sub-page [class*="-hero__breadcrumb"],
  .is-sub-page .p-service-intro__media img,
  .is-sub-page .p-service__media img,
  .is-sub-page .p-blog-rank-card img,
  .is-sub-page .p-blog-all-card img,
  .is-sub-page .p-news-card img,
  .is-sub-page .p-works-case img,
  .is-sub-page .p-company-profile__photo img,
  .is-sub-page .p-company-values__media img,
  .is-sub-page .p-blog-article__main-image img,
  .is-sub-page .p-news-article__main-image img,
  .is-sub-page .p-contact__bg,
  .is-sub-page .p-blog-contact__bg,
  .is-sub-page .p-works-contact__bg,
  .is-sub-page .p-contact__inner,
  .is-sub-page .p-blog-contact__inner,
  .is-sub-page .p-works-contact__inner {
    opacity: 1 !important;
    transform: none !important;
  }
}
