/* ============================================================
   APO-TECH — shared stylesheet
   Palette: graphite/ink + royal blue + bright-blue accent (Kanit/Sarabun)
   Deliberately distinct from the Wondertech site (navy/cyan, Sarabun-only)
   ============================================================ */

:root {
  --ink: #10151B;
  --ink-2: #1B2530;
  --steel: #22303C;
  --blue: #2451C4;
  --blue-dark: #16327E;
  --blue-pale: #EAF0FC;
  --accent: #0EA5E9;
  --accent-dark: #0284C7;
  --pale: #EEF2F8;
  --white: #FFFFFF;
  --text: #172233;
  --muted: #5B6B7C;
  --border: #DCE3EA;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 8px 28px rgba(16, 21, 27, 0.10);
  --shadow-sm: 0 2px 10px rgba(16, 21, 27, 0.08);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Sarabun", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 .5em;
  color: var(--ink);
}

p { margin: 0 0 1em; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

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

.section {
  padding: 88px 0;
}
.section--tight { padding: 56px 0; }
.section--pale { background: var(--pale); }
.section--ink { background: var(--ink); color: #C9D3DC; }
.section--ink h2, .section--ink h3 { color: var(--white); }

.eyebrow {
  display: inline-block;
  font-family: "Kanit", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(14, 165, 233, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section--ink .eyebrow { color: var(--accent); background: rgba(14, 165, 233, 0.16); }

.section-head { max-width: 680px; margin: 0 0 44px; }
.section-head--wide { max-width: 800px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 17px; }
.section--ink .section-head p { color: #9FADBB; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 15.5px;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.5); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.12); border-color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar.scrolled {
  background: rgba(16, 21, 27, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 0;
  box-shadow: var(--shadow-sm);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img {
  height: 68px; width: auto;
  border-radius: 8px;
  transition: height .25s ease;
}
.navbar.scrolled .nav-logo img { height: 46px; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--white);
  opacity: .88;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
}
.nav-cta { margin-left: 8px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 26px; height: 2px; background: var(--white); border-radius: 2px; }

/* page hero variant for non-home pages needs solid navbar on load */
body.page--inner .navbar:not(.scrolled) { background: var(--ink); padding: 16px 0; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a { font-family: "Kanit", sans-serif; font-size: 22px; color: var(--white); }
.mobile-close {
  position: absolute;
  top: 22px; right: 24px;
  background: none; border: none;
  font-size: 30px; color: var(--white);
  cursor: pointer;
  line-height: 1;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
  padding-top: 90px;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
}
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(35%) brightness(.85) contrast(1.05);
}
.hero-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(160deg, rgba(16,21,27,.82) 0%, rgba(27,37,48,.72) 55%, rgba(22,50,126,.68) 130%);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 2;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(14,165,233,.10), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(36,81,196,.35), transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 3; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Kanit", sans-serif; font-size: 13.5px; font-weight: 500;
  letter-spacing: .04em;
  color: var(--white);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(32px, 5vw, 54px);
  max-width: 820px;
}
.hero h1 span { color: var(--accent); }
.hero p.lead {
  font-size: 18px;
  color: #C9D3DC;
  max-width: 560px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.page-hero {
  min-height: 46vh;
  padding-top: 130px;
  padding-bottom: 56px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 60%, var(--blue-dark) 140%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 88% 10%, rgba(14,165,233,.14), transparent 45%);
}
.page-hero .container { position: relative; z-index: 1; }
.breadcrumb { font-family: "Kanit", sans-serif; font-size: 13.5px; color: #9FADBB; margin-bottom: 12px; }
.breadcrumb a { color: #C9D3DC; }
.page-hero h1 { color: var(--white); font-size: clamp(28px, 4vw, 42px); max-width: 720px; }
.page-hero p { color: #C9D3DC; max-width: 620px; font-size: 16.5px; margin: 0; }

/* ---------- Why-us cards ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card .icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--blue-pale);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 18.5px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; margin-bottom: 0; }

/* ---------- Stats ---------- */
.stats-bar {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
  margin-top: -110px;
  position: relative;
  z-index: 5;
  box-shadow: var(--shadow);
}
.stat-item .stat-val {
  font-family: "Kanit", sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat-item .stat-label {
  font-size: 14px;
  color: #9FADBB;
  margin-top: 8px;
  font-family: "Kanit", sans-serif;
}
.stats-bar + .section { padding-top: 150px; }

/* ---------- Services teaser / list ---------- */
.svc-item {
  display: flex;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.svc-item:last-child { border-bottom: none; }
.svc-num {
  font-family: "Kanit", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  min-width: 34px;
}
.svc-item h3 { font-size: 19px; margin-bottom: 6px; }
.svc-item p { color: var(--muted); margin: 0; font-size: 15px; }

.svc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.svc-card .svc-photo { aspect-ratio: 4/3; overflow: hidden; background: var(--pale); }
.svc-card .svc-photo img { width: 100%; height: 100%; object-fit: cover; }
.svc-card .svc-body { padding: 22px 22px 26px; }
.svc-card h3 { font-size: 18px; margin-bottom: 8px; }
.svc-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 0; }
.svc-tag {
  display: inline-block;
  font-family: "Kanit", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-pale);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.svc-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Kanit", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-dark);
  margin-top: 14px;
  transition: gap .15s ease;
}
.svc-more:hover { gap: 8px; color: var(--blue); }

/* ---------- Portfolio ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter-btn {
  font-family: "Kanit", sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: var(--white); }

.client-group { margin-bottom: 64px; }
.client-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 28px;
}
.client-group-head h2 { font-size: 22px; margin: 0; }
.client-group-head .count { font-family: "Kanit", sans-serif; color: var(--muted); font-size: 14px; white-space: nowrap; }

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--white);
}
.project-card .project-head { padding: 20px 24px 4px; }
.project-card h3 { font-size: 17.5px; margin-bottom: 4px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 3px;
  padding: 20px 24px 24px;
}
.photo-grid button {
  padding: 0; border: none; cursor: pointer;
  aspect-ratio: 1/1; overflow: hidden;
  border-radius: 6px;
  background: var(--pale);
}
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-grid button:hover img { transform: scale(1.08); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,13,17,.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--white);
  cursor: pointer;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close { top: 24px; right: 24px; width: 44px; height: 44px; font-size: 20px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 22px; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-caption { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: #C9D3DC; font-family: "Kanit", sans-serif; font-size: 14px; }

/* ---------- Trusted clients strip ---------- */
.clients-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  padding: 36px 0;
}
.clients-strip img { height: 76px; width: auto; transition: transform .2s ease; }
.clients-strip img.logo-lg { height: 108px; }
.clients-strip img:hover { transform: translateY(-3px); }
.client-badge {
  font-family: "Kanit", sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.contact-item { display: flex; gap: 16px; margin-bottom: 26px; }
.contact-item .icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--blue-pale); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.contact-item .icon svg { width: 22px; height: 22px; }
.contact-item h4 { font-size: 16px; margin-bottom: 4px; }
.contact-item p, .contact-item a { color: var(--muted); font-size: 15px; margin: 0; }
.contact-item a:hover { color: var(--blue); }
.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.social-row { display: flex; gap: 12px; margin-top: 8px; }
.social-row a {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--pale);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.social-row a:hover { background: var(--accent); color: var(--white); }
.social-row svg { width: 20px; height: 20px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--blue-dark), var(--ink));
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--white);
}
.cta-band h2 { color: var(--white); margin-bottom: 6px; }
.cta-band p { color: #C9D3DC; margin: 0; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: #9FADBB;
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo {
  height: 56px;
  margin-bottom: 16px;
  border-radius: 8px;
  display: inline-block;
}
.footer h4 { color: var(--white); font-size: 15px; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; font-size: 14.5px; }
.footer a { color: #9FADBB; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); margin-top: -70px; }
  .stats-bar + .section { padding-top: 110px; }
}
@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: auto; padding: 130px 0 80px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox { padding: 16px; }
}
