/* ==========================================================================
   KMG Water Engineering - stylesheet
   Palette derived from the company logo (deep navy + engineering blues)
   ========================================================================== */

:root {
  --navy: #0b2e4f;
  --navy-deep: #071f36;
  --blue: #1583c7;
  --blue-bright: #2ea9e5;
  --blue-soft: #e9f4fb;
  --line: #dbe6ef;
  --ink: #16242f;
  --ink-soft: #55697a;
  --white: #ffffff;
  --grad-blue: linear-gradient(135deg, #0b2e4f 0%, #1583c7 55%, #2ea9e5 100%);
  --grad-soft: linear-gradient(135deg, #e9f4fb 0%, #ffffff 100%);
  --shadow-sm: 0 2px 10px rgba(11, 46, 79, .08);
  --shadow-md: 0 14px 34px rgba(11, 46, 79, .12);
  --shadow-lg: 0 24px 60px rgba(11, 46, 79, .18);
  --radius: 14px;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--white);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
h1, h2, h3, h4 {
  font-family: var(--head);
  color: var(--navy);
  line-height: 1.12;
  margin: 0 0 .6rem;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.wrap { width: min(1200px, 92%); margin-inline: auto; }
.center { text-align: center; }
.narrow { max-width: 780px; margin-inline: auto; }
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }

.eyebrow {
  font-family: var(--head);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 .5rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--head); text-transform: uppercase; letter-spacing: .08em;
  font-size: 1rem; font-weight: 700;
  padding: .85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad-blue); color: var(--white); box-shadow: var(--shadow-md); }
.btn-primary:hover { color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline { border-color: var(--blue); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; background: rgba(255,255,255,.08); }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-sm { padding: .5rem 1.1rem; font-size: .9rem; }
.link-arrow { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; }
.link-arrow svg { width: 17px; height: 17px; transition: transform .2s ease; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- top information bar ---------- */
.topbar { background: var(--navy-deep); color: #cfe3f2; font-size: .88rem; }
.topbar a { color: #cfe3f2; }
.topbar a:hover { color: var(--blue-bright); }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 44px; flex-wrap: wrap; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.tb-item { display: inline-flex; align-items: center; gap: .45rem; }
.tb-socials { display: inline-flex; gap: .5rem; }
.tb-socials a { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; }
.tb-socials svg { width: 15px; height: 15px; }
.tb-socials a:hover { background: var(--blue); color: #fff; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header.is-stuck { box-shadow: var(--shadow-sm); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-logo { width: 56px; height: 56px; object-fit: contain; background: var(--grad-soft); border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1; font-family: var(--head); }
.brand-text strong { font-size: 1.65rem; color: var(--navy); letter-spacing: .06em; }
.brand-text em { font-style: normal; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); }
.main-nav { display: flex; align-items: center; gap: 1.35rem; }
.main-nav > a {
  font-family: var(--head); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; font-size: 1.02rem; color: var(--navy); position: relative; padding: .35rem 0;
}
.main-nav > a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--blue); transition: width .22s ease; }
.main-nav > a:hover::after, .main-nav > a.is-active::after { width: 100%; }
.main-nav > a.is-active { color: var(--blue); }
.nav-cta { color: #fff !important; padding: .6rem 1.2rem; font-size: .92rem; }
.nav-cta::after { display: none; }
.nav-toggle { display: none; background: var(--navy); color: #fff; border: 0; border-radius: 10px; width: 46px; height: 42px; padding: 9px; cursor: pointer; }

/* ---------- banners ---------- */
.hero, .page-banner, .cta-strip {
  position: relative; isolation: isolate; color: #fff;
  background-image: var(--banner), var(--grad-blue);
  background-size: cover; background-position: center;
}
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(7,31,54,.92) 0%, rgba(11,46,79,.82) 45%, rgba(21,131,199,.62) 100%); z-index: -1; }
.hero { min-height: 84vh; display: flex; align-items: center; }
.hero-in { padding: 6rem 0 5rem; max-width: 880px; }
.hero h1, .page-banner h1, .cta-strip h2 { color: #fff; }
.hero-title { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: .02em; margin-bottom: .3rem; }
.hero-tag { font-family: var(--head); text-transform: uppercase; letter-spacing: .14em; font-size: clamp(1rem, 2vw, 1.4rem); color: var(--blue-bright); margin-bottom: 1.1rem; }
.hero-copy { font-size: 1.12rem; color: #dcebf7; max-width: 640px; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-strip { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 2.4rem 0 0; }
.hero-strip li { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; padding: .4rem 1rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.hero .eyebrow, .page-banner .eyebrow { color: var(--blue-bright); }
.page-banner { padding: 5.5rem 0 4.5rem; }
.banner-sub { color: #dcebf7; max-width: 620px; margin-bottom: .8rem; }
.crumbs { display: flex; gap: .5rem; font-size: .9rem; color: #bdd6e8; }
.crumbs a { color: var(--blue-bright); }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-tint { background: var(--grad-soft); }
.section-dark { background: var(--navy); color: #cfe0ee; }
.section-dark h2, .section-dark h3 { color: #fff; }
.sec-head { max-width: 720px; margin: 0 auto 2.8rem; text-align: center; }
.sec-head p:last-child { color: var(--ink-soft); }
.section-dark .sec-head p:last-child { color: #bcd2e4; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.grid-2.reverse .media-frame { order: 2; }
.media-frame {
  border-radius: var(--radius); overflow: hidden; min-height: 420px;
  background-image: var(--img), var(--grad-blue);
  background-size: cover; background-position: center; box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.media-frame img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }

.ticks { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .5rem; }
.ticks.two-col { grid-template-columns: 1fr 1fr; }
.ticks li { display: flex; gap: .6rem; align-items: flex-start; font-size: .98rem; }
.ticks .ic { color: var(--blue); margin-top: .3rem; }

/* ---------- services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.6rem; }
.svc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; scroll-margin-top: 130px; }
.svc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.svc-media { position: relative; height: 220px; background-image: var(--img), var(--grad-blue); background-size: cover; background-position: center; }
.svc-media img { width: 100%; height: 220px; object-fit: cover; }
.svc-no { position: absolute; left: 0; bottom: 0; background: var(--navy); color: #fff; font-family: var(--head); font-size: 1.1rem; padding: .3rem 1rem; letter-spacing: .1em; }
.svc-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.svc-body p { color: var(--ink-soft); }
.svc-body .ticks { margin-top: .4rem; }
.svc-body .link-arrow { margin-top: auto; }

/* ---------- why / steps ---------- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.why-card { border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 1.6rem; background: rgba(255,255,255,.05); }
.why-card.light { background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.why-card.light p { color: var(--ink-soft); }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.step { background: #fff; border-radius: var(--radius); padding: 1.7rem; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.step-no { font-family: var(--head); font-size: 2.4rem; color: var(--blue-bright); display: block; line-height: 1; margin-bottom: .4rem; }
.step p { color: var(--ink-soft); margin: 0; }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.6rem; margin-bottom: 2rem; }
.proj-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease; }
.proj-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.proj-media { height: 250px; background-image: var(--img), var(--grad-blue); background-size: cover; background-position: center; }
.proj-media img { width: 100%; height: 250px; object-fit: cover; }
.proj-body { padding: 1.4rem; }
.proj-body p:last-child { color: var(--ink-soft); margin: 0; }

/* ---------- gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.gal-item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; height: 260px; background-image: var(--img), var(--grad-blue); background-size: cover; background-position: center; box-shadow: var(--shadow-sm); }
.gal-item img { width: 100%; height: 260px; object-fit: cover; }
.gal-item figcaption { position: absolute; inset: auto 0 0 0; padding: 1.4rem 1rem .9rem; color: #fff; font-size: .92rem; background: linear-gradient(to top, rgba(7,31,54,.9), rgba(7,31,54,0)); }

/* ---------- testimonials ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.6rem; }
.quote-card { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-sm); border-top: 4px solid var(--blue); }
.quote-card blockquote { margin: 0 0 1.2rem; font-size: 1.02rem; color: var(--ink); }
.quote-card figcaption { display: flex; align-items: center; gap: .8rem; }
.quote-card figcaption strong { display: block; font-family: var(--head); font-size: 1.1rem; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; }
.quote-card figcaption em { font-style: normal; font-size: .88rem; color: var(--ink-soft); }
.avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; background-image: var(--img), var(--grad-blue); background-size: cover; background-position: center; }
.avatar img { width: 52px; height: 52px; object-fit: cover; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.4rem; text-align: center; }
.stat strong { display: block; font-family: var(--head); font-size: 3rem; color: var(--blue); line-height: 1; }
.stat span { color: var(--ink-soft); font-size: .95rem; }

/* ---------- contact ---------- */
.contact-grid { align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: .9rem; }
.contact-list .ic { color: var(--blue); margin-top: .35rem; }
.contact-list strong { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--navy); }
.quote-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-md); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--navy); margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .78rem .9rem; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--body); font-size: 1rem; background: #fbfdff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue-bright); outline-offset: 1px; border-color: var(--blue); }
.field.has-error input, .field.has-error textarea { border-color: #c0392b; }
.form-note { margin-top: .9rem; font-weight: 600; color: var(--blue); }
.map-section iframe { display: block; filter: grayscale(.2); }

/* ---------- cta strip ---------- */
.cta-strip { padding: 3.6rem 0; }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; flex-wrap: wrap; }
.cta-in h2 { margin-bottom: .3rem; }
.cta-in p { margin: 0; color: #dcebf7; }
.cta-actions { display: flex; gap: .8rem; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: #b9cfe1; padding-top: 3.5rem; }
.site-footer h4 { color: #fff; letter-spacing: .12em; margin-bottom: 1rem; }
.site-footer a { color: #b9cfe1; }
.site-footer a:hover { color: var(--blue-bright); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1.4fr; gap: 2rem; padding-bottom: 3rem; }
.footer-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 50%; margin-bottom: 1rem; }
.footer-about { font-size: .95rem; }
.footer-strap { font-family: var(--head); letter-spacing: .16em; color: var(--blue-bright); font-size: .85rem; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .95rem; }
.footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
.footer-contact .ic { color: var(--blue-bright); margin-top: .3rem; }
.footer-bar { border-top: 1px solid rgba(255,255,255,.12); padding: 1rem 0; font-size: .88rem; }
.footer-bar-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bar p { margin: 0; }

/* ---------- floating elements ---------- */
.wa-float { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 70; }
.wa-float svg { width: 30px; height: 30px; }
.wa-float:hover { color: #fff; transform: translateY(-3px); }
.scroll-top { position: fixed; right: 20px; bottom: 88px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 70; box-shadow: var(--shadow-md); }
.scroll-top svg { width: 20px; height: 20px; }
.scroll-top.is-visible { display: flex; }
.cookie-banner { position: fixed; left: 20px; bottom: 20px; right: 96px; max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1rem 1.2rem; display: flex; align-items: center; gap: 1rem; z-index: 70; }
.cookie-banner p { margin: 0; font-size: .92rem; }
.cookie-banner[hidden] { display: none; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tb-hide { display: none; }
}
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 6% 1.2rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); display: none; }
  .main-nav.is-open { display: flex; }
  .main-nav > a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav-cta { justify-content: center; margin-top: .9rem; }
  .grid-2, .grid-2.reverse .media-frame { grid-template-columns: 1fr; order: 0; }
  .media-frame, .media-frame img { min-height: 300px; height: 300px; }
  .hero { min-height: 72vh; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .ticks.two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .topbar-in { justify-content: center; font-size: .82rem; }
  .cookie-banner { right: 20px; flex-direction: column; align-items: flex-start; }
  .cta-in { flex-direction: column; align-items: flex-start; }
}
