/* ============================================================
   尷尬司康 v2 特效層(甜點主題動效)
   載入順序:style.css 之後。
   規範:所有動效尊重 prefers-reduced-motion;
   不在 .site-header 上使用 transform/filter(11-pitfalls)。
   ============================================================ */

/* ---------- 烤焙進度條(頁面捲動進度) ---------- */
#bakeProgress {
  position: fixed; top: 0; left: 0;
  height: 4px; width: 0;
  z-index: 200;
  background: linear-gradient(90deg, #ffd968, var(--gold) 40%, #c98a3d 75%, #6b4226);
  border-radius: 0 999px 999px 0;
  box-shadow: 0 1px 6px rgba(179, 128, 7, 0.45);
  pointer-events: none;
}

/* ---------- 跑馬燈(奶油黃 × 墨黑,微傾斜) ---------- */
.fx-marquee {
  background: var(--gold);
  color: var(--ink);
  overflow: hidden;
  padding: 13px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-1.2deg) scale(1.02);
  position: relative;
  z-index: 5;
}
.fx-marquee.rev { transform: rotate(1.2deg) scale(1.02); }
.fx-marquee-track {
  display: flex;
  width: max-content;
  animation: fxMarquee 26s linear infinite;
}
.fx-marquee.rev .fx-marquee-track { animation-direction: reverse; }
.fx-marquee span {
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: 4px;
  font-weight: 700;
  padding-right: 28px;
}
@keyframes fxMarquee {
  to { transform: translateX(-50%); }
}

/* ---------- Hero:司康碎屑粒子 canvas ---------- */
#fxCrumbs {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero .hero-inner { z-index: 2; }   /* 內容壓在碎屑之上 */

/* ---------- Hero:漂浮甜點裝飾 ---------- */
.fx-float {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-size: 44px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
  animation: fxFloat 6s ease-in-out infinite;
  opacity: 0.92;
}
.fx-float.f2 { animation-duration: 7.5s; animation-delay: 0.8s; font-size: 36px; }
.fx-float.f3 { animation-duration: 8.5s; animation-delay: 1.6s; font-size: 40px; }
.fx-float.f4 { animation-duration: 7s;   animation-delay: 2.4s; font-size: 32px; }
@keyframes fxFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-24px) rotate(8deg); }
}

/* ---------- Hero:出爐熱氣 ---------- */
.fx-steam-wrap {
  display: flex; gap: 16px;
  height: 42px;
  margin-bottom: 4px;
  align-items: flex-end;
}
.fx-steam-wrap i {
  width: 10px; height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  filter: blur(6px);
  animation: fxSteam 2.6s ease-in-out infinite;
}
.fx-steam-wrap i:nth-child(2) { animation-delay: 0.6s; height: 40px; }
.fx-steam-wrap i:nth-child(3) { animation-delay: 1.1s; height: 30px; }
@keyframes fxSteam {
  0%   { transform: translateY(10px) scaleY(0.6); opacity: 0; }
  35%  { opacity: 0.85; }
  100% { transform: translateY(-28px) scaleY(1.2); opacity: 0; }
}

/* ---------- 產品卡:奶油光澤掃過(butter shine) ---------- */
.p-img, .g-img, .news-img { position: relative; }
.p-img::after, .g-img::after, .news-img::after {
  content: "";
  position: absolute; top: 0; bottom: 0;
  left: -85%; width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 246, 214, 0.55), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.p-card:hover .p-img::after,
.g-card:hover .g-img::after,
.news-card:hover .news-img::after {
  transition: left 0.65s ease;
  left: 135%;
}

/* ---------- 徽章果凍晃動 ---------- */
.p-badge, .news-tag, .store-badge {
  animation: fxJelly 3.4s ease-in-out infinite;
  transform-origin: 50% 100%;
  display: inline-block;
}
@keyframes fxJelly {
  0%, 84%, 100% { transform: none; }
  88%  { transform: scale(1.14, 0.86); }
  92%  { transform: scale(0.94, 1.06) rotate(-2deg); }
  96%  { transform: scale(1.05, 0.95); }
}

/* ---------- 區塊標題:奶油抹痕底線 ---------- */
.section-head .section-title { position: relative; }
.section-head .section-title::after {
  content: "";
  display: block;
  width: 58px; height: 9px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #ffd968);
  box-shadow: 0 2px 0 rgba(38, 32, 15, 0.14);
}

/* ---------- 游標碎屑 canvas(桌機限定) ---------- */
#fxCursor {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* ---------- CTA 呼吸微光 ---------- */
.cta {
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 183, 28, 0.22), transparent 65%);
  top: -180px; right: -120px;
  animation: fxGlow 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fxGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.18); }
}

/* ---------- 響應式 / 無障礙關閉 ---------- */
@media (hover: none) {
  #fxCursor { display: none; }
}
@media (max-width: 640px) {
  .fx-float { font-size: 30px; }
  .fx-float.f4 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-marquee-track,
  .fx-float,
  .fx-steam-wrap i,
  .p-badge, .news-tag, .store-badge,
  .cta::before {
    animation: none !important;
  }
  #fxCrumbs, #fxCursor { display: none; }
}
