:root {
    --bg: #050505;
    --surface: #111111;
    --text: #ffffff;
    --text-muted: #999;
    --accent: #F4C430; /* สีทองวิศวกรรม */
    --line-color: #06C755;
    
    --f-main: 'Inter', sans-serif;
    --f-thai: 'Kanit', sans-serif;
    --f-deco: 'Syncopate', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; /* Let Lenis handle scroll */ }
body { font-family: var(--f-thai); background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* --- BACKGROUNDS --- */
canvas#network-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none; opacity: 0.6;
}
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05; pointer-events: none; z-index: -1;
}

/* --- PRELOADER --- */
.preloader {
    position: fixed; inset: 0; background: #000; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.loader-content { text-align: center; }
.loader-logo { font-family: var(--f-deco); font-size: 2.5rem; color: white; margin-bottom: 10px; }
.loader-logo span { color: var(--accent); }
.loader-desc { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 3px; margin-bottom: 20px; font-family: var(--f-deco); }
.loader-line { width: 0%; height: 2px; background: var(--accent); }

/* --- NAVIGATION --- */
.fixed-nav {
    position: fixed; top: 0; width: 100%; padding: 20px 5%; z-index: 1000;
    backdrop-filter: blur(10px); background: rgba(5,5,5,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-wrapper {
    width: 100%; max-width: 1400px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.brand { font-family: var(--f-deco); font-size: 1.5rem; font-weight: 700; letter-spacing: -1px; }
.brand .accent { color: var(--accent); }
.nav-menu { display: flex; gap: 30px; }
.nav-menu a { font-size: 0.9rem; text-transform: uppercase; transition: 0.3s; color: #ccc; }
.nav-menu a:hover { color: var(--accent); }
.nav-btn {
    border: 1px solid rgba(255,255,255,0.2); padding: 8px 20px; border-radius: 50px;
    font-size: 0.75rem; display: flex; gap: 8px; align-items: center; transition: 0.3s;
}
.nav-btn:hover { background: var(--accent); border-color: var(--accent); color: black; }
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { width: 25px; height: 2px; background: white; transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }

/* --- HERO SECTION --- */
.hero { height: 100vh; display: flex; align-items: center; padding: 0 5%; position: relative; }
.hero-container { max-width: 1200px; width: 100%; margin: 0 auto; }
.hero-title {
    font-size: clamp(3rem, 9vw, 8rem); line-height: 0.95; font-weight: 700;
    text-transform: uppercase; margin-bottom: 30px; font-family: var(--f-main);
}
.text-outline { -webkit-text-stroke: 1px rgba(255,255,255,0.8); color: transparent; }
.hero-line-acc { width: 100px; height: 3px; background: var(--accent); margin-top: 25px; box-shadow: 0 0 15px var(--accent); }
.hero-desc { color: var(--text-muted); max-width: 600px; margin-bottom: 40px; font-size: 1.1rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 20px; flex-wrap: wrap; }
.btn-primary {
    background: white; color: black; padding: 15px 35px; font-weight: 600;
    border-radius: 4px; transition: 0.3s; display: inline-block;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-3px); }
.btn-line {
    border: 1px solid white; color: white; padding: 15px 35px;
    border-radius: 4px; display: inline-flex; gap: 10px; align-items: center; transition: 0.3s;
}
.btn-line:hover { background: white; color: black; transform: translateY(-3px); }

/* --- SERVICES (GRID & CARDS) --- */
.content-section, .services-section, .project-section-full { padding: 100px 5%; max-width: 1400px; margin: 0 auto; }
.section-head.center { text-align: center; margin-bottom: 60px; }
.tech-badge { 
    display: inline-block; padding: 5px 15px; border: 1px solid var(--accent); 
    color: var(--accent); font-family: var(--f-deco); font-size: 0.7rem; margin-bottom: 20px; 
}
.section-head h2 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 10px; }
.tech-subtitle { color: #555; font-family: var(--f-deco); font-size: 0.8rem; letter-spacing: 1px; }

.services-grid-modern {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px;
}

/* Card Design */
.svc-card {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
    padding: 30px; display: flex; flex-direction: column; justify-content: space-between;
    min-height: 350px; position: relative; transition: 0.4s; overflow: hidden;
}
.svc-card:hover { border-color: var(--accent); background: rgba(20,20,20,0.8); transform: translateY(-5px); }
.svc-pro-head { display: flex; justify-content: space-between; margin-bottom: 20px; font-family: var(--f-deco); font-size: 0.7rem; color: #666; }
.sys-status { color: var(--line-color); }
.sys-status.standby { color: var(--accent); }

.svc-icon-box { 
    font-size: 2rem; color: white; margin-bottom: 20px; 
    width: 60px; height: 60px; background: rgba(255,255,255,0.05); 
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    transition: 0.4s;
}
.svc-card:hover .svc-icon-box { background: var(--accent); color: black; }

.svc-card h3 { font-size: 1.5rem; margin-bottom: 10px; font-family: var(--f-deco); }
.svc-card p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

.svc-pro-footer { 
    margin-top: 30px; padding-top: 20px; border-top: 1px dashed rgba(255,255,255,0.1); 
    display: flex; justify-content: space-between; align-items: center; 
}
.tech-spec { font-family: 'Courier New', monospace; font-size: 0.7rem; color: #666; }
.svc-link { font-size: 0.8rem; color: var(--accent); font-weight: bold; display: flex; align-items: center; gap: 5px; }

.tech-hud { position: absolute; bottom: 10px; right: 10px; font-size: 9px; opacity: 0.2; font-family: monospace; }

/* --- TEAM & ABOUT --- */
.ceo-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03), transparent);
    border: 1px solid rgba(244,196,48, 0.2); padding: 50px; text-align: center;
    border-radius: 10px; margin: 0 auto 60px; max-width: 600px;
}
.ceo-image-wrapper {
    width: 180px; height: 180px; margin: 0 auto 25px; border-radius: 50%; overflow: hidden;
    border: 3px solid var(--accent); box-shadow: 0 0 30px rgba(244,196,48,0.2);
}
.ceo-img { width: 100%; height: 100%; object-fit: cover; }
.role { color: var(--accent); letter-spacing: 2px; font-size: 0.8rem; margin-bottom: 10px; font-family: var(--f-deco); }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 40px; }
.staff-card { background: rgba(255,255,255,0.03); padding: 20px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
.staff-names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; font-size: 0.9rem; color: #888; }
.name-item { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* --- TIMELINE --- */
.project-timeline { border-left: 2px solid rgba(255,255,255,0.1); padding-left: 40px; margin-left: 20px; }
.timeline-group { margin-bottom: 60px; position: relative; }
.year-marker { 
    position: absolute; left: -110px; top: 0; width: 80px; text-align: right; 
    color: var(--accent); font-family: var(--f-deco); font-weight: bold; 
}
.year-marker::after {
    content: ''; position: absolute; right: -46px; top: 5px; width: 12px; height: 12px;
    background: black; border: 2px solid var(--accent); border-radius: 50%;
}
.project-card {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
    padding: 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;
}
.tags span { background: rgba(255,255,255,0.1); font-size: 0.7rem; padding: 2px 8px; margin-right: 5px; border-radius: 2px; }
.pj-status { font-family: var(--f-deco); color: var(--accent); font-size: 0.7rem; }

/* --- FOOTER --- */
footer { padding: 80px 5% 40px; background: #020202; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; margin-bottom: 60px; }
.big-line-link { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: bold; color: white; border-bottom: 2px solid transparent; transition: 0.3s; }
.big-line-link:hover { color: var(--accent); border-color: var(--accent); }
.qr-card { background: white; padding: 15px; border-radius: 10px; width: 200px; text-align: center; color: black; }
.qr-card img { width: 100%; display: block; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; display: flex; justify-content: space-between; color: #666; font-size: 0.9rem; }

/* ========================================= */
/* --- MOBILE RESPONSIVE (PROFESSIONAL) --- */
/* ========================================= */
@media (max-width: 768px) {
    /* Mobile Nav */
    .nav-menu { display: none; }
    .hamburger { display: flex; }
    .nav-btn { display: none; }
    
    /* Mobile Hero */
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-primary, .btn-line { width: 100%; justify-content: center; text-align: center; }

    /* Mobile Services (Horizontal Slider) */
    .services-grid-modern {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
        padding-bottom: 30px; gap: 15px;
    }
    .svc-card {
        min-width: 85vw; scroll-snap-align: center;
        margin-right: 0; background: linear-gradient(160deg, #151515, #0a0a0a);
    }
    .services-grid-modern::-webkit-scrollbar { display: none; } /* Hide scrollbar */
    
    /* Mobile Timeline */
    .project-timeline { border-left: 2px dashed rgba(255,255,255,0.1); padding-left: 20px; margin-left: 0; }
    .year-marker { position: relative; left: 0; text-align: left; margin-bottom: 10px; width: 100%; }
    .year-marker::after { display: none; }
    .project-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .pj-status { width: 100%; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; }

    /* Footer Mobile */
    .footer-row { flex-direction: column; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}