/* =====================================================================
   หน้าตาเว็บ thebestss.biz — ธีมเข้มสาย Tech
   สีหลักดึงจากโลโก้ TBSS (แผงวงจรสีเขียว) บนพื้นเขียวเกือบดำ
   ทุกอย่างในไฟล์นี้เขียนขึ้นเอง ไม่ได้ใช้ธีม/เทมเพลตของผู้อื่น

   ขนาดจอที่รองรับ:  มือถือ (< 640px) · แท็บเล็ต (640–1023px) · คอม (1024px ขึ้นไป)
   ===================================================================== */
:root {
  --bg: #060d0a;            /* พื้นหลังหลัก */
  --bg-alt: #091510;        /* พื้นหลัง section สลับ */
  --surface: #0e1c16;       /* การ์ด */
  --surface-2: #13251d;     /* การ์ดตอนชี้เมาส์ */
  --line: rgba(110, 220, 160, .13);
  --line-strong: rgba(110, 220, 160, .28);
  --ink: #f1faf5;           /* หัวข้อ */
  --text: #c9dcd2;          /* ตัวหนังสือทั่วไป */
  --muted: #8aa598;         /* ตัวหนังสือรอง */
  --primary: #2bd17e;       /* เขียวสว่าง (ปุ่ม/ลิงก์) */
  --primary-ink: #04150d;   /* ตัวหนังสือบนปุ่มเขียว */
  --accent: #3ff0b4;        /* เขียวมิ้นต์เรืองแสง */
  --teal: #1fb5a3;          /* เขียวอมฟ้าในโลโก้ */
  --glow: 0 0 0 1px rgba(43, 209, 126, .35), 0 8px 30px rgba(43, 209, 126, .18);
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 80px;
  --font-head: "Anuphan", "IBM Plex Sans Thai", "Tahoma", sans-serif;
  --font-body: "IBM Plex Sans Thai", "Sarabun", "Tahoma", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
  /* ลายแผงวงจร (วาดเองเป็น SVG) */
  --pcb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke='%232bd17e' stroke-width='1.2'%3E%3Cpath d='M0 40h60l20 20h60M140 60h40l20-20h40M20 120h50l15 15v45M85 180h70M155 180l20-20h65M120 0v30l-15 15v40M200 240v-40l-20-20M40 240v-30l20-20h25M240 100h-50l-15 15'/%3E%3Cg fill='%232bd17e' stroke='none'%3E%3Ccircle cx='60' cy='40' r='3'/%3E%3Ccircle cx='140' cy='60' r='3'/%3E%3Ccircle cx='85' cy='180' r='3'/%3E%3Ccircle cx='155' cy='180' r='3'/%3E%3Ccircle cx='105' cy='85' r='3'/%3E%3Ccircle cx='175' cy='115' r='3'/%3E%3Ccircle cx='70' cy='120' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* ภาษาไทย: ตัดบรรทัดตามคำ ไม่ตัดกลางคำ */
  line-break: strict;
  overflow-wrap: break-word;
}
body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.35; margin: 0; color: var(--ink); text-wrap: balance; }
button { font: inherit; cursor: pointer; color: inherit; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(43, 209, 126, .35); color: #fff; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.nw { white-space: nowrap; }
.mono { font-family: var(--font-mono); letter-spacing: .04em; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===== ปุ่ม ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 12px; border: 1px solid var(--primary);
  background: var(--primary); color: var(--primary-ink);
  font-family: var(--font-head); font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--glow); background: #3ee08f; }
.btn svg { width: 19px; height: 19px; stroke-width: 2; }
.btn-small { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.btn-ghost { background: rgba(255, 255, 255, .03); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(43, 209, 126, .08); border-color: var(--primary); color: var(--ink); }
.btn-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn-fb:hover { background: #2d86f5; box-shadow: 0 8px 26px rgba(24, 119, 242, .35); }

/* ===== ส่วนหัว ===== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(6, 13, 10, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, background .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(6, 13, 10, .9); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
/* โลโก้เต็ม (วงกลม + ชื่อภาษาอังกฤษโค้งด้านล่าง) */
.brand-logo { height: 66px; width: auto; filter: drop-shadow(0 0 12px rgba(43, 209, 126, .22)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-family: var(--font-head); font-size: 17px; color: var(--ink); white-space: nowrap; }
.brand-text small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; color: var(--primary); white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a:not(.btn) { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 500; transition: color .2s, background .2s; }
.site-nav a:not(.btn):hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.site-nav .btn { margin-left: 8px; }

.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent; padding: 0; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0; background-image: var(--pcb); background-size: 240px;
  opacity: .09;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 78% 30%, rgba(31, 181, 163, .16), transparent 70%),
    radial-gradient(520px 380px at 10% 90%, rgba(43, 209, 126, .10), transparent 70%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  padding: 7px 16px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(43, 209, 126, .06);
  font-size: 12.5px; color: var(--accent);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(43, 209, 126, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(43, 209, 126, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 209, 126, 0); } }

.hero h1 { font-size: clamp(32px, 5.2vw, 58px); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.hero h1 > span { display: inline-block; }
.grad {
  background: linear-gradient(92deg, var(--primary) 0%, var(--accent) 55%, var(--teal) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .25em;
}
.lead { margin: 22px 0 32px; font-size: 17.5px; color: var(--text); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats { display: flex; gap: 0; margin: 40px 0 0; padding: 0; }
.hero-stats > div { padding: 0 28px; border-left: 1px solid var(--line); }
.hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero-stats dt { font-family: var(--font-mono); font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.hero-stats dt small { font-family: var(--font-body); font-size: 14px; color: var(--muted); margin-left: 6px; }
.hero-stats dd { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.hero-visual { position: relative; min-height: 520px; }
.hero-visual figure { position: absolute; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: var(--surface); }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hv-main { top: 0; right: 0; width: 64%; height: 520px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(43, 209, 126, .12); }
.hv-sub { left: 0; bottom: 36px; width: 46%; aspect-ratio: 4 / 3; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.hv-term {
  position: absolute; left: 4%; top: 28px; width: 210px;
  border-radius: 14px; border: 1px solid var(--line-strong);
  background: rgba(8, 18, 14, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px;
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a3b33; }
.term-bar i:first-child { background: #e0605a; }
.term-bar i:nth-child(2) { background: #e4b442; }
.term-bar i:nth-child(3) { background: var(--primary); }
.term-bar span { margin-left: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-term ul { list-style: none; margin: 0; padding: 10px 14px 12px; }
.hv-term li { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text); }
.hv-term li span::before { content: "> "; color: var(--muted); }
.hv-term b { font-weight: 500; color: var(--primary); }

/* ===== แถบงานที่รับ ===== */
.strip { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.strip-inner { display: flex; align-items: center; gap: 18px; padding-top: 18px; padding-bottom: 18px; }
.strip-label { flex: none; font-size: 13px; color: var(--primary); }
.strip ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.strip li { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--text); background: rgba(255, 255, 255, .02); white-space: nowrap; }

/* ===== Section ทั่วไป ===== */
.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; color: var(--primary); }
.section-head h2 { font-size: clamp(27px, 3.6vw, 40px); font-weight: 700; }
.section-head p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 17px; }

/* ===== บริการ ===== */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.service {
  position: relative; padding: 30px 28px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), rgba(14, 28, 22, .55));
  border: 1px solid var(--line); overflow: hidden;
  transition: border-color .25s, transform .25s, background .25s;
}
.service::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px 180px at 0% 0%, rgba(43, 209, 126, .12), transparent 70%);
}
.service:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.service:hover::after { opacity: 1; }
.service-icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 20px;
  border-radius: 14px; color: var(--primary);
  background: rgba(43, 209, 126, .08); border: 1px solid var(--line-strong);
}
.service-icon svg { width: 26px; height: 26px; }
.service h3 { font-size: 19.5px; margin-bottom: 8px; }
.service p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ===== ขั้นตอน ===== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 31px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 10%, var(--line-strong) 90%, transparent);
}
.step { position: relative; text-align: center; padding: 0 10px; }
.step-no {
  position: relative; display: inline-grid; place-items: center; width: 62px; height: 62px; margin-bottom: 16px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--primary);
  font-size: 18px; color: var(--primary); box-shadow: 0 0 24px rgba(43, 209, 126, .2);
}
.step h3 { font-size: 18px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ===== ผลงาน ===== */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -12px 0 36px; }
.filter {
  min-height: 42px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font-weight: 500; font-size: 15px; transition: all .2s;
}
.filter:hover { border-color: var(--line-strong); color: var(--ink); }
.filter.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.work-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.work-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.work-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #0b1611; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.work-card:hover .work-cover img { transform: scale(1.05); }
.work-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(6, 13, 10, .65)); pointer-events: none; }
.work-chip {
  position: absolute; z-index: 1; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  background: rgba(6, 13, 10, .78); border: 1px solid var(--line-strong); color: var(--accent);
  font-size: 12.5px; font-weight: 500; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.work-count {
  position: absolute; z-index: 1; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 8px; background: rgba(6, 13, 10, .78); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px;
}
.work-count svg { width: 15px; height: 15px; }
.work-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.work-meta { margin: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--primary); }
.work-body h3 { font-size: 17.5px; line-height: 1.45; }
.work-loc { margin: auto 0 0; padding-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.work-loc svg { width: 16px; height: 16px; }
.works-empty { text-align: center; color: var(--muted); }
.works-more { display: flex; justify-content: center; margin-top: 36px; }
.works-more .btn[hidden] { display: none; }
.works-fb { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.works-fb a { color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.works-fb a:hover { text-decoration: underline; }

.ph { width: 100%; height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; background: var(--surface); }
.ph svg { width: 36px; height: 36px; stroke-width: 1.3; }

/* ===== เกี่ยวกับเรา + Facebook ===== */
.about { display: grid; grid-template-columns: 1fr 500px; gap: 56px; align-items: center; }
.about-text h2 { font-size: clamp(27px, 3.4vw, 38px); margin-bottom: 18px; }
.about-text > p:not(.eyebrow) { margin: 0 0 22px; }
.checklist { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 34px; color: var(--ink); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(43, 209, 126, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bd17e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid var(--line-strong);
}
/* ผังระบบเครือข่าย Dual-WAN (ส่วนเกี่ยวกับเรา) */
.topo-panel {
  --isp1: #2bd17e;   /* สีแสงค่าย 1 */
  --isp2: #38bdf8;   /* สีแสงค่าย 2 */
  --down: #f2555a;
  border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: var(--surface);
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
svg.topo { display: block; width: 100%; height: auto; padding: 12px 8px 0; stroke: none; }
.topo .base path { fill: none; stroke: rgba(150, 200, 175, .16); stroke-width: 2.5; }
.topo .flow path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 5 13; animation: flow 1.4s linear infinite; transition: stroke .5s, opacity .5s; }
@keyframes flow { to { stroke-dashoffset: -36; } }
.topo .w1, .topo .t1, .topo .ga { stroke: var(--isp1); }
.topo .w2, .topo .t2, .topo .gb { stroke: var(--isp2); }
.topo .node rect { fill: #0a1712; stroke: rgba(150, 200, 175, .35); stroke-width: 1.4; transition: stroke .5s, fill .5s; }
.topo .node.core rect { fill: rgba(43, 209, 126, .1); stroke: var(--primary); }
.topo .node.isp1 rect, .topo .node.la rect { stroke: var(--isp1); }
.topo .node.isp2 rect, .topo .node.lb rect { stroke: var(--isp2); }
.topo text { stroke: none; fill: var(--ink); font-family: var(--font-mono); font-size: 13px; text-anchor: middle; }
.topo .node.isp1 text, .topo .node.isp2 text { font-family: var(--font-body); font-weight: 600; font-size: 14px; }
.topo .tag { fill: var(--muted); font-size: 11.5px; letter-spacing: .06em; }
.topo .down { opacity: 0; transition: opacity .4s; }
.topo .down circle { fill: #2a0c0e; stroke: var(--down); stroke-width: 2; }
.topo .down path { fill: none; stroke: var(--down); stroke-width: 2.6; stroke-linecap: round; }

/* ค่าย 2 ล่ม: ปิดเส้นค่าย 2 อุปกรณ์กลุ่ม B สลับมาใช้ค่าย 1 */
.topo-panel[data-state="down2"] .w2, .topo-panel[data-state="down2"] .t2 { opacity: 0; }
.topo-panel[data-state="down2"] .gb { stroke: var(--isp1); }
.topo-panel[data-state="down2"] .lb rect { stroke: var(--isp1); }
.topo-panel[data-state="down2"] .isp2 rect { stroke: var(--down); fill: #1d0b0c; }
.topo-panel[data-state="down2"] .d2 { opacity: 1; }
/* ค่าย 1 ล่ม: ปิดเส้นค่าย 1 อุปกรณ์กลุ่ม A สลับมาใช้ค่าย 2 */
.topo-panel[data-state="down1"] .w1, .topo-panel[data-state="down1"] .t1 { opacity: 0; }
.topo-panel[data-state="down1"] .ga { stroke: var(--isp2); }
.topo-panel[data-state="down1"] .la rect { stroke: var(--isp2); }
.topo-panel[data-state="down1"] .isp1 rect { stroke: var(--down); fill: #1d0b0c; }
.topo-panel[data-state="down1"] .d1 { opacity: 1; }

.topo-status { margin: 4px 18px 0; min-height: 3.4em; font-size: 14.5px; line-height: 1.7; color: var(--text); text-align: center; }
.topo-status b { font-weight: 600; }
.topo-status .c1 { color: var(--isp1); }
.topo-status .c2 { color: var(--isp2); }
.topo-status .cd { color: var(--down); }
.topo-ctrl { display: flex; justify-content: center; gap: 8px; padding: 12px 16px 18px; flex-wrap: wrap; }
.topo-ctrl button {
  min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font-size: 14px; font-weight: 500; transition: all .2s;
}
.topo-ctrl button:hover { border-color: var(--primary); color: var(--ink); }
.topo-ctrl button.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* ===== ติดต่อ ===== */
.contact-panel {
  position: relative; overflow: hidden; padding: 60px 48px; border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(700px 300px at 50% 0%, rgba(43, 209, 126, .14), transparent 70%), var(--surface);
}
.contact-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--pcb); background-size: 240px; opacity: .05;
}
.contact-panel > * { position: relative; }
.contact-panel .section-head { margin-bottom: 36px; }
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; text-align: center;
  border-radius: var(--radius); border: 1px solid var(--line); background: rgba(6, 13, 10, .55); text-decoration: none;
  transition: border-color .2s, transform .2s, background .2s;
}
.contact-card:hover { border-color: var(--primary); transform: translateY(-3px); background: rgba(43, 209, 126, .06); }
.contact-card svg { width: 28px; height: 28px; color: var(--primary); margin-bottom: 6px; }
.contact-card span { font-size: 14px; color: var(--muted); }
.contact-card strong { color: var(--ink); font-size: 17px; font-weight: 600; word-break: break-all; }
.address { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(6, 13, 10, .55); }
.address svg { color: var(--primary); margin-top: 3px; }
.address p { margin: 0; font-size: 15.5px; }
.address strong { color: var(--ink); }
.map-link { display: inline-block; margin-left: 6px; color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.map-link:hover { text-decoration: underline; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 34px; background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.footer-brand img { border-radius: 50%; }
.site-footer p { margin: 0; color: var(--muted); font-size: 14px; }
.site-footer .footer-note { margin-top: 14px; font-size: 12.5px; color: #66806f; }

/* ===== ปุ่มติดต่อลอย (มือถือ) ===== */
.quick-contact { display: none; }

/* ===== หน้าต่างผลงาน ===== */
.work-dialog {
  width: min(1040px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .7);
}
.work-dialog::backdrop { background: rgba(2, 6, 4, .82); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.wd-inner { position: relative; }
.wd-close {
  position: absolute; z-index: 3; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(6, 13, 10, .8); color: var(--ink); font-size: 26px; line-height: 1;
}
.wd-close:hover { border-color: var(--primary); color: var(--primary); }
.wd-gallery { position: relative; background: #030806; }
.wd-stage { aspect-ratio: 16 / 10; max-height: 68vh; display: flex; align-items: center; justify-content: center; }
.wd-stage img { width: 100%; height: 100%; object-fit: contain; }
.wd-stage .ph { min-height: 0; background: transparent; }
.wd-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(6, 13, 10, .75); color: var(--ink); font-size: 30px; line-height: 1;
  display: grid; place-items: center; padding-bottom: 4px;
}
.wd-nav:hover { border-color: var(--primary); color: var(--primary); }
.wd-nav[hidden] { display: none; }
.wd-prev { left: 14px; }
.wd-next { right: 14px; }
.wd-counter { position: absolute; left: 14px; bottom: 12px; padding: 2px 10px; border-radius: 8px; background: rgba(6, 13, 10, .8); color: var(--ink); font-size: 12.5px; }
.wd-counter:empty { display: none; }
.wd-thumbs { display: flex; gap: 8px; padding: 12px 18px; overflow-x: auto; background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.wd-thumbs[hidden] { display: none; }
.wd-thumb { flex: none; width: 76px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; opacity: .5; background: var(--surface); transition: opacity .2s, border-color .2s; }
.wd-thumb:hover { opacity: .85; }
.wd-thumb.is-active { border-color: var(--primary); opacity: 1; }
.wd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wd-thumb .ph { min-height: 0; font-size: 0; }
.wd-thumb .ph svg { width: 20px; height: 20px; }
.wd-info { padding: 22px 28px 30px; }
.wd-meta { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--primary); }
.wd-info h3 { font-size: 23px; }
.wd-detail { margin: 10px 0 0; color: var(--text); white-space: pre-line; }

/* =====================================================================
   แท็บเล็ต (640–1023px)
   ===================================================================== */
@media (max-width: 1023px) {
  .hero { padding: 56px 0 72px; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-text { max-width: 680px; }
  .hero-visual { min-height: 0; height: 480px; max-width: 640px; width: 100%; margin: 0 auto; }
  .hv-main { height: 100%; width: 58%; }
  .hv-sub { width: 52%; bottom: 24px; }
  .services, .works-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .steps::before { display: none; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .topo-panel { max-width: 560px; width: 100%; justify-self: center; }
  .section { padding: 80px 0; }
}

/* เมนูแบบพับ (แท็บเล็ตแนวตั้งลงไป) */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 20px 20px;
    background: rgba(6, 13, 10, .97); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a:not(.btn) { padding: 12px 14px; font-size: 17px; }
  .site-nav .btn { margin: 8px 0 0; min-height: 48px; }
}

/* =====================================================================
   มือถือ (< 640px)
   ===================================================================== */
@media (max-width: 639px) {
  :root { --header-h: 70px; }
  body { font-size: 15.5px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .container { padding: 0 16px; }
  .brand-logo { height: 56px; }
  .brand-text strong { font-size: 15.5px; }
  .brand-text small { font-size: 9.5px; }

  .hero { padding: 40px 0 56px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 36px); }
  .lead { font-size: 16px; margin: 18px 0 26px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-stats { margin-top: 32px; justify-content: space-between; }
  .hero-stats > div { padding: 0 12px; flex: 1; }
  .hero-stats dt { font-size: 24px; }
  .hero-stats dd { font-size: 12.5px; }
  .hero-visual { height: 380px; }
  .hv-main { width: 64%; }
  .hv-sub { width: 56%; bottom: 16px; }
  .hv-term { width: 176px; top: 12px; left: 0; font-size: 11.5px; }

  .strip-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .strip ul { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 16px); padding-right: 16px; scrollbar-width: none; }
  .strip ul::-webkit-scrollbar { display: none; }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .section-head p:not(.eyebrow) { font-size: 15.5px; }
  .services, .works-grid { grid-template-columns: 1fr; gap: 14px; }
  .service { padding: 24px 22px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px 12px; }
  .step-no { width: 54px; height: 54px; font-size: 16px; }
  .step h3 { font-size: 16.5px; }
  .step p { font-size: 14px; }
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: -8px -16px 24px; padding: 0 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }

  .contact-panel { padding: 40px 18px; border-radius: 22px; }
  .contacts { grid-template-columns: 1fr; }
  .contact-card { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 2px 14px; padding: 16px 18px; }
  .contact-card svg { margin: 0; grid-row: span 2; }
  .contact-card span { flex: 1; }
  .contact-card strong { flex-basis: 100%; padding-left: 42px; font-size: 16px; }
  .address { padding: 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  .quick-contact {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(6, 13, 10, .94); border-top: 1px solid var(--line-strong);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .quick-contact a {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 12px;
    font-family: var(--font-head); font-weight: 600; text-decoration: none;
  }
  .quick-contact svg { width: 19px; height: 19px; stroke-width: 2; }
  .qc-call { background: var(--primary); color: var(--primary-ink); }
  .qc-chat { background: #1877f2; color: #fff; }

  .work-dialog { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .wd-stage { aspect-ratio: auto; height: 52dvh; max-height: none; }
  .wd-info { padding: 18px 18px 28px; }
  .wd-info h3 { font-size: 19px; }
  .wd-nav { width: 40px; height: 40px; font-size: 26px; }
  .wd-prev { left: 8px; }
  .wd-next { right: 8px; }
}

/* จอเล็กมาก */
@media (max-width: 359px) {
  .brand-text small { display: none; }
  .hero-stats dt { font-size: 21px; }
  .hero-stats > div { padding: 0 8px; }
  .hero-stats dd { font-size: 11.5px; white-space: nowrap; }
}

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* แสงข้อมูลในผังเครือข่ายยังวิ่งได้ แต่ช้าลง (เป็นการเคลื่อนไหวเล็ก ๆ ไม่กระพริบ) */
  .topo .flow path { animation: flow 3s linear infinite !important; }
}
