:root {
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #13355f;
  --blue-600: #1f4fb4;
  --blue-500: #2d64d8;
  --green-600: #3a7f2c;
  --green-300: #a6d68c;
  --ink: #142235;
  --muted: #5a6a7e;
  --line: #dfe5ec;
  --surface: #ffffff;
  --surface-alt: #f4f6f9;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(7, 26, 51, 0.06), 0 8px 24px rgba(7, 26, 51, 0.08);
  --container: 1200px;
  --header-h: 76px;
  --font: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.005em;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  color: var(--navy-800);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.nowrap {
  white-space: nowrap;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: "IBM Plex Sans", var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

.eyebrow--light {
  color: var(--green-300);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 0.98rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--blue-600);
  color: #fff;
}

.btn--primary:hover {
  background: var(--blue-500);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn--outline {
  border-color: var(--navy-800);
  color: var(--navy-800);
  background: transparent;
}

.btn--outline:hover {
  background: var(--navy-800);
  color: #fff;
}

.btn--sm {
  padding: 9px 18px;
  font-size: 0.92rem;
}

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 3px;
}

/* Top bar & header */
.topbar {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  gap: 16px;
}

.topbar__links {
  display: flex;
  gap: 24px;
}

.topbar a {
  text-decoration: none;
}

.topbar a:hover {
  color: #fff;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s;
}

.header.is-scrolled {
  box-shadow: 0 6px 24px rgba(7, 26, 51, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.brand__text strong {
  font-size: 1.05rem;
  color: var(--navy-800);
}

.brand__text small {
  font-family: "IBM Plex Sans", var(--font);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a:not(.btn) {
  position: relative;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--blue-600);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.nav a:not(.btn):hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--navy-800);
  transition: transform 0.2s, opacity 0.2s;
}

.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);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(88vh, 820px);
  color: #fff;
  background: var(--navy-900);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 26, 51, 0.94) 0%, rgba(7, 26, 51, 0.78) 45%, rgba(7, 26, 51, 0.35) 100%),
    linear-gradient(0deg, rgba(7, 26, 51, 0.9) 0%, rgba(7, 26, 51, 0) 40%);
}

.hero__inner {
  padding-top: 96px;
  padding-bottom: 72px;
}

.hero h1 {
  max-width: 14em;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 20px;
}

.hero__lead {
  max-width: 36em;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__facts {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 26, 51, 0.55);
  backdrop-filter: blur(6px);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.fact {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.fact:first-child {
  border-left: 0;
  padding-left: 0;
}

.fact strong {
  font-family: "IBM Plex Sans", var(--font);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.fact span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Sections */
.section {
  padding: 112px 0;
}

.section__head {
  max-width: 680px;
  margin-bottom: 56px;
}

.section__head p:last-child {
  color: var(--muted);
  margin-top: 14px;
  font-size: 1.05rem;
}

.section__head--light h2 {
  color: #fff;
}

/* About */
.about__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
}

.about__media {
  position: relative;
  padding-bottom: 56px;
}

.about__media > img:first-child {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.about__inset {
  position: absolute;
  right: -28px;
  bottom: 0;
  width: 46%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 6px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about__body h2 {
  margin-bottom: 24px;
}

.about__body > p {
  color: #3a4a5e;
}

.checklist {
  list-style: none;
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.checklist li {
  position: relative;
  padding-left: 32px;
  font-weight: 500;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue-600)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

/* Services */
.services {
  background: var(--surface-alt);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}

.service:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.service img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.service__body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 28px 28px 26px;
}

.service__no {
  font-family: "IBM Plex Sans", var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--green-600);
  margin-bottom: 6px;
}

.service h3 {
  color: var(--navy-800);
  margin-bottom: 10px;
}

.service p {
  flex: 1;
  color: var(--muted);
  font-size: 0.95rem;
}

.service a {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue-600);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.service a::after {
  content: " →";
}

/* Process */
.process {
  background:
    linear-gradient(rgba(7, 26, 51, 0.92), rgba(7, 26, 51, 0.92)),
    url("../img/work/wastewater-17.webp") center / cover;
  color: #fff;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  counter-reset: step;
}

.steps li {
  padding: 32px 28px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
}

.steps li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-300);
}

.steps span {
  font-family: "IBM Plex Sans", var(--font);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--green-300);
}

.steps h3 {
  margin: 8px 0 10px;
  font-size: 1.2rem;
}

.steps p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

/* Portfolio */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font: 500 0.92rem/1.2 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.filters button span {
  font-size: 0.78rem;
  color: var(--muted);
}

.filters button:hover {
  border-color: var(--navy-800);
}

.filters button[aria-selected="true"] {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.filters button[aria-selected="true"] span {
  color: rgba(255, 255, 255, 0.7);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tile {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tile:hover img {
  transform: scale(1.05);
}

.tile__tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  color: #fff;
  background: linear-gradient(0deg, rgba(7, 26, 51, 0.8), rgba(7, 26, 51, 0));
  opacity: 0;
  transition: opacity 0.25s;
}

.tile:hover .tile__tag,
.tile:focus-visible .tile__tag {
  opacity: 1;
}

.gallery__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.gallery__more .btn[hidden] {
  display: none;
}

/* Contact */
.contact {
  background: var(--surface-alt);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.contact__lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact__list {
  margin: 32px 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.contact__list > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.contact__list dt {
  color: var(--muted);
  font-size: 0.92rem;
}

.contact__list dd {
  margin: 0;
  font-weight: 500;
}

.contact__list a {
  color: var(--navy-800);
  text-decoration: none;
}

.contact__list a:hover {
  color: var(--blue-600);
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact__media {
  margin: 0;
}

.contact__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Footer */
.footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.93rem;
  padding-top: 72px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.footer__brand img {
  width: 64px;
  height: 64px;
  flex: none;
}

.footer__brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.footer__brand strong {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
}

.footer__brand small {
  font-family: "IBM Plex Sans", var(--font);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: #fff;
}

.footer__bottom {
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 14, 28, 0.94);
  padding: 56px 72px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-height: 100%;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 4px;
}

.lightbox figcaption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lightbox__close {
  top: 16px;
  right: 16px;
}

.lightbox__nav--prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Responsive */
@media (max-width: 1080px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }
  .about__grid,
  .contact__grid {
    gap: 56px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 66px;
  }
  .nav-toggle {
    display: flex;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(7, 26, 51, 0.08);
    display: none;
  }
  .nav.is-open {
    display: flex;
  }
  .nav a:not(.btn) {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav a:not(.btn)::after {
    display: none;
  }
  .nav .btn {
    margin-top: 16px;
  }
  .about__grid,
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .about__inset {
    right: 16px;
  }
  .contact__media img {
    aspect-ratio: 16 / 10;
  }
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .fact {
    padding: 18px 16px;
  }
  .fact:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .fact:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .topbar__inner > span,
  .topbar__links a:last-child {
    display: none;
  }
  .brand img {
    width: 40px;
    height: 40px;
  }
  .brand__text small {
    display: none;
  }
  .section {
    padding: 76px 0;
  }
  .section__head {
    margin-bottom: 36px;
  }
  .hero__inner {
    padding-top: 64px;
    padding-bottom: 48px;
  }
  .hero__actions .btn {
    flex: 1 1 100%;
  }
  .fact strong {
    font-size: 1.25rem;
  }
  .service-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px 24px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }
  .filters button {
    flex: none;
  }
  .contact__list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .footer__brand img {
    width: 52px;
    height: 52px;
  }
  .lightbox {
    padding: 64px 8px;
  }
  .lightbox__nav--prev,
  .lightbox__nav--next {
    top: auto;
    bottom: 12px;
    transform: none;
  }
  .lightbox__nav--prev {
    left: calc(50% - 60px);
  }
  .lightbox__nav--next {
    right: calc(50% - 60px);
  }
}
