/* 首屏沉浸式 3D（#hero3d）：場景由 assets/js/home-v3-hero3d.js 畫在 canvas 上，
   這裡負責版面——舞台釘在畫面上、四段文字依序疊在場景上、右側（手機在上方）步驟導覽。
   原首屏的 H1／說明／標籤／按鈕原封不動放在第 0 段，只改成深底配色。 */

.hx { --navh: 76px; --stage-h: calc(100vh - var(--navh)); position: relative; background: #0B0D12; color: #fff; }
@supports (height: 100svh) { .hx { --stage-h: calc(100svh - var(--navh)); } }

.hx-pin { position: sticky; top: var(--navh); height: var(--stage-h); overflow: hidden; }
.hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.hx.is-gl .hx-canvas { opacity: 1; }

/* 背景：深藍黑漸層＋品牌橘光暈＋網格，WebGL 不能用時也有質感 */
.hx-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 70% 45%, rgba(208, 74, 17, .26), transparent 70%),
    radial-gradient(40% 50% at 15% 10%, rgba(252, 144, 0, .12), transparent 70%),
    linear-gradient(180deg, #0B0D12, #12151C 60%, #0B0D12);
}
.hx-bg::after { content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 60% 50%, #000, transparent); mask-image: radial-gradient(70% 70% at 60% 50%, #000, transparent);
}
/* 文字那一側壓暗 */
.hx-scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 13, 18, .82) 0%, rgba(11, 13, 18, .5) 34%, transparent 58%),
              radial-gradient(120% 60% at 50% 120%, rgba(11, 13, 18, .9), transparent 60%);
}

/* ---------- 步驟導覽 ---------- */
.hx-nav { position: absolute; right: 76px; top: 50%; z-index: 5; transform: translateY(-50%);
  padding: 18px 18px; border-radius: 18px; background: rgba(11, 13, 18, .62); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hx-nav ol { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.hx-nav button { display: flex; align-items: center; justify-content: flex-end; gap: 12px; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .86); cursor: pointer; white-space: nowrap; transition: color .25s; }
.hx-nav button::after { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .7); transition: all .3s; }
.hx-nav button:hover { color: #fff; }
.hx-nav button[aria-current="true"] { color: var(--o-2); }
.hx-nav button[aria-current="true"]::after { border-color: var(--o-2); background: var(--o-2); box-shadow: 0 0 12px var(--o-2); transform: scale(1.25); }
.hx-bar { display: none; }

/* ---------- 文字段落：疊在釘住的舞台上 ---------- */
.hx-steps { position: relative; z-index: 4; margin-top: calc(var(--stage-h) * -1); }
.hx-step { display: flex; align-items: center; height: var(--stage-h); }
.hx-step > .wrap { width: min(var(--wrap), 100% - 48px); }
.hx-inner { max-width: 560px; }
.js .hx-step .hx-inner { transition: opacity .6s ease, transform .8s cubic-bezier(.16, .84, .44, 1); }
.js .hx-step:not(.is-on) .hx-inner { opacity: 0; transform: translateY(30px); pointer-events: none; }

/* 第 0 段：原首屏文字改深底配色 */
.hx .hero-copy { max-width: 620px; padding: 24px 0; }
.hx .hero-brand { color: rgba(255, 255, 255, .9); }
.hx h1 { word-break: keep-all; margin-top: 10px; font-size: clamp(42px, 5vw, 66px); font-weight: 900; letter-spacing: .02em; line-height: 1.2; color: #fff; text-wrap: balance; }
.hx h1 em { font-style: normal; background: linear-gradient(100deg, #FFB46B, var(--o-2) 45%, #FF6A1F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx h1 .h1-sub { display: block; margin-top: 12px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: .04em; color: #fff; }
.hx .hero-desc { margin-top: 16px; font-size: 20px; color: rgba(255, 255, 255, .84); }
.hx .tags { margin-top: 20px; max-width: 560px; }
.hx .tags li { border-color: rgba(252, 144, 0, .45); background: rgba(11, 13, 18, .55); color: #FFD2A8; font-size: 17px; }
.hx .tags li.more { border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .8); }
.hx .hero-meta { margin-top: 18px; font-size: 18px; color: rgba(255, 255, 255, .86); }
.hx .hero-meta .ico { color: var(--o-2); }
.hx .hero-act { margin-top: 26px; }
/* 按鈕第二行（說出你的流程／我需要哪幾個模組）不從詞中間斷：窄螢幕縮字 */
.hx .bru-t span:last-child { white-space: nowrap; }
@media (max-width: 400px) { .hx .bru-t span:last-child { font-size: 19px; } .hx .bru { padding-inline: 14px; } }

/* 第 1～3 段：服務 */
.hx-tag { display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 700; letter-spacing: .16em; color: var(--o-2); }
.hx-tag b { font-size: 40px; font-weight: 900; letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; }
.hx-tag i { width: 40px; height: 1px; background: rgba(252, 144, 0, .75); }
.hx-step h2 { margin-top: 14px; font-size: clamp(36px, 4vw, 54px); font-weight: 900; letter-spacing: .04em; line-height: 1.22; word-break: keep-all; }
.hx-step h2 span { background: linear-gradient(100deg, #FFB46B, var(--o-2) 45%, #FF6A1F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-step .hx-desc { margin-top: 16px; font-size: 20px; line-height: 1.75; color: rgba(255, 255, 255, .84); }
.hx-points { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.hx-points li { padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .16) inset; font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.hx-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; padding: 13px 24px; border-radius: 999px; font-size: 18px; font-weight: 700; color: #fff; background: var(--o-btn); box-shadow: 0 10px 28px rgba(196, 67, 13, .45); transition: background .2s, transform .2s; }
.hx-go:hover { background: #A63609; transform: translateY(-1px); }
.hx-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.hx-go:hover svg { transform: translateX(3px); }

/* 手機專用 HUD（電腦版不顯示） */
.hx-hud { display: none; }

/* 捲動提示 */
.hx-hint { position: absolute; left: 50%; bottom: 20px; z-index: 5; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); font-size: 14px; color: rgba(255, 255, 255, .8); transition: opacity .4s; pointer-events: none; }
.hx-hint i { position: relative; width: 18px; height: 28px; border: 1.5px solid rgba(255, 255, 255, .6); border-radius: 10px; }
.hx-hint i::after { content: ''; position: absolute; left: 50%; top: 5px; width: 2px; height: 6px; margin-left: -1px; border-radius: 1px; background: #fff; animation: hx-wheel 1.6s ease-in-out infinite; }
@keyframes hx-wheel { 60% { transform: translateY(8px); opacity: 0; } }
.hx:not([data-k="0"]) .hx-hint { opacity: 0; }

/* ---------- 平板與手機：場景在上半、文字在下半 ---------- */
@media (max-width: 999px) {
  .hx-scrim { background: linear-gradient(0deg, rgba(11, 13, 18, .94) 0%, rgba(11, 13, 18, .8) 42%, rgba(11, 13, 18, .2) 64%, transparent 78%); }
  .hx-step { align-items: flex-end; padding-bottom: 28px; }
  .hx-nav { left: 0; right: 0; top: 0; transform: none; padding: 10px 16px 16px; border-radius: 0; background: linear-gradient(rgba(11, 13, 18, .9), rgba(11, 13, 18, 0)); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hx-nav ol { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 4px 6px; }
  .hx-nav button { flex-direction: row-reverse; justify-content: flex-start; gap: 6px; font-size: 13px; }
  .hx-bar { display: block; height: 2px; margin-top: 8px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
  .hx-bar i { display: block; height: 100%; background: var(--o-2); transform-origin: left; transform: scaleX(0); }
  .hx-hint { display: none; }
}
@media (max-width: 760px) {
  .hx-step > .wrap { width: calc(100% - 36px); }
  .hx .hero-copy { padding: 0; }
  .hx .hero-brand { font-size: 18px; }
  .hx h1 { font-size: 34px; }
  .hx h1 .h1-sub { margin-top: 6px; font-size: 18px; letter-spacing: .02em; }
  .hx .hero-desc { margin-top: 10px; font-size: 16px; }
  .hx .tags { gap: 6px; margin-top: 12px; }
  .hx .tags li { padding: 2px 10px; font-size: 13px; }
  .hx .hero-meta { display: none; }
  .hx .hero-act { gap: 12px; margin-top: 16px; }
  .hx-tag { font-size: 13px; }
  .hx-tag b { font-size: 28px; }
  .hx-step h2 { font-size: 28px; }
  .hx-step .hx-desc { margin-top: 10px; font-size: 16px; line-height: 1.65; }
  .hx-points { margin-top: 12px; gap: 6px; }
  .hx-points li { padding: 3px 10px; font-size: 13px; }
  .hx-go { margin-top: 16px; padding: 10px 18px; font-size: 16px; }
}

/* ---------- 電腦版 HUD：框在右側場景上，左邊文字不受影響 ---------- */
@media (min-width: 1000px) {
  .hx-bg { background:
      radial-gradient(34% 46% at 66% 48%, rgba(252, 144, 0, .2), transparent 70%),
      radial-gradient(50% 64% at 66% 48%, rgba(208, 74, 17, .3), transparent 75%),
      linear-gradient(180deg, #0B0D12, #12151C 60%, #0B0D12); animation: hx-breathe 5s ease-in-out infinite; }
  .hx-hud { display: block; position: absolute; left: 41%; right: 230px; top: 9%; bottom: 9%; z-index: 3; pointer-events: none; }
  .hx-hud > i { position: absolute; width: 30px; height: 30px; border: 2px solid var(--o-2); opacity: .85; box-shadow: 0 0 12px rgba(252, 144, 0, .5); }
  .hx-hud > i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
  .hx-hud > i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
  .hx-hud > i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
  .hx-hud > i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
  .hx-scan { position: absolute; left: 3%; right: 3%; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--o-2), #fff, var(--o-2), transparent); box-shadow: 0 0 18px 2px rgba(252, 144, 0, .6); opacity: .8; animation: hx-scan 4.2s cubic-bezier(.45, 0, .55, 1) infinite; }
  .hx-code { position: absolute; left: 42px; top: 8px; font: 600 13px/1 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: .16em; color: #FFD2A8; text-shadow: 0 0 8px rgba(252, 144, 0, .8); }
  .hx-code::after { content: 'EVERAN.SYS // 00 CORE'; }
  .hx[data-k="1"] .hx-code::after { content: 'EVERAN.SYS // 01 WEB'; }
  .hx[data-k="2"] .hx-code::after { content: 'EVERAN.SYS // 02 CUSTOM'; }
  .hx[data-k="3"] .hx-code::after { content: 'EVERAN.SYS // 03 POS'; }
  .hx-code i { display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--o-2); box-shadow: 0 0 8px var(--o-2); animation: hx-blink 1.2s steps(2) infinite; }
  .hx-ticks { position: absolute; right: 42px; bottom: 10px; display: flex; gap: 4px; align-items: flex-end; height: 22px; }
  .hx-ticks b { width: 4px; background: var(--o-2); opacity: .8; animation: hx-eq 1.1s ease-in-out infinite alternate; }
  .hx-ticks b:nth-child(1) { height: 40%; } .hx-ticks b:nth-child(2) { height: 90%; animation-delay: -.3s; } .hx-ticks b:nth-child(3) { height: 60%; animation-delay: -.6s; }
  .hx-ticks b:nth-child(4) { height: 100%; animation-delay: -.2s; } .hx-ticks b:nth-child(5) { height: 50%; animation-delay: -.8s; }
}

/* ---------- 手機加強科技感：HUD 框線、掃描光帶、系統代碼、光暈脈動（只在 760px 以下） ---------- */
@media (max-width: 760px) {
  .hx .tags { display: none; }
  .hx-scrim { background: linear-gradient(0deg, rgba(11, 13, 18, .96) 0%, rgba(11, 13, 18, .82) 36%, rgba(11, 13, 18, .15) 54%, transparent 66%); }
  .hx-bg { background:
      radial-gradient(70% 34% at 50% 30%, rgba(252, 144, 0, .22), transparent 70%),
      radial-gradient(90% 50% at 50% 32%, rgba(208, 74, 17, .3), transparent 75%),
      linear-gradient(180deg, #0B0D12, #12151C 60%, #0B0D12); animation: hx-breathe 5s ease-in-out infinite; }
  .hx-hud { display: block; position: absolute; left: 14px; right: 14px; top: 64px; height: 31%; z-index: 3; pointer-events: none; }
  .hx-hud > i { position: absolute; width: 22px; height: 22px; border: 2px solid var(--o-2); opacity: .85; box-shadow: 0 0 10px rgba(252, 144, 0, .5); }
  .hx-hud > i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
  .hx-hud > i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
  .hx-hud > i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
  .hx-hud > i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
  .hx-scan { position: absolute; left: 4%; right: 4%; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--o-2), #fff, var(--o-2), transparent); box-shadow: 0 0 16px 2px rgba(252, 144, 0, .6); opacity: .8; animation: hx-scan 3.6s cubic-bezier(.45, 0, .55, 1) infinite; }
  .hx-code { position: absolute; left: 30px; top: 6px; font: 600 11px/1 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: .14em; color: #FFD2A8; text-shadow: 0 0 8px rgba(252, 144, 0, .8); }
  .hx-code::after { content: 'EVERAN.SYS // 00 CORE'; }
  .hx[data-k="1"] .hx-code::after { content: 'EVERAN.SYS // 01 WEB'; }
  .hx[data-k="2"] .hx-code::after { content: 'EVERAN.SYS // 02 CUSTOM'; }
  .hx[data-k="3"] .hx-code::after { content: 'EVERAN.SYS // 03 POS'; }
  .hx-code i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--o-2); box-shadow: 0 0 8px var(--o-2); animation: hx-blink 1.2s steps(2) infinite; }
  .hx-ticks { position: absolute; right: 30px; bottom: 8px; display: flex; gap: 3px; align-items: flex-end; height: 18px; }
  .hx-ticks b { width: 3px; background: var(--o-2); opacity: .8; animation: hx-eq 1.1s ease-in-out infinite alternate; }
  .hx-ticks b:nth-child(1) { height: 40%; } .hx-ticks b:nth-child(2) { height: 90%; animation-delay: -.3s; } .hx-ticks b:nth-child(3) { height: 60%; animation-delay: -.6s; }
  .hx-ticks b:nth-child(4) { height: 100%; animation-delay: -.2s; } .hx-ticks b:nth-child(5) { height: 50%; animation-delay: -.8s; }
}
@keyframes hx-scan { 0% { top: 2%; opacity: 0; } 12% { opacity: .85; } 88% { opacity: .85; } 100% { top: 98%; opacity: 0; } }
@keyframes hx-blink { 50% { opacity: .2; } }
@keyframes hx-eq { to { transform: scaleY(.35); } }
@keyframes hx-breathe { 50% { filter: brightness(1.18); } }

@media (prefers-reduced-motion: reduce) {
  .hx-hint i::after, .hx-scan, .hx-code i, .hx-ticks b, .hx-bg { animation: none; }
  .hx-scan { display: none; }
  .js .hx-step .hx-inner { transition: none; }
}
