/*! cn-motion.css v1.0 (2026-10-16) — co-nect 5サイト共通モーション部品
 * 効く範囲：body.cn-motion の中だけ。属性 data-cn-* で宣言的に付ける。
 * 開始状態（隠す・縮める）は JS が画面外の要素に .cn-wait を付けたときだけ。JS無効・reduced-motion では最終状態のまま。
 * イージングは3乗系の1系統：入る＝--cn-out（easeOutCubic）、状態の間を動く＝--cn-io（easeInOutCubic）。
 * 移植元（数値の出典）：
 * Motion Prompt #002 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#002
 * Motion Prompt #004 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#004
 * Motion Prompt #052 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#052
 * Motion Prompt #057 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#057
 * Motion Prompt #063 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#063
 * Motion Prompt #065 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#065
 * Motion Prompt #068 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#068
 * Motion Prompt #070 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#070
 * Motion Prompt #079 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#079
 * Motion Prompt #080 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#080
 * Motion Prompt #081 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#081
 * Motion Prompt #082 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#082
 * Motion Prompt #086 · MIT License (c) 2026 Shohei Ohtaki · https://showheyohtaki.github.io/motion-prompt/#086
 */

/* ---- サイトごとに上書きする値（ブランド色とスコープ） ---- */
.cn-motion {
  --cn-accent: #F85602;               /* 強調（線・点・弾む数字） */
  --cn-ink: #1A1A1A;
  --cn-line: #E6E2DD;                 /* 未到達の線・読了バーの地 */
  --cn-mark: rgba(248, 86, 2, .18);   /* マーカー（#080の黄色をブランドの薄いオレンジに置換） */
  --cn-out: cubic-bezier(.33, 1, .68, 1);   /* easeOutCubic = kit eOut */
  --cn-io: cubic-bezier(.65, 0, .35, 1);    /* easeInOutCubic = kit eIO */
}

/* ================= #002 スタガー：棒が順に伸びる ================= */
/* 開始 0.15 + 0.12×i 秒・0.5秒。仕様の backOut（行き過ぎ）は1系統イージングのため easeOutCubic に置換 */
.cn-motion [data-cn-bar] { transform-origin: 50% 100%; transform-box: fill-box; }
.cn-motion [data-cn-bars="x"] [data-cn-bar], .cn-motion [data-cn-bars="shrink"] [data-cn-bar] { transform-origin: 0 50%; }
.cn-motion .cn-wait[data-cn-bars] [data-cn-bar] { transform: scaleY(0); }
.cn-motion .cn-wait[data-cn-bars="x"] [data-cn-bar] { transform: scaleX(0); }
/* shrink：同じ長さ（--from）から本来の長さへ縮む（カルテ「離れていく」）。--from = 最大幅 / 本来の幅 */
.cn-motion .cn-wait[data-cn-bars="shrink"] [data-cn-bar] { transform: scaleX(var(--from, 1)); }
.cn-motion .cn-wait[data-cn-bars] [data-cn-bar-after] { opacity: 0; }

/* ================= #004 ラインドロー：SVGの線を描く ================= */
/* 対象の線に JS が pathLength="1" を付ける。1.55秒・easeInOutCubic */
.cn-motion .cn-wait[data-cn-draw] .cn-dr { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cn-motion .cn-wait[data-cn-draw] [data-cn-draw-after] { opacity: 0; }

/* ================= #080 マーカー ================= */
/* 線の高さ＝文字の下寄り（仕様：ベースラインの8px上〜3px下＝20px文字で .55em）。幅0→100%を0.8秒・easeOutCubic */
.cn-motion [data-cn-marker], .cn-motion [data-cn-after] {
  background-image: linear-gradient(var(--cn-mark), var(--cn-mark));
  background-repeat: no-repeat; background-position: 0 92%; background-size: 100% .55em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cn-motion .cn-wait[data-cn-marker], .cn-motion .cn-wait [data-cn-marker],
.cn-motion .cn-wait[data-cn-ba] [data-cn-after] { background-size: 0 .55em; }

/* ================= 前後差（#086の線の伸び ＋ #080 ＋ #002の時差） ================= */
/* 取り消し線は行ごとに引く（折り返しても各行の中央に線）。data-cn-before / data-cn-after は文字を包む「インライン」の span に付ける */
.cn-motion [data-cn-before] {
  background-image: linear-gradient(var(--cn-strike, rgba(107, 114, 128, .75)), var(--cn-strike, rgba(107, 114, 128, .75)));
  background-repeat: no-repeat; background-position: 0 58%; background-size: 100% 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cn-motion .cn-wait[data-cn-ba] [data-cn-before] { background-size: 0 2px; }

/* ================= #068 ステップインジケーター：順に点く ================= */
/* 1区間0.3秒・easeInOutCubic。段階 [data-cn-step] に JS が順に .is-on を付ける */
.cn-motion [data-cn-step-line] { transform-origin: 0 50%; }
.cn-motion [data-cn-step-line="y"] { transform-origin: 50% 0; }
.cn-motion .cn-wait [data-cn-step-line], .cn-motion .cn-in [data-cn-step]:not(.is-on) [data-cn-step-line],
.cn-motion .cn-in[data-cn-step]:not(.is-on) [data-cn-step-line] { transform: scaleX(0); }
.cn-motion .cn-wait [data-cn-step-line="y"], .cn-motion .cn-in [data-cn-step]:not(.is-on) [data-cn-step-line="y"] { transform: scaleY(0); }
.cn-motion .cn-wait [data-cn-step-dot], .cn-motion .cn-in [data-cn-step]:not(.is-on) [data-cn-step-dot] {
  background: #fff !important; color: var(--cn-ink) !important; box-shadow: inset 0 0 0 2px var(--cn-line);
}
/* 段階そのものを薄くしておく型（BEFORE/AFTERの並走など） */
.cn-motion .cn-wait [data-cn-step="dim"], .cn-motion .cn-in [data-cn-step="dim"]:not(.is-on) { opacity: .3; }
.cn-motion [data-cn-step="dim"].is-on { box-shadow: inset 0 -.5em 0 var(--cn-mark); }
/* 会話・リストが順に出る型（data-cn-seq="reveal"） */
.cn-motion .cn-wait[data-cn-seq="reveal"] [data-cn-step],
.cn-motion .cn-in[data-cn-seq="reveal"] [data-cn-step]:not(.is-on) { opacity: 0; transform: translateY(8px); }

/* ================= #079 読了バー ================= */
.cn-motion [data-cn-progress] {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1000;
  background: var(--cn-line); pointer-events: none;
}
.cn-motion [data-cn-progress]::after {
  content: ""; position: absolute; inset: 0; background: var(--cn-accent);
  transform-origin: 0 50%; transform: scaleX(var(--cn-p, 0));
}
@supports (animation-timeline: scroll()) {
  .cn-motion [data-cn-progress]::after { animation: cn-progress linear both; animation-timeline: scroll(root block); }
  @keyframes cn-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ================= #057 タブ／目次の下線（JSが .cn-ind を差し込む） ================= */
.cn-motion [data-cn-tabs], .cn-motion [data-cn-toc] { position: relative; }
.cn-motion .cn-ind {
  position: absolute; left: 0; bottom: 0; width: 100px; height: 3px; background: var(--cn-accent);
  transform-origin: 0 0; pointer-events: none; opacity: 0;
}
.cn-motion [data-cn-toc] .cn-ind { top: 0; bottom: auto; width: 3px; height: 100px; }
.cn-motion .cn-ind.is-ready { opacity: 1; }

/* ================= #063 数字の弾み（値が変わったとき） ================= */
.cn-motion [data-cn-pop] { display: inline-block; transform-origin: 50% 60%; }

/* ================= #070 送信中 ================= */
.cn-motion .cn-busy { position: relative; color: transparent !important; pointer-events: none; }
.cn-motion .cn-busy > * { visibility: hidden; }
.cn-motion .cn-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  /* 243°（1.35π）の弧＋薄い輪。太さは半径26:太さ6 の比を20pxに換算して約3px */
  background: conic-gradient(var(--cn-spin, #fff) 0 243deg, rgba(255, 255, 255, .35) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}

/* ================= #052 アコーディオン ================= */
/* details：対応ブラウザ（::details-content）だけ高さが伸びる。非対応は従来どおり即開閉 */
.cn-motion details[data-cn-acc] { interpolate-size: allow-keywords; }
/* class で開閉する型（.open / .is-open の親）：中身を1枚の要素で包んで data-cn-acc-panel を付ける */
.cn-motion [data-cn-acc-panel] { display: grid !important; grid-template-rows: 0fr; }
.cn-motion [data-cn-acc-panel] > * { overflow: hidden; min-height: 0; }
.cn-motion .open > [data-cn-acc-panel], .cn-motion .is-open > [data-cn-acc-panel] { grid-template-rows: 1fr; }

/* ================= #065 ハンバーガー → × ================= */
.cn-motion [data-cn-burger] svg > * { transform-box: fill-box; transform-origin: center; }
.cn-motion [data-cn-burger][aria-expanded="true"] svg > :nth-child(1), .cn-motion details[open] > [data-cn-burger] svg > :nth-child(1) { transform: translateY(var(--cn-burger-gap, 8px)) rotate(45deg); }
.cn-motion [data-cn-burger][aria-expanded="true"] svg > :nth-child(2), .cn-motion details[open] > [data-cn-burger] svg > :nth-child(2) { opacity: 0; }
.cn-motion [data-cn-burger][aria-expanded="true"] svg > :nth-child(3), .cn-motion details[open] > [data-cn-burger] svg > :nth-child(3) { transform: translateY(calc(var(--cn-burger-gap, 8px) * -1)) rotate(-45deg); }

/* ================= #086 下線 ================= */
.cn-motion [data-cn-underline] { position: relative; text-decoration: none; }
.cn-motion [data-cn-underline]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.3em; height: 2px;
  background: var(--cn-accent); transform: scaleX(0); transform-origin: 100% 50%; pointer-events: none;
}

/* ================= #082 画像ズーム（枠は動かさない） ================= */
.cn-motion [data-cn-zoom] { overflow: hidden; }

/* ======== 動き（reduced-motion では一切入れない） ======== */
@media (prefers-reduced-motion: no-preference) {
  .cn-motion .cn-in[data-cn-bars] [data-cn-bar] { transition: transform .5s var(--cn-out) calc(.15s + var(--i, 0) * .12s); }
  .cn-motion .cn-in[data-cn-bars] [data-cn-bar-after] { transition: opacity .3s var(--cn-out) calc(.65s + var(--n, 3) * .12s); }
  .cn-motion .cn-in[data-cn-draw] .cn-dr { stroke-dasharray: 1; transition: stroke-dashoffset 1.55s var(--cn-io) calc(var(--i, 0) * .12s); }
  .cn-motion .cn-in[data-cn-draw] [data-cn-draw-after] { transition: opacity .3s var(--cn-out) 1.5s; }
  .cn-motion .cn-in[data-cn-marker], .cn-motion .cn-in [data-cn-marker] { transition: background-size .8s var(--cn-out) var(--d, 0s); }
  .cn-motion .cn-in[data-cn-ba] [data-cn-before] { transition: background-size .3s var(--cn-out) calc(var(--i, 0) * .12s); }
  .cn-motion .cn-in[data-cn-ba] [data-cn-after] { transition: background-size .8s var(--cn-out) calc(.3s + var(--i, 0) * .12s); }
  .cn-motion [data-cn-step-line] { transition: transform .3s var(--cn-io); }
  .cn-motion [data-cn-step-dot] { transition: background-color .3s var(--cn-io), color .3s var(--cn-io), box-shadow .3s var(--cn-io); }
  .cn-motion [data-cn-step="dim"] { transition: opacity .3s var(--cn-io), box-shadow .3s var(--cn-io); }
  .cn-motion [data-cn-seq="reveal"] [data-cn-step] { transition: opacity .5s var(--cn-out), transform .5s var(--cn-out); }
  .cn-motion .cn-ind { transition: transform .25s var(--cn-io), opacity .2s linear; }
  .cn-motion .cn-panel-in { animation: cn-panel .2s linear .1s both; }
  @keyframes cn-panel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  /* #063：拡大率 1.18→1 を0.25秒で直線的に。その間は強調色 */
  .cn-motion .cn-popping { animation: cn-pop .25s linear; }
  @keyframes cn-pop { 0% { transform: scale(1.18); color: var(--cn-accent); } 99% { color: var(--cn-accent); } 100% { transform: none; } }
  /* #070：1秒に1.3回転（468°/秒 → 1回転0.769秒） */
  .cn-motion .cn-busy::after { animation: cn-spin .769s linear infinite; }
  @keyframes cn-spin { to { transform: rotate(360deg); } }
  /* #052：0.35秒・easeInOutCubic（仕様 1.0〜1.35秒） */
  .cn-motion details[data-cn-acc]::details-content { block-size: 0; overflow: clip; transition: block-size .35s var(--cn-io), content-visibility .35s allow-discrete; }
  .cn-motion details[data-cn-acc][open]::details-content { block-size: auto; }
  .cn-motion [data-cn-acc-panel] { transition: grid-template-rows .35s var(--cn-io); }
  .cn-motion [data-cn-acc-icon] { transition: transform .35s var(--cn-io); }
  /* #065：0.3秒・easeInOutCubic */
  .cn-motion [data-cn-burger] svg > * { transition: transform .3s var(--cn-io), opacity .3s var(--cn-io); }

  @media (hover: hover) {
    /* #081：0.3秒で上へ10px、影 ぼかし6→22・ずれ2→12・濃さ.08→.22 */
    .cn-motion [data-cn-lift] { transition: transform .3s var(--cn-out), box-shadow .3s var(--cn-out); box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
    .cn-motion [data-cn-lift]:hover { transform: translateY(var(--cn-lift, -10px)); box-shadow: 0 12px 22px rgba(0, 0, 0, .22); }
    /* #082：0.5秒で中身 1→1.15（中心から） */
    .cn-motion [data-cn-zoom] img { transition: transform .5s var(--cn-out); }
    .cn-motion [data-cn-zoom]:hover img, .cn-motion a:hover [data-cn-zoom] img { transform: scale(var(--cn-zoom, 1.15)); }
    /* #086：乗ったら左から0.3秒、離れたら右へ抜ける */
    .cn-motion [data-cn-underline]::after { transition: transform .3s var(--cn-out); }
    .cn-motion [data-cn-underline]:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
  }
}

/* =====================================================================
 * service.bdfull.com（バディフル）固有（2026-10-16）
 * 上の共通部品は ~/dev/motion-upgrade-202610/kit/cn-motion.css のコピー。ここから下だけがサイト固有。
 * ===================================================================== */
.cn-motion { --cn-accent: #FF6600; --cn-mark: rgba(255, 102, 0, .18); --cn-ink: #1A1A2E; --cn-line: #E5E7EB; }

/* 数え上げの数字を包む span は親の文字のまま（.bf-proof span・.pricing-combo__price span の指定を受けない） */
.cn-motion [data-cn-count] { display: inline; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; }

/* 導入前→導入後：取り消し線は kit の線（行ごと）に置き換える。色は既存の #D1D5DB に合わせる */
.cn-motion .bf-ba { --cn-strike: #D1D5DB; }
.cn-motion .bf-ba__before { text-decoration: none; }

/* 段階の要素そのものが「点」のとき（予約の入口図のバディフルの箱など） */
.cn-motion .cn-in [data-cn-step]:not(.is-on)[data-cn-step-dot] {
  background: #fff !important; color: var(--cn-ink) !important; box-shadow: inset 0 0 0 2px var(--cn-line) !important;
}
.cn-motion .cn-wait [data-cn-step-dot] { box-shadow: inset 0 0 0 2px var(--cn-line) !important; }

/* トップ「しくみ」：番号帯は文字なので、点く前は灰色の文字（枠は付けない） */
.cn-motion .cn-wait .bf-steps4__no[data-cn-step-dot],
.cn-motion .cn-in [data-cn-step]:not(.is-on) .bf-steps4__no[data-cn-step-dot] {
  background: transparent !important; box-shadow: none !important; color: #9CA3AF !important;
}

/* 申し込みの流れ（contact.php）：2段目以降の上に縦の線（PCのみ。スマホは横並びなので線なし） */
.cn-motion .bf-flow li { position: relative; }
.cn-motion .bf-flow__ln { position: absolute; left: 15px; top: -14px; width: 2px; height: 14px; background: var(--bf-ac, #FF6600); }
@media (max-width: 900px) { .cn-motion .bf-flow__ln { display: none; } }

/* 予約の入口図（.yk-ch）：つなぎの線（SVG）は左から／上から伸びる */
.cn-motion .yk-ch svg[data-cn-step-line] { transform-origin: 0 50%; }
.cn-motion .yk-ch [data-cn-step-line="y"] path { transform-box: view-box; }

/* AI「1週間」：縦の線は上から全体の時間で伸びる */
.cn-motion [data-cn-week-line] { transform-box: fill-box; transform-origin: 50% 0; }
.cn-motion .cn-wait [data-cn-week-line] { transform: scaleY(0); }

/* 機能一覧の追従タブ：下線は .cn-ind（滑る）に任せ、既存の is-on の下線は消す。色は読んでいる商品の色 */
.cn-motion .bf-tabs a.is-on { border-color: transparent; }
.cn-motion .bf-tabs .cn-ind { background: #FF6600; }
.cn-motion .bf-tabs ul:has(.bf-t-karte a.is-on) .cn-ind { background: #2563EB; }
.cn-motion .bf-tabs ul:has(.bf-t-ai a.is-on) .cn-ind { background: #7C3AED; }

@media (prefers-reduced-motion: no-preference) {
  .cn-motion .cn-in [data-cn-week-line] { transition: transform 1.2s var(--cn-io); }
  .cn-motion .bf-tabs .cn-ind { transition: transform .25s var(--cn-io), opacity .2s linear, background-color .25s var(--cn-io); }
}

/* ---- ロゴは assets/css/cn-logo.css（全ページで読む・2026-10-16〜） ---- */

/* トップの実績グラフ：JS が棒の親に --n を書くと style 属性が "height: 64px; --n: 3" になり、
   front-page.php の [style*="height:64px"]（スマホで56px）が外れるため、同じ高さをここで指定 */
@media (max-width: 639px) { .cn-motion .fp-graph [data-cn-bars] { height: 56px !important; } }

/* AIの図：矢印の先（marker）は線が描き終わる頃に出す */
.cn-motion .cn-wait[data-cn-draw] marker path { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cn-motion .cn-in[data-cn-draw] marker path { transition: opacity .2s var(--cn-out) 1.3s; }
}
