/* ==========================================================================
   新培教育 —— 視覺特效層（fx.css）
   Blender 3D 圖示、立體字、層次卡片、絲帶標籤。
   唔想要？刪走頁面 <head> 入面 fx.css 嗰行，同底部 fx.js 嗰行就還原。
   3D 圖由 tools/blender3d/build_icons.py 渲染 → make_webp.py → assets/img/3d/
   ========================================================================== */

/* ---------- 1. 絲帶標籤（eyebrow → ribbon tag） ---------- */
.fx .section-head:is(.center, :not(.center)) .eyebrow {
  position: relative;
  padding: 7px 18px 7px 16px;
  border: 0;
  color: #fff;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #FF8A3D 0%, #E8590C 55%, #C94B09 100%);
  border-radius: 999px 6px 6px 999px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 14px -4px rgba(201,75,9,.55), 0 2px 0 #A03D08;
  transform: rotate(-1.2deg);
}
.fx .section-head:is(.center, :not(.center)) .eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #FFE7C2;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}
.fx .section-head.center .eyebrow::before { display: inline-block; }
.fx .section-head:is(.center, :not(.center)) .eyebrow::after {          /* 絲帶尾 */
  content: "";
  position: absolute; right: -9px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 55% 50%, 100% 100%, 0 100%);
  filter: brightness(.85);
  z-index: -1;
}
.fx .section-deep .section-head .eyebrow,
.fx .section-navy .section-head .eyebrow { color: #fff; }

/* ---------- 2. 標題：手寫筆劃底線（唔用重影陰影，字要清楚） ---------- */
.fx .section-head h2 {
  position: relative;
  display: block;
  text-shadow: none;
}
.fx .section-head h2::after {
  content: "";
  display: block;
  width: min(220px, 60%);
  height: 12px;
  margin: 10px auto 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 12'%3E%3Cpath d='M3 8 C40 2 70 2 110 6 S180 11 217 4' fill='none' stroke='%23E8590C' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M30 10 C80 6 140 7 190 8' fill='none' stroke='%23F5A623' stroke-width='2.5' stroke-linecap='round' opacity='.8'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.fx .section-head:not(.center) h2::after { margin-left: 0; }
.fx .section-deep .section-head h2,
.fx .section-navy .section-head h2,
.fx .grads-sec .section-head h2 { text-shadow: 0 4px 22px rgba(0,0,0,.35); }

/* ---------- 3. 立體數字（Canva「立體／延伸」效果） ---------- */
.fx .stat-num,
.fx .story-stats strong,
.fx .primary-stats strong {
  color: #FF7417;
  text-shadow:
    1px 1px 0 #EE6510, 2px 2px 0 #DD5A0C, 3px 3px 0 #CC500B, 4px 4px 0 #B8470A, 5px 5px 0 #A03D08,
    7px 9px 14px rgba(160, 61, 8, .32);
  -webkit-text-stroke: 1px rgba(255,255,255,.35);
}
.fx .stat-num { margin-bottom: 18px; transform: translate(-2px, -2px); }

/* ---------- 4. 層次卡片：漸變邊框 + 柔光 + 掃光 ---------- */
.fx .stat-card, .fx .subj-card, .fx .section-deep .card {
  --edge: linear-gradient(140deg, #FFC8A3 0%, #E4E7EC 38%, #E4E7EC 62%, #B9CBEA 100%);
  border: 1px solid transparent;
  background: linear-gradient(180deg, #fff, #FCFBFA) padding-box, var(--edge) border-box;
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(11,31,58,.04), 0 14px 30px -14px rgba(11,31,58,.18);
  overflow: hidden;
  isolation: isolate;
}
.fx .stat-card::before, .fx .subj-card::before, .fx .section-deep .card::before {   /* 掃光 */
  content: "";
  position: absolute; inset: -40% auto -40% -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg);
  transition: left .9s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  z-index: 3;
}
.fx .stat-card:hover::before, .fx .subj-card:hover::before, .fx .section-deep .card:hover::before { left: 130%; }

/* 深色區卡片：玻璃感 */
.fx .section-deep .card {
  --edge: linear-gradient(150deg, rgba(255,138,61,.7), rgba(255,255,255,.12) 40%, rgba(120,160,230,.45));
  background: linear-gradient(170deg, rgba(255,255,255,.10), rgba(255,255,255,.03)) padding-box, var(--edge) border-box;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 24px 50px -20px rgba(0,0,0,.6);
}

/* ---------- 5. 3D 圖示 ---------- */
.fx .icon3d {
  display: block;
  width: 92px; height: 92px;
  margin: -6px 0 10px -6px;
  filter: drop-shadow(0 12px 14px rgba(11,31,58,.28));
  transition: transform .5s cubic-bezier(.22,1,.36,1), filter .5s;
  transform: translateZ(30px);
  pointer-events: none;
}
.fx .subj-card .icon3d { width: 84px; height: 84px; }
.fx .card .icon3d { width: 104px; height: 104px; margin: -10px auto 8px; }
.fx .section-deep .card { text-align: center; }
.fx .tilt { transform-style: preserve-3d; }
.fx :is(.subj-card, .card):hover .icon3d {
  transform: translateZ(40px) translateY(-8px) rotate(-4deg) scale(1.06);
  filter: drop-shadow(0 20px 18px rgba(11,31,58,.32));
}
.fx .card-icon.has-3d { display: none; }

/* ---------- 6. Hero 浮動 3D 物件 ---------- */
.hero-3d { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.hero-3d img {
  position: absolute;
  filter: drop-shadow(0 24px 26px rgba(0,0,0,.45));
  will-change: transform;
  animation: fx-float 7s ease-in-out infinite;
  translate: var(--px, 0) var(--py, 0);
}
.hero-3d .h-cap    { width: clamp(110px, 11vw, 168px); right: -34px; top: -66px; animation-delay: -1s; }
.hero-3d .h-medal  { width: clamp(84px, 8vw, 120px); left: -62px; bottom: 90px; animation-delay: -3s; animation-duration: 8s; }
.hero-3d .h-pencil { width: clamp(120px, 12vw, 180px); right: -40px; bottom: -58px; animation-delay: -5s; animation-duration: 9s; }
@keyframes fx-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(3deg); }
}
.hero-card { position: relative; }
@media (max-width: 940px) {
  .hero-3d .h-medal { display: none; }
  .hero-3d .h-cap { right: -6px; top: -54px; }
  .hero-3d .h-pencil { right: -8px; bottom: -44px; }
}

/* ---------- 7. DSE 橫幅：金星獎章 ---------- */
.fx .dse-banner { position: relative; overflow: visible; }
.fx .dse-banner .medal3d {
  position: absolute; width: 132px; left: -14px; top: -50px;
  filter: drop-shadow(0 16px 18px rgba(160,61,8,.35));
  animation: fx-float 8s ease-in-out infinite;
  pointer-events: none;
}
.fx .dse-banner > div:first-child { padding-left: 96px; }
@media (max-width: 720px) {
  .fx .dse-banner .medal3d { width: 96px; left: auto; right: -10px; top: -50px; }
  .fx .dse-banner > div:first-child { padding-left: 0; }
}

/* ---------- 8. Hero 大標題：柔和陰影 + 筆劃底線 ---------- */
.fx .hero h1 {
  text-shadow: 0 3px 22px rgba(0,0,0,.45);
}
.fx .hero h1 .hl { position: relative; display: inline-block; }
.fx .hero h1 .hl::after {
  content: "";
  position: absolute; left: -2%; right: -2%; bottom: -0.12em; height: 0.26em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 26' preserveAspectRatio='none'%3E%3Cpath d='M4 17 C70 6 150 4 296 12' fill='none' stroke='%23FF8A3D' stroke-width='9' stroke-linecap='round'/%3E%3Cpath d='M40 22 C120 15 200 16 270 19' fill='none' stroke='%23F5A623' stroke-width='4' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  filter: drop-shadow(0 3px 8px rgba(232,89,12,.5));
  z-index: -1;
}
.fx .hero-motto span {
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.04)) padding-box,
              linear-gradient(140deg, rgba(255,170,110,.9), rgba(255,255,255,.15) 50%, rgba(140,180,255,.6)) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 18px -8px rgba(0,0,0,.6);
}
.fx .hero-badge {
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04)) padding-box,
              linear-gradient(120deg, rgba(255,138,61,.95), rgba(255,255,255,.18) 45%, rgba(245,166,35,.8)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 10px 24px -12px rgba(232,89,12,.7);
}
.fx .hero-card {
  background: linear-gradient(165deg, rgba(255,255,255,.12), rgba(255,255,255,.04)) padding-box,
              linear-gradient(150deg, rgba(255,138,61,.85), rgba(255,255,255,.14) 35%, rgba(255,255,255,.08) 65%, rgba(120,160,230,.6)) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 30px 60px -24px rgba(0,0,0,.7), 0 0 0 8px rgba(255,255,255,.03);
}

@media (prefers-reduced-motion: reduce) {
  .hero-3d img, .fx .dse-banner .medal3d { animation: none; }
  .fx .stat-card::before, .fx .subj-card::before, .fx .section-deep .card::before { display: none; }
}
