/* 
 * AD4D Website Stylesheet
 * Theme: Dark FinTech / Modern SaaS
 * Primary Color: #0A66FF
 */

:root {
    --primary-color: #0A66FF;
    --primary-dark: #06294A;
    --accent-color: #38bdf8;
    --bg-dark: #0f1720;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --header-height: 80px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(10, 102, 255, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #005ce6;
    box-shadow: 0 6px 20px rgba(10, 102, 255, 0.23);
}

.section-padding {
    padding: 80px 0;
}

.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* Background Animation Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

/* Header & Nav */
header {
    height: var(--header-height);
    background-color: rgba(15, 23, 32, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 30px;
}

/* Cards & Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
}

.icon-box {
    width: 50px;
    height: 50px;
    background: rgba(10, 102, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 24px;
}

/* About Page Specifics */
.about-hero-img img, .case-img img {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Forms */
.contact-form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background-color: #0b1118;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-muted);
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.disclaimer {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 10px;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-dark);
        width: 100%;
        height: calc(100vh - var(--header-height));
        text-align: center;
        transition: 0.3s;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ===== HERO VIDEO FIX (TEXT VISIBILITY) ===== */

.hero.hero-video {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20vw;
}

.hero-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 22, 0.72);
    background: rgb(0 0 0 / 25%);
    background: rgb(106 106 106 / 22%);
    z-index: 2;
}

/* 🔥 關鍵：文字一定要在最上層 */
.hero-video-content {
    position: relative;
    z-index: 3;
    text-align: center;
    text-align: left;
    max-width: 700px;
    padding: 0;
    max-width: 1200px;
}

.hero-video-content h1 {
    color: #4da3ff;
    color: #689EF9;
    font-size: clamp(36px, 5vw, 56px);
    margin-bottom: 20px;
}

.hero-video-content p {
    color: #d7e3ff;
    font-size: 20px;
    line-height: 1.7;
    margin-bottom: 36px;
}

@media screen and (max-width: 768px) {
    .hero.hero-video {
        padding: 0 5vw;
    }

    .hero-video-content h1 {
        font-size: clamp(30px, 5vw, 56px);
    }
    .hero-video-content p {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 20px;
    }
}
