:root {
  --bg-deep: #050508;
  --bg-surface: #0f1119;
  --accent-primary: #FF4D00; /* J&M Logo 橘色 */
  --accent-secondary: #7c6cf0; /* 紫色補色 */
  --accent-glow: #5b4bdb;
  --text-main: #f2f4f8;
  --text-muted: #949ba8;
  
  /* 玻璃與光澤參數 */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 20px;
  --shadow-soft: 0 20px 40px -10px rgba(0,0,0,0.5);
  --sheen-gradient: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* 響應式間距變數 */
  --section-spacing: 80px;
  --container-padding: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0; font-family: var(--font-body); color: var(--text-main);
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 20% 0%, #1a1438 0%, transparent 40%),
                    radial-gradient(circle at 80% 90%, #130f24 0%, transparent 40%);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

/* --- 噪點紋理 --- */
.noise-overlay {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 背景光場 --- */
.lightfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: 
    radial-gradient(800px circle at 50% -20%, rgba(124, 108, 240, 0.08), transparent 60%),
    radial-gradient(600px circle at 90% 60%, rgba(255, 77, 0, 0.03), transparent 50%);
  filter: blur(60px);
}

/* --- Navigation --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 5, 8, 0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px var(--container-padding);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; background: var(--accent-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; border-radius: 8px; font-size: 14px;
}
.brand-name {
  font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(90deg, #fff, #d1d5db); -webkit-background-clip: text; color: transparent;
}
.links { display: flex; gap: 24px; align-items: center; }
.desktop-links { display: flex; gap: 24px; }
.desktop-links a {
  text-decoration: none; color: var(--text-muted); font-size: 0.95rem; transition: color 0.3s; font-weight: 500;
}
.desktop-links a:hover { color: #fff; }

.btn-glow {
  padding: 8px 20px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 50px;
  color: #fff; text-decoration: none; font-size: 0.9rem;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.btn-glow:hover {
  background: var(--accent-secondary); border-color: var(--accent-secondary);
  box-shadow: 0 0 25px rgba(124, 108, 240, 0.5);
}

/* ====== 核心：光澤動畫 (Interactive Real Glass) ====== */

/* 基礎設定 */
.continuous-sheen, .hover-sheen, .video-card {
  position: relative;
  overflow: hidden !important;
  /* 初始化變數，避免 JS 載入前報錯 */
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* 1. Hero Card: 保持原本的「自動優雅掃光」 (因為使用者不會一直在上面滑動) */
.continuous-sheen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  mix-blend-mode: overlay;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.02) 40%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.02) 60%, transparent 70%);
  transform: translateX(-150%) skewX(-25deg);
  animation: sheen-natural 7s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes sheen-natural {
  0% { transform: translateX(-150%) skewX(-25deg); }
  30% { transform: translateX(200%) skewX(-25deg); }
  100% { transform: translateX(200%) skewX(-25deg); }
}

/* 2. 按鈕與影片卡片: 改為「跟隨滑鼠」的聚光燈效果 */
.hover-sheen::after,
.video-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  
  /* 關鍵：混合模式讓光看起來像從內部透出來，而不是蓋在上面 */
  mix-blend-mode: overlay; 
  
  /* 預設透明 (隱藏) */
  opacity: 0;
  
  /* 製作一個「光暈聚光燈」，位置由 JS 的 --mouse-x/y 控制 */
  background: radial-gradient(
    600px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.35), /* 中心最亮 */
    rgba(255, 255, 255, 0.06) 40%, /* 擴散光暈 */
    transparent 80%
  );
  
  /* 移開時的動畫：優雅地淡出 (Fade Out) */
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 滑鼠懸停時：顯示光澤 (Fade In) */
.hover-sheen:hover::after,
.video-card:hover::after {
  opacity: 1;
  /* 進場時稍微快一點，出發時慢一點，製造靈敏度 */
  transition: opacity 0.2s ease-out;
}

/* 手機版：因為沒有 Hover，保持原本的自動掃光或降低效果 */
@media (max-width: 768px) {
  .hover-sheen::after, .video-card::after { display: none; } /* 手機上為了效能與體驗，通常不開啟滑鼠追蹤 */
}
/* ========================================== */


/* --- Layout --- */
main { max-width: 1200px; margin: 0 auto; padding: 0 var(--container-padding); position: relative; z-index: 1; }
.section { padding: var(--section-spacing) 0; }
.section-header { margin-bottom: 40px; }
.muted { color: var(--text-muted); font-size: 0.95rem; }
h1, h2, h3 { margin-top: 0; font-weight: 700; color: #fff; }

/* --- Hero Section --- */
.hero {
  min-height: 85vh; display: flex; align-items: center;
  padding-top: 40px; padding-bottom: 60px;
}
.hero-content-wrapper {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 60px; width: 100%;
}
.tag-pill {
  display: inline-block; padding: 6px 12px; background: rgba(255,255,255,0.08);
  border-radius: 100px; font-size: 0.8rem; color: var(--accent-secondary);
  font-weight: 600; margin-bottom: 24px; border: 1px solid rgba(124, 108, 240, 0.2);
}
.hero-title {
  font-family: var(--font-heading); font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.15; margin-bottom: 24px; letter-spacing: -0.02em;
}
.gradient-text-hero {
  background: linear-gradient(120deg, #fff 20%, var(--accent-secondary) 80%);
  -webkit-background-clip: text; color: transparent;
}
.lead { font-size: 1.15rem; color: #b0b8c4; margin-bottom: 40px; max-width: 90%; }
.hero-actions { display: flex; gap: 16px; margin-bottom: 40px; flex-wrap: wrap; }
.cta {
  padding: 14px 28px; border-radius: 12px; font-weight: 600; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta.primary {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-glow));
  color: #fff; box-shadow: 0 10px 25px rgba(91, 75, 219, 0.3);
}
.cta.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 35px rgba(91, 75, 219, 0.4); }
.cta.secondary { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.cta.secondary:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.clients-row { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.client-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.client-list { font-size: 0.9rem; color: #fff; font-weight: 500; }

/* --- Glass Panel & Hero Card --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft), inset 0 0 30px rgba(255,255,255,0.02);
  border-radius: var(--radius-lg);
}
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

#heroCard { padding: 0; }
/* 強化卡片邊緣光 */
#heroCard::before {
  content:''; position:absolute; inset:0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

.hero-img-wrapper {
  width: 100%; aspect-ratio: 16/9; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
}
.hero-img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.card-body { padding: 28px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tag.small { font-size: 0.7rem; background: var(--accent-primary); padding: 2px 8px; border-radius: 4px; color: #fff; }
.date { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-heading); font-style: italic; }
#heroCard h3 { font-size: 1.4rem; margin-bottom: 8px; }

/* --- Video Grid --- */
.videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.video-card {
  background: var(--bg-surface); border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08); transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-8px); box-shadow: 0 20px 40px -5px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.25);
}
.thumb-wrapper { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.thumb-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.video-card:hover .thumb-wrapper img { transform: scale(1.05); }
.play-btn-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s;
}
.video-card:hover .play-btn-overlay { opacity: 1; }
.play-icon {
  width: 50px; height: 50px; background: rgba(255,255,255,0.95); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.play-icon::after { content:''; border-left: 12px solid var(--accent-primary); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.video-card .meta { padding: 20px; }
.video-title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 1.1rem; }
.video-desc { font-size: 0.85rem; color: var(--text-muted); }

/* --- Sections & Clients --- */
.two-col-section { display: grid; grid-template-columns: 1fr 350px; gap: 40px; align-items: start; }
.fb-container { overflow: hidden; padding: 0; }
.info-box { padding: 30px; }
.links-list { list-style: none; padding: 0; margin: 0; }
.links-list li { margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 12px; }
.links-list a { color: #fff; text-decoration: none; display: flex; justify-content: space-between; }
.links-list .arrow { opacity: 0.5; transition: transform 0.2s; }
.links-list a:hover .arrow { transform: translate(3px, -3px); opacity: 1; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card-grid .card { padding: 30px; }
.card-icon { font-size: 2rem; margin-bottom: 16px; }
.team-member { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.team-member strong { display: block; color: #fff; }
.team-member span { font-size: 0.85rem; color: var(--text-muted); display: block; margin-top: 4px; }

.contact-panel { max-width: 600px; margin: 0 auto; padding: 50px; text-align: center; }
.contact-details { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; text-align: left; background: rgba(0,0,0,0.2); padding: 24px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.contact-item { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.contact-item:last-child { border: none; padding-bottom: 0; }
.contact-item .value { font-weight: 600; color: #fff; }
.contact-item .highlight { color: var(--accent-primary); }
.contact-item .link { color: var(--accent-secondary); text-decoration: none; }

.footer { border-top: 1px solid rgba(255,255,255,0.05); padding: 40px 0; margin-top: 60px; font-size: 0.9rem; color: var(--text-muted); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--container-padding); display: flex; justify-content: space-between; }
.footer-links a { color: var(--text-muted); text-decoration: none; margin-left: 20px; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }

/* --- Animations Base --- */
[data-anim] { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
body.is-loaded [data-anim] { opacity: 1; transform: translateY(0); }

/* =========================================
   RESPONSIVE OPTIMIZATION (移動端優化核心)
========================================= */

/* Tablet & Small Desktop (低於 1024px) */
@media (max-width: 1024px) {
  :root { --section-spacing: 60px; }
  .hero-title { font-size: 3rem; }
  .hero-content-wrapper { grid-template-columns: 1fr 1fr; gap: 40px; }
  .two-col-section { grid-template-columns: 1fr; gap: 30px; }
}

/* Mobile Devices (低於 768px) */
@media (max-width: 768px) {
  :root {
    --section-spacing: 50px; /* 減少區塊間距 */
    --container-padding: 20px; /* 減少左右邊距 */
  }
  
  /* 導航列：隱藏桌面連結，只留按鈕 */
  .desktop-links { display: none; }
  .nav-inner { padding: 12px var(--container-padding); }

  /* Hero 區塊：改為垂直堆疊 */
  .hero { min-height: auto; padding-top: 20px; }
  .hero-content-wrapper { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .hero-left { order: 2; /* 手機上文字在下 */ }
  .hero-right { order: 1; /* 手機上圖片在上 */ }
  
  .hero-title { font-size: 2.5rem; margin-bottom: 16px; }
  .lead { font-size: 1rem; margin: 0 auto 30px auto; }
  .hero-actions { justify-content: center; }
  .clients-row { align-items: center; }

  /* Hero Card 手機適配 */
  #heroCard { max-width: 500px; margin: 0 auto; }
  .hero-img-wrapper { aspect-ratio: 4/3; /* 手機上稍微高一點的比例更好看 */ }
  .floating { animation: none; /* 手機上移除浮動動畫，避免暈眩 */ }

  /* 其他區塊 */
  .section-header { text-align: center; margin-bottom: 30px; }
  .contact-panel { padding: 30px 20px; }
  .contact-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links a { margin: 0 10px; }
}

/* Small Mobile (低於 480px) */
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .cta { padding: 12px 20px; width: 100%; text-align: center; } /* 按鈕滿寬 */
  .hero-actions { flex-direction: column; gap: 12px; }
  .brand-name { font-size: 1rem; }
  .card-body { padding: 20px; }
}