/* ══════════════════════════════════════════════
   showcase.css — 炫技層疊加樣式
   所有 class 一律以 `sc-` 開頭,避免撞到原站
   ══════════════════════════════════════════════ */

/* ── 1. SHADER & BLOOM layers ──────────────── */
#sc-bg-shader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}
#sc-bloom {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.45;
  filter: blur(32px);
}
/* CRT 掃描線 */
.sc-scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.01) 2px,
    rgba(255, 255, 255, 0.01) 3px
  );
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: overlay;
}
/* 把所有內容推到 shader 之上 */
body > nav,
body > header,
body > section,
body > footer,
body > main { position: relative; z-index: 3; }

/* ── 2. HERO 強化 ──────────────────────────── */
/* 訊號雷達:繞著 hero card 擴散的光圈 */
.hero-right { position: relative; }
.sc-radar {
  position: absolute;
  inset: -30px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 24px;
}
.sc-radar::before,
.sc-radar::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--brand);
  transform: translate(-50%, -50%) scale(0);
  animation: sc-radar-ping 5s cubic-bezier(.2,.8,.4,1) infinite;
  opacity: 0;
}
.sc-radar::after { animation-delay: 2.5s; border-color: var(--green); }
@keyframes sc-radar-ping {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(16); opacity: 0; }
}

/* Hero card 四角括號 */
.hero-card { position: relative; }
.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--brand);
  opacity: 0.4;
  z-index: 2;
  pointer-events: none;
}
.hero-card::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.hero-card::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* Hero 標題 "edge" 的色差層 */
.hero-title em { position: relative; display: inline-block; }
.hero-title em::before,
.hero-title em::after {
  content: attr(data-sc-text);
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  background: none;
  font-family: inherit;
  font-style: inherit;
  font-weight: inherit;
}
.hero-title em::before { color: rgba(255, 59, 107, 0.35); transform: translate(-2px, 0); }
.hero-title em::after { color: rgba(59, 255, 221, 0.35); transform: translate(2px, 0); }

/* 逐字出場 */
.sc-split-char {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(0.3em);
  animation: sc-char-in 0.7s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes sc-char-in {
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ── 3. LIVE TAPE 在 hero card 內 ─────────── */
.sc-tape {
  height: 26px;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 7, 10, 0.55);
  mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}
.sc-tape-track {
  display: flex;
  gap: 22px;
  padding: 5px 0;
  animation: sc-tape-scroll 40s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
@keyframes sc-tape-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.sc-tape-item {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sc-tape-item .n { color: var(--text-2); }
.sc-tape-item .up { color: var(--green); text-shadow: 0 0 6px rgba(74,222,128,0.4); }
.sc-tape-item .dn { color: var(--red); }

/* ── 4. TICKER(巨型走馬燈)────────────────── */
.sc-ticker {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(14, 16, 20, 0.7), rgba(8, 9, 11, 0.7));
  padding: 22px 0;
  overflow: hidden;
  position: relative;
}
.sc-ticker::before,
.sc-ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.sc-ticker::before { left: 0;  background: linear-gradient(90deg,  var(--bg), transparent); }
.sc-ticker::after  { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.sc-ticker-track {
  display: flex;
  gap: 56px;
  animation: sc-ticker-scroll 70s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
@keyframes sc-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.sc-ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--mono);
}
.sc-ticker-item .lb {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sc-ticker-item .vl {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.sc-ticker-item .vl.up { color: var(--green); text-shadow: 0 0 14px rgba(74,222,128,0.25); }
.sc-ticker-item .vl.dn { color: var(--red); }
.sc-ticker-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border-2);
}

/* ── 5. FORCE GRAPH section ──────────────── */
.sc-graph-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 100px var(--gutter);
}
.sc-graph-wrap {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(124, 140, 255, 0.05), transparent 70%),
    linear-gradient(180deg, rgba(14, 16, 20, 0.55), rgba(20, 23, 28, 0.55));
  border: 1px solid var(--border);
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.sc-graph-wrap::before,
.sc-graph-wrap::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--brand);
  opacity: 0.4;
  pointer-events: none;
}
.sc-graph-wrap::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.sc-graph-wrap::after  { bottom: 10px; right: 10px; border-left: none; border-top: none; }
#sc-graph { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#sc-graph:active { cursor: grabbing; }
.sc-graph-hint {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  gap: 16px;
}
.sc-graph-hint .k { display: flex; align-items: center; gap: 6px; }
.sc-graph-hint .dot { width: 8px; height: 8px; border-radius: 50%; }
.sc-graph-hint .d-p { background: var(--brand);  box-shadow: 0 0 8px var(--brand); }
.sc-graph-hint .d-m { background: var(--amber);  box-shadow: 0 0 8px var(--amber); }
.sc-graph-hint .d-b { background: var(--green);  box-shadow: 0 0 8px var(--green); }
.sc-graph-stats {
  position: absolute;
  bottom: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
}
.sc-graph-tip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0.6;
}

/* ── 6. FUNNEL / PIPELINE scrollytelling ──── */
.sc-scrolly-section {
  max-width: 100%;
  padding: 0;
}
.sc-scrolly-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 100px var(--gutter) 0;
}
.sc-scrolly {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px var(--gutter) 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
@media (max-width: 960px) { .sc-scrolly { grid-template-columns: 1fr; gap: 40px; } }

.sc-scrolly-text { padding: 18vh 0; }
@media (max-width: 960px) { .sc-scrolly-text { padding: 0; } }

.sc-step {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.25;
  transition: opacity 0.4s;
}
@media (max-width: 960px) {
  .sc-step { min-height: auto; padding: 40px 0; opacity: 1; }
}
.sc-step.active { opacity: 1; }
.sc-step h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  line-height: 1.15;
  color: var(--text);
}
.sc-step p {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
  max-width: 480px;
}
.sc-step .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
  margin-bottom: 14px;
  letter-spacing: 0.15em;
}
.sc-sticky {
  position: sticky;
  top: 14vh;
  height: 72vh;
  background:
    radial-gradient(ellipse at 72% 50%, rgba(74, 222, 128, 0.04), transparent 60%),
    linear-gradient(180deg, rgba(14, 16, 20, 0.55), rgba(20, 23, 28, 0.55));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 960px) {
  .sc-sticky { position: relative; top: 0; height: 50vh; min-height: 360px; }
}
#sc-stage { width: 100%; height: 100%; display: block; }
.sc-stage-label {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.sc-stage-counter {
  position: absolute;
  bottom: 16px; left: 16px;
  font-family: var(--mono);
}
.sc-stage-counter small {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.sc-stage-counter b {
  font-size: 30px;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: -0.02em;
}

/* ── 7. PERF meter ────────────────────────── */
.sc-perf {
  position: fixed;
  bottom: 12px; right: 12px;
  z-index: 200;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  display: flex;
  gap: 10px;
  letter-spacing: 0.03em;
  opacity: 0.65;
}
.sc-perf:hover { opacity: 1; }
.sc-perf b { color: var(--green); font-weight: 500; }
.sc-perf .warn { color: var(--amber); }

/* ── 8. reveal on scroll(相容原 reveal 邏輯) */
.sc-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.3,1), transform 0.9s cubic-bezier(.2,.7,.3,1);
}
.sc-reveal.in { opacity: 1; transform: none; }

/* ── 9. reduced motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #sc-bg-shader, #sc-bloom { display: none !important; }
  .sc-tape-track, .sc-ticker-track,
  .sc-radar::before, .sc-radar::after { animation: none !important; }
}
