﻿/* =========================================
    1. VARIABLES (THEME & BRAND)
========================================= */
:root {
    --ep-dark: #5830A8;  
    --ep-light: #8058D0; 
    
    --bg-color: #020617;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    --cursor-color: var(--ep-light); 
    --stroke-color: rgba(255, 255, 255, 0.3);
    /* แยกตัวแปรสีเมนูเป็นบน (เข้ม) และ ล่าง (โปร่งใส) */
    --nav-glass-top: rgba(2, 6, 23, 0.95);
    --nav-glass-bottom: rgba(2, 6, 23, 0);
    
    --blob-1: rgba(88, 48, 168, 0.6);
    --blob-2: rgba(50, 20, 100, 0.6);
    --blob-3: rgba(128, 88, 208, 0.4);
    
    --font-family: 'Prompt', sans-serif;
    --container-width: 1920px;
}

body.light-theme {
    --bg-color: #f8fafc; 
    --text-primary: #1e1b4b; 
    --text-secondary: #475569; 
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(226, 232, 240, 0.8);
    --card-shadow: 0 4px 30px rgba(148, 163, 184, 0.15);
    
    --cursor-color: var(--ep-dark); 
    --stroke-color: rgba(88, 48, 168, 0.2); 
    /* สลับเป็นสีสว่างและโปร่งใส */
    --nav-glass-top: rgba(255, 255, 255, 0.85);
    --nav-glass-bottom: rgba(255, 255, 255, 0);

    --blob-1: rgba(88, 48, 168, 0.15);
    --blob-2: rgba(128, 88, 208, 0.15);
    --blob-3: rgba(100, 50, 180, 0.1);
}

/* =========================================
    2. RESET & BASE STYLES
========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: none;
    transition: background-color 0.5s ease, color 0.5s ease;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: transparent; cursor: none; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
strong, b { font-weight: 700; color: var(--text-primary); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--ep-dark); border-radius: 4px; }

/* =========================================
    3. LAYOUT & UTILITIES
========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    /* เพิ่มระยะห่างจากขอบจอเริ่มต้นเป็น 2rem (32px) */
    padding: 0 2rem; 
}

/* เพิ่มระยะขอบให้กว้างขึ้นอีกสำหรับหน้าจอ Tablet และ Desktop */
@media (min-width: 768px) {
    .container {
        padding: 0 4rem; 
    }
}

/* เมื่อหน้าจอใหญ่กว่า 1280px (Desktop) ให้เพิ่มระยะขอบเพื่อบีบเนื้อหาเข้าหากัน */
@media (min-width: 1280px) {
    .container {
        padding: 0 8rem; 
    }
}

.section-py { padding: 6rem 0; }
.section-py-lg { padding: 8rem 0; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.overflow-hidden { overflow: hidden; }
.flex-grow { flex-grow: 1; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* Spacing Utilities */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.pt-32 { padding-top: 8rem; }
.pb-12 { padding-bottom: 3rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }
.tracking-widest { letter-spacing: 0.2em; }
.uppercase { text-transform: uppercase; }

.text-muted { color: var(--text-secondary); }
.text-white { color: #ffffff; }
body.light-theme .text-white { color: var(--text-primary); }

/* Brand Colors Adaptive */
.text-brand { color: var(--ep-light); }
body.light-theme .text-brand { color: var(--ep-dark); }

.bg-brand { background-color: var(--ep-dark); color: #fff; }
.bg-ep-light { background-color: rgba(128, 88, 208, 0.1); }
body.light-theme .bg-ep-light { background-color: rgba(88, 48, 168, 0.05); }

/* Gradients */
.text-gradient {
    background-image: linear-gradient(to right, var(--ep-light), #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.light-theme .text-gradient {
    background-image: linear-gradient(to right, var(--ep-dark), var(--text-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: 1.5rem;
    transition: all 0.3s ease-out;
    transform-style: preserve-3d;
}
.glass-card-content { transform: translateZ(20px); }

/* Lines & Dividers */
.divider-line {
    width: 100%; height: 1px;
    background: linear-gradient(to right, transparent, rgba(88, 48, 168, 0.3), transparent);
}

/* =========================================
    4. COMPONENTS
========================================= */
/* Navbar */
.navbar {
    position: fixed; width: 100%; top: 0; left: 0; z-index: 50;
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

.navbar::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: -2.5rem;
    background: linear-gradient(to bottom, var(--nav-glass-top) 30%, var(--nav-glass-bottom) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.navbar.scrolled { padding: 1rem 0; }
.navbar.scrolled::before { opacity: 1; }

.nav-logo-img { height: 2.5rem; width: auto; object-fit: contain; }

body.light-theme .nav-logo-box .bg-inner { background-color: #ffffff; }

.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-link {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-secondary); transition: color 0.3s;
}
.nav-link:hover { color: var(--ep-light); }
body.light-theme .nav-link:hover { color: var(--ep-dark); }

/* Buttons */
.btn-primary {
    background-color: #ffffff; color: #000;
    padding: 1rem 2rem; font-weight: 700; font-size: 0.875rem;
    text-transform: uppercase; letter-spacing: 0.1em;
    border-radius: 0.5rem; position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary .btn-text { position: relative; z-index: 10; transition: color 0.3s; }
.btn-primary .btn-hover-bg {
    position: absolute; inset: 0; background-color: var(--ep-dark);
    transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease-out;
}
.btn-primary:hover .btn-text { color: #ffffff; }
.btn-primary:hover .btn-hover-bg { transform: scaleX(1); }
body.light-theme .btn-primary { background-color: var(--ep-dark); color: #fff; }
body.light-theme .btn-primary .btn-hover-bg { background-color: var(--ep-light); }

.btn-outline {
    border: 1px solid rgba(128, 88, 208, 0.3);
    background-color: rgba(88, 48, 168, 0.1);
    color: var(--ep-light);
    padding: 0.75rem 2rem; border-radius: 2rem;
    font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em;
    transition: all 0.3s;
}
.btn-outline:hover { background-color: var(--ep-dark); color: #fff; }
body.light-theme .btn-outline { color: var(--ep-dark); border-color: var(--ep-dark); }
body.light-theme .btn-outline:hover { color: #ffffff; }

/* Dropdown Menu */
.dropdown-wrapper { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown-toggle { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 0; cursor: none; }
.dropdown-menu {
    position: absolute; top: calc(100% + 0.5rem); left: 50%; transform: translateX(-50%) translateY(1rem);
    width: 240px; padding: 0.5rem;
    opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 50;
}
.dropdown-wrapper:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-item {
    display: block; padding: 0.75rem 1rem; border-radius: 0.5rem; transition: all 0.2s;
}
.dropdown-item:hover { background: rgba(128, 88, 208, 0.1); }
body.light-theme .dropdown-item:hover { background: rgba(88, 48, 168, 0.05); }

/* Theme Toggle Styles */
#theme-toggle {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    color: var(--text-secondary);
    position: relative; overflow: hidden;
    padding: 0; flex-shrink: 0; cursor: none;
    display: flex; align-items: center; justify-content: center;
}
.theme-icon {
    position: absolute;
    font-size: 1.1rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-sun { transform: translateY(200%) scale(0.5); opacity: 0; color: #f59e0b; }
.icon-moon { transform: translateY(0) scale(1); opacity: 1; }

body.light-theme .icon-sun { transform: translateY(0) scale(1); opacity: 1; }
body.light-theme .icon-moon { transform: translateY(-200%) scale(0.5); opacity: 0; }

/* Hero Section */
.hero-section { min-height: 100vh; display: flex; align-items: center; padding-top: 5rem; position: relative; }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
/* แก้ไข grid-template-columns จาก 60% 40% เป็น 1.5fr 1fr เพื่อไม่ให้ล้นจอเมื่อบวก gap */
@media (min-width: 992px) { .hero-grid { grid-template-columns: 1.5fr 1fr; gap: 4rem; } }

.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 0.9; margin-bottom: 2rem; }
@media (min-width: 768px) { .hero-title { font-size: 6rem; } }

.play-btn {
    width: 3rem; height: 3rem; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.3s;
}
body.light-theme .play-btn { border-color: rgba(15, 23, 42, 0.2); }
.play-wrap:hover .play-btn { border-color: var(--ep-light); }
body.light-theme .play-wrap:hover .play-btn { border-color: var(--ep-dark); }

/* Hero Image Card */
/* เพิ่ม display: flex; flex-direction: column; เพื่อให้ภาพด้านในขยายเต็มพื้นที่พอดี */
.hero-visual-card { 
    width: 100%; max-width: 400px; aspect-ratio: 4/5; padding: 1.5rem; margin: 0 auto; position: relative; display: flex; flex-direction: column; 
}
@media (max-width: 991px) {
    .hero-visual-card { max-width: 100%; aspect-ratio: 16/9; height: auto; }
}

.hero-visual-inner { width: 100%; height: 100%; border-radius: 1rem; overflow: hidden; position: relative; flex-grow: 1; }

/* ปรับให้รองรับภาพ 2 ชั้นทับซ้อนกัน */
.hero-visual-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease, opacity 0.7s ease; }
.img-primary { opacity: 0.8; z-index: 1; transform: scale(1); }
.img-secondary { opacity: 0; z-index: 2; transform: scale(1.1); }

/* แอนิเมชันสลับภาพตอน Hover (Cross-Zoom Fade) */
.hero-visual-card:hover .img-primary { opacity: 0; transform: scale(1.1); }
.hero-visual-card:hover .img-secondary { opacity: 0.8; transform: scale(1); }

.hero-badge-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 10; /* บังคับให้ข้อความลอยอยู่เหนือรูปภาพเสมอ */
}

/* บังคับให้ข้อความบนรูปภาพเป็นสีสว่างเสมอ ไม่เปลี่ยนตาม Theme */
body.light-theme .hero-badge-overlay .text-white { color: #ffffff; }
body.light-theme .hero-badge-overlay .text-brand { color: var(--ep-light); }
body.light-theme .about-text .text-white { color: #ffffff; }

.pulse-dot { width: 0.75rem; height: 0.75rem; background-color: #ef4444; border-radius: 50%; position: absolute; top: -4px; right: -4px; }

/* Stats Section */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; text-align: center; padding: 2rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-col { position: relative; }
@media (min-width: 768px) {
    .stat-col:not(:last-child)::after {
        content: ''; position: absolute; right: -1rem; top: 10%; height: 80%; width: 1px; background: rgba(128, 88, 208, 0.1);
    }
}
.stat-number { font-size: 2.25rem; font-weight: 700; transition: color 0.3s; }
.stat-col:hover .stat-number { color: var(--ep-light); }
body.light-theme .stat-col:hover .stat-number { color: var(--ep-dark); }

/* Solutions Section Header */
.section-header { margin-bottom: 4rem; text-align: center; }
@media (min-width: 768px) {
    .section-header-split { display: flex; justify-content: space-between; align-items: flex-end; text-align: left; }
    .section-header-split .desc { max-width: 400px; text-align: right; margin-bottom: 0.5rem; }
}
.title-lg { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.2; }
@media (min-width: 768px) { .title-lg { font-size: 3rem; } }

/* Card Grids */
.cards-grid-2 { display: grid; gap: 2rem; }
@media (min-width: 768px) { .cards-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 3rem; } }

.cards-grid-3 { display: grid; gap: 2rem; }
@media (min-width: 768px) { 
    .cards-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
    .stagger-1 { margin-top: 0; }
    .stagger-2 { margin-top: 4rem; }
}

/* The Card Design (Fixed Flex properties) */
.solution-card { 
    display: flex; flex-direction: column; min-height: 400px; 
    padding: 2.5rem; border-radius: 1.5rem; position: relative; 
    overflow: hidden; cursor: none;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

/* แสงสะท้อนขอบบน (Inner Light) ช่วยให้กระจกดูมีมิติเวลา Hover */
.solution-card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none; z-index: 10;
}

/* เปลี่ยนจากเทสีม่วงทึบ เป็นการเพิ่มความสว่าง (Brighter Glass) และเสริมเงาดำ (Drop Shadow) ให้การ์ดลอยเด่น */
.solution-card:hover { 
    background-color: rgba(255, 255, 255, 0.08); 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); 
}
.solution-card:hover::before { opacity: 1; }

/* สำหรับ Light Theme เปลี่ยนให้ขาวสว่าง 100% พร้อมเงาฟุ้งๆ */
body.light-theme .solution-card:hover { 
    background-color: #ffffff; 
    box-shadow: 0 20px 40px rgba(148, 163, 184, 0.3); 
}

.card-icon-box {
    width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 1.5rem; transition: transform 0.3s;
}
.solution-card:hover .card-icon-box { transform: scale(1.1); }

.card-corner-blob {
    position: absolute; top: 0; right: 0; width: 6rem; height: 6rem;
    border-bottom-left-radius: 100%; opacity: 0.1; transition: opacity 0.3s;
}
.solution-card:hover .card-corner-blob { opacity: 0.2; }

.card-link { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.5rem; transition: gap 0.3s; margin-top: 1.5rem; }
.solution-card:hover .card-link { gap: 1rem; }

.card-line-animate { width: 100%; height: 1px; background: rgba(255,255,255,0.1); margin-top: 1.5rem; position: relative; overflow: hidden; }
.card-line-fill { position: absolute; inset: 0; width: 0; transition: width 0.7s ease; }
.solution-card:hover .card-line-fill { width: 100%; }
body.light-theme .card-line-animate { background: rgba(0,0,0,0.1); }

/* About Section */
.about-grid { display: grid; gap: 4rem; align-items: center; }
@media (min-width: 992px) { .about-grid { grid-template-columns: repeat(2, 1fr); } }

.feature-list { display: flex; flex-direction: column; gap: 1.5rem; }
.feature-item { display: flex; align-items: flex-start; gap: 1rem; }
.feature-icon {
    width: 2.5rem; height: 2.5rem; border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; flex-shrink: 0;
}

/* Marquee */
.marquee-section { padding: 3rem 0; border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); background-color: var(--card-bg); overflow: hidden; position: relative; }
body.light-theme .marquee-section { border-color: rgba(0,0,0,0.05); }
.marquee-content { display: flex; white-space: nowrap; animation: marquee 20s linear infinite; }
.marquee-text { font-size: 3.75rem; font-weight: 900; margin: 0 2rem; }
@media (min-width: 768px) { .marquee-text { font-size: 6rem; } }

/* Contact Section */
.title-xl { font-size: 2.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 2.5rem; }
@media (min-width: 768px) { .title-xl { font-size: 4.5rem; } }

.form-group { position: relative; margin-bottom: 1.5rem; }
.form-input {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--text-secondary);
    padding: 1rem 0; color: var(--text-primary); font-family: inherit; font-size: 1rem; transition: border-color 0.3s;
}
.form-input:focus { outline: none; border-color: var(--ep-light); }
body.light-theme .form-input:focus { border-color: var(--ep-dark); }
.form-label {
    position: absolute; left: 0; top: 1rem; color: var(--text-secondary);
    transition: all 0.3s; pointer-events: none;
}
.form-input:focus ~ .form-label, .form-input:not(:placeholder-shown) ~ .form-label {
    top: -0.5rem; font-size: 0.75rem; color: var(--ep-light);
}
body.light-theme .form-input:focus ~ .form-label { color: var(--ep-dark); }

.btn-submit {
    width: 100%; padding: 1.5rem; margin-top: 1.5rem; background-color: var(--ep-dark); color: #fff;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; border-radius: 0.5rem;
    position: relative; overflow: hidden; border: none;
}
.btn-submit:hover { opacity: 0.9; }

/* Footer */
.footer { padding: 2.5rem 0; border-top: 1px solid rgba(255,255,255,0.05); background: transparent; }
body.light-theme .footer { border-color: rgba(0,0,0,0.05); }
.footer-content { display: flex; flex-direction: column; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; gap: 1rem; }
@media (min-width: 768px) { .footer-content { flex-direction: row; gap: 0; } }
.footer-links { display: flex; gap: 1.5rem; }

.social{
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right:10px;
    color: #5830a8;
    background-color:#c8c8c8;
    width: 28px;  height: 28px;
    font-size: 20px !important;
}
.youtube:hover{ background-color:#bb0000; color: #fff;}
.linkedin:hover{ background-color:#0077b5; color: #fff;}
.facebook:hover{ background-color:#3b5998; color: #fff;}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed; inset: 0; z-index: 60;
    background-color: rgba(2, 6, 23, 0.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
body.light-theme .mobile-menu-overlay { background-color: rgba(248, 250, 252, 0.95); }
.mobile-menu-overlay.active { opacity: 1; pointer-events: auto; }
.close-btn { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 1.5rem; color: var(--text-secondary); }
.mobile-link-group { width: 100%; max-width: 300px; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1rem; }
body.light-theme .mobile-link-group { border-color: rgba(0,0,0,0.1); }

/* =========================================
    5. UTILITIES & ANIMATIONS
========================================= */
/* Outline Text (Stroke) */
.text-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--stroke-color);
    position: relative;
    display: inline-block;
}
.hacker-effect { cursor: none; }

/* Reveal Animation */
.reveal { opacity: 0; transform: translateY(50px) scale(0.95); transition: all 1s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0) scale(1); }

/* Animations */
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes pulse { 50% { opacity: .5; } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* Magnetic & Interactive Elements */
.magnetic-btn { display: inline-block; transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* Custom Cursor Elements (AI Theme) */
.cursor-dot, .cursor-outline {
    position: fixed; top: 0; left: 0; transform: translate(-50%, -50%);
    z-index: 9999; pointer-events: none;
}

/* 1. AI Core (Diamond shape with glow) */
.cursor-dot { 
    width: 8px; height: 8px; 
    background-color: var(--cursor-color); 
    border-radius: 1px; /* ลดความเหลี่ยมของมุมเพชรลงนิดหน่อยไม่ให้คมเกินไป */
    transform: translate(-50%, -50%) rotate(45deg); 
    box-shadow: 0 0 10px var(--cursor-color); 
    transition: width 0.2s, height 0.2s, transform 0.3s;
}

/* 2. Scanner Ring Wrapper */
.cursor-outline {
    width: 40px; height: 40px; 
    border-radius: 50%; /* ให้วงแหวนรอบนอกเป็นวงกลม */
    display: flex; align-items: center; justify-content: center;
    transition: width 0.3s, height 0.3s;
}

/* 3. Spinning Dashed Ring */
.cursor-scanner {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 1.5px dashed var(--cursor-color);
    opacity: 0.6;
    animation: ai-spin 8s linear infinite;
    transition: all 0.3s ease;
}

/* Hover State (Lock-on & Processing) */
body.hovering .cursor-dot { 
    width: 4px; height: 4px; 
    transform: translate(-50%, -50%) rotate(135deg); 
}
body.hovering .cursor-outline { 
    width: 60px; height: 60px; 
}
body.hovering .cursor-scanner { 
    background-color: rgba(128, 88, 208, 0.1); 
    border: 2px double var(--cursor-color); 
    opacity: 1;
    animation: ai-spin 3s linear infinite; 
    box-shadow: 0 0 15px rgba(128, 88, 208, 0.3);
}
body.light-theme.hovering .cursor-scanner { 
    background-color: rgba(88, 48, 168, 0.05); 
    box-shadow: 0 0 15px rgba(88, 48, 168, 0.2);
}

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Background Aurora & Noise */
.aurora-bg { position: fixed; inset: 0; background: radial-gradient(circle at 50% 50%, transparent, var(--bg-color)); z-index: -2; overflow: hidden; transition: background 0.5s; }
.aurora-blob { position: absolute; filter: blur(80px); animation: float-blob 20s infinite ease-in-out alternate; transition: filter 0.5s; }
body.light-theme .aurora-blob { filter: blur(100px); }
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vh; background: var(--blob-1); animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vh; background: var(--blob-2); animation-delay: -5s; }
.blob-3 { top: 40%; left: 40%; width: 40vw; height: 40vh; background: var(--blob-3); animation-delay: -10s; }
@keyframes float-blob {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}
#canvas1 { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* =========================================
    6. AI CHAT WIDGET (DEMO)
========================================= */
.ai-fab {
    position: fixed; bottom: 2rem; right: 2rem;
    width: 4rem; height: 4rem; border-radius: 50%;
    background: var(--ep-dark); color: #fff;
    box-shadow: 0 0 20px rgba(128, 88, 208, 0.5);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 0 30px rgba(128, 88, 208, 0.8); }
body.light-theme .ai-fab { background: #fff; color: var(--ep-dark); border-color: var(--ep-dark); }

#ai-chat-window {
    position: fixed; bottom: 7rem; right: 2rem;
    width: 380px; height: 550px;
    display: flex; flex-direction: column;
    z-index: 99;
    transform-origin: bottom right;
    transform: scale(0); opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#ai-chat-window.active { transform: scale(1); opacity: 1; pointer-events: auto; }

.chat-header {
    padding: 1rem; border-bottom: 1px solid var(--card-border);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.2); border-radius: 1.5rem 1.5rem 0 0;
}
body.light-theme .chat-header { background: rgba(128, 88, 208, 0.15); border-bottom-color: rgba(128, 88, 208, 0.1); }

.chat-body {
    flex-grow: 1; padding: 1rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: 1rem;
    scrollbar-width: thin;
}
.chat-footer {
    padding: 1rem; border-top: 1px solid var(--card-border);
    background: rgba(0,0,0,0.1); border-radius: 0 0 1.5rem 1.5rem;
}
body.light-theme .chat-footer { background: rgba(128, 88, 208, 0.05); border-top-color: rgba(128, 88, 208, 0.1); }

.chat-bubble {
    max-width: 85%; padding: 0.75rem 1rem; border-radius: 1rem;
    font-size: 0.875rem; line-height: 1.5; position: relative;
    animation: popIn 0.3s ease-out forwards;
}
.chat-bubble.ai {
    align-self: flex-start; background: rgba(255,255,255,0.25);
    color: var(--text-primary); border-bottom-left-radius: 0.25rem;
}
body.light-theme .chat-bubble.ai { background: #e2e8f0; color: #1e293b; }

.chat-bubble.user {
    align-self: flex-end; background: var(--ep-dark);
    color: #fff; border-bottom-right-radius: 0.25rem;
}

.suggestions-container { display: flex; flex-direction: column; gap: 0.5rem; }
.suggestion-btn {
    text-align: left; padding: 0.6rem 0.75rem; border-radius: 0.5rem;
    background: rgba(255,255,255,0.05); border: 1px solid var(--card-border);
    color: var(--text-secondary); font-size: 0.75rem; transition: all 0.2s;
    cursor: pointer;
}
.suggestion-btn:hover { background: rgba(128, 88, 208, 0.2); color: var(--ep-light); border-color: var(--ep-light); }
body.light-theme .suggestion-btn:hover { background: rgba(88, 48, 168, 0.1); color: var(--ep-dark); }

@keyframes popIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.typing-indicator span {
    display: inline-block; width: 6px; height: 6px; background: var(--text-secondary);
    border-radius: 50%; margin: 0 2px; animation: typing 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* =========================================
    7. Contact Page
========================================= */
.contactBox {display: table;}
.contactRow {display: table-row;}

.contactAction{
    display: table-caption;
    caption-side: bottom;
    padding-top: 8px;
}
.contactCell{
    display: table-cell;
    padding: 8px 3px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.contactCell input{
    border-radius: 5px;
    line-height: 1.3em;
    box-sizing: border-box;
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--text-secondary);
    padding: 1rem 0; color: var(--text-primary); font-family: inherit; font-size: 1rem; transition: border-color 0.3s;
}
.contactButton input{
    width: 100%; padding: 1.5rem; margin-top: 1.5rem; background-color: var(--ep-dark); color: #fff;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; border-radius: 0.5rem;
    position: relative; overflow: hidden; border: none;
}
.contactButton input:hover { opacity: 0.9; }

.contactCell input:focus { outline: none; border-color: var(--ep-light); }
body.light-theme .contactCell input:focus { border-color: var(--ep-dark); }
.contactLabel {
    left: 0; top: 1rem; color: var(--text-secondary);
    transition: all 0.3s; pointer-events: none;
}
.contactCell input:focus ~ .contactLabel, .contactCell input:not(:placeholder-shown) ~ .contactLabel {
    top: -0.5rem; font-size: 0.75rem; color: var(--ep-light);
}
body.light-theme .contactCell input:focus ~ .form-label { color: var(--ep-dark); }

.contactWarning {border: 1px solid #ee5555 !important;}

.checkWarning{
    outline: 1px solid #ee5555 !important;
    box-shadow: 1px 1px 2px rgba(255,50,50,0.8);
}
.captcha {display: none;}

.contactButton .g-recaptcha {display:flex; justify-content: center;}

.contactLabel{
    display:table-cell;
    width: 30%;
    padding: 2px 10px;
}



