/* 基礎設定：極簡暗色調調性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    background-color: #030712;
    color: #ffffff;
    overflow-x: hidden;
}

/* 讓 Matrix 數位雨 Canvas 固定在最底層背景，且自帶向下的漸變淡出 */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15; /* 保持精緻淡淡的背景襯托 */
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 55%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 55%);
}

/* 讓 WebGL Canvas 固定在最底層背景 */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none; /* 允許滑鼠穿透去點擊前景文字 */
}

/* 前景滾動容器 */
.scroll-container {
    position: relative;
    z-index: 2;
}

/* 每一層面板區塊的基本結構：全螢幕 + 自動貼齊 */
.panel {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.content-wrapper {
    max-width: 650px;
    opacity: 0; /* 預設隱藏，由 GSAP 控制淡入淡出 */
    transform: translateY(30px);
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 35px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Hero Section 面板無背景邊框 */
.hero-wrapper {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* 文字對齊樣式 */
.left-align { margin-right: auto; }
.right-align { margin-left: auto; }
.center-align { margin: 0 auto; text-align: center; }

/* 標題與排版細節 */
.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 55%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.hero-statement {
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.5;
    color: #f1f5f9;
}

.section-number {
    font-size: 1rem;
    color: #38bdf8;
    font-family: monospace;
    display: block;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 30%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 雙語輔助標題與文字樣式 */
.en-sub {
    font-size: 1.35rem;
    font-weight: 400;
    display: inline-block;
    margin-left: 8px;
    color: #94a3b8;
    background: none;
    -webkit-text-fill-color: initial;
    vertical-align: baseline;
    letter-spacing: 1px;
}

.en-sub-block {
    display: block;
    font-size: 1.15rem;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 6px;
    background: none;
    -webkit-text-fill-color: initial;
    letter-spacing: 1px;
}

.core-concept {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 25px;
    font-style: italic;
}

.core-concept-en {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.95rem;
    color: #64748b;
    font-style: normal;
    font-weight: 300;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #cbd5e1;
    letter-spacing: 1px;
}

.en-item {
    font-size: 0.88rem;
    color: #64748b;
    margin-left: 6px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* 行動呼籲按鈕 */
.cta-button {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 35px;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 2px;
    background: rgba(56, 189, 248, 0.05);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #38bdf8;
    color: #030712;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
}

/* 頂部固定導覽列 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 100;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.5));
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link-en {
    font-size: 0.78rem;
    color: #64748b;
    margin-left: 2px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-link:hover .nav-link-en {
    color: #94a3b8;
}

.nav-cta {
    padding: 8px 18px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.05);
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: #38bdf8;
    color: #030712;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.nav-cta-en {
    font-size: 0.78rem;
    font-weight: 400;
    margin-left: 2px;
    opacity: 0.85;
}

/* Hero Section 核心排版 */
.hero-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.hero-company-name {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 12px;
    color: #ffffff;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.4));
    transition: color 0.4s ease, filter 0.4s ease, text-shadow 0.4s ease;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 4px;
    color: #ffffff;
    opacity: 0.95;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transition: color 0.4s ease, opacity 0.4s ease;
}

.hero-subtitle-en {
    font-size: 1.05rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-top: -5px;
    opacity: 0.85;
    transition: color 0.4s ease;
}

.contact-desc {
    font-size: 1.1rem;
    color: #f1f5f9;
}

.contact-desc-en {
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.cta-button-en {
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 4px;
    opacity: 0.85;
}

/* Contact Us Section Logo */
.contact-logo-badge {
    margin-bottom: 25px;
}

.contact-logo {
    width: 105px;
    height: auto;
    filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.35));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.contact-logo:hover {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 0 35px rgba(0, 210, 255, 0.6));
}

/* 頁尾樣式 */
.site-footer {
    position: relative;
    z-index: 2;
    background: rgba(5, 7, 12, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px 10%;
    scroll-snap-align: start;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    height: 32px;
    width: auto;
    opacity: 0.9;
}

.footer-tagline {
    font-size: 0.85rem;
    color: #64748b;
    letter-spacing: 1px;
}

.footer-copy {
    font-size: 0.85rem;
    color: #64748b;
}

/* 主題切換按鈕 (Theme Toggle Button) */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

body.light-mode .theme-toggle {
    border-color: rgba(15, 23, 42, 0.2);
    color: #475569;
}

body.light-mode .theme-toggle:hover {
    color: #0f172a;
    border-color: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
}

body.light-mode .theme-toggle .sun-icon {
    display: none;
}

body.light-mode .theme-toggle .moon-icon {
    display: block;
}

/* ==========================================
   明亮模式 (Light Mode) 完整調性設計
   ========================================== */
body, .content-wrapper, .navbar, .site-footer, .nav-link, .nav-cta, .cta-button {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

body.light-mode {
    background-color: #f8fafc;
    color: #0f172a;
}

body.light-mode .content-wrapper {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

body.light-mode .hero-wrapper {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
}

body.light-mode .hero-company-name {
    color: #0f172a;
    background: none;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.15));
    text-shadow: none;
}

body.light-mode .hero-subtitle {
    color: #0f172a;
    text-shadow: none;
    opacity: 0.9;
}

body.light-mode .hero-subtitle-en {
    color: #475569;
}

body.light-mode .contact-logo {
    filter: drop-shadow(0 0 20px rgba(2, 132, 199, 0.25));
}

body.light-mode .contact-logo:hover {
    filter: drop-shadow(0 0 30px rgba(2, 132, 199, 0.45));
}

body.light-mode .tagline {
    color: #475569;
}

body.light-mode .hero-statement {
    color: #1e293b;
}

body.light-mode .section-number {
    color: #0284c7;
}

body.light-mode h2 {
    background: linear-gradient(135deg, #0f172a 30%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .en-sub,
body.light-mode .en-sub-block {
    color: #64748b;
}

body.light-mode .core-concept {
    color: #475569;
}

body.light-mode .core-concept-en,
body.light-mode .en-item,
body.light-mode .contact-desc-en {
    color: #64748b;
}

body.light-mode .contact-desc {
    color: #1e293b;
}

body.light-mode .feature-list li {
    color: #334155;
}

body.light-mode .nav-link-en {
    color: #94a3b8;
}

body.light-mode .nav-link:hover .nav-link-en {
    color: #0f172a;
}

body.light-mode .cta-button {
    border-color: #0284c7;
    color: #0284c7;
    background: rgba(2, 132, 199, 0.06);
}

body.light-mode .cta-button:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.35);
}

body.light-mode .navbar {
    background: rgba(248, 250, 252, 0.85);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-mode .nav-link {
    color: #475569;
}

body.light-mode .nav-link:hover {
    color: #0f172a;
}

body.light-mode .nav-cta {
    border-color: rgba(2, 132, 199, 0.5);
    color: #0284c7;
    background: rgba(2, 132, 199, 0.06);
}

body.light-mode .nav-cta:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(2, 132, 199, 0.3);
}

body.light-mode .nav-logo {
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.1));
}

body.light-mode .nav-logo:hover {
    filter: drop-shadow(0 0 14px rgba(2, 132, 199, 0.35));
}

body.light-mode .hero-logo {
    filter: drop-shadow(0 0 20px rgba(2, 132, 199, 0.25));
}

body.light-mode .hero-logo:hover {
    filter: drop-shadow(0 0 30px rgba(2, 132, 199, 0.45));
}

body.light-mode .site-footer {
    background: rgba(241, 245, 249, 0.95);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-mode .footer-tagline,
body.light-mode .footer-copy {
    color: #64748b;
}

/* 響應式裝置樣式 (Mobile & Tablet) */
@media (max-width: 768px) {
    .navbar {
        height: 60px;
    }
    
    .nav-menu {
        gap: 15px;
    }

    .nav-link {
        font-size: 0.85rem;
    }
    
    .nav-logo {
        height: 30px;
    }

    .contact-logo {
        width: 80px;
    }

    .hero-company-name {
        font-size: 2.8rem;
        letter-spacing: 6px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .hero-subtitle-en {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .en-sub {
        display: block;
        margin-left: 0;
        margin-top: 4px;
        font-size: 1.1rem;
    }

    .nav-link-en, .nav-cta-en {
        display: none;
    }

    .main-title {
        font-size: 2.2rem;
    }
    
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
}
