:root {
  --primary: #3b82f6;
  --accent: #f59e0b;
  --blue: #3b82f6;
  --green: #22c55e;
  --purple: #a855f7;
  --orange: #f59e0b;
  --teal: #14b8a6;
  --red: #ef4444;
  --bg-dark: #060a14;
  --bg-panel: #0b1120;
  --bg-card: #111a2e;
  --bg-card2: #0d1424;
  --text: #e8edf7;
  --text-muted: #7c8aa5;
  --border: rgba(59,130,246,0.16);
  --glow: 0 0 24px rgba(59,130,246,0.35);
  --font-main: 'Sarabun', sans-serif;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text);
  overflow-x:hidden;
}
body::before {
  content:''; position:fixed; inset:0; z-index:0;
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(59,130,246,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 85% 15%, rgba(168,85,247,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(20,184,166,0.08) 0%, transparent 55%);
  pointer-events:none;
}
body::after {
  content:''; position:fixed; inset:0; z-index:0;
  background-image:
    linear-gradient(rgba(59,130,246,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.035) 1px, transparent 1px);
  background-size:44px 44px;
  pointer-events:none;
}
a { color:inherit; }
img { max-width:100%; display:block; }
.skeleton { background:linear-gradient(90deg,var(--bg-card) 25%,var(--bg-card2) 37%,var(--bg-card) 63%); background-size:400% 100%; animation:shimmer 1.4s ease infinite; border-radius:6px; }
@keyframes shimmer { 0%{background-position:100% 50%} 100%{background-position:0 50%} }

/* NAV */
nav { position:fixed; top:0; left:0; right:0; z-index:200; display:flex; align-items:center; justify-content:space-between; padding:0.85rem 2rem; background:rgba(6,10,20,0.9); backdrop-filter:blur(14px); border-bottom:1px solid var(--border); gap:.5rem; }
.nav-brand { display:flex; align-items:center; gap:0.7rem; min-width:0; }
.nav-brand img { height:38px; width:38px; border-radius:8px; object-fit:cover; flex-shrink:0; }
.logo { font-family:'Orbitron',monospace; font-size:1.2rem; font-weight:900; letter-spacing:0.05em; white-space:nowrap; }
.logo span { color: var(--blue); }
.nav-links { display:flex; gap:1.5rem; list-style:none; }
.nav-links a { text-decoration:none; color:var(--text-muted); font-size:0.88rem; letter-spacing:0.02em; transition:color .2s; cursor:pointer; }
.nav-links a:hover { color:var(--blue); }
.nav-right { display:flex; align-items:center; gap:0.7rem; flex-shrink:0; }
.lang-switch { display:flex; border:1px solid var(--border); border-radius:20px; overflow:hidden; flex-shrink:0; }
.lang-switch button { background:transparent; border:none; color:var(--text-muted); padding:0.35rem 0.8rem; font-size:0.78rem; cursor:pointer; font-family:var(--font-main); }
.lang-switch button.active { background:var(--blue); color:#fff; font-weight:700; }
.nav-cta { background:var(--blue); color:#fff; border:none; padding:0.55rem 1.2rem; font-weight:700; font-size:0.85rem; border-radius:6px; cursor:pointer; transition:box-shadow .2s, transform .1s; white-space:nowrap; flex-shrink:0; }
.nav-cta:hover { box-shadow:var(--glow); transform:translateY(-1px); }
.nav-shop-btn { display:flex; align-items:center; gap:.4rem; text-decoration:none; color:var(--teal); border:1px solid rgba(20,184,166,.5); padding:0.5rem 0.9rem; border-radius:6px; font-weight:700; font-size:0.85rem; white-space:nowrap; flex-shrink:0; transition:background .2s, box-shadow .2s, transform .1s; }
.nav-shop-btn:hover { background:rgba(20,184,166,.12); box-shadow:0 0 16px rgba(20,184,166,.3); transform:translateY(-1px); }
.nav-shop-btn .shop-icon { font-size:1rem; line-height:1; }
.nav-shop-btn .shop-text { line-height:1; }
.nav-burger { display:none; background:none; border:none; color:var(--text); font-size:1.5rem; cursor:pointer; flex-shrink:0; }
.lang-switch-mobile-wrap { display:none; }

/* แท็บเล็ต/มือถือแนวนอน: ย่อโลโก้และปุ่มลงเล็กน้อย ซ่อนตัวเลือกภาษาบน navbar (ย้ายไปอยู่ในเมนู) */
@media (max-width:960px){
  nav { padding:0.65rem 1rem; }
  .nav-brand img { height:32px; width:32px; }
  .logo { font-size:1rem; }
  .nav-right { gap:.5rem; }
  .lang-switch-desktop { display:none; }
  .lang-switch-mobile-wrap { display:block; margin-top:.3rem; }
  .lang-switch-mobile-wrap .lang-switch { display:inline-flex; }
  .nav-cta { padding:0.48rem 0.9rem; font-size:0.78rem; }
  .nav-shop-btn { padding:0.48rem 0.75rem; font-size:0.78rem; }
  .nav-links{ position:fixed; top:58px; left:0; right:0; background:rgba(6,10,20,0.98); flex-direction:column; padding:1rem 1.5rem; display:none; gap:1rem; border-bottom:1px solid var(--border); max-height:calc(100vh - 58px); overflow-y:auto; }
  .nav-links.open{ display:flex; }
  .nav-burger{ display:block; }
}

/* มือถือจอเล็ก: ย่อทุกอย่างลงอีกขั้น ให้ TECH-TJ ไม่ตกบรรทัดและปุ่มไม่ล้นจอ */
@media (max-width:400px){
  nav { padding:0.55rem 0.7rem; }
  .nav-brand { gap:.4rem; }
  .nav-brand img { height:28px; width:28px; }
  .logo { font-size:0.82rem; }
  .nav-right { gap:.35rem; }
  .nav-cta { padding:0.4rem 0.65rem; font-size:0.68rem; border-radius:5px; }
  .nav-shop-btn { padding:0.4rem 0.55rem; }
  .nav-shop-btn .shop-text { display:none; }
  .nav-shop-btn .shop-icon { font-size:1.05rem; }
  .nav-burger { font-size:1.25rem; }
  .services-grid, .portfolio-grid { grid-template-columns:1fr; }
}

/* STAT STRIP (dashboard-style overview bar) */
.stat-strip { position:relative; z-index:1; padding:6.5rem 1.5rem 0; max-width:1200px; margin:0 auto; }
.stat-strip-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:1rem; }
.stat-card { background:var(--bg-panel); border:1px solid var(--border); border-radius:14px; padding:1.1rem 1.2rem; display:flex; align-items:center; gap:.8rem; }
.stat-card .badge { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; }
.stat-card .badge.blue { background:rgba(59,130,246,.16); color:var(--blue); }
.stat-card .badge.green { background:rgba(34,197,94,.16); color:var(--green); }
.stat-card .badge.purple { background:rgba(168,85,247,.16); color:var(--purple); }
.stat-card .badge.orange { background:rgba(245,158,11,.16); color:var(--orange); }
.stat-card .badge.teal { background:rgba(20,184,166,.16); color:var(--teal); }
.stat-card .num { font-family:'Orbitron',monospace; font-size:1.35rem; font-weight:700; line-height:1; }
.stat-card .lbl { color:var(--text-muted); font-size:0.72rem; margin-top:.3rem; letter-spacing:.02em; }

/* HERO */
.hero { position:relative; z-index:1; padding:6.5rem 1.5rem 4rem; max-width:1250px; margin:0 auto; display:grid; grid-template-columns:1fr 1.15fr; gap:2.5rem; align-items:center; min-height:70vh; }
@media (max-width:960px){ .hero{ grid-template-columns:1fr; text-align:center; padding-top:5.5rem;} .hero-illustration{ order:-1; max-width:480px; margin:0 auto;} }
.hero-badge { display:inline-block; border:1px solid var(--border); color:var(--blue); font-size:0.72rem; letter-spacing:0.18em; padding:0.35rem 1rem; margin-bottom:1.3rem; border-radius:20px; animation:fadeDown .6s ease; }
.hero h1 { font-family:'Orbitron',monospace; font-size:clamp(2rem,5.2vw,3.4rem); font-weight:900; line-height:1.15; margin-bottom:1.1rem; animation:fadeDown .7s ease; }
.hero h1 .accent { color:var(--blue); text-shadow:var(--glow); }
.hero-sub { max-width:520px; margin-bottom:2.2rem; color:var(--text-muted); font-size:1.03rem; line-height:1.7; animation:fadeDown .8s ease; }
@media (max-width:960px){ .hero-sub{ margin-left:auto; margin-right:auto; } }
.hero-btns { display:flex; gap:1rem; flex-wrap:wrap; animation:fadeDown .9s ease; }
@media (max-width:960px){ .hero-btns{ justify-content:center; } }
.btn-primary { background:var(--blue); color:#fff; border:none; padding:0.85rem 2rem; font-weight:700; letter-spacing:.03em; border-radius:8px; cursor:pointer; transition:box-shadow .2s, transform .1s; font-family:var(--font-main); font-size:1rem; }
.btn-primary:hover { box-shadow:0 0 25px rgba(59,130,246,.5); transform:translateY(-2px); }
.btn-outline { background:transparent; color:var(--text); border:1px solid var(--border); padding:0.85rem 2rem; border-radius:8px; cursor:pointer; letter-spacing:.03em; font-family:var(--font-main); font-size:1rem; transition:background .2s, border-color .2s; }
.btn-outline:hover { background:rgba(59,130,246,.08); border-color:var(--blue); }
@keyframes fadeDown { from{opacity:0; transform:translateY(-20px);} to{opacity:1; transform:translateY(0);} }
@keyframes fadeUp { from{opacity:0; transform:translateY(20px);} to{opacity:1; transform:translateY(0);} }
.reveal { opacity:0; transform:translateY(24px); transition:opacity .6s ease, transform .6s ease; }
.reveal.in { opacity:1; transform:translateY(0); }

/* HERO ILLUSTRATION — HUD sci-fi showcase image */
.hero-illustration { position:relative; animation:fadeUp 1s ease; border-radius:16px; overflow:hidden; box-shadow:0 20px 50px rgba(0,0,0,.55); }
.hero-showcase-img {
  width:100%; height:auto; display:block; border-radius:16px;
  filter:brightness(0.85) saturate(1.05);
  transition:transform .5s ease, filter .5s ease;
  animation: heroFadeInFlash 1.4s ease both;
}
.hero-illustration:hover .hero-showcase-img { transform:scale(1.045); filter:brightness(1) saturate(1.1); }

@keyframes heroFadeInFlash {
  0% { opacity:0; filter:brightness(2.4) saturate(0.6); transform:scale(1.02); }
  35% { opacity:1; filter:brightness(1.6) saturate(1.2); }
  60% { filter:brightness(0.75) saturate(1); }
  100% { opacity:1; filter:brightness(0.85) saturate(1.05); transform:scale(1); }
}

/* corner HUD brackets */
.hud-corner { position:absolute; width:34px; height:34px; z-index:5; pointer-events:none; opacity:.85; }
.hud-corner::before, .hud-corner::after { content:''; position:absolute; background:var(--blue); box-shadow:0 0 8px rgba(59,130,246,.8); }
.hud-corner::before { width:100%; height:2.5px; }
.hud-corner::after { height:100%; width:2.5px; }
.hud-corner.tl { top:10px; left:10px; } .hud-corner.tl::before,.hud-corner.tl::after{ top:0; left:0; }
.hud-corner.tr { top:10px; right:10px; } .hud-corner.tr::before{ top:0; right:0; } .hud-corner.tr::after{ top:0; right:0; }
.hud-corner.bl { bottom:10px; left:10px; } .hud-corner.bl::before{ bottom:0; left:0; } .hud-corner.bl::after{ bottom:0; left:0; }
.hud-corner.br { bottom:10px; right:10px; } .hud-corner.br::before{ bottom:0; right:0; } .hud-corner.br::after{ bottom:0; right:0; }

/* scanline sweep */
.hud-scanline { position:absolute; left:0; right:0; height:2px; z-index:4; pointer-events:none;
  background:linear-gradient(90deg, transparent, rgba(59,130,246,.9), transparent);
  box-shadow:0 0 12px 2px rgba(59,130,246,.7);
  animation: scanSweep 4.5s linear infinite; }
@keyframes scanSweep { 0%{ top:0%; opacity:0;} 5%{opacity:1;} 95%{opacity:1;} 100%{ top:100%; opacity:0;} }

/* subtle vignette to blend edges with dark theme */
.hud-vignette { position:absolute; inset:0; z-index:3; pointer-events:none;
  background:
    linear-gradient(180deg, rgba(6,10,20,.35) 0%, transparent 15%, transparent 80%, rgba(6,10,20,.55) 100%),
    linear-gradient(90deg, rgba(6,10,20,.3) 0%, transparent 12%, transparent 88%, rgba(6,10,20,.3) 100%);
}

/* occasional glitch flicker */
.hero-illustration.glitch .hero-showcase-img { animation: glitchFlicker .28s steps(2) 1; }
@keyframes glitchFlicker {
  0% { transform:translate(0,0); filter:brightness(0.85) saturate(1.05); }
  20% { transform:translate(-2px,1px); filter:brightness(1.3) saturate(1.4) hue-rotate(6deg); }
  40% { transform:translate(2px,-1px); filter:brightness(0.6) saturate(0.8); }
  60% { transform:translate(-1px,0); filter:brightness(1.2); }
  100% { transform:translate(0,0); filter:brightness(0.85) saturate(1.05); }
}

/* floating logo badge — bottom-center of the hero image */
.hud-logo-badge { position:absolute; bottom:16px; left:50%; transform:translateX(-50%); z-index:6; display:flex; align-items:center; gap:.55rem;
  background:rgba(6,10,20,.72); border:1px solid rgba(59,130,246,.5); border-radius:30px; padding:.4rem .9rem .4rem .4rem;
  backdrop-filter:blur(6px); animation:badgeBounce 3s ease-in-out infinite; box-shadow:0 6px 18px rgba(0,0,0,.4); }
.hud-logo-badge img { width:26px; height:26px; border-radius:50%; object-fit:cover; }
.hud-logo-badge span { font-family:'Orbitron',monospace; font-size:.62rem; letter-spacing:.12em; color:var(--blue); font-weight:700; }
@keyframes badgeBounce { 0%,100%{ transform:translateX(-50%) translateY(0);} 50%{ transform:translateX(-50%) translateY(-6px);} }

@media (max-width:960px){ .hud-logo-badge{ bottom:10px; } }

section { position:relative; z-index:1; padding:5rem 1.5rem; }
.section-header { text-align:center; max-width:700px; margin:0 auto 3rem; }
.section-tag { display:inline-block; color:var(--blue); font-size:0.72rem; letter-spacing:0.18em; border-left:3px solid var(--blue); padding-left:0.7rem; margin-bottom:0.7rem; }
.section-title { font-family:'Orbitron',monospace; font-size:clamp(1.4rem,3.6vw,2.1rem); font-weight:700; }
.section-sub { color:var(--text-muted); margin-top:0.75rem; font-size:0.95rem; }

/* SERVICES — module cards with colored icon badges */
.services-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:1.4rem; max-width:1150px; margin:0 auto; }
.service-card { background:var(--bg-panel); border:1px solid var(--border); border-radius:14px; padding:1.8rem; transition:transform .25s, border-color .25s, box-shadow .25s; }
.service-card:hover { transform:translateY(-6px); border-color:var(--card-color, var(--blue)); box-shadow:0 14px 32px rgba(0,0,0,.35); }
.service-icon { width:52px; height:52px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.5rem; margin-bottom:1.1rem; background:var(--card-bg, rgba(59,130,246,.16)); color:var(--card-color, var(--blue)); }
.service-card h3 { font-size:1.05rem; margin-bottom:.6rem; color:var(--text); }
.service-card p { color:var(--text-muted); font-size:0.88rem; line-height:1.65; }

/* PORTFOLIO */
.portfolio-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:1.6rem; max-width:1150px; margin:0 auto; }
.portfolio-card { background:var(--bg-panel); border:1px solid var(--border); border-radius:14px; overflow:hidden; transition:transform .25s, box-shadow .25s; }
.portfolio-card:hover { transform:translateY(-6px); box-shadow:0 16px 36px rgba(0,0,0,.4); }
.portfolio-card img { width:100%; height:200px; object-fit:cover; border-bottom:1px solid var(--border); }
.portfolio-card .pf-body { padding:1.4rem; }
.portfolio-card h3 { font-size:1.05rem; margin-bottom:.5rem; }
.portfolio-card p { color:var(--text-muted); font-size:0.88rem; line-height:1.6; }

/* WHY US — workflow-style steps with connecting line */
.workflow-wrap { max-width:1050px; margin:0 auto; position:relative; }
.workflow-steps { display:grid; grid-template-columns:repeat(4,1fr); gap:1.2rem; position:relative; }
@media (max-width:820px){ .workflow-steps{ grid-template-columns:1fr; } .workflow-line{ display:none; } }
.workflow-line { position:absolute; top:26px; left:8%; right:8%; height:2px; background:linear-gradient(90deg, var(--blue), var(--purple), var(--orange), var(--teal)); opacity:.35; z-index:0; }
.workflow-step { position:relative; z-index:1; background:var(--bg-panel); border:1px solid var(--border); border-radius:14px; padding:1.4rem 1.2rem; text-align:center; }
.workflow-step .num { width:34px; height:34px; border-radius:50%; margin:0 auto .9rem; display:flex; align-items:center; justify-content:center; font-family:'Orbitron',monospace; font-weight:700; font-size:.85rem; color:#fff; }
.workflow-step .t { font-weight:700; font-size:.92rem; display:block; margin-bottom:.4rem; }
.workflow-step p { color:var(--text-muted); font-size:0.82rem; line-height:1.5; }

/* CONTACT */
.contact-wrap { max-width:1100px; margin:0 auto; display:grid; grid-template-columns:1fr 1fr; gap:2.5rem; }
@media (max-width:820px){ .contact-wrap{ grid-template-columns:1fr; } }
.contact-info { display:flex; flex-direction:column; gap:1.1rem; }
.contact-item { display:flex; gap:1rem; align-items:center; background:var(--bg-panel); border:1px solid var(--border); padding:1rem 1.2rem; border-radius:12px; }
.contact-item .ic { width:40px; height:40px; border-radius:10px; background:rgba(59,130,246,.14); color:var(--blue); display:flex; align-items:center; justify-content:center; font-size:1.15rem; flex-shrink:0; }
.contact-item b { display:block; font-size:0.76rem; color:var(--text-muted); letter-spacing:.04em; }
.contact-item span.v { font-size:1rem; }
.qr-box { text-align:center; margin-top:.5rem; }
.qr-box img { max-width:180px; margin:0 auto; border-radius:10px; border:1px solid var(--border); }
.qr-box p { color:var(--text-muted); font-size:0.8rem; margin-top:.5rem; }

.contact-form { background:var(--bg-panel); border:1px solid var(--border); border-radius:14px; padding:2rem; }
.contact-form .fg { margin-bottom:1.1rem; }
.contact-form label { display:block; font-size:0.82rem; color:var(--text-muted); margin-bottom:.4rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  width:100%; background:var(--bg-card2); border:1px solid var(--border); color:var(--text);
  padding:0.7rem 0.9rem; border-radius:8px; font-family:var(--font-main); font-size:0.95rem;
}
.contact-form textarea { resize:vertical; min-height:100px; }
.contact-form button { width:100%; }
.form-msg { margin-top:1rem; font-size:0.88rem; text-align:center; }
.form-msg.ok { color:#5eead4; }
.form-msg.err { color:#ff8b8b; }

footer { position:relative; z-index:1; border-top:1px solid var(--border); padding:2.5rem 1.5rem 1.5rem; text-align:center; color:var(--text-muted); font-size:0.85rem; }
footer .f-links { display:flex; gap:1.4rem; justify-content:center; margin-bottom:1rem; flex-wrap:wrap; }

/* CHAT WIDGET */
#tj-chat-btn { position:fixed; bottom:22px; right:22px; z-index:500; width:58px; height:58px; border-radius:50%; background:var(--blue); border:none; cursor:pointer; box-shadow:0 6px 22px rgba(59,130,246,.45); font-size:1.5rem; display:flex; align-items:center; justify-content:center; animation:pulseBtn 2.4s ease infinite; }
@keyframes pulseBtn { 0%,100%{box-shadow:0 6px 22px rgba(59,130,246,.4);} 50%{box-shadow:0 6px 32px rgba(59,130,246,.75);} }
#tj-chat-panel { position:fixed; bottom:94px; right:22px; z-index:500; width:330px; max-width:90vw; height:440px; background:var(--bg-panel); border:1px solid var(--border); border-radius:16px; display:none; flex-direction:column; overflow:hidden; box-shadow:0 20px 50px rgba(0,0,0,.55); }
#tj-chat-panel.open { display:flex; }
.chat-head { background:var(--bg-card2); padding:0.9rem 1.1rem; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); }
.chat-head b { font-size:0.95rem; }
.chat-head small { color:var(--text-muted); display:block; font-size:0.72rem; }
.chat-head button { background:none; border:none; color:var(--text-muted); font-size:1.2rem; cursor:pointer; }
.chat-body { flex:1; overflow-y:auto; padding:1rem; display:flex; flex-direction:column; gap:0.6rem; }
.chat-msg { max-width:80%; padding:0.55rem 0.8rem; border-radius:10px; font-size:0.86rem; line-height:1.5; }
.chat-msg.customer { align-self:flex-end; background:var(--blue); color:#fff; }
.chat-msg.admin { align-self:flex-start; background:var(--bg-card2); border:1px solid var(--border); }
.chat-foot { display:flex; border-top:1px solid var(--border); }
.chat-foot input { flex:1; background:transparent; border:none; padding:0.8rem; color:var(--text); font-family:var(--font-main); }
.chat-foot button { background:var(--blue); color:#fff; border:none; padding:0 1.1rem; cursor:pointer; font-weight:700; }

.badge-dot { position:absolute; top:-2px; right:-2px; width:12px; height:12px; background:var(--red); border-radius:50%; border:2px solid var(--bg-dark); display:none; }
