/* =========================================================
   ROOT
========================================================== */
:root {
  /* Original boring-test palette */
  --primary:#194d4e;
  --primary-dark:#113839;
  --green:#6fc4b0;
  --navy:#0b1d28;
  --dark:#08131a;
  --text:#23333c;
  --muted:#71808a;
  --light:#f4f7f7;
  --border:#dfe8e8;
  --max-width:1280px;

  /* ===== MASTER NAVBAR PALETTE ===== */
  --m-primary: #1a5555;
  --m-primary-dark: #123f3f;
  --m-primary-deep: #0d3030;
  --m-primary-light: #e0eeee;
  --m-navy: #0b1f33;
  --m-navy-dark: #071522;
  --m-line: #dce6e4;
  --m-text-light: #63727a;
  --m-gray-600: #52636b;
  --m-shadow-sm: 0 4px 20px rgba(11, 31, 51, 0.05);
  --m-shadow-lg: 0 25px 80px rgba(11, 31, 51, 0.14);
}

* {
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html {
  scroll-behavior:smooth;
}

body {
  font-family:"Noto Sans Thai",sans-serif;
  color:var(--text);
  line-height:1.8;
}

body.menu-open {
  overflow: hidden;
}

a {
  text-decoration:none;
  color:inherit;
}

.container {
  width:min(calc(100% - 48px),var(--max-width));
  margin:auto;
}

/* HERO */
.hero {
  padding-top:90px;
  min-height:720px;
  display:flex;
  align-items:center;
  color:white;
  background:
    linear-gradient(100deg,#07151ff5,#0b1f33e6),
    linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);
  background-size:auto,45px 45px,45px 45px;
}

.hero-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:80px;
  align-items:center;
}

.eyebrow {
  font-family:"DM Mono",monospace;
  color:var(--green);
  font-size:11px;
  letter-spacing:.14em;
  margin-bottom:20px;
}

h1 {
  font-size:clamp(40px,5.5vw,70px);
  line-height:1.15;
  font-weight:600;
}

h1 span {
  display:block;
  margin-top:18px;
  color:var(--green);
  font-family:"Manrope",sans-serif;
  font-size:clamp(20px,2.5vw,30px);
  letter-spacing:.08em;
}

.hero p {
  max-width:620px;
  margin-top:25px;
  color:rgba(255,255,255,.67);
}

.boring-visual {
  height:450px;
  position:relative;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(
      145deg,
      #173a55,
      #081b2c
    );
}

.ground {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:48%;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.05) 0,
      rgba(255,255,255,.05) 35px,
      rgba(255,255,255,.015) 35px,
      rgba(255,255,255,.015) 70px
    );
  border-top:1px solid rgba(255,255,255,.15);
}

.bore-hole {
  position:absolute;
  left:50%;
  top:35px;
  transform:translateX(-50%);
  width:145px;
  height:390px;
  border:2px solid rgba(255,255,255,.25);
  background:rgba(0,0,0,.08);
}

.casing {
  position:absolute;
  left:50%;
  top:70px;
  transform:translateX(-50%);
  width:95px;
  height:280px;
  border-left:2px solid rgba(111,196,176,.65);
  border-right:2px solid rgba(111,196,176,.65);
}

.depth-line {
  position:absolute;
  left:0;
  right:0;
  top:53%;
  height:1px;
  background:rgba(255,255,255,.25);
}

.depth-label {
  position:absolute;
  right:25px;
  top:calc(53% - 13px);
  font-family:"DM Mono",monospace;
  color:var(--green);
  font-size:10px;
}

/* SECTIONS */
.section {
  padding:120px 0;
}

.light {
  background:var(--light);
}

.dark {
  background:var(--navy);
  color:white;
}

.section-grid {
  display:grid;
  grid-template-columns:.7fr 1.3fr;
  gap:80px;
}

.section-number {
  color:var(--primary);
  font-family:"DM Mono",monospace;
  font-size:11px;
  letter-spacing:.12em;
}

h2 {
  margin-top:15px;
  font-size:clamp(30px,4vw,50px);
  line-height:1.3;
  font-weight:600;
}

.description {
  color:var(--muted);
  font-size:16px;
}

.description + .description {
  margin-top:20px;
}

/* SYSTEM */
.system-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  border-top:1px solid var(--border);
  border-left:1px solid var(--border);
  margin-top:55px;
}

.system-item {
  padding:35px;
  min-height:220px;
  border-right:1px solid var(--border);
  border-bottom:1px solid var(--border);
}

.system-number {
  font-family:"DM Mono",monospace;
  color:var(--primary);
  font-size:12px;
}

.system-item h3 {
  margin-top:20px;
  font-size:22px;
}

.system-item p {
  color:var(--muted);
  font-size:14px;
  margin-top:8px;
}

/* PROCESS */
.process {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  margin-top:60px;
  border-top:1px solid rgba(255,255,255,.12);
}

.process-item {
  padding:35px 25px;
  border-right:1px solid rgba(255,255,255,.12);
}

.process-item:last-child {
  border-right:0;
}

.process-item span {
  color:var(--green);
  font-family:"DM Mono",monospace;
  font-size:11px;
}

.process-item h3 {
  margin-top:30px;
  font-size:19px;
  font-weight:500;
}

.process-item p {
  color:rgba(255,255,255,.55);
  font-size:14px;
  margin-top:10px;
}

/* TECHNICAL */
.technical-box {
  padding:55px;
  border:1px solid var(--border);
  background:white;
}

.technical-label {
  color:var(--primary);
  font-family:"DM Mono",monospace;
  font-size:11px;
  letter-spacing:.12em;
}

.specs {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  margin-top:40px;
  border-top:1px solid var(--border);
}

.spec {
  padding:25px 20px;
  border-right:1px solid var(--border);
}

.spec:last-child {
  border-right:0;
}

.spec strong {
  display:block;
  font-family:"Manrope",sans-serif;
  font-size:22px;
  color:var(--primary);
}

.spec span {
  color:var(--muted);
  font-size:13px;
}

/* CTA */
.cta {
  background:var(--primary);
  color:white;
  padding:100px 0;
}

.cta-inner {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:40px;
}

.cta h2 {
  margin:0;
  font-weight:500;
}

.cta p {
  color:rgba(255,255,255,.65);
  margin-top:10px;
}

.cta a {
  background:white;
  color:var(--primary);
  padding:17px 28px;
  font-family:"Manrope",sans-serif;
  font-weight:700;
  font-size:13px;
  transition:background-color .25s ease, color .25s ease;
  border-radius:6px;
}

.cta a:hover {
  background:var(--navy);
  color:white;
}

/* REVEAL */
.reveal {
  opacity:0;
  transform:translateY(25px);
  transition:.8s ease;
}

.reveal.visible {
  opacity:1;
  transform:none;
}


/* =========================================================
   HEADER & NAVBAR (MASTER TEMPLATE)
========================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: .3s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow:
    0 1px 0 rgba(11, 31, 51, 0.08),
    0 10px 30px rgba(11, 31, 51, 0.05);
}

.navbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BRAND LOGO DESIGN */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: max-content;
  transition: transform 0.25s ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-logo {
  width: 52px;
  height: 52px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--m-line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--m-shadow-sm);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--m-navy);
  transition: color 0.3s ease;
}

.header:not(.scrolled) .brand-name {
  color: #ffffff;
}

.brand-sub {
  margin-top: 4px;
  color: var(--m-primary);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.header:not(.scrolled) .brand-sub {
  color: #75c8b3;
}


/* NAV LINKS & ACTIVE HIGHLIGHT */
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  position: relative;
  color: var(--m-gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: color .25s ease;
  padding: 4px 0;
}

.header:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.75);
}

.nav-link:hover {
  color: var(--m-primary);
}

.header:not(.scrolled) .nav-link:hover {
  color: #75c8b3;
}

/* Active Highlight Style */
.nav-link.active {
  color: var(--m-primary) !important;
  font-weight: 700;
}

.header:not(.scrolled) .nav-link.active {
  color: #75c8b3 !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--m-primary);
  transition: width 0.3s ease;
}

.header:not(.scrolled) .nav-link::after {
  background: #75c8b3;
}

.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  padding: 12px 20px;
  background: var(--m-primary);
  color: white !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: .25s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.nav-cta:hover {
  background: var(--m-primary-dark);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--m-line);
  background: white;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
  transition: background .25s ease, border-color .25s ease;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--m-navy);
  border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}

/* ===== Animated Hamburger → X ===== */
.menu-toggle.open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}


/* =========================================================
   MOBILE MENU HEADER + BACKDROP
========================================================== */

.nav-mobile-header {
  display: none;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 20px;
  background:
    linear-gradient(
      135deg,
      var(--m-primary) 0%,
      var(--m-primary-dark) 100%
    );
  color: #ffffff;
}

.nav-mobile-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-mobile-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #75c8b3;
  box-shadow: 0 0 0 4px rgba(117, 200, 179, .25);
}

.nav-mobile-title {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}


/* BACKDROP */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(7, 21, 34, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity .3s ease,
    visibility .3s ease;
}

.menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}


/* FOOTER */
footer {
  background: #071522;
  color: white;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr .7fr .9fr;
  gap: 70px;
  padding: 75px 0;
}

.footer-brand p {
  max-width: 420px;
  margin-top: 20px;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  line-height: 1.9;
}

.footer-title {
  font-size: 12px;
  font-weight: 700;
}

.footer-links {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.footer-links a {
  color: rgba(255,255,255,.42);
  font-size: 12px;
}

.footer-links a:hover {
  color: #72c8b4;
}

.footer-contact {
  margin-top: 20px;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  line-height: 2;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}

.copyright,
.footer-code {
  color: rgba(255,255,255,.25);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: .05em;
}


/* =========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 1024px) {
  .hero-grid,
  .section-grid {
    grid-template-columns:1fr;
  }

  .process {
    grid-template-columns:1fr 1fr;
  }

  .process-item:nth-child(2) {
    border-right:0;
  }

  .footer-main {
    grid-template-columns:1fr 1fr;
    gap:40px;
  }
}

@media (max-width: 760px) {
  .container {
    width:calc(100% - 30px);
  }

  .navbar {
    height: 76px;
  }

  /* ===== MOBILE NAV DRAWER (MASTER TEMPLATE) ===== */
  .nav {
    position: fixed;
    top: 84px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    background: #ffffff;
    border: 1px solid var(--m-line);
    border-radius: 16px;
    box-shadow:
      0 25px 60px rgba(11, 31, 51, .18),
      0 8px 24px rgba(11, 31, 51, .08);
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-18px) scale(.97);
    transform-origin: top center;
    pointer-events: none;
    transition:
      opacity .28s ease,
      transform .28s cubic-bezier(.2, .9, .35, 1.2);
    z-index: 999;
    gap: 0;
  }

  .nav.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* แสดง mobile header ในเมนู */
  .nav-mobile-header {
    display: flex;
    border-radius: 15px 15px 0 0;
  }

  /* ปุ่ม/ลิงก์ภายในเมนู */
  .nav-link {
    padding: 15px 20px;
    color: var(--m-navy) !important;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--m-line);
    border-radius: 0;
    transition: background .2s ease, padding-left .25s ease, color .2s ease;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.active {
    background: var(--m-primary-light);
    color: var(--m-primary) !important;
    padding-left: 26px;
  }

  .nav-link.active {
    border-left: 4px solid var(--m-primary);
  }

  /* CTA ด้านล่างเมนู */
  .nav-cta {
    margin: 16px;
    padding: 14px 20px;
    text-align: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(26, 85, 85, .28);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #ffffff;
    border-color: var(--m-line);
  }

  .menu-toggle.open {
    background: var(--m-primary-light);
    border-color: var(--m-primary);
  }

  .menu-toggle.open span {
    background: var(--m-primary);
  }

  .hero {
    padding-top:76px;
    padding-bottom:80px;
    min-height:auto;
  }

  .boring-visual {
    height:370px;
  }

  .section {
    padding:80px 0;
  }

  .system-grid,
  .specs {
    grid-template-columns:1fr;
  }

  .spec {
    border-right:0;
    border-bottom:1px solid var(--border);
  }

  .process {
    grid-template-columns:1fr;
  }

  .process-item {
    border-right:0;
    border-bottom:1px solid rgba(255,255,255,.12);
  }

  .cta-inner {
    flex-direction:column;
    align-items:flex-start;
  }

  .footer-main {
    grid-template-columns:1fr;
    gap:40px;
  }

  .footer-brand {
    grid-column:auto;
  }

  .footer-bottom {
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-sub {
    font-size: 7px;
  }
}

/* =========================================================
   RELATED SERVICES
========================================================== */
.related-services {
  padding: 100px 0 80px;
}

.related-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 55px;
}

.related-header .section-number {
  display: inline-block;
}

.related-header h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.25;
  margin-top: 12px;
}

.related-header p {
  color: var(--muted);
  margin-top: 14px;
  font-size: 15px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 32px 28px 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.related-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(11,31,51,0.08);
  border-color: var(--primary);
}

.related-icon {
  font-size: 28px;
  margin-bottom: 18px;
}

.related-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 8px;
}

.related-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  flex: 1;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  transition: gap 0.3s ease;
}

.related-card:hover .related-link {
  gap: 12px;
}

@media (max-width: 900px) {
  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .related-services {
    padding: 70px 0 50px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-card {
    padding: 24px 20px;
  }
}