/* ==========================================================================
   VAEL — 電影級 Scroll 敘事品牌站
   曜石黑 × 冷光（青綠 #46E6CF → 紫羅蘭 #8B7CF6）
   母題：縫光（The Seam）— 一條貫穿全站嘅發光線
   佈局策略：預設 CSS = 無 JS / reduced-motion 嘅完整靜態版；
             body.fx / body.fx-desktop 由 JS 按 matchMedia 加上，先開啟電影版佈局。
   ========================================================================== */

:root {
  /* 曜石 × 冷光 */
  --bg: #08090C;
  --bg-2: #0B0D12;
  --text: #ECEEF3;
  --muted: #8A93A3;
  --faint: #5C6372;
  --teal: #46E6CF;
  --violet: #8B7CF6;
  --seam-hot: #CFF6EE;
  --accent-grad: linear-gradient(135deg, var(--teal), var(--violet));

  /* Vael wordmark 官方色（深底版） */
  --logo-ink: #F4EFE6;
  --logo-stone: #B8A98F;
  --logo-line: rgba(184, 169, 143, .9);

  /* Liquid Glass（冷調） */
  --surface: rgba(24, 28, 36, .45);
  --surface-2: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .2);
  --border-soft: rgba(255, 255, 255, .1);
  --sheen: inset 0 1px 0 rgba(255, 255, 255, .38);
  --glass-blur: saturate(160%) blur(28px);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow: 0 18px 46px rgba(0, 0, 0, .5);
  --radius: 20px;

  --sans: "Noto Sans TC", -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang HK", sans-serif;
  --latin: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  color-scheme: dark;
}

/* ====== 基礎 ====== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: 76px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  background:
    radial-gradient(820px 680px at 12% 4%,   rgba(70, 230, 207, .10), transparent 55%),
    radial-gradient(720px 600px at 92% 12%,  rgba(91, 140, 240, .10), transparent 52%),
    radial-gradient(780px 760px at 84% 104%, rgba(139, 124, 246, .12), transparent 55%),
    radial-gradient(680px 680px at 14% 98%,  rgba(70, 230, 207, .06), transparent 55%),
    linear-gradient(160deg, #0B0D12 0%, #08090C 52%, #07080B 100%);
  background-color: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
i { font-style: normal; }
svg { display: block; }

::selection { background: rgba(70, 230, 207, .85); color: #06110F; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(70, 230, 207, .35);
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1E232E; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2A3140; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ====== Vael wordmark（官方規格 1:1 移植） ======
   雙色滑右錯位剪切：下半象牙、上半石褐右滑 size×0.085，中線伸出 size×0.12 */
.vael {
  --vael-size: 60px;
  position: relative;
  display: inline-block;
  font: 600 var(--vael-size)/1 var(--latin);
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.vael-ghost { display: block; color: transparent; }
.vael-ink, .vael-stone { position: absolute; inset: 0; }
.vael-ink i, .vael-stone i { display: block; }
.vael-ink   { color: var(--logo-ink);   clip-path: inset(49% 0 0 0); }
.vael-stone { color: var(--logo-stone); clip-path: inset(0 0 51% 0);
              transform: translateX(calc(var(--vael-size) * .085)); }
.vael-line {
  position: absolute;
  left:  calc(var(--vael-size) * -.12);
  right: calc(var(--vael-size) * -.12);
  top: 49%;
  height: max(1px, calc(var(--vael-size) * .0127));
  background: linear-gradient(90deg, transparent,
              var(--logo-line) 12%, var(--logo-line) 88%, transparent);
}
/* 縫光版中線：中段守官方石褐，兩端燃起青／紫（品牌 × 主題嘅橋） */
.vael--seamed .vael-line {
  background: linear-gradient(90deg, transparent,
              var(--teal) 5%, var(--logo-line) 28%,
              var(--logo-line) 72%, var(--violet) 95%, transparent);
}

/* ====== 縫光 The Seam ====== */
.seam {
  position: fixed;
  top: 50%; left: 50%;
  width: min(64vw, 760px);
  height: 2px;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.seam-core {
  position: absolute; inset: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent,
              var(--seam-hot) 18%, #FFFFFF 50%, var(--seam-hot) 82%, transparent);
}
.seam-glow {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 10px;
  background: linear-gradient(90deg, transparent,
              rgba(70, 230, 207, .55) 20%, rgba(143, 233, 220, .7) 50%,
              rgba(139, 124, 246, .55) 80%, transparent);
  filter: blur(9px);
  opacity: .85;
}
.seam-node {
  position: absolute; top: 50%; left: 2%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--seam-hot);
  box-shadow: 0 0 14px 5px rgba(70, 230, 207, .55);
  transform: translate(-50%, -50%);
  opacity: 0;
}

/* ====== 通用元件 ====== */
.scene-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
}
.scene-label span { color: var(--teal); }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal);
}

.tags {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease,
              border-color .25s ease, background .25s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent-grad);
  color: #06110F;
  box-shadow: 0 6px 18px rgba(70, 230, 207, .28);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(70, 230, 207, .4);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--teal); background: rgba(255, 255, 255, .13); }

.btn-sm { padding: 9px 20px; font-size: 13.5px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ====== 導覽列 ====== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled {
  background: rgba(8, 9, 12, .72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom-color: var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 64px;
  padding-inline: clamp(20px, 4vw, 48px);
}
.brand { display: inline-flex; align-items: center; }
.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--muted);
  transition: color .2s ease;
  padding: 6px 2px;
}
.nav-links a:hover { color: var(--teal); }

/* ====== 場景通用 ====== */
.scene { position: relative; z-index: 2; }

/* ====== 場景 1 · Hero ====== */
.scene-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-halo {
  position: absolute;
  top: 50%; left: 50%;
  width: min(90vw, 980px);
  aspect-ratio: 1.6;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(46% 42% at 38% 46%, rgba(70, 230, 207, .12), transparent 70%),
    radial-gradient(44% 40% at 64% 54%, rgba(139, 124, 246, .12), transparent 70%);
  pointer-events: none;
  animation: haloBreath 9s ease-in-out infinite;
}
@keyframes haloBreath {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}
.hero-stage {
  position: relative;
  text-align: center;
  will-change: transform, opacity;
}
.hero-vael { --vael-size: clamp(72px, 15vw, 168px); }
.hero-tagline {
  margin-top: clamp(30px, 5vh, 48px);
  font-size: clamp(16px, 2.2vw, 21px);
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--text);
}
.hero-sub {
  margin-top: 14px;
  font-size: clamp(13px, 1.6vw, 15px);
  letter-spacing: .1em;
  color: var(--muted);
}
.hero-hint {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.hint-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .4em;
  color: var(--faint);
}
.hint-line {
  width: 1px; height: 44px;
  background: linear-gradient(180deg, var(--teal), transparent);
  animation: hintDrop 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hintDrop {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ====== 場景 2 · 理念 ====== */
.scene-manifesto { padding: clamp(80px, 12vh, 140px) clamp(24px, 6vw, 72px); }
.scene-manifesto .scene-label { margin-bottom: 48px; }
.manifesto-stage { position: relative; }
.principle { max-width: 560px; }
.principle + .principle { margin-top: clamp(48px, 8vh, 88px); }
.p-num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--teal);
  opacity: .55;
}
.p-title {
  margin-top: 10px;
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
}
.p-body {
  margin-top: 14px;
  font-size: clamp(15px, 1.8vw, 18px);
  letter-spacing: .06em;
  color: var(--muted);
}

/* 電影版：pinned 舞台，三條原則圍住縫光左右交替 */
.fx .scene-manifesto {
  height: 100vh;
  padding: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.fx .scene-manifesto .scene-label {
  position: absolute;
  top: 92px; left: clamp(24px, 6vw, 72px);
  margin: 0;
  z-index: 3;
}
.fx .manifesto-stage { position: relative; width: 100%; height: 100%; }
.fx .principle { position: absolute; margin: 0; width: min(40vw, 520px); }
.fx .principle + .principle { margin-top: 0; }
.fx .principle:nth-child(1) { left: clamp(24px, 8vw, 120px);  top: 20%; }
.fx .principle:nth-child(2) { right: clamp(24px, 8vw, 120px); top: 42%; text-align: right; }
.fx .principle:nth-child(3) { left: clamp(24px, 8vw, 120px);  top: 64%; }

/* 手機電影版：置中疊排 */
@media (max-width: 768px) {
  .fx .principle { width: 84vw; left: 8vw !important; right: auto !important; text-align: left !important; }
  .fx .principle:nth-child(1) { top: 16%; }
  .fx .principle:nth-child(2) { top: 42%; }
  .fx .principle:nth-child(3) { top: 68%; }
}

/* ====== 場景 3 · 作品 ====== */
.scene-works { padding: clamp(80px, 12vh, 140px) clamp(24px, 6vw, 72px); }
.scene-works .scene-label { margin-bottom: 48px; }

.works-track {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vh, 48px);
}

.work-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), var(--sheen);
  padding: clamp(28px, 4vw, 56px);
  max-width: 820px;
}
.work-num {
  position: absolute;
  top: -0.28em; right: -0.06em;
  font-family: var(--mono);
  font-size: clamp(120px, 16vw, 220px);
  font-weight: 500;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .14);
  pointer-events: none;
  user-select: none;
}
.work-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}
.work-text { flex: 1; min-width: 0; }
.work-text h3 {
  margin-top: 16px;
  font-family: var(--latin);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.work-text h3 .by {
  font-size: .5em;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--logo-stone);
}
.work-text .desc {
  margin-top: 14px;
  font-size: clamp(14.5px, 1.7vw, 16.5px);
  letter-spacing: .04em;
  color: var(--muted);
  max-width: 420px;
}
.work-text .tags { margin-top: 22px; }
.work-visual { flex: none; width: clamp(120px, 12vw, 170px); }
.meld-mini { width: 100%; height: auto; }
.meld-pulse { animation: seamPulse 2.8s ease-in-out infinite; }
@keyframes seamPulse {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* 桌面電影版：pinned 橫向畫廊 */
.fx-desktop .scene-works {
  height: 100vh;
  padding: 0;
  overflow: hidden;
}
.fx-desktop .scene-works .scene-label {
  position: absolute;
  top: 92px; left: clamp(24px, 6vw, 72px);
  margin: 0;
  z-index: 3;
}
.fx-desktop .works-track {
  flex-direction: row;
  align-items: center;
  height: 100%;
  width: max-content;
  gap: 6vw;
  padding-inline: max(8vw, calc(50vw - 360px));
  will-change: transform;
}
.fx-desktop .work-card {
  flex: none;
  width: min(66vw, 720px);
  max-width: none;
}

/* ====== 場景 4 · 關於 ====== */
.scene-maker {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: clamp(100px, 16vh, 180px) clamp(24px, 6vw, 72px);
}
.maker-card { max-width: 640px; margin-inline: auto; }
.maker-card .scene-label { margin-bottom: 30px; }
.maker-card h2 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: .04em;
}
.maker-body {
  margin-top: 26px;
  font-size: clamp(15.5px, 1.9vw, 18px);
  letter-spacing: .05em;
  line-height: 2.1;
  color: var(--text);
}
.maker-note {
  margin-top: 20px;
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ====== 場景 5 · 聯絡終章 ====== */
.scene-contact {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(80px, 10vh, 120px) 24px;
  overflow: hidden;
  text-align: center;
}
.contact-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact-vael { --vael-size: clamp(52px, 9vw, 104px); }
.contact-body { margin-top: clamp(36px, 6vh, 56px); }
.contact-body h2 {
  font-size: clamp(24px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: .08em;
}
.contact-body .actions { margin-top: 34px; }
.contact-email {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--faint);
}

/* ====== 頁尾 ====== */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 30px clamp(24px, 6vw, 72px) 44px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--faint);
}
.footer-note { display: inline-flex; align-items: center; gap: 12px; }
.footer-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 8px rgba(70, 230, 207, .5);
}

/* ====== Toast（自動淡出） ====== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  background: rgba(20, 24, 31, .85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .04em;
  box-shadow: var(--shadow-sm), var(--sheen);
  cursor: pointer;
  opacity: 1;
  transition: opacity .4s ease;
}
.toast.show {
  display: inline-flex;
  animation: toastIn .3s cubic-bezier(.22, 1, .36, 1);
}
.toast.fading { opacity: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ====== Reduced motion：全靜態可讀 ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .seam { display: none; }
  .hero-hint { display: none; }
}
