/* Ascentek home FX — 首頁專用視覺層（Hero 網格／光帶／網路粒子、標題流光、AI 工作室區塊）。
   純增強：移除 index.html 中對 home-fx.css / home-fx.js 的引用即可還原。尊重 prefers-reduced-motion。 */

/* ── Hero：細網格 + 掃光 ───────────────────── */
.hero-v2::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 18%, transparent 74%);
  animation: fx-grid 28s linear infinite;
}
@keyframes fx-grid { to { background-position: 56px 56px, 56px 56px; } }
.hero-v2::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 28%; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(155,232,207,0.10), rgba(185,179,255,0.10), transparent);
  transform: skewX(-18deg);
  animation: fx-beam 10s ease-in-out infinite;
}
@keyframes fx-beam { 0% { left: -40%; } 62%, 100% { left: 125%; } }
.fx-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ── Hero 標題：流光（不依賴文字結構，多語系皆適用）─ */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-v2-h1 {
    background-image: linear-gradient(100deg, #f8f6f1 0%, #f8f6f1 36%, #9be8cf 47%, #b9b3ff 54%, #f8f6f1 66%, #f8f6f1 100%);
    background-size: 260% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 26px rgba(82,196,160,0.22));
    animation: mo-rise 0.85s cubic-bezier(.2,.7,.2,1) 0.18s both, fx-shine 8s ease-in-out 1.2s infinite;
  }
}
@keyframes fx-shine { 0%, 12% { background-position: 100% 0; } 55%, 100% { background-position: 0% 0; } }

/* ── Hero 膠囊：通往 AI 工作室，效果名稱逐字切換 ── */
.fx-pill-row { display: flex; justify-content: center; margin: 0 0 40px; animation: mo-rise 0.8s cubic-bezier(.2,.7,.2,1) 0.42s both; }
.fx-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(248,246,241,0.18); background: rgba(255,255,255,0.05); backdrop-filter: blur(8px);
  color: rgba(248,246,241,0.82); font-size: 0.88rem; letter-spacing: 0.04em;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.fx-pill:hover { border-color: var(--accent-a-light); background: rgba(82,196,160,0.10); transform: translateY(-2px); }
.fx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-a-light); box-shadow: 0 0 0 0 rgba(82,196,160,0.6); animation: fx-ping 2.2s ease-out infinite; }
@keyframes fx-ping { 0% { box-shadow: 0 0 0 0 rgba(82,196,160,0.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(82,196,160,0); } }
.fx-pill-k { color: #f8f6f1; font-weight: 500; }
.fx-pill-w { display: inline-block; min-width: 6.2em; text-align: left; color: var(--accent-a-light); font-variant-numeric: tabular-nums; }
.fx-pill-w::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: var(--accent-a-light); animation: fx-caret 1s steps(1) infinite; }
@keyframes fx-caret { 50% { opacity: 0; } }
@media (max-width: 640px) { .fx-pill-row { margin-bottom: 30px; } .fx-pill { font-size: 0.8rem; padding: 7px 14px; } }

/* ── AI 工作室區塊 ─────────────────────────── */
@property --fx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.fx-studio-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px; align-items: center; }
.fx-studio .section-title { margin-bottom: 18px; }
.fx-studio-p { color: var(--ink-80); line-height: 1.9; max-width: 34em; margin-bottom: 22px; }
.fx-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.fx-points li { font-size: 0.84rem; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--ink-12); color: var(--ink-80); }
.fx-studio-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.fx-link { font-size: 0.94rem; color: var(--accent-a); font-weight: 500; transition: gap 0.2s; display: inline-flex; gap: 4px; }
.fx-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.fx-reel {
  position: relative; display: block; padding: 2px; border-radius: 20px;
  background: conic-gradient(from var(--fx-a), var(--accent-a-light), var(--accent-b-light), rgba(139,131,224,0) 38%, rgba(82,196,160,0) 62%, var(--accent-a-light));
  animation: fx-spin 7s linear infinite;
  box-shadow: 0 24px 70px rgba(82,196,160,0.16), 0 8px 30px rgba(58,47,170,0.14);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.fx-reel:hover { transform: translateY(-4px); }
@keyframes fx-spin { to { --fx-a: 360deg; } }
.fx-reel video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: #05060a; object-fit: cover; }
.fx-fig { margin: 0; }
.fx-reel-tag { margin-top: 14px; text-align: center; font-size: 0.94rem; letter-spacing: 0.06em; color: var(--ink-80); }
html.dark .fx-reel { box-shadow: 0 24px 70px rgba(82,196,160,0.12), 0 8px 30px rgba(0,0,0,0.5); }
@media (max-width: 900px) { .fx-studio-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ── 減少動態偏好 ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-v2::before, .hero-v2::after, .fx-dot, .fx-pill-w::after, .fx-reel { animation: none; }
  .hero-v2::after { display: none; }
  .hero-v2-h1 { animation: none !important; -webkit-text-fill-color: #f8f6f1; color: #f8f6f1; background: none; filter: none; }
  .fx-pill-row { animation: none; }
  .fx-reel:hover, .fx-pill:hover { transform: none; }
}

/* Hero 間距：副標與膠囊 */
.hero-v2-sub { margin-bottom: 28px; }

/* ══ 可讀性補強（字級與對比）══════════════════════════════
   原則：正文與標籤 ≥ 13px、文字對比 ≥ 4.5:1；裝飾性大數字（01、02…）不在此限。 */

/* Hero：小標與副標加大加亮，並加柔和暗影托底，避免被連線與光帶干擾 */
.hero-v2-eyebrow { font-size: 0.9rem; letter-spacing: 0.14em; color: rgba(248,246,241,0.76); }
.hero-v2-sub { font-size: 1.2rem; color: rgba(248,246,241,0.86); text-shadow: 0 1px 16px rgba(10,10,26,0.85), 0 0 2px rgba(10,10,26,0.6); }
.hero-v2-eyebrow, .hero-v2-ctas { text-shadow: 0 1px 14px rgba(10,10,26,0.8); }
.fx-pill { font-size: 1rem; background: rgba(14,14,32,0.78); border-color: rgba(248,246,241,0.34); }
.fx-pill-k { color: #ffffff; }
.fx-pill-w { color: #8ff0cc; }
.hero-v2::after { background: linear-gradient(100deg, transparent, rgba(155,232,207,0.06), rgba(185,179,255,0.06), transparent); }
.btn-sec { color: rgba(248,246,241,0.92); border-color: rgba(248,246,241,0.40); }
@media (max-width: 640px) { .hero-v2-sub { font-size: 1.1rem; } .fx-pill { font-size: 0.9rem; } }

/* 區塊標籤、小標籤、說明文字 */
.section-label { font-size: 0.86rem; color: rgba(14,16,22,0.66); }
html.dark .section-label { color: rgba(232,229,224,0.72); }
.modes-section .section-label, .why-block .section-label { color: rgba(248,246,241,0.70); }
.why-now-tag { font-size: 0.84rem; color: rgba(14,16,22,0.66); }
html.dark .why-now-tag { color: rgba(232,229,224,0.72); }
.svc-meta-label { font-size: 0.8rem; color: rgba(14,16,22,0.64); }
html.dark .svc-meta-label { color: rgba(232,229,224,0.72); }
.svc-meta-text { font-size: 0.95rem; }
.svc-badge, .mode-badge { font-size: 0.82rem; }
.modes-intro { font-size: 1.02rem; color: rgba(248,246,241,0.82); }
.mode-who { font-size: 0.92rem; color: rgba(248,246,241,0.84); }
.cf-label { font-size: 0.88rem; }
.footer-copy { font-size: 0.88rem; color: rgba(14,16,22,0.62); }
html.dark .footer-copy { color: rgba(232,229,224,0.66); }
.ext-desc { font-size: 0.92rem; color: rgba(14,16,22,0.68); }
html.dark .ext-desc { color: rgba(232,229,224,0.72); }
.svc-wide-cta { color: #0a6a50; }
html.dark .svc-wide-cta { color: var(--accent-a-light); }
html.dark .nav-links a[style*="accent-a"] { color: var(--accent-a-light) !important; }

/* AI 工作室區塊 */
.fx-points li { font-size: 0.94rem; color: var(--ink-80); }
.fx-link { font-size: 1rem; color: #0a6a50; }
html.dark .fx-link { color: var(--accent-a-light); }
.fx-studio-p { font-size: 1.02rem; }
html.dark .svc-badge { color: #c9c4ff; background: rgba(139,131,224,0.26); }

/* ══ 卡片升級：游標光暈、輕微傾斜、漸層線、漸層數字 ═════════════ */
.trust-card, .svc-card, .svc-card-wide, .mode-card { position: relative; isolation: isolate; }

/* 游標光暈（--mx / --my 由 home-fx.js 在 pointermove 時更新；沒有 JS 時不顯示） */
.trust-card::after, .svc-card::after, .svc-card-wide::after, .mode-card::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(82,196,160,0.17), rgba(139,131,224,0.09) 46%, transparent 72%);
  opacity: 0; transition: opacity 0.35s ease;
}
.trust-card:hover::after, .svc-card:hover::after, .svc-card-wide:hover::after, .mode-card:hover::after { opacity: 1; }

/* 邊框與陰影：懸停時轉為薄荷綠光邊 */
.trust-card:hover, .svc-card:hover, .svc-card-wide:hover {
  border-color: rgba(82,196,160,0.55);
  box-shadow: 0 0 0 1px rgba(82,196,160,0.22), 0 20px 48px rgba(58,47,170,0.10);
}
html.dark .trust-card:hover, html.dark .svc-card:hover, html.dark .svc-card-wide:hover {
  box-shadow: 0 0 0 1px rgba(82,196,160,0.28), 0 20px 48px rgba(0,0,0,0.55);
}
.mode-card { background: rgba(248,246,241,0.05); backdrop-filter: blur(6px); transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.3s, box-shadow 0.35s; }
.mode-card:hover { border-color: rgba(82,196,160,0.5); box-shadow: 0 0 0 1px rgba(82,196,160,0.2), 0 22px 54px rgba(0,0,0,0.45); }

/* 傾斜（--rx / --ry 由 JS 設定，僅限有滑鼠的裝置；懸停時覆蓋 motion.css 的位移） */
.trust-card:hover, .svc-card:hover, .svc-card-wide:hover, .mode-card:hover {
  transform: perspective(1000px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.14s ease-out, box-shadow 0.35s ease, border-color 0.25s ease;
}

/* 頂部漸層線：懸停時由左向右畫出 */
.svc-card::before, .svc-card-wide::before, .mode-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, var(--accent-a-light), var(--accent-b-light));
  transform: scaleX(0); transform-origin: left; transition: transform 0.55s cubic-bezier(.2,.7,.2,1);
}
.svc-card:hover::before, .svc-card-wide:hover::before, .mode-card:hover::before { transform: scaleX(1); }
.trust-card::before { transform: scaleX(0.34); transform-origin: left; transition: transform 0.55s cubic-bezier(.2,.7,.2,1); }
.trust-card:hover::before { transform: scaleX(1); }

/* 編號：由幾乎看不見的灰色，改為薄荷綠到淡紫的漸層（裝飾用） */
.tc-num, .svc-num {
  background-image: linear-gradient(120deg, var(--accent-a-light), var(--accent-b-light));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: 0.62; transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.trust-card:hover .tc-num, .svc-card:hover .svc-num, .svc-card-wide:hover .svc-num { opacity: 1; }

/* 「開發中」徽章：呼吸點 */
.svc-badge::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%;
  background: currentColor; vertical-align: 0.08em; animation: fx-breathe 2.4s ease-out infinite;
}
@keyframes fx-breathe { 0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; } 70% { box-shadow: 0 0 0 6px transparent; opacity: 0.85; } 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; } }

/* 服務卡底部資訊欄：加一條薄荷綠的引導線 */
.svc-card-meta { position: relative; }
.svc-card-meta::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--accent-a-light), var(--accent-b-light)); opacity: 0.55; }

/* 「合作方式」深色區塊：細網格與緩慢光帶，和 Hero 呼應 */
.modes-section { position: relative; overflow: hidden; }
.modes-section > .wrap { position: relative; z-index: 1; }
.modes-section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 55%, #000 15%, transparent 72%);
  animation: fx-grid 32s linear infinite;
}
.modes-section::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 26%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(155,232,207,0.05), rgba(185,179,255,0.05), transparent);
  transform: skewX(-18deg); animation: fx-beam 14s ease-in-out infinite;
}

/* 分隔線：緩慢流動的細光 */
.rule {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--ink-12) 16%, rgba(82,196,160,0.6) 50%, var(--ink-12) 84%, transparent);
  background-size: 220% 100%; animation: fx-rule 9s ease-in-out infinite;
}
@keyframes fx-rule { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

@media (prefers-reduced-motion: reduce) {
  .svc-badge::before, .modes-section::before, .modes-section::after, .rule { animation: none; }
  .modes-section::after { display: none; }
  .trust-card:hover, .svc-card:hover, .svc-card-wide:hover, .mode-card:hover { transform: none; }
  .svc-card::before, .svc-card-wide::before, .mode-card::before, .trust-card::before { transition: none; }
}
.mode-card { overflow: hidden; }
.mode-desc { color: rgba(248,246,241,0.74); }
