/* ============================================================
   Hero Showcase — 真實作品 3D 裝置牆 + AI 生成敘事
   設計意圖:
   · 收斂首屏特效(粒子 canvas 移除、影片壓暗),讓「真實作品」成為主角
   · AI BUILD 打字列 → 掃描線揭示截圖,呼應「AI 智能建站」賣點
   · 此檔在 design-ex.*.css 與 theme-light.css 之後載入
   ============================================================ */

/* 影片壓暗:從 .55 降到 .32,並加重對角漸層,前景作品才有對比 */
.hero-video.loaded { opacity: .32; }
.hero:after {
  background: linear-gradient(120deg, rgba(13,27,42,.82) 0%, rgba(13,27,42,.55) 45%, rgba(6,16,27,.88) 100%);
}

/* ---------- 兩欄版面 ---------- */
.hero .wrap.hero-wrap {
  max-width: 1380px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: clamp(36px, 4vw, 64px);
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(30px, 3.4vw, 46px); }
.hero-stats { gap: clamp(20px, 2.4vw, 36px); }

/* ---------- AI BUILD 列 ---------- */
.ai-build-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; padding: 10px 16px;
  border: 1px solid rgba(0,212,255,.25); border-radius: 10px;
  background: rgba(6,16,27,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 13px; white-space: nowrap; overflow: hidden;
}
.ai-build-led {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #2ee87e; box-shadow: 0 0 10px #2ee87e;
  animation: ai-led 1.6s ease-in-out infinite;
}
@keyframes ai-led { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.ai-build-label {
  font-family: 'Orbitron', sans-serif; font-size: 10px;
  letter-spacing: 3px; color: #00d4ff; flex: none;
}
.ai-build-prompt {
  color: rgba(255,255,255,.78);
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ai-caret {
  width: 7px; height: 15px; flex: none; background: #00d4ff;
  animation: ai-caret .9s steps(1) infinite;
}
@keyframes ai-caret { 50% { opacity: 0; } }

/* ---------- 3D 舞台 ---------- */
/* 桌面:hero 高度先前已被縮短,給 fixed header 留出安全邊距
   (限定 min-width,避免覆蓋行動版既有的 padding:120px 0 80px) */
@media (min-width: 961px) {
  .hero { padding-top: 104px; padding-bottom: 56px; }
}
.hero-showcase { position: relative; z-index: 2; perspective: 1500px; }
.showcase-stage {
  position: relative;
  height: clamp(310px, 28vw, 400px);
  transform-style: preserve-3d;
  transform: rotateX(calc(3deg + var(--my, 0deg))) rotateY(calc(-8deg + var(--mx, 0deg)));
  transition: transform .3s ease-out;
}

.bframe {
  position: absolute; inset: 0; margin: 0;
  border-radius: 12px; overflow: hidden;
  background: #0b1520;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(0,212,255,.06);
  transition: transform .85s cubic-bezier(.22,1,.36,1), opacity .85s ease, filter .85s ease;
  will-change: transform, opacity;
  cursor: pointer;
}
.bframe.pos-front { transform: translate3d(0,0,50px); opacity: 1; z-index: 3; }
.bframe.pos-mid {
  transform: translate3d(46px,26px,-110px) scale(.94);
  opacity: .42; z-index: 2; filter: saturate(.5) brightness(.65);
}
.bframe.pos-back {
  transform: translate3d(90px,52px,-230px) scale(.88);
  opacity: .2; z-index: 1; filter: saturate(.35) brightness(.45);
}

/* 瀏覽器外框 */
.bframe-bar {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: #101c2a; border-bottom: 1px solid rgba(255,255,255,.08);
}
.bframe-bar .bd { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bd.r { background: #ff5f57; } .bd.y { background: #febc2e; } .bd.g { background: #28c840; }
.bframe-url {
  margin-left: 10px; flex: 1; min-width: 0;
  font-style: normal; font-size: 11.5px; letter-spacing: .4px; text-align: center;
  color: rgba(255,255,255,.55); background: rgba(255,255,255,.06);
  border-radius: 6px; padding: 4px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bframe-body { position: relative; height: calc(100% - 34px); background: #0b1520; }
.bframe-body img {
  position: relative; z-index: 2; display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}

/* skeleton 佔位(位於截圖下層,只在 build 揭示過程露出) */
.bframe-skeleton {
  position: absolute; inset: 0; z-index: 1;
  padding: 8% 7%; display: flex; flex-direction: column; gap: 7%;
}
.bframe-skeleton i {
  display: block; border-radius: 6px;
  background: linear-gradient(100deg, rgba(255,255,255,.05) 35%, rgba(0,212,255,.16) 50%, rgba(255,255,255,.05) 65%);
  background-size: 240% 100%;
  animation: skel 1.4s linear infinite;
}
.bframe-skeleton i:nth-child(1) { height: 16%; width: 55%; }
.bframe-skeleton i:nth-child(2) { height: 8%;  width: 80%; }
.bframe-skeleton i:nth-child(3) { height: 8%;  width: 70%; }
.bframe-skeleton i:nth-child(4) { height: 26%; width: 100%; }
.bframe-skeleton i:nth-child(5) { height: 11%; width: 40%; }
@keyframes skel { to { background-position: -140% 0; } }

/* build 揭示:掃描線由上而下掃過,截圖隨之展開 */
.bframe.building .bframe-body img {
  animation: bf-reveal 1.15s cubic-bezier(.45,0,.2,1) both;
}
@keyframes bf-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.bframe-scan {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #00d4ff 30%, #7bdfff 50%, #00d4ff 70%, transparent);
  box-shadow: 0 0 16px rgba(0,212,255,.9);
  opacity: 0; pointer-events: none;
}
.bframe.building .bframe-scan { animation: bf-scan 1.15s cubic-bezier(.45,0,.2,1) both; }
@keyframes bf-scan {
  0%   { top: 0; opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 3px); opacity: 0; }
}

/* 指示條 */
.showcase-dots { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.showcase-dots b {
  width: 22px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.18); cursor: pointer;
  transition: background .3s, width .3s, box-shadow .3s;
}
.showcase-dots b.on {
  width: 34px; background: #00d4ff;
  box-shadow: 0 0 8px rgba(0,212,255,.6);
}

/* ---------- 響應式 ---------- */
@media (max-width: 960px) {
  .hero .wrap.hero-wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero-showcase { width: 100%; max-width: 560px; margin: 0 auto; perspective: 1100px; }
  .showcase-stage { height: clamp(230px, 52vw, 340px); transform: rotateX(2deg) rotateY(-5deg); }
  .bframe.pos-mid  { transform: translate3d(26px,16px,-90px) scale(.94); }
  .bframe.pos-back { transform: translate3d(50px,30px,-180px) scale(.88); }
}

/* ---------- prefers-reduced-motion:全部降級為淡入淡出 ---------- */
@media (prefers-reduced-motion: reduce) {
  .showcase-stage { transform: none; transition: none; }
  .bframe { transition: opacity .4s ease; }
  .bframe.pos-front, .bframe.pos-mid, .bframe.pos-back { transform: none; }
  .bframe.building .bframe-body img { animation: none; clip-path: none; }
  .bframe.building .bframe-scan { animation: none; }
  .ai-build-led, .ai-caret, .bframe-skeleton i { animation: none; }
}
