/* =========================================================
   PST — บริษัท ป.สิงห์ทอง จำกัด
   Shared stylesheet — ใช้ร่วมกันทุกหน้า
   ========================================================= */

:root {
  --color-primary: #FFC629;
  --color-primary-dark: #E6AC00;
  --color-amber: #EFA51F;
  --color-accent: #FFF4D6;
  --color-dark: #0A2647;
  --color-dark-soft: #123A63;
  --color-navy-deep: #061A30;
  --color-gray: #5C6B80;
  --color-light-gray: #F3F6FB;
  --color-white: #FFFFFF;
  --color-border: #DCE3EE;
  /* สีแบรนด์ LINE — ข้อยกเว้นจาก palette หลัก ใช้เฉพาะปุ่ม LINE เพื่อให้จำได้ทันที */
  --color-line: #06C755;
  --color-line-dark: #05A948;

  --font-base: "Sarabun", "Noto Sans Thai", sans-serif;

  --container-w: 1180px;
  --header-h: 92px;
  --header-h-mobile: 66px;

  --radius: 6px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  font-weight: 400;
  color: var(--color-dark);
  background: var(--color-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* หมายเหตุ: ห้ามใส่ overflow-x: hidden ที่ html/body เพื่อกันขอบ scroll แนวนอน — ค่า
     overflow-x ใด ๆ ที่ไม่ใช่ visible จะบังคับให้ overflow-y กลายเป็น auto ไปด้วยตามสเปก
     ทำให้ element นั้นกลายเป็น scroll container ที่ IntersectionObserver (ใช้ใน Blueprint
     Reveal) คำนวณ intersection ผิดพลาด (ratio ค้างที่ 0 ทั้งที่มองเห็นจริง) แก้ overflow
     แนวนอนที่ต้นเหตุแทน (ดู .carousel-frame — ใช้ --vw-safe จาก JS ไม่ใช่ 100vw ตรง ๆ) */
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

p { color: var(--color-gray); }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-dark);
  font-weight: 700;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  background: var(--color-primary);
  color: var(--color-dark);
}
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}
.btn-outline:hover { background: var(--color-white); color: var(--color-dark); }
.btn-outline-dark {
  background: transparent;
  border-color: var(--color-dark);
  color: var(--color-dark);
}
.btn-outline-dark:hover { background: var(--color-dark); color: var(--color-white); }
.btn-dark {
  background: var(--color-dark);
  color: var(--color-white);
}
.btn-dark:hover { background: #061626; transform: translateY(-2px); }
.btn-line {
  background: var(--color-line);
  color: var(--color-white);
}
.btn-line:hover { background: var(--color-line-dark); transform: translateY(-2px); }

/* ---------- Section helpers ---------- */
.section { padding: 20px 0; }
.section-alt { background: var(--color-light-gray); }
.section-dark { background: var(--color-dark); color: var(--color-white); }
.section-dark p { color: #C9D4E2; }
.section-dark h2 { color: var(--color-white); }

/* ---- ส่วนแนะนำใต้ hero (index.html) — รูปพื้นหลังงานก่อสร้างจริง + overlay ไล่สีกรมท่า ---- */
.intro-band {
  position: relative;
  background: var(--color-dark) url("../images/backgrounds/intro-construction.jpg") center / cover no-repeat;
  background-image: image-set(url("../images/backgrounds/intro-construction.webp") type("image/webp"), url("../images/backgrounds/intro-construction.jpg") type("image/jpeg"));
}
.intro-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(6, 20, 36, 0.94) 15%, rgba(6, 20, 36, 0.72) 55%, rgba(6, 20, 36, 0.4) 100%);
}
.intro-band .container { position: relative; z-index: 1; }

/* หัวข้อของแถบแนะนำใช้ h2 (H1 อยู่ใน hero) แต่คงขนาดเท่าเดิม */
.intro-band .intro-title { font-size: clamp(2rem, 4vw, 3rem); color: var(--color-white); margin-bottom: 18px; }

/* ---- ส่วนผลงานล่าสุด (index.html) — รูปพื้นหลัง blueprint/เหล็กโครงสร้างนามธรรม
   จางกว่า intro-band เพราะมีการ์ดขาวลอยด้านหน้าอยู่แล้ว ไม่ต้องกลบภาพให้เข้มมาก ---- */
.portfolio-band {
  position: relative;
  background: var(--color-dark) url("../images/backgrounds/portfolio-blueprint.jpg") center / cover no-repeat;
  background-image: image-set(url("../images/backgrounds/portfolio-blueprint.webp") type("image/webp"), url("../images/backgrounds/portfolio-blueprint.jpg") type("image/jpeg"));
}
.portfolio-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 20, 36, 0.55);
}
.portfolio-band .container { position: relative; z-index: 1; }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
}
.section-head .eyebrow {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-dark);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section-head h2 { margin-bottom: 12px; }

/* =========================================================
   Header — แถบ navy เต็มความกว้าง เมนูกระจายตัว
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-navy-deep);
  height: var(--header-h-mobile);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    var(--color-primary) 0,
    rgba(255, 198, 41, 0.45) 160px,
    rgba(255, 255, 255, 0.07) 380px,
    rgba(255, 255, 255, 0.07) 100%);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(4, 14, 26, 0.45); }
@media (min-width: 1024px) { .site-header { height: var(--header-h); } }

.site-header .container {
  max-width: none;
  height: 100%;
  padding: 0 clamp(18px, 3vw, 48px);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-white);
}
.brand picture { display: block; flex: none; }
.brand img { height: 46px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)); }
@media (min-width: 1024px) { .brand img { height: 60px; } }
.brand .brand-sub {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
@media (min-width: 1024px) { .brand .brand-sub { font-size: 0.95rem; } }
.brand .brand-en {
  display: block;
  margin-top: 2px;
  font: 600 0.62rem/1.2 var(--font-base);
  letter-spacing: 0.08em;
  color: var(--color-primary);
  white-space: nowrap;
}
@media (min-width: 1024px) { .brand .brand-en { font-size: 0.66rem; } }

.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
  }
  .main-nav a {
    position: relative;
    display: block;
    padding: 12px 2px;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: #DCE6F2;
    transition: color var(--transition);
    animation: nav-in 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .main-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .main-nav a:hover { color: var(--color-white); }
  .main-nav a:hover::after,
  .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
  .main-nav a[aria-current="page"] { color: var(--color-white); font-weight: 600; }
  .main-nav a:nth-child(1) { animation-delay: 0.04s; }
  .main-nav a:nth-child(2) { animation-delay: 0.09s; }
  .main-nav a:nth-child(3) { animation-delay: 0.14s; }
  .main-nav a:nth-child(4) { animation-delay: 0.19s; }
  .main-nav a:nth-child(5) { animation-delay: 0.24s; }
  .main-nav a:nth-child(6) { animation-delay: 0.29s; }
}
@keyframes nav-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: none; }
}

/* ปุ่ม LINE ขวาสุดของแถบ — บนมือถือเหลือแค่ไอคอนเพื่อประหยัดพื้นที่ */
.header-line {
  display: inline-flex;
  flex: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--color-line);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition);
}
.header-line svg { width: 18px; height: 18px; flex: none; }
.header-line span { display: none; }
.header-line:hover { background: var(--color-line-dark); transform: translateY(-1px); }
@media (min-width: 1024px) {
  .header-line {
    width: auto;
    height: auto;
    margin-left: 0;
    padding: 10px 18px;
  }
  .header-line span { display: inline; }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-white);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: var(--header-h-mobile) 0 0 0;
  background: var(--color-dark);
  z-index: 490;
  padding: 14px 20px 28px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition);
}
.mobile-nav.is-open { transform: translateX(0); }
@media (min-width: 1024px) { .mobile-nav { display: none; } }
.mobile-nav a:not(.btn) {
  display: block;
  padding: 17px 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #DCE6F2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition), padding-left var(--transition);
}
.mobile-nav a[aria-current="page"]:not(.btn) {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  padding-left: 14px;
}
.mobile-nav .btn { margin-top: 24px; width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .main-nav a { animation: none; }
  .main-nav a::after { transition: none; }
}

/* =========================================================
   Breadcrumb
   ========================================================= */
.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: var(--color-white); text-decoration: underline; }
.breadcrumb span[aria-hidden] { color: rgba(255,255,255,0.5); }

/* =========================================================
   Hero — homepage
   ========================================================= */
/* ภาพเคลื่อนไหวจากรูปผลงานจริง (แทนวิดีโอ ให้คมชัดเต็มความละเอียด) — ลำดับ/จังหวะตามวิดีโอต้นฉบับ
   อินโทรขาวดำ → แสงวาบ → ชื่อบริษัท → ฉากผลงานซูม/แพนช้า → มืดลง → "ดูรายละเอียดด้านล่าง" 2.5 วิ → วนใหม่
   JS (engine.js: initHeroFilm) สร้าง animation จาก data-t="เริ่ม,จบ" ของแต่ละชั้น */
.hero--film {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--header-h-mobile));
  background: #000;
}
@media (min-width: 1024px) { .hero--film { max-height: calc(100vh - var(--header-h)); } }
@media (max-width: 767px) { .hero--film { aspect-ratio: 4 / 3; } }
.film { position: absolute; inset: 0; }
.film > * { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }
/* รับคลิกเฉพาะช่องทางติดต่อและฉากท้าย (ฉากท้ายซ่อนด้วย visibility เมื่อไม่แสดง) */
.film > .film-contact, .film > .hero-end { pointer-events: auto; }
.film-shot { overflow: hidden; }
.film-shot img { width: 100%; height: 100%; object-fit: cover; display: block; will-change: transform; }
.film-flash img { filter: grayscale(1) contrast(1.25) brightness(0.95) blur(1.5px); }
/* แสงวาบโทนอุ่นแบบ light leak */
.film-leak {
  background:
    radial-gradient(70% 90% at 30% 40%, rgba(255, 244, 214, 0.95) 0%, rgba(255, 220, 150, 0.6) 35%, rgba(255, 198, 41, 0) 70%),
    linear-gradient(115deg, rgba(255, 236, 190, 0.85) 0%, rgba(255, 236, 190, 0) 60%);
  mix-blend-mode: screen;
}
/* ฉากชื่อบริษัท */
.film-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 10px);
  text-align: center;
  /* ขนาดชื่อไทยเป็นตัวตั้ง — ชื่ออังกฤษคำนวณจากค่าเดียวกัน ทำให้ 2 บรรทัดกว้างเท่ากันทุกขนาดจอ */
  --nm: clamp(1.95rem, 6vw, 5.2rem);
  background: radial-gradient(55% 60% at 50% 50%, rgba(6, 20, 36, 0.55) 0%, rgba(6, 20, 36, 0) 75%);
}
.film-logo { width: auto; height: clamp(76px, 13vw, 190px); filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45)); margin-bottom: clamp(4px, 1vw, 12px); }
.film-name-th {
  margin: 0;
  font-size: var(--nm);
  font-weight: 800;
  line-height: 1.3;
  color: var(--color-primary);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
}
.film-name-en {
  margin: 0;
  /* 0.512 = อัตราส่วนที่ทำให้ความกว้างเท่าชื่อไทย (Sarabun ทั้งคู่ วัดจริงแล้ว) */
  font-size: calc(var(--nm) * 0.512);
  font-weight: 700;
  letter-spacing: 0.14em;
  padding-left: 0.14em; /* ชดเชยช่องว่างท้ายบรรทัดจาก letter-spacing ให้ตัวอักษรอยู่กึ่งกลางพอดี */
  white-space: nowrap;
  color: var(--color-white);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.film-black { background: #000; }
.film-leak--r {
  background:
    radial-gradient(60% 80% at 78% 30%, rgba(255, 236, 200, 0.9) 0%, rgba(255, 190, 90, 0.45) 40%, rgba(255, 160, 40, 0) 72%);
}
.film-strobe { background: #fff; mix-blend-mode: soft-light; }
/* เอฟเฟกต์ฟิล์มถาวร: ขอบมืด + เกรนเคลื่อนไหวจาง ๆ (ไม่บังภาพ) */
.film > .film-vignette, .film > .film-grain { opacity: 1; pointer-events: none; }
.film-vignette { background: radial-gradient(120% 95% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.42) 100%); }
.film-grain {
  inset: -50%;
  opacity: 0.07 !important;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: film-grain 0.9s steps(6) infinite;
}
@keyframes film-grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 3%); } 100% { transform: translate(0, 0); }
}

/* ชั้นทับ hero: เส้นตารางพิมพ์เขียวเลื่อนช้า + เส้นสแกน + มุมกรอบแบบ HUD + ป้ายพิกัด
   โปร่งแสงพอให้รู้สึกถึง "งานวิศวกรรม" โดยไม่บังภาพ อยู่ใต้ข้อความทุกชั้น */
.film > .film-hud { opacity: 1; pointer-events: none; overflow: hidden; }
.film-hud {
  background-image:
    linear-gradient(rgba(180, 215, 252, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 215, 252, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(180, 215, 252, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 215, 252, 0.2) 1px, transparent 1px);
  background-size: 240px 240px, 240px 240px, 48px 48px, 48px 48px;
  animation: hud-drift 24s linear infinite;
}
@keyframes hud-drift { to { background-position: 240px 240px, 240px 240px, 48px 48px, 48px 48px; } }
.hud-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(180deg, rgba(255, 198, 41, 0) 0%, rgba(255, 198, 41, 0.07) 80%, rgba(255, 220, 120, 0.22) 99%, rgba(255, 198, 41, 0) 100%);
  animation: hud-scan 6.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes hud-scan { 0% { transform: translateY(0); } 100% { transform: translateY(433%); } }
.hud-corner {
  position: absolute;
  width: clamp(18px, 2.6vw, 42px);
  height: clamp(18px, 2.6vw, 42px);
  border: 0 solid rgba(255, 198, 41, 0.75);
  animation: hud-breathe 3.2s ease-in-out infinite;
}
.hud-tl { top: clamp(10px, 2vw, 28px); left: clamp(10px, 2vw, 28px); border-top-width: 2px; border-left-width: 2px; }
.hud-tr { top: clamp(10px, 2vw, 28px); right: clamp(10px, 2vw, 28px); border-top-width: 2px; border-right-width: 2px; }
.hud-bl { bottom: clamp(10px, 2vw, 28px); left: clamp(10px, 2vw, 28px); border-bottom-width: 2px; border-left-width: 2px; }
.hud-br { bottom: clamp(10px, 2vw, 28px); right: clamp(10px, 2vw, 28px); border-bottom-width: 2px; border-right-width: 2px; }
@keyframes hud-breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }
.hud-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 clamp(0.6rem, 0.85vw, 0.78rem) "Chakra Petch", var(--font-base);
  letter-spacing: 0.18em;
  color: rgba(230, 238, 248, 0.72);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.hud-label-tr { top: clamp(14px, 2.4vw, 34px); right: clamp(40px, 5vw, 84px); }
.hud-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 8px rgba(255, 198, 41, 0.8); animation: hud-breathe 1.6s ease-in-out infinite; }
@media (max-width: 767px) {
  .hud-label { display: none; }
  .film-hud { background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-hud, .hud-scan, .hud-corner, .hud-label i { animation: none; }
  .hud-scan { display: none; }
}

/* ช่องทางติดต่อมุมขวาล่างของ hero — กดโทร/เปิด LINE ได้ (อยู่เหนือภาพ ใต้ฉากท้าย) */
.film > .film-contact {
  opacity: 1;
  inset: auto clamp(40px, 5vw, 84px) clamp(18px, 2.6vw, 38px) auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 198, 41, 0.45);
  background: rgba(6, 26, 48, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 600 clamp(0.8rem, 1vw, 0.98rem) "Chakra Petch", var(--font-base);
  letter-spacing: 0.04em;
  pointer-events: auto;
}
.film-contact a { display: inline-flex; align-items: center; gap: 7px; color: var(--color-white); transition: color var(--transition); }
.film-contact a:hover, .film-contact a:focus-visible { color: var(--color-primary); }
.film-contact svg { width: 16px; height: 16px; color: var(--color-primary); }
.film-contact-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.3); }
@media (max-width: 767px) { .film > .film-contact { display: none; } }

/* ตัวชี้นำ "เลื่อนดูรายละเอียด" กลางขอบล่างของ hero (เหมือนเวอร์ชันก่อน) — เส้นแนวตั้งมีจุดเหลืองไหลลง
   แสดงตลอดภาพเคลื่อนไหว ถูกพื้นดำของฉากท้ายบังไว้ (ฉากท้ายมีปุ่ม "ดูรายละเอียดด้านล่าง" อยู่แล้ว) */
.film > .hero-scroll {
  opacity: 1;
  top: auto;
  right: auto;
  left: 50%;
  bottom: clamp(10px, 1.4vw, 20px);
  transform: translateX(-50%);
  pointer-events: auto;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #DCE6F2;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  transition: color var(--transition);
}
@media (min-width: 1024px) { .film > .hero-scroll { display: inline-flex; } }
/* เว้นที่ขอบล่างให้ตัวชี้นำ: ยกข้อความประจำฉากขึ้นเหนือแนวตัวชี้นำ */
@media (min-width: 1024px) { .film > .film-cap { padding-bottom: clamp(96px, 7.8vw, 116px); } }
.hero-scroll:hover, .hero-scroll:focus-visible { color: var(--color-primary); }
.hero-scroll .track {
  position: relative;
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.hero-scroll .track::after {
  content: "";
  position: absolute;
  left: 0;
  top: -14px;
  width: 1px;
  height: 14px;
  background: var(--color-primary);
  box-shadow: 0 0 6px rgba(255, 198, 41, 0.9);
  animation: scroll-cue 1.9s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}
@keyframes scroll-cue {
  0% { transform: translateY(0); opacity: 0; }
  18% { opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translateY(54px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll .track::after { animation: none; top: 0; opacity: 1; }
}
/* เผื่อระยะให้ sticky header ตอนกระโดดด้วย anchor */
.scroll-target { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ข้อความประจำฉาก — lower-third มุมซ้ายล่าง: แถบเหลืองงอกขึ้น → หัวข้อกวาดเปิด → บรรทัดรองจางเข้า */
.film-cap {
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 1.4vw, 18px);
  padding: clamp(14px, 4.2vw, 64px);
  padding-bottom: clamp(16px, 5vw, 72px);
  background: linear-gradient(20deg, rgba(6, 20, 36, 0.82) 0%, rgba(6, 20, 36, 0.35) 34%, rgba(6, 20, 36, 0) 58%);
  pointer-events: none;
}
.cap-inner { display: flex; align-items: stretch; gap: clamp(10px, 1.4vw, 18px); }
.cap-bar {
  flex: none;
  width: clamp(4px, 0.45vw, 7px);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-amber));
  transform-origin: bottom;
  box-shadow: 0 0 18px rgba(255, 198, 41, 0.45);
}
.cap-body { display: flex; flex-direction: column; gap: clamp(2px, 0.5vw, 8px); max-width: min(72vw, 900px); }
.cap-tag {
  font: 700 clamp(0.78rem, 1.25vw, 1.12rem) "Chakra Petch", var(--font-base);
  letter-spacing: 0.24em;
  color: var(--color-primary);
}
.cap-title {
  margin: 0;
  font-size: clamp(1.45rem, 4.4vw, 4.1rem);
  font-weight: 800;
  line-height: 1.42;
  padding-top: 0.08em;
  color: var(--color-white);
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}
.cap-sub {
  margin: 0;
  font-size: clamp(0.95rem, 1.85vw, 1.55rem);
  font-weight: 600;
  line-height: 1.55;
  color: #D6E1EE;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* ปณิธาน — กลางจอ คำทยอยขึ้นทีละคำ */
.film-mission {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 16px);
  padding: 16px;
  text-align: center;
  background: radial-gradient(70% 60% at 50% 50%, rgba(6, 20, 36, 0.78) 0%, rgba(6, 20, 36, 0.35) 70%, rgba(6, 20, 36, 0.15) 100%);
}
.mission-kicker {
  font: 700 clamp(0.82rem, 1.35vw, 1.2rem) "Chakra Petch", var(--font-base);
  letter-spacing: 0.3em;
  color: var(--color-primary);
}
.mission-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.15em 0.45em;
  font-size: clamp(1.65rem, 4.9vw, 4.5rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--color-white);
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}
.mission-line i { font-style: normal; color: var(--color-primary); }
@media (max-width: 767px) {
  .cap-body { max-width: 82vw; }
  .film-cap { background: linear-gradient(0deg, rgba(6, 20, 36, 0.85) 0%, rgba(6, 20, 36, 0.3) 45%, rgba(6, 20, 36, 0) 70%); }
}
@media (prefers-reduced-motion: reduce) { .film-grain { animation: none; } }
/* ไม่มี JS: แสดงฉากชื่อบริษัทบนรูปนิ่ง */
.hero--film:not(.is-live) .film-shot:nth-child(4),
.hero--film:not(.is-live) .film-title { opacity: 1; }
/* ตั้งค่าลดการเคลื่อนไหว: รูปนิ่ง + ชื่อบริษัท + ปุ่มดูรายละเอียด */
.hero--film.is-still .film-shot:nth-child(4),
.hero--film.is-still .film-title { opacity: 1; }
.hero--film.is-still .hero-end { opacity: 1; visibility: visible; background: none; justify-content: flex-end; padding-bottom: 6%; }
.hero--film.is-still .hero-end-kicker { display: none; }

/* ฉากท้ายคลิป */
.hero-end {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vw, 22px);
  padding: 16px;
  text-align: center;
  color: var(--color-white);
  background:
    radial-gradient(60% 70% at 50% 55%, rgba(18, 58, 99, 0.55) 0%, rgba(6, 20, 36, 0.92) 70%),
    repeating-linear-gradient(0deg, rgba(150, 190, 235, 0.07) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(150, 190, 235, 0.07) 0 1px, transparent 1px 48px);
  visibility: hidden;
}
.hero-end-kicker {
  margin: 0;
  font-size: clamp(0.95rem, 1.95vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #C9D4E2;
}
.hero-end-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.4vw, 14px);
  font-size: clamp(1.55rem, 4.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--color-white);
}
.hero-end-cta:hover { color: var(--color-primary); }
.hero-end-arrow {
  display: grid;
  place-items: center;
  width: clamp(48px, 6.6vw, 84px);
  height: clamp(48px, 6.6vw, 84px);
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-dark);
  box-shadow: 0 0 0 0 rgba(255, 198, 41, 0.55);
  animation: hero-end-pulse 2s ease-out infinite;
}
.hero-end-arrow svg { width: 55%; height: 55%; animation: hero-end-bob 1.6s ease-in-out infinite; }
@keyframes hero-end-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 198, 41, 0.5); } 100% { box-shadow: 0 0 0 18px rgba(255, 198, 41, 0); } }
@keyframes hero-end-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) {
  .hero-end-arrow, .hero-end-arrow svg { animation: none; }
  .hero-end, .hero-end > * { transition: none; }
}
/* จอแคบ (คลิป 16:9 สูงราว 200px): ตัดบรรทัดเล็กออก และให้ปุ่มชิดกันน้อยลง */
@media (max-width: 520px) {
  .hero-end { gap: 10px; }
  .hero-end-kicker { display: none; }
  .hero-end-cta { flex-direction: row; gap: 12px; font-size: 1.4rem; }
  .hero-end-arrow { width: 44px; height: 44px; }
}
/* ปุ่มของฉากท้ายพาลงมาที่แถบแนะนำ — เว้นที่ให้ header ที่ติดด้านบน */
.intro-band { scroll-margin-top: var(--header-h-mobile); }
@media (min-width: 1024px) { .intro-band { scroll-margin-top: var(--header-h); } }

.hero-content { max-width: 700px; }
.hero-content .eyebrow {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-content h1 { margin-bottom: 18px; color: var(--color-white); }
.hero-content p.lead {
  color: #D6E1EE;
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
}
.hero-stats .stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
}
.hero-stats .stat-label { font-size: 0.85rem; color: #B9C6D6; }

/* ---------- Small hero (inner pages) — พื้นหลังพิมพ์เขียว (blueprint) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  color: var(--color-white);
  padding: 64px 0 52px;
  background-color: #0B3A6B;
  background-image:
    linear-gradient(rgba(170, 214, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 214, 255, 0.22) 1px, transparent 1px),
    linear-gradient(rgba(170, 214, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 214, 255, 0.09) 1px, transparent 1px),
    radial-gradient(120% 140% at 15% 0%, #13508f 0%, #0B3A6B 45%, var(--color-navy-deep) 100%);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px, auto;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px, 0 0;
}
/* ลายเส้น isometric อุปกรณ์งาน Facility (ชุดเดียวกับพื้นหลัง section บริการ หน้าแรก) สีฟ้าอ่อนบนพิมพ์เขียว
   วางขนาดจริง 1:1 ซ้าย-ขวา ฝั่งซ้ายจางลงด้วย mask เพื่อไม่รบกวนหัวข้อ */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("../images/backgrounds/hero-lines-r.png"),
    url("../images/backgrounds/hero-lines-l.png");
  background-image:
    image-set(url("../images/backgrounds/hero-lines-r.webp") type("image/webp"), url("../images/backgrounds/hero-lines-r.png") type("image/png")),
    image-set(url("../images/backgrounds/hero-lines-l.webp") type("image/webp"), url("../images/backgrounds/hero-lines-l.png") type("image/png"));
  background-position: right -8px, left -8px;
  background-size: 356px auto, 470px auto;
  background-repeat: no-repeat;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0, rgba(0, 0, 0, 0.18) 34%, rgba(0, 0, 0, 0.5) 62%, #000 82%);
          mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0, rgba(0, 0, 0, 0.18) 34%, rgba(0, 0, 0, 0.5) 62%, #000 82%);
  pointer-events: none;
}
/* กรอบมุมแบบแบบพิมพ์ + ไม้บรรทัดสีเหลืองด้านล่าง */
.page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 198, 41, 0.85) 0 1px, transparent 1px 24px) bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 198, 41, 0.5) 0 1px, transparent 1px 6px) bottom / 100% 5px no-repeat,
    linear-gradient(var(--color-primary), var(--color-primary)) bottom / 100% 2px no-repeat;
  pointer-events: none;
}
@media (max-width: 767px) {
  .page-hero { padding: 48px 0 40px; }
  .page-hero::before { background-size: 230px auto, 300px auto; opacity: 0.4; }
}
.page-hero .container { position: relative; }
.page-hero h1 { color: var(--color-white); margin-bottom: 8px; }
.page-hero p { color: #D3E2F3; max-width: 640px; }
.page-hero h1, .page-hero p { text-shadow: 0 2px 14px rgba(6, 26, 48, 0.55); }

/* =========================================================
   Services grid (11 บริการ)
   ========================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (min-width: 768px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card {
  display: block;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.service-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray);
}
.service-card .thumb svg { width: 40px; height: 40px; color: var(--color-dark); }
.service-card .body { padding: 16px 18px 20px; }
.service-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.service-card p { font-size: 0.87rem; margin: 0; }
.service-card .arrow { color: var(--color-dark); font-weight: 700; font-size: 0.85rem; display: inline-block; margin-top: 10px; }

/* ---- หน้า services.html: การ์ดที่มีรูปผลงานจริง + การ์ดไอคอนบนพื้นพิมพ์เขียว (บริการที่ยังไม่มีรูป) ---- */
.services-grid--hub .service-card .thumb {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(170, 210, 250, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 210, 250, 0.16) 1px, transparent 1px),
    radial-gradient(80% 90% at 50% 40%, #14467a 0%, var(--color-dark) 70%);
  background-size: 24px 24px, 24px 24px, auto;
}
.services-grid--hub .service-card .thumb svg { width: 52px; height: 52px; color: var(--color-primary); filter: drop-shadow(0 0 10px rgba(255, 198, 41, 0.35)); }
.services-grid--hub .service-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.services-grid--hub .service-card:hover .thumb img { transform: scale(1.07); }
.services-grid--hub .service-card.has-photo .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 20, 36, 0.45) 0%, rgba(6, 20, 36, 0) 45%);
  pointer-events: none;
}
.thumb-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---- หน้าแรกเท่านั้น: พื้นหลังลายเส้น isometric อุปกรณ์งาน Facility จางบนพื้นขาว ---- */
/* แยกลายเส้นออกจากพื้น (PNG/WebP โปร่งใส) แล้ววางซ้าย-ขวาที่ขนาดจริง 1:1 ไม่ขยายภาพ จึงคมชัด
   พื้นไล่สีวาดด้วย CSS แทนการยืดรูปทั้งใบ */
#services {
  background-color: #F7F9FC;
  background-image:
    url("../images/backgrounds/services-lines-l.png"),
    url("../images/backgrounds/services-lines-r.png"),
    linear-gradient(180deg, #FFFFFF 0%, #F4F6FA 55%, #EDF1F6 100%);
  background-image:
    image-set(url("../images/backgrounds/services-lines-l.webp") type("image/webp"), url("../images/backgrounds/services-lines-l.png") type("image/png")),
    image-set(url("../images/backgrounds/services-lines-r.webp") type("image/webp"), url("../images/backgrounds/services-lines-r.png") type("image/png")),
    linear-gradient(180deg, #FFFFFF 0%, #F4F6FA 55%, #EDF1F6 100%);
  background-position: left top, right top, 0 0;
  background-size: 470px auto, 356px auto, auto;
  background-repeat: no-repeat;
}
@media (max-width: 767px) {
  #services { background-size: 282px auto, 214px auto, auto; }
}

/* ---- หน้าแรกเท่านั้น: จัด grid แบบ Asymmetrical (บริการเด่น 3 ใบขนาดใหญ่กว่าใบอื่น
   ใน .services-grid ทั่วเว็บที่อื่นยังเป็น grid สมมาตรปกติเหมือนเดิม) ---- */
#services .services-grid {
  grid-auto-flow: dense;
  grid-auto-rows: 190px;
}
/* 11 การ์ดพอดีตาราง ไม่เหลือช่องว่าง — มือถือ 2 คอลัมน์: ใบสุดท้ายกว้างเต็มแถว,
   แท็บเล็ต 3 คอลัมน์: 15 ช่อง (4+2+9), จอใหญ่ 4 คอลัมน์: 16 ช่อง (4+2+2+8) */
@media (max-width: 767px) {
  #services .service-card:nth-child(11) { grid-column: span 2; }
}
@media (min-width: 768px) {
  #services .service-card:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  #services .service-card:nth-child(6) { grid-column: span 2; }
}
@media (min-width: 1024px) {
  /* Duct Hood: คอลัมน์ขวาสุด แถว 3–4 — ปิดมุมล่างขวาของตาราง */
  #services .service-card:nth-child(9) { grid-column: 4; grid-row: 3 / span 2; }
}

/* ---- หน้าแรกเท่านั้น: การ์ดเป็นรูปเต็มใบ ชี้เมาส์แล้วรายละเอียดเลื่อนขึ้นทับ
   (ปกติเห็นแค่ไอคอน + ชื่อบริการแถบล่าง ชี้ค้างจะโชว์คำอธิบาย + ลิงก์) ---- */
#services .service-card {
  position: relative;
  isolation: isolate;
}
#services .service-card .thumb {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}
#services .service-card .thumb svg {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#services .service-card:hover .thumb svg,
#services .service-card:focus-visible .thumb svg { transform: scale(1.12) translateY(-4px); }
#services .service-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
#services .service-card:hover .thumb img,
#services .service-card:focus-visible .thumb img { transform: scale(1.06); }

#services .service-card .body {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(6, 20, 36, 0.94) 0%, rgba(6, 20, 36, 0.82) 48%, rgba(6, 20, 36, 0) 100%);
  transform: translateY(calc(100% - 54px));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#services .service-card h3 { color: var(--color-white); margin-bottom: 6px; }
#services .service-card p,
#services .service-card .arrow {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.3s ease;
}
#services .service-card p { color: #D6E1EE; }
#services .service-card .arrow { color: var(--color-primary); margin-top: 8px; }

#services .service-card:hover .body,
#services .service-card:focus-visible .body { transform: translateY(0); }
#services .service-card:hover p, #services .service-card:hover .arrow,
#services .service-card:focus-visible p, #services .service-card:focus-visible .arrow {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}
@media (prefers-reduced-motion: reduce) {
  #services .service-card .body { transition: none; }
  #services .service-card p, #services .service-card .arrow { transition: none; }
  #services .service-card .thumb svg { transition: none; }
}

/* =========================================================
   Cards — generic (values / about)
   ========================================================= */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.info-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.info-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.info-card .icon svg { width: 24px; height: 24px; }
.info-card h3 { margin-bottom: 6px; }
.info-card p { font-size: 0.92rem; margin: 0; }

/* =========================================================
   Values strip — ค่านิยมองค์กรบนหน้าแรก (เวอร์ชันทันสมัย/editorial)
   ตัวเลขกำกับ + ไอคอนกระเด้ง/หมุนตอน hover + เส้นใต้หัวข้อวาดเข้าเมื่อชี้
   ต่างจาก .info-card ธรรมดาที่ใช้ในหน้า about.html โดยตั้งใจ
   ========================================================= */
.values-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}
@media (max-width: 1023px) { .values-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .values-strip { grid-template-columns: 1fr; } }

.value-mark {
  position: relative;
  overflow: hidden;
  padding: 36px 26px 30px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.value-mark:hover { background: var(--color-light-gray); }

.value-num {
  position: absolute;
  top: 2px;
  right: 14px;
  z-index: 0;
  font-size: 3.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-light-gray);
  transition: color 0.35s ease;
  font-variant-numeric: tabular-nums;
}
.value-mark:hover .value-num { color: var(--color-accent); }

.value-icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background var(--transition);
}
.value-icon svg { width: 24px; height: 24px; }
.value-mark:hover .value-icon { transform: scale(1.1) rotate(-8deg); background: var(--color-primary); }

.value-mark h3 {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 1.04rem;
  margin-bottom: 9px;
}
.value-mark h3::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  margin-top: 6px;
  background: var(--color-primary);
  transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.value-mark:hover h3::after { width: 100%; }

.value-mark p { position: relative; z-index: 1; font-size: 0.88rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .value-icon, .value-mark h3::after, .value-num { transition: none; }
}

/* ---------- Scope list (service sub-pages) ---------- */
.scope-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0 8px;
}
@media (min-width: 768px) { .scope-list { grid-template-columns: repeat(2, 1fr); } }
.scope-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-light-gray);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.94rem;
}
.scope-list li svg {
  width: 18px; height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--color-dark);
}

/* =========================================================
   Empty state (เช่น หน้าบทความที่ยังไม่มีเนื้อหา)
   ========================================================= */
.empty-state {
  max-width: 560px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}
.empty-state .icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state .icon svg { width: 30px; height: 30px; }
.empty-state h2 { margin-bottom: 12px; }
.empty-state p { margin-bottom: 28px; }

/* =========================================================
   Mission banner — ปณิธาน: "สองบล็อกแยกกัน วางซ้อนเหลื่อม"
   บล็อกส้ม (ปณิธาน/Resolution) เป็นคนละกล่องกับบล็อกเหลือง (คำคม)
   ส้มเลื่อนขึ้น-ชิดซ้าย ทับบนเหลืองที่เลื่อนลง-ไปทางขวา จึงเห็นพื้นหลัง
   เป็นร่องแคบ ๆ ที่ขอบบน-ขวา และขอบล่าง-ซ้าย ตามภาพต้นแบบ
   มือถือ: วางเรียงลงมาเป็นสองกล่องเต็มความกว้าง
   ========================================================= */
.mission-banner {
  --mb-offset: 11px;      /* ระยะเหลื่อมแนวตั้งของสองบล็อก */
  --mb-label-w: 38%;      /* ความกว้างบล็อกส้ม (วัดจากความกว้างแบนเนอร์) */
  --mb-quote-x: 27%;      /* จุดเริ่มของบล็อกเหลือง */
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 4px 0;
}

/* ---------- บล็อกส้ม: ปณิธาน / Resolution ---------- */
.mission-label-card {
  order: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 22px 20px 24px;
  text-align: center;
  background: var(--color-amber);
}
@media (min-width: 768px) {
  .mission-label-card {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    bottom: var(--mb-offset);
    width: var(--mb-label-w);
    align-items: flex-start;
    text-align: left;
    padding: 0 13% 0 7%;
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
  }
}

.mission-th {
  font-size: clamp(2rem, 4.1vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-dark);
}
.mission-en {
  font-size: clamp(1.05rem, 1.9vw, 1.45rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-white);
}
@media (min-width: 768px) { .mission-en { margin-left: 1.9em; } }

/* ---------- บล็อกเหลือง: คำคม ---------- */
.mission-quote-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 28px;
  background: var(--color-primary);
}
@media (min-width: 768px) {
  .mission-quote-card {
    position: relative;
    z-index: 2;
    margin-left: var(--mb-quote-x);
    margin-top: var(--mb-offset);
    padding: 34px 5% 38px 11%;
    clip-path: polygon(7.6% 0, 100% 0, 98% 100%, 0 100%);
  }
}

.mission-quote-card p {
  margin: 0;
  max-width: 30em;
  text-align: center;
  text-wrap: balance;
  color: var(--color-dark);
  font-size: clamp(1.06rem, 1.65vw, 1.25rem);
  font-weight: 600;
  line-height: 2;
}
.quote-mark {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1em;
  font-weight: 700;
  line-height: 0;
  vertical-align: -0.3em;
  color: var(--color-dark);
}
.quote-mark-open { margin-right: 0.08em; }
.quote-mark-close { margin-left: 0.08em; }

/* ---- animation: สองบล็อกเลื่อนเข้าหากันจนซ้อนเหลื่อม แล้วคำพูดเด้งตาม ----
   ใช้ transform ล้วน ไม่แตะ clip-path ของ .mission-banner ที่ IntersectionObserver
   เฝ้าอยู่ เพราะ clip-path บน element ที่ถูกเฝ้าเองทำให้ ratio ถูกคำนวณผิดเป็น 0 */
.mission-label-card,
.mission-quote-card {
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.mission-label-card { transform: translateY(-18px); }
.mission-quote-card { transform: translateY(18px); transition-delay: 0.1s; }
@media (min-width: 768px) {
  .mission-label-card { transform: translateX(-56px); }
  .mission-quote-card { transform: translateX(56px); }
}
.mission-banner.is-revealed .mission-label-card,
.mission-banner.is-revealed .mission-quote-card { opacity: 1; transform: none; }

.quote-mark {
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.62s, opacity 0.3s ease 0.62s;
}
.mission-banner.is-revealed .quote-mark { transform: scale(1); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .mission-label-card, .mission-quote-card, .quote-mark {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   Timeline / facts (about)
   ========================================================= */
.fact-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 32px 0;
}
@media (min-width: 768px) { .fact-row { grid-template-columns: repeat(3, 1fr); } }
.fact-item {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--color-light-gray);
}
.fact-item .label { font-size: 0.8rem; color: var(--color-gray); margin-bottom: 4px; }
.fact-item .value { font-size: 1.05rem; font-weight: 700; color: var(--color-dark); }

/* =========================================================
   Gallery / Portfolio grid + Lightbox
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-light-gray);
  border: none;
  padding: 0;
  display: block;
  width: 100%;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .placeholder-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-gray);
  background: repeating-linear-gradient(45deg, #E7ECF3 0 10px, #F3F6FB 10px 20px);
}
.gallery-item .placeholder-ph svg { width: 32px; height: 32px; opacity: 0.6; }
.gallery-item .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.72), transparent);
  color: var(--color-white);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 16, 30, 0.93);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay .lb-content { max-width: 900px; width: 100%; text-align: center; }
.lightbox-overlay img { max-height: 80vh; margin: 0 auto; border-radius: 4px; }
.lightbox-overlay .lb-caption { color: var(--color-white); margin-top: 14px; font-size: 0.95rem; }
.lightbox-overlay .lb-close,
.lightbox-overlay .lb-prev,
.lightbox-overlay .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background var(--transition);
}
.lightbox-overlay .lb-close:hover,
.lightbox-overlay .lb-prev:hover,
.lightbox-overlay .lb-next:hover { background: rgba(255,255,255,0.25); }
.lightbox-overlay .lb-close { top: 20px; right: 20px; }
.lightbox-overlay .lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-overlay .lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* =========================================================
   Carousel — ผลงานล่าสุด, แสดงแบบ Cover Flow (สไลด์อัตโนมัติทุก 5 วิ)
   ตัวเลขระยะ/มุม/สเกล กำหนดเป็น custom property บน .carousel-viewport
   เพื่อให้ JS อ่านค่าเดียวกับที่ CSS ใช้จริง ณ breakpoint นั้น ๆ (ไม่ hardcode ซ้ำ)
   ========================================================= */
/* การ์ดขนาดใหญ่ขึ้นทำให้กว้างเกิน .container (1180px) — ดึงเฟรมออกมาเต็มความกว้างจอจริง
   แล้วไปตัดขอบ (overflow) ที่ .carousel-viewport แทน เพื่อไม่ให้การ์ดที่ซ่อนอยู่ (opacity:0)
   ดันความกว้างเอกสารจนเกิด scrollbar แนวนอน
   ใช้ --vw-safe (คำนวณจริงจาก JS ด้วย clientWidth) แทน 100vw ตรง ๆ เพราะ 100vw ในหลาย
   เบราว์เซอร์รวมความหนา scrollbar เข้าไปด้วย ทำให้กว้างเกินจอจริงไม่กี่ px — ถ้าแก้ด้วยการใส่
   overflow-x:hidden ที่ body จะไปกระทบ overflow-y (สเปกบังคับให้กลายเป็น auto) จนกลายเป็น
   scroll container ซ้อนกับ html โดยไม่ตั้งใจ และทำให้ IntersectionObserver ของ Blueprint
   Reveal คำนวณ intersection ผิดพลาด (ดูรายละเอียดที่ engine.js: initSafeViewportWidth) */
.carousel-frame {
  position: relative;
  width: var(--vw-safe, 100vw);
  margin-left: calc((100% - var(--vw-safe, 100vw)) / 2);
}

.carousel-viewport {
  --cf-card-w: 525px;
  --cf-track-h: 510px;
  --cf-x1: 368px;
  --cf-x2: 651px;
  --cf-x3: 900px;
  --cf-z1: -228px;
  --cf-z2: -473px;
  --cf-z3: -690px;
  --cf-rot: 50deg;
  --cf-scale1: 0.8;
  --cf-scale2: 0.62;
  --cf-scale3: 0.48;
  overflow: hidden;
  perspective: 1500px;
  padding: 10px 0;
}
@media (max-width: 639px) {
  .carousel-viewport {
    --cf-card-w: 364px;
    --cf-track-h: 459px;
    --cf-x1: 189px;
    --cf-x2: 308px;
    --cf-x3: 415px;
    --cf-z1: -149px;
    --cf-z2: -289px;
    --cf-z3: -420px;
    --cf-rot: 54deg;
    --cf-scale1: 0.72;
    --cf-scale2: 0.52;
    --cf-scale3: 0.38;
  }
}

.carousel-track {
  position: relative;
  height: var(--cf-track-h);
  list-style: none;
  margin: 0;
  padding: 0;
  transform-style: preserve-3d;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--cf-card-w);
  margin-left: calc(var(--cf-card-w) / -2);
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.3, 1), opacity 0.6s ease;
  cursor: pointer;
}
.carousel-slide.is-active { cursor: default; }

.carousel-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(4, 14, 26, 0.45);
}
.carousel-card-media {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-gray);
  background: repeating-linear-gradient(45deg, #E7ECF3 0 10px, #F3F6FB 10px 20px);
}
.carousel-card-media { position: relative; overflow: hidden; }
.carousel-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-card-media svg { width: 46px; height: 46px; opacity: 0.6; }
.carousel-card-body { padding: 22px 26px 28px; }
.carousel-card-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-dark);
  background: var(--color-accent);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.carousel-card h3 { font-size: 1.35rem; margin: 0; line-height: 1.4; }
@media (max-width: 639px) {
  .carousel-card-body { padding: 17px 19px 20px; }
  .carousel-card-media svg { width: 36px; height: 36px; }
  .carousel-card-tag { font-size: 0.72rem; }
  .carousel-card h3 { font-size: 1.08rem; }
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--color-white);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow:hover { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-dark); }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }
@media (max-width: 639px) {
  .carousel-arrow { width: 36px; height: 36px; }
  .carousel-arrow svg { width: 16px; height: 16px; }
  .carousel-arrow.prev { left: 8px; }
  .carousel-arrow.next { right: 8px; }
}

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background var(--transition), width var(--transition);
}
.carousel-dot.is-active { background: rgba(255, 198, 41, 0.35); width: 34px; position: relative; overflow: hidden; }
/* แถบนับเวลาในจุดที่ active — เต็มเมื่อถึงเวลาเลื่อนไปสไลด์ถัดไป */
.carousel-dot.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform-origin: left;
  animation: carousel-dot-fill var(--carousel-interval, 5000ms) linear forwards;
}
[data-carousel].is-paused .carousel-dot.is-active::after { animation-play-state: paused; }
@keyframes carousel-dot-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .carousel-dot.is-active::after { animation: none; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none; }
}

/* =========================================================
   Clients grid
   ========================================================= */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) { .clients-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .clients-grid { grid-template-columns: repeat(3, 1fr); } }

.client-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  background: var(--color-white);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.client-card:hover { box-shadow: var(--shadow-sm); border-color: var(--color-primary); }
.client-card .logo-ph {
  width: 100%;
  height: 84px;
  background: var(--color-light-gray);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-gray);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 8px;
}
.client-card .logo-ph svg { width: 26px; height: 26px; color: var(--color-dark); }
.client-card .name { font-weight: 600; font-size: 0.98rem; }
.client-card .loc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: -6px;
  font-size: 0.84rem;
  color: var(--color-gray);
}
.client-card .loc svg { width: 15px; height: 15px; flex: none; color: var(--color-amber); }

.client-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (min-width: 768px) { .client-strip { grid-template-columns: repeat(5, 1fr); } }
.client-strip .logo-ph {
  height: 64px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-gray);
  text-align: center;
  padding: 6px;
}
/* =========================================================
   แผนที่พื้นที่ให้บริการ (หน้าแรก — section "ลูกค้าของเรา")
   แนว "ศูนย์ควบคุม Facility": แผนที่ SVG เต็ม section + แผงรายการแบบกระจกฝ้า
   ≥1200px  แผนที่เป็นพื้นหลังเต็ม section, ข้อความ/แผงลอยทับ
   <1200px  เรียงเป็น หัวข้อ → แถบแผนที่เต็มความกว้าง → แผงรายการ
   ========================================================= */
.client-map-section {
  --cm-hud: "Chakra Petch", var(--font-base);
  --cm-ink: #E6EEF8;
  --cm-mute: #9FB2C9;
  --cm-line: rgba(255, 198, 41, 0.24);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--cm-ink);
  background:
    radial-gradient(70% 60% at 42% 62%, #14467a 0%, rgba(20, 70, 122, 0) 70%),
    radial-gradient(50% 50% at 90% 10%, rgba(255, 198, 41, 0.07) 0%, rgba(255, 198, 41, 0) 70%),
    linear-gradient(180deg, #0A2647 0%, var(--color-navy-deep) 100%);
}
/* เกรนจาง ๆ ให้พื้นมีมิติ */
.client-map-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- SVG layers ---------- */
.cm-stage { position: relative; z-index: 0; }
.cm-svg { display: block; }
.cm-base { opacity: 0.95; }
.cm-grid line { stroke: rgba(255, 255, 255, 0.055); stroke-width: 1; }
.cm-ticks text { fill: rgba(170, 195, 225, 0.45); font: 600 14px var(--cm-hud); letter-spacing: 0.08em; }
.cm-estates path { fill: rgba(200, 215, 235, 0.05); stroke: rgba(200, 215, 235, 0.32); stroke-width: 1; stroke-dasharray: 3 4; }
.cm-estates text { fill: rgba(200, 215, 235, 0.55); font: 600 13px var(--font-base); }
.cm-towns circle { fill: rgba(220, 232, 247, 0.55); }
.cm-towns text { fill: rgba(220, 232, 247, 0.62); font: 600 15px var(--font-base); paint-order: stroke; stroke: rgba(6, 26, 48, 0.85); stroke-width: 4px; stroke-linejoin: round; }
.cm-rings circle { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.2; stroke-dasharray: 2 8; transform-box: view-box; transform-origin: 706.7px 530.5px; }
.cm-rings text { fill: rgba(200, 216, 236, 0.55); font: 600 14px var(--cm-hud); letter-spacing: 0.06em; }
.cm-sweep-arm { transform-box: view-box; transform-origin: 706.7px 530.5px; animation: cm-sweep 9s linear infinite; }
.cm-sweep line { stroke: rgba(255, 198, 41, 0.55); stroke-width: 1.5; }
@keyframes cm-sweep { to { transform: rotate(360deg); } }
.cm-city circle { fill: none; stroke: rgba(230, 238, 248, 0.75); stroke-width: 2; }
.cm-city circle.c { fill: rgba(230, 238, 248, 0.85); stroke: none; }
.cm-city text { fill: rgba(220, 232, 247, 0.78); font: 600 18px var(--font-base); }
.cm-zones path { fill: rgba(255, 198, 41, 0.16); stroke: var(--color-primary); stroke-opacity: 0.8; stroke-width: 1.6; stroke-dasharray: 5 4; transition: fill 0.3s ease; }
.cm-zone.is-active path { fill: rgba(255, 198, 41, 0.34); }
.cm-routes path { fill: none; stroke-linecap: round; }
.cm-routes .base { stroke: rgba(255, 198, 41, 0.35); stroke-width: 1.5; }
.cm-routes .flow { stroke: var(--color-primary); stroke-width: 2.5; stroke-dasharray: 2 12; animation: cm-flow 1.4s linear infinite; }
@keyframes cm-flow { to { stroke-dashoffset: -28; } }

/* หมุด */
.cm-pin { cursor: default; }
.cm-pin .pulse { fill: rgba(255, 198, 41, 0.25); animation: cm-pulse 2.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.cm-pin .halo { fill: rgba(255, 198, 41, 0.35); filter: blur(6px); }
.cm-pin .ticks line { stroke: rgba(255, 198, 41, 0.75); stroke-width: 2; stroke-linecap: round; }
.cm-pin .core { fill: var(--color-primary); stroke: var(--color-navy-deep); stroke-width: 3; }
.cm-pin .count { fill: var(--color-navy-deep); font: 700 18px var(--cm-hud); }
.cm-pin-hq .core { fill: #fff; }
.cm-pin-hq .dot { fill: var(--color-dark); }
.cm-pin-hq .pulse { fill: rgba(255, 255, 255, 0.22); }
.cm-pin-hq .halo { fill: rgba(255, 255, 255, 0.3); }
.cm-pin-hq .ticks line { stroke: rgba(255, 255, 255, 0.8); }
@keyframes cm-pulse { 0% { transform: scale(0.5); opacity: 0.95; } 100% { transform: scale(1.7); opacity: 0; } }
.cm-pin-s { transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.cm-pin.is-active .cm-pin-s { transform: scale(1.28); }
.cm-label {
  fill: #fff;
  font: 700 22px var(--font-base);
  paint-order: stroke;
  stroke: rgba(6, 26, 48, 0.9);
  stroke-width: 6px;
  stroke-linejoin: round;
}
.cm-coord { fill: rgba(255, 198, 41, 0.9); font: 600 15px var(--cm-hud); letter-spacing: 0.06em; paint-order: stroke; stroke: rgba(6, 26, 48, 0.9); stroke-width: 5px; }
.cm-pin.is-active .cm-label { fill: var(--color-primary); }

/* ---------- ข้อความ / สถิติ ---------- */
.cm-layout { position: relative; z-index: 2; }
.cm-head { text-align: left; max-width: 680px; margin: 0; }
.cm-head h2 { text-wrap: balance; }
.cm-head h2 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.25; margin-bottom: 12px; }
.cm-head p { color: var(--cm-mute); font-size: 1.02rem; margin: 0; }

.cm-stats { display: flex; gap: 0; margin: 0; }
.cm-stats > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 4px 26px;
  border-left: 1px solid var(--cm-line);
}
.cm-stats > div:first-child { padding-left: 0; border-left: 0; }
.cm-stats dd { margin: 0; font: 700 clamp(2rem, 3.4vw, 2.9rem)/1 var(--cm-hud); color: var(--color-primary); letter-spacing: 0.02em; }
.cm-stats dd small { font-size: 0.55em; margin-right: 2px; color: rgba(255, 198, 41, 0.7); }
.cm-stats dt { font-size: 0.8rem; color: var(--cm-mute); white-space: nowrap; }

/* ---------- แผงรายการ ---------- */
.cm-panel {
  position: relative;
  background: linear-gradient(160deg, rgba(18, 58, 99, 0.72) 0%, rgba(6, 26, 48, 0.82) 100%);
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  padding: 20px 20px 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
/* มุมกรอบแบบ HUD */
.cm-panel::before, .cm-panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-primary);
  pointer-events: none;
}
.cm-panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.cm-panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

.cm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 8px; }
.cm-hud { font: 600 0.7rem var(--cm-hud); letter-spacing: 0.2em; color: rgba(255, 198, 41, 0.85); }
.cm-live { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; color: #fff; }
.cm-live i { width: 8px; height: 8px; border-radius: 50%; background: #3BE08A; box-shadow: 0 0 0 0 rgba(59, 224, 138, 0.6); animation: cm-live 2s ease-out infinite; }
@keyframes cm-live { 0% { box-shadow: 0 0 0 0 rgba(59, 224, 138, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(59, 224, 138, 0); } }

.cm-list { display: grid; gap: 2px; }
.map-loc {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 10px 12px 12px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.map-loc[tabindex] { cursor: pointer; }
.map-loc[tabindex]:hover, .map-loc[tabindex]:focus-visible, .map-loc.is-active {
  background: rgba(255, 198, 41, 0.08);
  border-left-color: var(--color-primary);
  transform: translateX(4px);
  outline: none;
}
.cm-num { font: 700 0.95rem/1.6 var(--cm-hud); color: rgba(255, 198, 41, 0.75); }
.cm-body { display: grid; gap: 3px; min-width: 0; }
.cm-body strong { color: #fff; font-size: 1rem; line-height: 1.4; }
.cm-sub { color: var(--cm-mute); font-size: 0.84rem; line-height: 1.5; }
.cm-xy { font: 600 0.74rem var(--cm-hud); letter-spacing: 0.06em; color: rgba(255, 198, 41, 0.7); }
.cm-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-navy-deep);
  background: var(--color-primary);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 2px;
}
.cm-badge.hq { background: #fff; font-family: var(--cm-hud); letter-spacing: 0.1em; }
.cm-badge.muted { background: rgba(255, 255, 255, 0.14); color: #fff; }
.cm-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cm-panel-foot p { margin: 0; font-size: 0.72rem; line-height: 1.5; color: rgba(159, 178, 201, 0.85); }
.cm-panel-foot p a { color: #cfe0f3; text-decoration: underline; text-underline-offset: 2px; }
.cm-panel-foot .btn { flex: none; }

/* ---------- ≥1200px : แผนที่เต็ม section ---------- */
@media (min-width: 1200px) {
  .client-map-section { min-height: 880px; }
  .cm-stage { position: absolute; inset: 0; }
  .cm-svg { width: 100%; height: 100%; }
  .cm-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(6, 26, 48, 0.94) 0%, rgba(6, 26, 48, 0.6) 22%, rgba(6, 26, 48, 0) 40%),
      linear-gradient(270deg, rgba(6, 26, 48, 0.7) 0%, rgba(6, 26, 48, 0) 34%),
      linear-gradient(0deg, var(--color-navy-deep) 0%, rgba(6, 26, 48, 0) 16%);
  }
  .cm-layout {
    max-width: calc(var(--container-w) + 48px);
    min-height: 880px;
    margin: 0 auto;
    padding: 84px 24px 96px;
    display: grid;
    grid-template-columns: 1fr 420px;
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    pointer-events: none;
  }
  .cm-layout > * { pointer-events: auto; }
  .cm-intro { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
  .cm-panel { grid-column: 2; grid-row: 2; align-self: start; margin-top: 40px; }
}

/* ---------- <1200px : เรียงซ้อน ---------- */
@media (max-width: 1199px) {
  .client-map-section { display: flex; flex-direction: column; padding: 64px 0 72px; }
  .cm-layout, .cm-shade { display: contents; }
  .cm-intro { order: 1; width: 100%; max-width: var(--container-w); margin: 0 auto; padding: 0 20px; display: grid; gap: 26px; }
  .cm-stage {
    order: 2;
    height: clamp(360px, 58vw, 540px);
    margin: 32px 0;
    overflow: hidden;
    border-top: 1px solid var(--cm-line);
    border-bottom: 1px solid var(--cm-line);
  }
  /* ซูมเข้าหากลุ่มหมุด: ขยายแผนที่ 170% ของแถบ แล้วเลื่อนให้กลุ่มหมุดอยู่กลาง */
  .cm-svg { position: absolute; height: 170%; width: auto; max-width: none; left: 50%; top: 50%; transform: translate(-43.75%, -64%); }
  .cm-panel { order: 3; width: calc(100% - 40px); max-width: calc(var(--container-w) - 40px); margin: 0 auto; }
  .cm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
}
@media (max-width: 639px) {
  .cm-stage { height: 380px; }
  .cm-svg { height: 150%; transform: translate(-44%, -63%); }
  .cm-tag, .cm-city text, .cm-rings text, .cm-towns text, .cm-estates text { display: none; }
  .cm-pin-s { transform: scale(1.35); }
  .cm-pin.is-active .cm-pin-s { transform: scale(1.65); }
  .cm-stats > div { padding: 4px 16px; }
  .cm-stats dt { white-space: normal; font-size: 0.74rem; }
  .cm-panel-foot { flex-direction: column; align-items: stretch; }
  .cm-list { grid-template-columns: 1fr; }
}

/* ---------- เปิดตัวเมื่อเลื่อนมาถึง (JS ใส่ .cm-armed ก่อน แล้ว .is-live เมื่อเห็น section) ---------- */
.cm-armed .cm-rings circle { opacity: 0; transform: scale(0.55); }
.cm-armed .cm-routes .base { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cm-armed .cm-routes .flow, .cm-armed .cm-sweep, .cm-armed .cm-zones path, .cm-armed .cm-tag { opacity: 0; }
.cm-armed .cm-pin-r { opacity: 0; transform: scale(0); }
.cm-armed .cm-panel, .cm-armed .cm-stats { opacity: 0; transform: translateY(18px); }

.cm-armed.is-live .cm-rings circle { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1); }
.cm-armed.is-live .cm-rings circle:nth-child(2) { transition-delay: 0.12s; }
.cm-armed.is-live .cm-rings circle:nth-child(3) { transition-delay: 0.24s; }
.cm-armed.is-live .cm-pin-hq .cm-pin-r { opacity: 1; transform: none; transition: opacity 0.3s ease 0.3s, transform 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) 0.3s; }
.cm-armed.is-live .cm-routes .base { stroke-dashoffset: 0; transition: stroke-dashoffset 1s cubic-bezier(0.65, 0, 0.35, 1) 0.6s; }
.cm-armed.is-live .cm-pin:not(.cm-pin-hq) .cm-pin-r { opacity: 1; transform: none; transition: opacity 0.3s ease 1.3s, transform 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) 1.3s; }
.cm-armed.is-live .cm-pin[data-loc="bangpain"] .cm-pin-r { transition-delay: 1.45s; }
.cm-armed.is-live .cm-zones path { opacity: 1; transition: opacity 0.6s ease 1.4s, fill 0.3s ease; }
.cm-armed.is-live .cm-tag { opacity: 1; transition: opacity 0.6s ease 1.6s; }
.cm-armed.is-live .cm-routes .flow { opacity: 1; transition: opacity 0.6s ease 1.7s; }
.cm-armed.is-live .cm-sweep { opacity: 1; transition: opacity 1.2s ease 1.9s; }
.cm-armed.is-live .cm-stats { opacity: 1; transform: none; transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s; }
.cm-armed.is-live .cm-panel { opacity: 1; transform: none; transition: opacity 0.7s ease 0.5s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .cm-sweep-arm, .cm-routes .flow, .cm-pin .pulse, .cm-live i { animation: none; }
  .cm-sweep { display: none; }
  .map-loc, .cm-pin-s { transition: none; }
}

/* แถบ CTA ถัดไป: คลื่นด้านบนเป็นสีกรมท่าให้ต่อเนื่องกับแผนที่ */
.client-map-section + .cta-band .cta-band-wave path { fill: var(--color-navy-deep); }

.client-strip .logo-ph { flex-direction: column; gap: 3px; height: 76px; line-height: 1.3; }
.client-strip .logo-ph span { color: var(--color-dark); }
.client-strip .logo-ph small { font-size: 0.64rem; font-weight: 600; color: var(--color-gray); }

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 1.2fr; } }

.contact-list { display: flex; flex-direction: column; gap: 20px; }
.contact-list .item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.contact-list .icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-list .icon svg { width: 20px; height: 20px; }
.contact-list .label { font-size: 0.8rem; color: var(--color-gray); margin-bottom: 2px; }
.contact-list .value { font-weight: 600; }
.contact-list .value a:hover { color: var(--color-dark-soft); text-decoration: underline; }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  min-height: 320px;
  background: var(--color-light-gray);
}
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* =========================================================
   CTA band — พื้นเหลือง (ธีมหลักของ PST) + เส้นแบ่งบนเป็นคลื่น (wave divider)
   ตัดจาก section ก่อนหน้าที่เป็นพื้นขาว/เทาอ่อนเสมอ
   ========================================================= */
.cta-band {
  position: relative;
  background: var(--color-primary);
  color: var(--color-dark);
  padding: 84px 0 58px;
  text-align: center;
  overflow: hidden;
}
.cta-band-wave {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 64px;
  display: block;
}
@media (min-width: 768px) { .cta-band-wave { height: 84px; } }
.cta-band h2 { position: relative; color: var(--color-dark); margin-bottom: 10px; }
.cta-band p { position: relative; color: rgba(10, 38, 71, 0.8); margin-bottom: 26px; }
.cta-band .btn, .cta-band .hero-actions { position: relative; }
.cta-band .btn-dark:hover { background: #061626; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--color-dark);
  color: #B7C3D4;
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 40px;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand picture { display: block; }
.footer-brand img { height: 72px; width: auto; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35)); }
.footer-brand span { color: var(--color-white); font-weight: 700; font-size: 1.05rem; }
.site-footer h4 {
  color: var(--color-white);
  font-size: 0.95rem;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.site-footer p { font-size: 0.88rem; color: #A9B7CB; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 0.88rem; color: #A9B7CB; transition: color var(--transition); }
.footer-links a:hover { color: var(--color-primary); }
.footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 0.88rem; }
.footer-contact a { color: #A9B7CB; display: flex; align-items: center; gap: 7px; }
.footer-contact a svg { width: 15px; height: 15px; flex: none; color: var(--color-primary); }
.footer-contact a:hover { color: var(--color-primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
  font-size: 0.8rem;
  color: #7E8FA6;
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 400;
  border: none;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; }

/* =========================================================
   404
   ========================================================= */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}
.error-page .code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1;
  position: relative;
  display: inline-block;
}
.error-page .code::after {
  content: "";
  display: block;
  width: 72px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 999px;
  margin: 14px auto 0;
}

/* =========================================================
   Blueprint Reveal — scroll-triggered animation ทั่วเว็บ
   engine.js เติมคลาส .is-revealed ให้ตัวห่อเมื่อเลื่อนมาเห็น (เล่นครั้งเดียว)
   ธีม: เส้น/badge สีเหลืองวาดนำ + แถบสแกนพาดผ่านเปิดเนื้อหา — ต่อยอดจากลายเส้น
   ที่มีอยู่แล้วในเว็บ (nav underline, hero kicker) ให้กลายเป็นการเคลื่อนไหว
   ========================================================= */

/* ---- หัวข้อ section: badge วาดนำ แล้ว heading/paragraph จาง-ลอยขึ้นตามกัน ---- */
.section-head .eyebrow {
  clip-path: inset(-0.6em 100% -0.5em -0.4em);
  transition: clip-path 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.section-head.is-revealed .eyebrow { clip-path: inset(-0.6em -0.4em -0.5em -0.4em); }

.section-head h2 {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease 0.16s, transform 0.5s ease 0.16s;
}
.section-head.is-revealed h2 { opacity: 1; transform: translateY(0); }

.section-head p {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.26s, transform 0.5s ease 0.26s;
}
.section-head.is-revealed p { opacity: 1; transform: translateY(0); }

/* ---- การ์ด/กริดต่าง ๆ ทั่วเว็บ — เปิดออกทีละใบด้วยแถบสแกนสีเหลืองพาดผ่าน
   (JS กำหนด transition-delay ให้แต่ละใบตาม index จริง ไม่ hardcode nth-child) ---- */
.services-grid > *, .gallery-grid > *, .clients-grid > *, .client-strip > *,
.fact-row > *, .scope-list > *, .card-grid > *, .values-strip > * {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.services-grid.is-revealed > *, .gallery-grid.is-revealed > *, .clients-grid.is-revealed > *,
.client-strip.is-revealed > *, .fact-row.is-revealed > *, .scope-list.is-revealed > *,
.card-grid.is-revealed > *, .values-strip.is-revealed > * { clip-path: inset(0 0 0 0); }

.services-grid > *::after, .gallery-grid > *::after, .clients-grid > *::after,
.client-strip > *::after, .fact-row > *::after, .scope-list > *::after, .card-grid > *::after,
.values-strip > *::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  opacity: 0.85;
  transform: translateX(-100%);
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
  z-index: 3;
}
.services-grid.is-revealed > *::after, .gallery-grid.is-revealed > *::after,
.clients-grid.is-revealed > *::after, .client-strip.is-revealed > *::after,
.fact-row.is-revealed > *::after, .scope-list.is-revealed > *::after,
.card-grid.is-revealed > *::after, .values-strip.is-revealed > *::after { transform: translateX(100%); }

/* ---- กล่องเดี่ยว (empty state) — เปิดออกทั้งกล่อง ---- */
/* หมายเหตุ: ใช้ opacity+transform ไม่ใช้ clip-path เพราะ .empty-state สังเกตตัวเอง
   (ไม่ใช่ parent สังเกต children แบบกริดด้านบน) — clip-path บน element ที่
   IntersectionObserver สังเกตตัวมันเองตรง ๆ ทำให้เบราว์เซอร์บางตัวคำนวณ
   intersection ผิดพลาด (ratio ค้างที่ 0 แม้ตั้งค่า inset(0px) เปิดเต็มแล้วก็ตาม)
   (.mission-banner มี animation เฉพาะของตัวเองอยู่แล้วที่นิยามไว้ในบล็อก
   Mission banner ด้านบน — ไม่ต้องพ่วงกับกฎทั่วไปตรงนี้) */
.empty-state {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.8, 0.32, 1), transform 0.6s cubic-bezier(0.22, 0.8, 0.32, 1);
}
.empty-state.is-revealed { opacity: 1; transform: translateY(0); }

/* ---- คอลัมน์/รายการเนื้อหา (footer, contact) — จาง + ลอยขึ้นเบา ๆ ไม่ใช้ scan bar
   เพราะไม่ใช่การ์ด สแกนทับข้อความยาวจะดูหนักเกินไป ---- */
.footer-grid > *, .contact-list > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s cubic-bezier(0.22, 0.8, 0.32, 1), transform 0.5s cubic-bezier(0.22, 0.8, 0.32, 1);
}
.footer-grid.is-revealed > *, .contact-list.is-revealed > * { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .section-head .eyebrow,
  .services-grid > *, .gallery-grid > *, .clients-grid > *, .client-strip > *,
  .fact-row > *, .scope-list > *, .card-grid > *, .values-strip > * {
    clip-path: inset(0 0 0 0) !important;
    transition: none !important;
  }
  .services-grid > *::after, .gallery-grid > *::after, .clients-grid > *::after,
  .client-strip > *::after, .fact-row > *::after, .scope-list > *::after, .card-grid > *::after,
  .values-strip > *::after {
    display: none !important;
  }
  .section-head h2, .section-head p, .footer-grid > *, .contact-list > *,
  .empty-state {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Utilities
   ========================================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================
   หน้า portfolio.html — รายละเอียดงานแต่ละโครงการ + ทางลัด
   ========================================================= */
.project-jump {
  position: sticky;
  top: var(--header-h-mobile);
  z-index: 40;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 18px rgba(10, 38, 71, 0.06);
}
.project-jump .container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
@media (min-width: 1024px) { .project-jump { top: var(--header-h); } }
/* เลื่อนไปยังงาน: เว้นที่ให้ header + แถบทางลัด */
.project-jump ~ section[id] { scroll-margin-top: calc(var(--header-h-mobile) + 64px); }
@media (min-width: 1024px) { .project-jump ~ section[id] { scroll-margin-top: calc(var(--header-h) + 64px); } }
.project-jump-label { flex: none; font-weight: 700; font-size: 0.85rem; color: var(--color-gray); }
.project-jump ul {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
  padding: 2px 0;
  list-style: none;
}
.project-jump ul::-webkit-scrollbar { display: none; }
.project-jump a {
  display: block;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-dark);
  transition: background 0.2s, border-color 0.2s;
}
.project-jump a:hover, .project-jump a:focus-visible { background: var(--color-primary); border-color: var(--color-primary); }

.project-brief {
  display: grid;
  gap: 24px;
  margin: -12px 0 36px;
}
@media (min-width: 1024px) {
  .project-brief { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: start; }
}
.project-lead { font-size: 1.04rem; line-height: 1.8; color: #2b3a4f; margin: 0; }
.project-sub {
  margin: 22px 0 0;
  font-size: 1rem;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-sub::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--color-primary); }
.project-scope { margin-top: 14px; }
.section-alt .project-scope li { background: var(--color-white); }
.project-facts {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 22px;
  border-radius: calc(var(--radius) * 2);
  color: var(--color-white);
  background:
    linear-gradient(rgba(170, 210, 250, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 210, 250, 0.1) 1px, transparent 1px),
    linear-gradient(160deg, var(--color-dark-soft), var(--color-dark) 60%, var(--color-navy-deep));
  background-size: 22px 22px, 22px 22px, auto;
  border-top: 4px solid var(--color-primary);
}
.project-facts dl { margin: 0; display: grid; gap: 12px; }
.project-facts dl > div { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255, 255, 255, 0.18); }
.project-facts dt { font-size: 0.75rem; letter-spacing: 0.06em; color: var(--color-primary); font-weight: 700; }
.project-facts dd { margin: 0; font-weight: 600; line-height: 1.5; }
.project-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-weight: 700;
  color: var(--color-primary);
}
.project-link + .project-link { margin-top: 10px; }
.project-link svg { width: 18px; height: 18px; transition: transform 0.2s; }
.project-link:hover svg { transform: translateX(4px); }

/* ปัญหา → วิธีแก้ → ผลลัพธ์ (portfolio) */
.project-psr {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: psr;
}
@media (min-width: 768px) { .project-psr { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.project-psr li {
  position: relative;
  padding: 14px 16px 14px;
  border-radius: var(--radius);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-dark);
  counter-increment: psr;
}
.project-psr li:last-child { border-top-color: var(--color-primary); background: var(--color-accent); border-color: #f3dc98; }
.project-psr .psr-k {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--color-dark-soft);
  margin-bottom: 4px;
}
.project-psr .psr-k::before { content: "0" counter(psr) " · "; color: var(--color-gray); }
.project-psr p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: #2b3a4f; }

/* FAQ */
.faq-list { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.faq-item[open] { border-color: var(--color-primary); box-shadow: 0 10px 26px rgba(10, 38, 71, 0.08); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 1.02rem; line-height: 1.5; color: var(--color-dark); }
.faq-item summary svg { width: 22px; height: 22px; flex: none; color: var(--color-dark); transition: transform 0.25s; }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: inherit; }
.faq-item p { margin: 0; padding: 0 20px 20px; line-height: 1.75; color: #2b3a4f; }

/* ตัวกรองหมวดงาน (portfolio) — ปุ่มใช้หน้าตาเดียวกับลิงก์ทางลัด */
.project-jump button {
  display: block;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-dark);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.project-jump button span { margin-left: 4px; font-size: 0.76rem; color: var(--color-gray); font-weight: 700; }
.project-jump button:hover { border-color: var(--color-primary); }
.project-jump button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.project-jump button.is-active { background: var(--color-dark); border-color: var(--color-dark); color: var(--color-white); }
.project-jump button.is-active span { color: var(--color-primary); }
section[data-cat][hidden] { display: none; }

/* บริการที่เกี่ยวข้อง (หน้าบริการย่อย): การ์ดมีรูปปก */
.services-grid--related .service-card .thumb { position: relative; overflow: hidden; background: var(--color-dark); }
.services-grid--related .service-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.services-grid--related .service-card:hover .thumb img { transform: scale(1.07); }
.services-grid--related .service-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 20, 36, 0.35) 0%, rgba(6, 20, 36, 0) 45%);
  pointer-events: none;
}
/* 3 การ์ดต่อแถวเต็มความกว้าง (เดิมเป็น 4 คอลัมน์ เหลือช่องว่างขวา) — มือถือ: ใบสุดท้ายเต็มแถว */
.services-grid--related .service-card:last-child:nth-child(odd) { grid-column: span 2; }
@media (min-width: 768px) {
  .services-grid--related { grid-template-columns: repeat(3, 1fr); }
  .services-grid--related .service-card:last-child:nth-child(odd) { grid-column: auto; }
}

/* ลิงก์ท้ายการ์ดข้อมูล (about.html) */
.info-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-dark);
}
.info-card .card-link svg { width: 16px; height: 16px; transition: transform 0.2s; }
.info-card .card-link:hover { text-decoration: underline; }
.info-card .card-link:hover svg { transform: translateX(4px); }

/* รูปทีมงานและหน้างานจริง (about.html): ใบใหญ่ 2×2 + ใบเล็ก 4 ใบ = ตารางเต็ม 4×2 */
.about-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.about-shot {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-dark);
  aspect-ratio: 4 / 3;
}
.about-shot--lead { grid-column: span 2; aspect-ratio: 16 / 10; }
.about-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.about-shot:hover img { transform: scale(1.06); }
.about-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 20, 36, 0.7) 0%, rgba(6, 20, 36, 0) 50%);
  pointer-events: none;
}
.about-shot-cap { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; color: var(--color-white); font-weight: 700; font-size: 0.9rem; line-height: 1.4; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.about-shot--lead .about-shot-cap { font-size: 1.1rem; }
.about-mosaic-more { text-align: center; margin: 32px 0 0; }
@media (min-width: 768px) {
  .about-mosaic { grid-template-columns: repeat(4, 1fr); }
  .about-shot, .about-shot--lead { aspect-ratio: auto; }
  .about-shot--lead { grid-column: span 2; grid-row: span 2; }
  .about-shot { min-height: 210px; }
}

/* ประวัติบริษัท (about.html): ข้อความซ้าย + รูปซ้อนกัน (collage) ขวา */
.about-history { display: grid; gap: 32px; align-items: center; margin-bottom: 8px; }
.about-history-photos { position: relative; padding-bottom: 14%; }
.about-history-photos figure { margin: 0; overflow: hidden; border-radius: calc(var(--radius) * 1.5); box-shadow: 0 14px 34px rgba(10, 38, 71, 0.18); background: var(--color-dark); }
.about-history-photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.ah-main { position: relative; }
.ah-sub { position: absolute; left: 0; bottom: 0; width: 44%; border: 5px solid var(--color-white); }
@media (min-width: 900px) {
  .about-history { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
  .ah-sub { left: -9%; }
}

/* ป้ายรอง "ก่อตั้ง พ.ศ. 2560" ข้างป้ายหัวข้อ (ไม่อยู่บนรูป) */
.section-head .eyebrow.eyebrow--outline {
  background: transparent;
  color: var(--color-dark);
  box-shadow: inset 0 0 0 2px var(--color-primary);
  margin-left: 8px;
}

/* =========================================================
   ปุ่มลอย โทร + LINE (ทุกหน้า) — มุมขวาล่าง ปุ่มกลับขึ้นบนอยู่เหนือชุดนี้
   ========================================================= */
.float-contact {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 410;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.float-contact.is-pending { opacity: 0; transform: translateY(12px); pointer-events: none; }
.float-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 52px;
  min-width: 52px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(6, 20, 36, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.float-btn svg { width: 24px; height: 24px; flex: none; }
.float-btn span { max-width: 0; overflow: hidden; opacity: 0; transition: max-width 0.3s ease, opacity 0.2s ease, margin 0.3s ease; }
.float-btn:hover, .float-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(6, 20, 36, 0.4); }
.float-btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.float-btn--line { background: var(--color-line); }
.float-btn--line:hover, .float-btn--line:focus-visible { background: var(--color-line-dark); }
.float-btn--tel { background: var(--color-primary); color: var(--color-dark); }
.float-btn--tel:hover, .float-btn--tel:focus-visible { background: var(--color-primary-dark); }
/* วงคลื่นเตือนที่ปุ่มโทร */
.float-btn--tel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--color-primary);
  animation: float-ring 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes float-ring { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
@media (hover: hover) and (min-width: 1024px) {
  .float-btn:hover span, .float-btn:focus-visible span { max-width: 200px; opacity: 1; margin-left: 10px; }
}
@media (min-width: 768px) { .float-contact { right: 22px; bottom: 22px; } }
@media (prefers-reduced-motion: reduce) { .float-btn--tel::after { animation: none; display: none; } .float-contact, .float-btn, .float-btn span { transition: none; } }
/* ปุ่มกลับขึ้นบน: ยกขึ้นเหนือปุ่มลอย 2 ปุ่ม */
.back-to-top { right: 17px; bottom: 138px; }
@media (min-width: 768px) { .back-to-top { right: 25px; bottom: 146px; } }

/* =========================================================
   บทความ — การ์ด "เร็วๆ นี้" (หน้าแรก + articles.html)
   ========================================================= */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .article-grid { grid-template-columns: repeat(3, 1fr); } }
.article-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background:
    linear-gradient(rgba(170, 210, 250, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 210, 250, 0.16) 1px, transparent 1px),
    radial-gradient(80% 90% at 50% 40%, #14467a 0%, var(--color-dark) 70%);
  background-size: 24px 24px, 24px 24px, auto;
}
.article-thumb svg { width: 52px; height: 52px; filter: drop-shadow(0 0 10px rgba(255, 198, 41, 0.35)); }
.article-soon {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-dark);
  font-size: 0.75rem;
  font-weight: 800;
}
.article-body { padding: 18px 20px 22px; }
.article-cat { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--color-gray); letter-spacing: 0.04em; margin-bottom: 6px; }
.article-body h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--color-dark); }
.article-body p { font-size: 0.9rem; margin: 0; color: var(--color-gray); }
.article-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 32px 0 0; }

/* =========================================================
   QR Code เพิ่มเพื่อน LINE — การ์ดหน้าติดต่อเรา + popup จากปุ่ม LINE ลอย (เฉพาะจอคอม)
   ========================================================= */
.line-qr-card {
  display: none;            /* มือถือสแกนหน้าจอตัวเองไม่ได้ — ใช้ปุ่มกด LINE แทน */
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  background: var(--color-white);
}
.line-qr-card img { width: 150px; height: 150px; flex: none; border-radius: var(--radius); border: 1px solid var(--color-border); }
.line-qr-card strong { display: block; margin-bottom: 4px; color: var(--color-dark); font-size: 1.02rem; }
.line-qr-card p { margin: 0 0 12px; font-size: 0.9rem; color: var(--color-gray); }
@media (min-width: 768px) { .line-qr-card { display: flex; } }

.float-line { position: relative; }
.float-qr {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 196px;
  padding: 14px 14px 12px;
  border-radius: calc(var(--radius) * 2);
  background: var(--color-white);
  box-shadow: 0 16px 40px rgba(6, 20, 36, 0.35);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  display: none;
}
.float-qr::after {   /* ลูกศรชี้ลงหาปุ่ม LINE */
  content: "";
  position: absolute;
  right: 20px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: var(--color-white);
  transform: rotate(45deg);
}
.float-qr img { display: block; width: 168px; height: 168px; margin: 0 auto 8px; }
.float-qr p { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--color-dark); }
@media (hover: hover) and (min-width: 1024px) {
  .float-qr { display: block; }
  .float-line:hover .float-qr, .float-line:focus-within .float-qr { opacity: 1; visibility: visible; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .float-qr { transition: none; } }

/* =========================================================
   หน้าบริการย่อย: หัวข้อรอง / ขั้นตอนการทำงาน / ผลงานที่เกี่ยวข้อง
   ========================================================= */
.svc-sub { font-size: clamp(1.15rem, 2vw, 1.4rem); margin: 36px 0 0; color: var(--color-dark); }
.process-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: none; }
@media (min-width: 768px) { .process-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .process-steps { grid-template-columns: repeat(5, 1fr); } }
.process-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 20px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius);
}
@media (min-width: 1100px) { .process-steps li { flex-direction: column; gap: 10px; } }
.ps-num { flex: none; font-weight: 800; font-size: 1.1rem; color: var(--color-dark); background: var(--color-accent); border-radius: 8px; padding: 4px 10px; line-height: 1.3; }
.process-steps h3 { margin: 0 0 4px; font-size: 1rem; color: var(--color-dark); }
.process-steps p { margin: 0; font-size: 0.9rem; line-height: 1.65; color: #2b3a4f; }
.related-jobs-title { margin: 36px 0 12px; font-size: 1.05rem; color: var(--color-dark); }
.related-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 768px) { .related-jobs { grid-template-columns: repeat(2, 1fr); } }
.related-jobs li { padding: 12px 16px; border-left: 3px solid var(--color-primary); background: var(--color-light-gray); border-radius: 0 var(--radius) var(--radius) 0; }
.related-jobs a { display: block; font-weight: 700; color: var(--color-dark); }
.related-jobs a:hover { text-decoration: underline; }
.related-jobs span { display: block; margin-top: 2px; font-size: 0.86rem; color: var(--color-gray); line-height: 1.55; }

/* ลิงก์พื้นที่ให้บริการ (หน้านิคม / หน้าลูกค้า / ติดต่อเรา) */
.estate-band { padding: 28px 0; }
.estate-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; }
.estate-links--center { justify-content: center; margin-top: 0; }
.estate-links > span { font-weight: 700; color: var(--color-gray); font-size: 0.9rem; }
.estate-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-dark);
  transition: border-color 0.2s, background 0.2s;
}
.estate-link svg { width: 16px; height: 16px; color: var(--color-primary-dark); }
.estate-link:hover, .estate-link:focus-visible { border-color: var(--color-primary); background: var(--color-accent); }
