/* yourpcai.com 全ページ共通の「動き」（2026-10-13 ブルー・kim-hub/149 の調査をもとに自作）
   tools/build_site_header.py が全ページの <head> に入れる。ページごとに手で足さない。
   守ること: 動かすのは transform と opacity だけ／「動きを減らす」設定では動かさない／
   JS が無いときは何も隠さない（隠す規則はすべて html.sm-js の下に置く）。 */

/* ---------- 1. スクロールで下から上がる ---------- */
.sm-js .sm-rv {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}
.sm-js .sm-rv.sm-on {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* もとからある .reveal（script.js が .show を付ける）も、JS が無いときは見せる。
   style.css の .reveal 規則をここで JS ありの時だけに絞る */
html:not(.sm-js) .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- 2. ヘッダー: 下へで隠れる・上へで出る・60px 進んだら背景をはっきり ----------
   transform は「隠すときだけ」付ける。付けたままにすると、中のスマホ用メニュー（position: fixed）の
   基準がヘッダーになって潰れる（megamenu.css の注意と同じ理由） */
.sm-js .mm-header {
  transition: transform 0.32s ease;
}
.sm-js .mm-header.sm-hide {
  transform: translate3d(0, -100%, 0);
}
.mm-header.sm-solid::before {
  background: #fff;
  box-shadow: 0 6px 24px rgba(10, 10, 12, 0.06);
}

/* ---------- 3. カードに乗ると少し浮く（マウスのときだけ） ---------- */
@media (hover: hover) and (pointer: fine) {
  .home-start-card,
  .home-price-card,
  .pg-light-card,
  .svc-plan,
  .chk-cta-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .home-start-card:hover,
  .home-price-card:hover,
  .pg-light-card:hover,
  .svc-plan:hover,
  .chk-cta-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(10, 10, 12, 0.10);
  }
}

/* ---------- 4. 機能のカード → 説明のシート ----------
   JS があるときだけ、カードの中の細かい説明（data-sm-detail）を畳んで「説明を見る」を出す */
.sm-js [data-sm-sheet] [data-sm-detail] {
  display: none;
}
[data-sm-sheet] {
  cursor: default;
}
.sm-js [data-sm-sheet] {
  cursor: pointer;
}
.sm-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 18px;
  min-height: 44px;
  border: 1px solid #424248;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.sm-more span {
  color: var(--accent, #a6ff00);
}
.sm-more:hover,
.sm-more:focus-visible {
  border-color: var(--accent, #a6ff00);
}
.sm-more:focus-visible,
.sm-close:focus-visible,
.sm-sheet a:focus-visible {
  outline: 2px solid var(--accent, #a6ff00);
  outline-offset: 2px;
}

.sm-sheet-root {
  position: fixed;
  z-index: 800; /* 守り神（nexoria-guardian.css の 760）より上。説明を読む間は後ろに回す */
  inset: 0;
}
.sm-sheet-root[hidden] {
  display: none;
}
.sm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.62);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sm-sheet {
  position: absolute;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #111116;
  border: 1px solid #2c2c33;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
  outline: none;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* スマホ: 下から */
@media (max-width: 900px) {
  .sm-sheet {
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 86vh;
    border-radius: 24px 24px 0 0;
    transform: translate3d(0, 100%, 0);
  }
}
/* PC: 右から */
@media (min-width: 901px) {
  .sm-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(500px, 92vw);
    border-radius: 24px 0 0 24px;
    transform: translate3d(100%, 0, 0);
  }
}
.sm-sheet-root.sm-open .sm-backdrop {
  opacity: 1;
}
.sm-sheet-root.sm-open .sm-sheet {
  transform: none;
}
.sm-grip {
  display: none;
  width: 44px;
  height: 5px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: #3a3a42;
}
@media (max-width: 900px) {
  .sm-grip {
    display: block;
  }
}
.sm-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0 26px;
}
.sm-sheet-kicker {
  margin: 0;
  color: var(--accent, #a6ff00);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.sm-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #33333a;
  border-radius: 50%;
  background: #1b1b21;
  color: #fff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sm-sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 26px 30px;
}
.sm-sheet-body h3 {
  margin: 6px 0 12px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.sm-sheet-body p {
  color: #c8c8cf;
  font-size: 16px;
}
.sm-sheet-body ul {
  margin: 16px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #26262c;
}
.sm-sheet-body li {
  position: relative;
  padding: 12px 0 12px 22px;
  border-bottom: 1px solid #26262c;
  font-size: 16px;
}
.sm-sheet-body li::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #a6ff00);
}
.sm-sheet-body .home-feature-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #1a1a20;
  color: #a1a1aa;
  font-size: 14px;
}
.sm-sheet-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--accent, #a6ff00);
  color: #0a0a0c;
  font-size: 15px;
  font-weight: 800;
}
html.sm-lock,
html.sm-lock body {
  overflow: hidden;
}

/* ---------- 5. 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  .sm-js .sm-rv {
    opacity: 1;
    transform: none;
  }
  .sm-js .mm-header,
  .sm-backdrop,
  .sm-sheet,
  .sm-js .sm-rv.sm-on {
    transition: none;
  }
}

/* ---------- 6. 印刷ではシート・動きを出さない ---------- */
@media print {
  .sm-sheet-root,
  .sm-more {
    display: none !important;
  }
  .sm-js .sm-rv,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .sm-js [data-sm-sheet] [data-sm-detail] {
    display: block;
  }
}
