@charset "UTF-8";
/* ==========================================================================
   animation.css : アニメーション（全ページのアニメーションはこのファイルに記述）
   ========================================================================== */

/* --------------------------------------------------------------------------
   キーフレーム
   -------------------------------------------------------------------------- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(3rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* スクロール表示用：40px（1920px幅時）下から浮き上がる */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(4rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* 右側から見えてくる（透明と表示の境目が右端から左端へ移動） */
@keyframes reveal-from-right {
  from {
    -webkit-mask-position: 0% 0;
    mask-position: 0% 0;
  }
  to {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
}

/* transform ではなく translate を使い、SP 時の中央寄せ（transform: translateX(-50%)）と重ねられるようにする */
@keyframes scroll-bounce {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 3rem; }
}

@keyframes work-fade {
  from { opacity: 0; transform: translateX(2rem); }
  to { opacity: 1; transform: translateX(0); }
}

/* 制作実績スライド：今のカードが抜ける */
@keyframes work-slide-out-left {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-12rem); }
}

@keyframes work-slide-out-right {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(12rem); }
}

/* 制作実績スライド：次のカードが入ってくる */
@keyframes work-slide-in-right {
  from { opacity: 0; transform: translateX(12rem); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes work-slide-in-left {
  from { opacity: 0; transform: translateX(-12rem); }
  to { opacity: 1; transform: translateX(0); }
}

/* --------------------------------------------------------------------------
   トップ：ファーストビューのコピー（読み込み時に順番にフェードイン）
   1.「モノが溢れる時代だから、」
   2.「記憶に残るデザインを。」
   3.「集客・ブランディング特化Web制作」「良い商品を、もっと見てもらう。」
   -------------------------------------------------------------------------- */
.p-top-fv__catch-line,
.p-top-fv__sub,
.p-top-fv__lead {
  animation: fade-in-up 1s ease-out both;
}

.p-top-fv__catch-line:nth-child(1) {
  animation-delay: 0.3s;
}

.p-top-fv__catch-line:nth-child(2) {
  animation-delay: 1.1s;
}

.p-top-fv__sub,
.p-top-fv__lead {
  animation-delay: 1.9s;
}

/* --------------------------------------------------------------------------
   トップ：メインビジュアル
   コピーがすべて表示された後（1.9s + 1s）、画像の右側から見えてくる
   画像自体は動かさず、透明→表示の境目だけを右から左へ動かす
   マスクを画像の2倍幅にし、中央（50%）を境目にすることで、
   アニメーションの開始〜終了でちょうど境目が右端→左端へ移動する
   緩急：ためてから一気に進み、最後はゆっくり止まる（easeInOutExpo 系）
   -------------------------------------------------------------------------- */
.p-top-fv__visual {
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 50%, #000 50%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 50%, #000 50%, #000 100%);
  -webkit-mask-size: 200% 100%;
  mask-size: 200% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: reveal-from-right 1.8s cubic-bezier(0.85, 0, 0.15, 1) 2.9s both;
}

/* --------------------------------------------------------------------------
   トップ：SCROLL（文字と矢印をまとめて上下させる）
   -------------------------------------------------------------------------- */
.p-top-fv__scroll {
  animation: scroll-bounce 1.9s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   トップ：制作実績の切り替え（js/components/work-slider.js がクラスと --flip-x を付け外しする）
   ・カード全体：並び替え前の位置から新しい位置へ、横移動でなめらかに動かす
   ・先頭（大きい表示）になるカード：画像枠とキャプションのサイズを拡大／縮小
   ・端から押し出されるカード：複製が進行方向へ抜けて消え、本体は反対側から入る
   ・カテゴリ切り替え時：.is-fade でフェード
   -------------------------------------------------------------------------- */
.c-work-card__frame {
  transition:
    width 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.c-work-card__caption {
  transition:
    width 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    font-size 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 位置移動：移動前の位置（--flip-x）から元の位置へ戻す */
.c-work-slider__list .c-work-card.is-flip-start {
  transform: translateX(var(--flip-x, 0));
  transition: none;
}

.c-work-slider__list .c-work-card.is-flip {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 押し出されるカード（複製）：ほかのカードの後ろを通って抜ける */
.c-work-slider__list .c-work-card.is-leaving-next,
.c-work-slider__list .c-work-card.is-leaving-prev {
  position: absolute;
  z-index: -1;
  margin: 0;
  pointer-events: none;
}

.c-work-slider__list .c-work-card.is-leaving-next {
  animation: work-slide-out-left 0.4s cubic-bezier(0.33, 1, 0.68, 1) both;
}

.c-work-slider__list .c-work-card.is-leaving-prev {
  animation: work-slide-out-right 0.4s cubic-bezier(0.33, 1, 0.68, 1) both;
}

/* 反対側から入ってくるカード */
.c-work-slider__list .c-work-card.is-entering-next {
  animation: work-slide-in-right 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.c-work-slider__list .c-work-card.is-entering-prev {
  animation: work-slide-in-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* カテゴリ切り替え */
.c-work-slider__list.is-fade .c-work-card {
  animation: work-fade 0.5s ease both;
}

/* --------------------------------------------------------------------------
   制作実績ページ：NEW WORKS のスライダー（js/pages/works.js がクラスを付け替える）
   ・カード：位置・大きさ・透明度をなめらかに変える
   ・端から反対側の端へ回り込むカード（.is-jump）：移動は一瞬で行い、フェードインで出す
   -------------------------------------------------------------------------- */
@keyframes new-card-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.p-works-new__card {
  transition:
    translate 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.5s ease;
}

.p-works-new__card.is-jump {
  transition: none;
  animation: new-card-fade-in 0.6s ease 0.2s both;
}

/* --------------------------------------------------------------------------
   [部品]スクロールで表示するアニメーション
   使い方：要素にクラスを付けるだけ（画面に入ると js/common.js が is-inview を付与）
     .a-fade-up            … 少し下からフェードイン
     .a-delay-1〜5         … 表示開始を遅らせる（0.4s / 0.8s / 1s / 1.2s / 1.4s）
   -------------------------------------------------------------------------- */
.a-fade-up {
  opacity: 0;
}

.a-fade-up.is-inview {
  animation: reveal-up 1s ease-out both;
}

.a-delay-1.is-inview { animation-delay: 0.4s; }
.a-delay-2.is-inview { animation-delay: 0.8s; }
.a-delay-3.is-inview { animation-delay: 1s; }
.a-delay-4.is-inview { animation-delay: 1.2s; }
.a-delay-5.is-inview { animation-delay: 1.4s; }

/* --------------------------------------------------------------------------
   視差効果を減らす設定の端末ではアニメーションを無効化
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
