/**
 * サイト全体のモーション（スクロール表示・FV・ホバー）
 * prefers-reduced-motion ではアニメーションを無効化
 */

/* ---------- FV ヒーロー ---------- */
@keyframes archet-fv-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes archet-fv-media {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* FV 背景色は page.css（#ffffff / --color-base）に任せ、motion では変更しない */

#fv .c-hero__simple-main > .c-hero__title {
  animation: archet-fv-fade-up 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.04s backwards;
}

#fv .c-hero__simple-main > .c-hero__lead {
  animation: archet-fv-fade-up 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.14s backwards;
}

#fv .c-hero__simple-main > .c-hero__actions {
  animation: archet-fv-fade-up 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.26s backwards;
}

#fv .c-hero__simple-media {
  animation: archet-fv-media 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards;
}

/* ---------- スクロール表示 ---------- */
main > section:not(#fv).archet-reveal:not(.is-inview),
main.landing-section.archet-reveal:not(.is-inview),
main.work-detail.archet-reveal:not(.is-inview) {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  will-change: opacity, transform;
}

main > section:not(#fv).archet-reveal.is-inview,
main.landing-section.archet-reveal.is-inview,
main.work-detail.archet-reveal.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.78s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.78s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: auto;
}

@keyframes archet-stagger-fade {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

#process.archet-reveal.is-inview .c-process-step {
  animation: archet-stagger-fade 0.62s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#process.archet-reveal.is-inview .c-process-step:nth-child(1) {
  animation-delay: 0.06s;
}
#process.archet-reveal.is-inview .c-process-step:nth-child(2) {
  animation-delay: 0.12s;
}
#process.archet-reveal.is-inview .c-process-step:nth-child(3) {
  animation-delay: 0.18s;
}
#process.archet-reveal.is-inview .c-process-step:nth-child(4) {
  animation-delay: 0.24s;
}

#pricing.archet-reveal.is-inview .c-grid-3 > .c-card {
  animation: archet-stagger-fade 0.58s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#pricing.archet-reveal.is-inview .c-grid-3 > .c-card:nth-child(1) {
  animation-delay: 0.05s;
}
#pricing.archet-reveal.is-inview .c-grid-3 > .c-card:nth-child(2) {
  animation-delay: 0.12s;
}
#pricing.archet-reveal.is-inview .c-grid-3 > .c-card:nth-child(3) {
  animation-delay: 0.19s;
}

#faq.archet-reveal.is-inview .c-faq__item {
  animation: archet-stagger-fade 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#faq.archet-reveal.is-inview .c-faq__col:nth-child(1) .c-faq__item:nth-child(1) {
  animation-delay: 0.04s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(1) .c-faq__item:nth-child(2) {
  animation-delay: 0.08s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(1) .c-faq__item:nth-child(3) {
  animation-delay: 0.12s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(1) .c-faq__item:nth-child(4) {
  animation-delay: 0.16s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(2) .c-faq__item:nth-child(1) {
  animation-delay: 0.06s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(2) .c-faq__item:nth-child(2) {
  animation-delay: 0.1s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(2) .c-faq__item:nth-child(3) {
  animation-delay: 0.14s;
}
#faq.archet-reveal.is-inview .c-faq__col:nth-child(2) .c-faq__item:nth-child(4) {
  animation-delay: 0.18s;
}

/* ---------- ヘッダー（スクロール時） ---------- */
.c-header {
  transition:
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease;
}

.c-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(13, 14, 16, 0.06), 0 10px 28px rgba(13, 14, 16, 0.07);
}

/* ---------- カード・実績・CTA ---------- */
.c-work-card .c-work-card__media img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-work-card:hover .c-work-card__media img {
  transform: scale(1.04);
}

.c-cta-split__panel {
  transition:
    background 0.28s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-cta-split__panel:hover {
  transform: translateY(-3px);
}

.c-cta-split__icon svg {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-cta-split__panel:hover .c-cta-split__icon svg {
  transform: translate(3px, -3px);
}

.c-nav a:not(.c-nav__cta) {
  position: relative;
  transition: color 0.2s ease;
}

.c-nav a:not(.c-nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-nav a:not(.c-nav__cta):hover::after {
  transform: scaleX(1);
}

.c-footer__nav a {
  transition: color 0.2s ease, transform 0.25s ease;
}

.c-footer__nav a:hover {
  color: var(--color-accent-hover);
  transform: translateX(2px);
}

/* ---------- アクセシビリティ ---------- */
@media (prefers-reduced-motion: reduce) {
  #fv .c-hero__simple-main > .c-hero__title,
  #fv .c-hero__simple-main > .c-hero__lead,
  #fv .c-hero__simple-main > .c-hero__actions,
  #fv .c-hero__simple-media {
    animation: none !important;
  }

  main > section:not(#fv).archet-reveal,
  main.landing-section.archet-reveal,
  main.work-detail.archet-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  #process.archet-reveal.is-inview .c-process-step,
  #pricing.archet-reveal.is-inview .c-grid-3 > .c-card,
  #faq.archet-reveal.is-inview .c-faq__item {
    animation: none !important;
  }

  .c-cta-split__panel:hover {
    transform: none;
    box-shadow: none;
  }

  .c-work-card:hover .c-work-card__media img {
    transform: none;
  }

  .c-cta-split__panel:hover .c-cta-split__icon svg {
    transform: none;
  }

  .c-nav a:not(.c-nav__cta)::after {
    display: none;
  }

  .c-footer__nav a:hover {
    transform: none;
  }
}
