/* 版面動效 —— 動作與節奏依 Motion Prompt 的規格（MIT License (c) 2026 Shohei Ohtaki）
 * https://showheyohtaki.github.io/motion-prompt/
 *
 * 旭方 2026-11-22：「風格要跟我的品牌調性類似，不需要太多種，重要的地方提示就好」。
 * 所以每個只用在一種地方，現在七個：
 *   #005 Mask reveal        大標題進場（首頁主標、各段標題；棋盤圖上的三行文案用逐行版，見檔尾）
 *   #007 Count-up           重點數字
 *   #022 Light sweep        主要的購買、訂購按鈕
 *   #074 Fade-in on scroll  其他內容進場（底層，全站一致）
 *   #154 Spotlight hover    卡片
 *   #160 Loading button     訂購單送出
 *   #004 Line draw          「適合誰」三張卡片的圖示進場（旭方 2026-11-22 指定加的；問過要不要拿掉一個舊的，他回「維持七個」）
 * 規格用技能的 get 指令取得；這裡是依規格用 CSS 重建，數值照規格，和規格不同的地方各段有註明。
 */

/* #074 Fade-in on scroll：碰到畫面 85% 的線就觸發；0.7 秒、從下方 28px、cubic ease-out */
.rv { transform: translateY(28px); transition: opacity .7s cubic-bezier(.33, 1, .68, 1), transform .7s cubic-bezier(.33, 1, .68, 1); transition-delay: var(--d, 0ms); }

/* #005 Mask reveal：一條線從中間長出來（0.1–0.5 秒），標題從線的下方升上來（0.35–1.0 秒、五次方緩出），
   下面的說明文字從線的上方降下來（0.55–1.15 秒）。透明度不變，文字只靠被邊緣遮住來隱藏。
   和規格不同：規格的位移是固定像素（照 98px 的字），這裡換成同比例的百分比，各種字級才都遮得住。 */
.mr .mr__top, .mr .mr__bot { overflow: hidden; }
.mr .mr__top { padding-bottom: .14em; margin-bottom: -.14em; }
.mr .mr__top > * { transform: translateY(122%); }
.mr .mr__bot > * { transform: translateY(-104%); }
.mr .mr__line { display: block; height: 0; position: relative; }
.mr .mr__line::before { content: ""; position: absolute; left: 0; top: 9px; width: min(380px, 100%); height: 2px; border-radius: 2px; background: linear-gradient(90deg, #3ea6ff, #8f7dff); transform: scaleX(0); transform-origin: 50% 50%; }
.head--center.mr .mr__line::before, .final .mr .mr__line::before { left: 50%; margin-left: max(-190px, -50%); }
.mr > .eyebrow { opacity: 0; transition: opacity .4s ease; }
.mr.is-on > .eyebrow { opacity: 1; }
.mr.is-on .mr__top > * { transform: none; transition: transform .65s cubic-bezier(.22, 1, .36, 1) .35s; }
.mr.is-on .mr__bot > * { transform: none; transition: transform .6s cubic-bezier(.22, 1, .36, 1) .55s; }
.mr.is-on .mr__line::before { animation: mr-line 2.3s both; }
@keyframes mr-line {
  0%, 4.3% { transform: scaleX(0); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  21.7%, 89.1% { transform: scaleX(1); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  100% { transform: scaleX(0); }
}

/* #007 Count-up：數字跑完鎖定時，顏色切換、小小彈一下：1 + 0.07·e^(−7t)·cos(15t)。
   和規格不同：沒有做旁邊的箭頭圓點與進度條；顏色從白切到淡藍，不是黃。 */
[data-count] { transition: color .2s ease; transform-origin: 50% 60%; }
[data-count].is-landed { color: #cfe6ff; animation: land .6s linear both; }
@keyframes land { 0% { transform: scale(1.07); } 17% { transform: scale(1); } 35% { transform: scale(.984); } 70% { transform: scale(1.004); } 100% { transform: scale(1); } }

/* #022 Light sweep：一道斜的光帶掃過按鈕表面（約 24 度、中間 0.72 不透明），後面跟一條細光帶；
   掃完右上角閃一顆四角星。按鈕本身不動。
   和規格不同：規格是每 2.35 秒掃一次，放在網頁上太搶，改成每 4.7 秒（它的一個完整循環）掃一次。 */
.btn--l:not(.btn--ghost):not(.btn--line) { position: relative; isolation: isolate; }
.btn--l:not(.btn--ghost):not(.btn--line):not(.is-busy):not(.is-done)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(114deg,
    transparent 38%, rgba(255, 255, 255, .72) 47%, transparent 56%,
    transparent 60.5%, rgba(255, 255, 255, .5) 62%, transparent 63.5%) no-repeat;
  background-size: 300% 100%; background-position: 135% 0;
  animation: sweep 4.7s infinite;
}
@keyframes sweep {
  0%, 9.6% { background-position: 135% 0; animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  31.9%, 100% { background-position: -35% 0; }
}
.btn--l:not(.btn--ghost):not(.btn--line):not(.is-busy):not(.is-done)::after {
  content: ""; position: absolute; right: -6px; top: -9px; width: 22px; height: 22px; pointer-events: none;
  background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  transform: scale(0) rotate(0); filter: drop-shadow(0 0 6px rgba(160, 205, 255, .9));
  animation: sparkle 4.7s infinite;
}
@keyframes sparkle {
  0%, 29.4% { transform: scale(0) rotate(0); }
  33.5% { transform: scale(.82) rotate(17deg); }
  35.7% { transform: scale(1.1) rotate(26deg); }
  39% { transform: scale(.6) rotate(41deg); }
  42.1%, 100% { transform: scale(0) rotate(52deg); }
}

/* #154 Spotlight hover：只有游標周圍亮起來，燈貼著游標不延遲。光的顏色改成品牌的藍。 */
@media (hover: hover) and (pointer: fine) {
  .spot { position: relative; }
  .spot::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .3s ease;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(150, 190, 255, .16), transparent 70%);
  }
  .spot:hover::before { opacity: 1; }
  .spot:hover { border-color: rgba(108, 188, 255, .45); }
  .spot > * { position: relative; z-index: 1; }
  .tile, .sec .card, .num, .box li, .assure li { transition: border-color .3s ease; }
}

/* #004 Line draw：圖示的線條像被畫出來一樣長出來（trim path），cubic ease-in-out。
   和規格不同：規格畫 1.55 秒、前端有一顆黃點帶著走、之後會擦掉重來；這裡是小圖示，畫 1.1 秒、沒有黃點、畫完就留著不重播。 */
.who__ico svg > * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.card--who.is-on .who__ico svg > * { animation: ico-draw 1.1s cubic-bezier(.65, 0, .35, 1) calc(var(--d, 0ms) + .4s) both; }
.card--who.is-on .who__ico svg > :nth-child(2) { animation-delay: calc(var(--d, 0ms) + .62s); }
.card--who.is-on .who__ico svg > :nth-child(3) { animation-delay: calc(var(--d, 0ms) + .84s); }
@keyframes ico-draw { to { stroke-dashoffset: 0; } }

/* #160 Loading button：縮成圓（0.3 秒）、裡面每 0.7 秒轉一圈，完成後變綠色打勾再展開（0.35 秒） */
.btn.is-busy, .btn.is-done { pointer-events: none; overflow: hidden; }
.btn.is-busy { color: transparent !important; width: 54px !important; min-width: 0; padding: 0; transition: width .3s cubic-bezier(.65, 0, .35, 1), color .1s; justify-self: center; }
.btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid rgba(2, 16, 34, .25); border-top-color: var(--navy-ink); animation: spin .7s linear infinite; }
.btn.is-done { background: #1e9e5a !important; color: #fff !important; box-shadow: 0 10px 36px rgba(30, 158, 90, .4); transition: width .35s cubic-bezier(.65, 0, .35, 1), background .2s; }
.form .btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 常見問題展開時高度順順地長出來；不支援的瀏覽器照舊直接展開 */
.faq { interpolate-size: allow-keywords; }
.faq details::details-content { block-size: 0; overflow: hidden; opacity: 0; transition: block-size .35s cubic-bezier(.33, 1, .68, 1), opacity .3s ease, content-visibility .35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .btn--l::before, .btn--l::after { animation: none !important; }
  .mr .mr__top > *, .mr .mr__bot > * { transform: none !important; }
  .mr > .eyebrow { opacity: 1; }
  .mr .mr__line::before { animation: none !important; }
  [data-count].is-landed { animation: none; }
  .who__ico svg > * { stroke-dashoffset: 0 !important; animation: none !important; }
}

/* #005 Mask reveal 的逐行版：疊在棋盤圖上的三行文案（旭方 2026-11-23 要求用 motion prompt 挑一個微型動畫）。
   沿用 #005 的核心：每一行從看不見的邊緣下方升上來（0.65 秒、五次方緩出、起點 122%、透明度不變）。
   和規格不同：規格是一條線配上下兩段字，這裡沒有線，改成三行依序升起、每行晚 0.12 秒；不新增動效種類，仍是七個。 */
.scene__txt.mrl .ln > span { transform: translateY(122%); }
.scene__txt.mrl.is-on .ln > span { transform: none; transition: transform .65s cubic-bezier(.22, 1, .36, 1); }
.scene__txt.mrl.is-on .ln:nth-child(1) > span { transition-delay: .15s; }
.scene__txt.mrl.is-on .ln:nth-child(2) > span { transition-delay: .27s; }
.scene__txt.mrl.is-on .ln:nth-child(3) > span { transition-delay: .39s; }
