/* ===========================================================
   ESM Engineering — Design tokens
   Palette grounded in the subject: blueprint-slate for civil
   engineering precision, a muted field-green for the
   environmental heritage side of the business, and a warm
   permit-stamp gold for calls to action.
   =========================================================== */
:root {
  --color-ink: #14262f;
  --color-slate: #1b3a4b;
  --color-slate-light: #2c5069;
  --color-field-green: #4a7c59;
  --color-field-green-dark: #386347;
  --color-gold: #b9862f;
  --color-gold-dark: #9c6f24;
  --color-paper: #f6f4ef;
  --color-paper-alt: #eeece3;
  --color-line: #d9d5c9;
  --color-text: #24313a;
  --color-text-muted: #5b6a72;
  --color-white: #ffffff;

  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;

  --container-width: 1160px;
  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(20, 38, 47, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 38, 47, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-field-green-dark);
  text-decoration: none;
}
a:hover { color: var(--color-gold-dark); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-slate);
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }

p { margin: 0 0 1.1em; color: var(--color-text); }
p.lead { font-size: 1.15rem; color: var(--color-text-muted); }

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

/* ===================== Header / Nav ===================== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo img { height: 52px; width: auto; }
.logo-fallback {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--color-slate);
  letter-spacing: 0.3px;
}
.logo-fallback em { color: var(--color-field-green-dark); font-style: normal; }

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  padding: 10px 16px;
  color: var(--color-slate);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover { background: var(--color-paper-alt); color: var(--color-slate); }

.main-nav a.nav-cta {
  background: var(--color-field-green);
  color: var(--color-white);
}
.main-nav a.nav-cta:hover { background: var(--color-field-green-dark); color: var(--color-white); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-slate);
  border-radius: 2px;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-gold);
  color: var(--color-white);
}
.btn-primary:hover { background: var(--color-gold-dark); color: var(--color-white); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-slate);
  color: var(--color-slate);
}
.btn-secondary:hover { background: var(--color-slate); color: var(--color-white); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.4em; }

/* ===================== Hero ===================== */
.hero {
  background:
    linear-gradient(160deg, rgba(27,58,75,0.94), rgba(27,58,75,0.86)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 48px);
  color: var(--color-white);
  padding: 88px 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { color: var(--color-white); margin-bottom: 0.2em; }
.hero h2 {
  color: var(--color-gold);
  font-weight: 600;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8em;
}
.hero p { color: rgba(255,255,255,0.85); }

/* ===================== Page hero (interior pages) ===================== */
.page-hero {
  background: var(--color-slate);
  color: var(--color-white);
  padding: 64px 0;
}
.page-hero h1 { color: var(--color-white); margin-bottom: 0.2em; }
.page-hero p { color: rgba(255,255,255,0.82); margin: 0; }

/* ===================== Split sections ===================== */
.split-section { padding: 88px 0; }
.split-section.alt-bg { background: var(--color-paper-alt); }
.split-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split-section.reverse .split-inner { direction: rtl; }
.split-section.reverse .split-inner > * { direction: ltr; }

.service-section { padding: 80px 0; }
.contact-section { padding: 80px 0; }

.img-placeholder {
  background: linear-gradient(135deg, var(--color-line), var(--color-paper-alt));
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}
.img-placeholder.tall { aspect-ratio: 3 / 4; }
.img-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(27,58,75,0.05) 0 2px, transparent 2px 14px);
}

/* ===================== Service list ===================== */
.service-list {
  list-style: none;
  margin: 0 0 2em;
  padding: 0;
  display: grid;
  gap: 12px;
}
.service-list li {
  position: relative;
  padding-left: 30px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-slate);
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--color-field-green);
}

/* ===================== Clients section ===================== */
.clients-section { padding: 72px 0; text-align: center; }
.section-heading { margin-bottom: 1.2em; }
.clients-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.clients-grid li {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 22px 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-slate);
  font-size: 0.92rem;
}

/* ===================== Contact form ===================== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-slate);
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-white);
  color: var(--color-text);
}
.form-control:focus {
  border-color: var(--color-field-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.18);
}
.field-error { color: #b3261e; font-size: 0.85rem; display: block; margin-top: 4px; }
.text-danger { color: #b3261e; }
.alert {
  padding: 16px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-weight: 600;
}
.alert-success {
  background: rgba(74, 124, 89, 0.12);
  border: 1px solid var(--color-field-green);
  color: var(--color-field-green-dark);
}

/* ===================== Footer ===================== */
.site-footer { background: var(--color-ink); color: rgba(255,255,255,0.85); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding: 64px 0 40px;
}
.footer-brand p { color: rgba(255,255,255,0.65); max-width: 340px; }
.logo-footer img { height: 44px; filter: brightness(0) invert(1); }
.footer-col h4 {
  color: var(--color-white);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1em;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255,255,255,0.75); }
.footer-col a:hover { color: var(--color-gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 18px 0;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .hero-inner, .split-inner, .footer-inner {
    grid-template-columns: 1fr;
  }
  .split-section.reverse .split-inner { direction: ltr; }
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px; gap: 4px; }
  .main-nav a { display: block; }
  .hero { padding: 56px 0; }
  .split-section, .service-section, .contact-section, .clients-section { padding: 56px 0; }
}
