:root {
  --green-950: #102a18;
  --green-900: #163a22;
  --green-800: #1d4a28;
  --green-700: #265f33;
  --green-500: #4a8a4f;
  --green-100: #e5efe1;
  --green-50: #f3f7f0;
  --bg: #fbfcf9;
  --surface: #ffffff;
  --ink: #17241a;
  --muted: #4b5a4f;
  --line: #dbe4d6;
  --radius: 14px;
  --gutter: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.4; margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--green-700); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--green-500); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--green-900); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 32px; height: 32px; }
.logo-ic { width: 22px; height: 22px; flex: none; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 17px; text-decoration: none;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 18px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-sm .logo-ic { width: 18px; height: 18px; }

/* ---------- หัวเว็บ ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: flex; align-items: center; min-height: 48px; }
.brand img { height: 40px; width: auto; }
.nav { display: none; gap: 28px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.nav a:hover { color: var(--green-700); }
.header-cta { margin-left: auto; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .header-cta { margin-left: 0; }
}

/* ---------- แบนเนอร์ ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(70vh, 640px);
  display: flex; align-items: flex-end;
  color: #fff;
  background: var(--green-900);
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 55% 28%; /* เก็บหน้าทีมงานและโต๊ะเครื่องมือ */
  will-change: transform;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16, 42, 24, 0.15) 0%, rgba(16, 42, 24, 0.55) 45%, rgba(16, 42, 24, 0.92) 100%);
}
.hero-content { position: relative; z-index: 1; padding-top: 120px; padding-bottom: 36px; }
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; color: #cfe5c8; margin-bottom: 10px; }
.hero h1 { font-size: 30px; line-height: 1.4; max-width: 20ch; }
.hero-lead { margin-top: 14px; font-size: 17px; line-height: 1.65; color: rgba(255, 255, 255, 0.9); max-width: 40em; }
.hero-actions { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.hero .btn-primary { background: #fff; color: var(--green-900); }
.hero .btn-primary:hover { background: var(--green-50); }
.hero .btn-primary .logo-ic { color: #06c755; }
.hero-call { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; text-decoration: none; min-height: 44px; }
.hero-call:hover { text-decoration: underline; text-underline-offset: 4px; }
.br-d { display: none; }
@media (min-width: 768px) {
  .hero { min-height: min(82vh, 760px); }
  .hero-content { padding-bottom: 64px; }
  .hero h1 { font-size: 48px; max-width: none; }
  .hero-lead { font-size: 19px; }
  .br-d { display: inline; }
}
@media (min-width: 1200px) { .hero h1 { font-size: 58px; } }

/* ---------- ส่วนทั่วไป ---------- */
.section { padding: 64px 0; }
@media (min-width: 768px) { .section { padding: 96px 0; } }
.kicker { font-size: 15px; font-weight: 600; color: var(--green-700); margin-bottom: 8px; }
.section h2 { font-size: 28px; }
@media (min-width: 768px) { .section h2 { font-size: 40px; } }
.section-head { max-width: 720px; margin-bottom: 32px; }

/* ---------- จุดเด่น ---------- */
.features { padding: 40px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
@media (min-width: 480px) { .feature-grid { gap: 32px 20px; } }
@media (min-width: 768px) { .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 32px; } }
.feature .ic-lg { color: var(--green-700); margin-bottom: 12px; }
.feature h3 { font-size: 17px; margin-bottom: 4px; }
.feature p { font-size: 15px; line-height: 1.6; color: var(--muted); }
@media (min-width: 768px) { .feature h3 { font-size: 19px; } .feature p { font-size: 16px; } }

/* ---------- เกี่ยวกับเรา ---------- */
.about-grid { display: grid; gap: 40px; align-items: center; }
.about-text h2 { margin-bottom: 18px; }
.about-text > p:not(.kicker) { color: var(--muted); }
.checklist { margin-top: 22px; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 16px; }
.checklist .ic { color: var(--green-700); margin-top: 4px; }
.about-figure { margin: 0; max-width: 420px; justify-self: center; width: 100%; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1.15fr 0.85fr; gap: 72px; }
  .about-figure { justify-self: end; }
}
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }

.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.zoom img { width: 100%; border-radius: 10px; transition: opacity 200ms ease; }
.zoom:hover img { opacity: 0.92; }

/* ---------- กฎหมาย ---------- */
.law { background: var(--green-50); }
.law-head { max-width: 760px; }
.law-head h2 { margin-bottom: 16px; }
.law-head > p:not(.kicker) { color: var(--muted); }
.duty-list { margin-top: 32px; display: grid; gap: 12px; }
@media (min-width: 600px) { .duty-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .duty-list { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.duty-list li { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px; }
.duty-num {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-800); color: #fff; font-weight: 700; font-size: 16px;
}
.duty-list h3 { font-size: 17px; margin-bottom: 2px; }
.duty-list p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.law-figure { margin: 32px 0 0; }
.law-cta { margin-top: 24px; font-weight: 600; }
.law-cta a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-underline-offset: 4px; }

/* ---------- บริการ ---------- */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: start; }
@media (min-width: 768px) { .service-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .service-grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 42, 24, 0.06), 0 2px 8px rgba(16, 42, 24, 0.05);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 42, 24, 0.06), 0 10px 24px rgba(16, 42, 24, 0.10); }
}
.card img { width: 100%; height: auto; }
.card-body { padding: 14px 14px 18px; }
.card h3 { font-size: 16px; margin-bottom: 6px; }
.card p { font-size: 14px; line-height: 1.6; color: var(--muted); }
@media (min-width: 480px) {
  .card-body { padding: 18px 18px 22px; }
  .card h3 { font-size: 18px; }
  .card p { font-size: 15px; }
}

/* ---------- ผลงาน (masonry ไม่ครอป) ---------- */
.works { background: var(--surface); }
.gallery { columns: 2; column-gap: 10px; }
.gallery-item { break-inside: avoid; margin-bottom: 10px; }
@media (min-width: 480px) { .gallery { columns: 3; column-gap: 14px; } .gallery-item { margin-bottom: 14px; } }
@media (min-width: 1024px) { .gallery { columns: 4; column-gap: 16px; } .gallery-item { margin-bottom: 16px; } }

/* ---------- ติดต่อ ---------- */
.contact-grid { display: grid; gap: 40px; }
.contact-intro h2 { margin-bottom: 14px; }
.contact-intro > p:not(.kicker) { color: var(--muted); margin-bottom: 26px; }
.nw { white-space: nowrap; }
.contact-list { display: grid; gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 8px 20px; box-shadow: 0 1px 2px rgba(16, 42, 24, 0.06), 0 2px 8px rgba(16, 42, 24, 0.05); }
.contact-list li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .ic { color: var(--green-700); margin-top: 4px; }
.contact-list .label { display: block; font-size: 14px; color: var(--muted); }
.contact-list a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-underline-offset: 4px; overflow-wrap: anywhere; }
.contact-list .sep { color: var(--muted); }
.map-link { gap: 6px; margin-top: 2px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; } }

/* ---------- โซเชียล ---------- */
.social { padding: 48px 0; background: var(--green-900); color: #fff; }
.social-inner { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.social h2 { font-size: 22px; }
@media (min-width: 768px) { .social-inner { flex-direction: row; align-items: center; justify-content: space-between; } .social h2 { font-size: 26px; } }
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600;
  transition: transform 160ms var(--ease-out);
}
.social-btn:active { transform: scale(0.97); }
.social-btn svg { width: 22px; height: 22px; }
.social-fb svg { color: #0866ff; }
.social-line svg { color: #06c755; }

/* ---------- ท้ายหน้า ---------- */
.site-footer { background: var(--green-950); color: rgba(255, 255, 255, 0.78); padding: 32px 0 calc(32px + 76px); font-size: 15px; }
.footer-name { color: #fff; font-weight: 600; margin-bottom: 4px; }
.copy { margin-top: 12px; font-size: 14px; color: rgba(255, 255, 255, 0.6); }
@media (min-width: 768px) { .site-footer { padding-bottom: 32px; } }

/* ---------- ปุ่มลอยมือถือ ---------- */
.float-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.float-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none;
}
.float-line { background: var(--green-800); color: #fff; }
.float-line .logo-ic { color: #fff; width: 20px; height: 20px; }
.float-call { background: var(--green-100); color: var(--green-900); }
@media (min-width: 768px) { .float-bar { display: none; } }

/* ---------- กล่องดูรูป ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 20, 12, 0.94); color: #fff;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; padding: 64px 16px 24px; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox img { width: auto; height: auto; max-width: min(100%, 1200px); max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: rgba(255, 255, 255, 0.85); font-size: 15px; }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-btn .ic { width: 24px; height: 24px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 599px) { .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; } }

/* ---------- อนิเมชัน ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .card, .btn, .social-btn { transition: none; }
}
