/* Merit Advisory Energy Services — site styles
   Brand colours sampled from the corporate mark: navy #03438C, swoosh blue #3E92DE */

:root {
  --navy:        #03438C;
  --navy-deep:   #042B5C;
  --navy-dark:   #021E42;
  --blue:        #3E92DE;
  --blue-pale:   #E8F1FB;

  --ink:         #16202D;
  --muted:       #5C6875;
  --line:        #E1E7EF;
  --panel:       #F5F8FC;
  --white:       #FFFFFF;

  --measure:     68ch;
  --wrap:        1140px;
  --radius:      6px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3, h4 {
  color: var(--navy-deep);
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: 0.4em; }

a { color: var(--navy); }
a:hover { color: var(--blue); }

img { max-width: 100%; height: auto; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.measure { max-width: var(--measure); }


/* ---------- Header ---------- */

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--navy-deep);
  flex-shrink: 0;
}
.brand img { width: 42px; height: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-tag {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Direct child only — the dropdown is also a <ul> inside .nav */
.nav > ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.93rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--navy); border-bottom-color: var(--blue); }
.nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }

/* CSS-only services dropdown */
.has-menu { position: relative; }
.has-menu > button {
  font: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.4rem 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.has-menu > button::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}
.has-menu:hover > button,
.has-menu:focus-within > button { color: var(--navy); border-bottom-color: var(--blue); }

.menu {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(4, 43, 92, 0.12);
  padding: 0.5rem 0;
  display: none;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
}
.has-menu:hover .menu,
.has-menu:focus-within .menu { display: flex; }
.menu li { margin: 0; }
.menu a {
  display: block;
  padding: 0.55rem 1.1rem;
  border-bottom: 0;
  font-size: 0.92rem;
}
.menu a:hover { background: var(--blue-pale); border-bottom: 0; }


/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: var(--white); }

.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

.btn-on-dark { border-color: var(--white); background: var(--white); color: var(--navy-deep); }
.btn-on-dark:hover { background: transparent; color: var(--white); border-color: var(--white); }

.btn-outline-light { border-color: var(--white); background: transparent; color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--navy-deep); border-color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }


/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(140deg, var(--navy-deep) 0%, var(--navy) 65%, #0A56A8 100%);
  color: var(--white);
  padding: 5.5rem 0 5rem;
}
.hero h1 { color: var(--white); max-width: 20ch; }
.hero .lead {
  font-size: 1.18rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 58ch;
  margin-bottom: 2rem;
}
.hero .eyebrow { color: var(--blue); }

/* Compact hero for interior pages */
.page-head {
  background: var(--navy-deep);
  color: var(--white);
  padding: 3.5rem 0 3rem;
}
.page-head h1 { color: var(--white); margin-bottom: 0.4rem; font-size: 2.25rem; }
.page-head .lead {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  max-width: 62ch;
  margin: 0;
}
.page-head .eyebrow { color: var(--blue); }


/* ---------- Sections ---------- */

section { padding: 4.5rem 0; }
section.tight { padding: 3rem 0; }
.band-panel { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-navy { background: var(--navy-deep); color: var(--white); }
.band-navy h2, .band-navy h3 { color: var(--white); }
.band-navy p { color: rgba(255, 255, 255, 0.85); }

.eyebrow {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.7rem;
}

.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head.centred { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin-bottom: 0; }
.band-navy .section-head p { color: rgba(255, 255, 255, 0.85); }


/* ---------- Grids and cards ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  border-top: 3px solid var(--navy);
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0; }
.card .card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.card .card-link::after { content: " →"; }

.card-plain { border-top-color: var(--line); }

.numbered .num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue);
  display: block;
  margin-bottom: 0.4rem;
}


/* ---------- Feature list ---------- */

.ticks { list-style: none; padding: 0; }
.ticks li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}

.excludes {
  background: var(--panel);
  border-left: 3px solid var(--line);
  padding: 1.1rem 1.4rem;
  font-size: 0.93rem;
  color: var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.excludes strong { color: var(--ink); }
.excludes p:last-child { margin-bottom: 0; }


/* ---------- Case studies ---------- */

.case {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
  background: var(--white);
}
.case .client {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.5rem;
}
.case h3 { font-size: 1.15rem; }
.case dl { margin: 1.1rem 0 0; }
.case dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
  color: var(--navy);
  margin-top: 1rem;
}
.case dd { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.96rem; }


/* ---------- Bios ---------- */

.bio {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2rem;
  align-items: start;
}
.bio + .bio { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--line); }
/* Source photos differ in aspect ratio — crop to a common frame */
.bio-photo {
  width: 150px;
  height: 185px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius);
  display: block;
  border: 1px solid var(--line);
}
.bio .role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--blue);
  margin: -0.4em 0 1rem;
}
.bio h2 { margin-bottom: 0.15em; }
.bio h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--navy);
  margin: 1.8rem 0 0.7rem;
}
.bio .contact-line { font-size: 0.94rem; color: var(--muted); }
.bio .contact-line a { text-decoration: none; }

.cols-2 { columns: 2; column-gap: 2.5rem; }
.cols-2 li { break-inside: avoid; }


/* ---------- Stats ---------- */

.stat .figure {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.05;
  display: block;
}
.band-navy .stat .figure { color: var(--blue); }
.stat .caption { font-size: 0.95rem; color: var(--muted); }
.band-navy .stat .caption { color: rgba(255, 255, 255, 0.85); }


/* ---------- Contact ---------- */

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  background: var(--white);
}
.contact-card .name { font-weight: 700; font-size: 1.15rem; color: var(--navy-deep); }
.contact-card .role {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.contact-card a { display: block; text-decoration: none; margin: 0.3rem 0; font-size: 0.97rem; }


/* ---------- CTA ---------- */

.cta { text-align: center; }
.cta h2 { color: var(--white); }
.cta p { max-width: 56ch; margin-left: auto; margin-right: auto; }
.cta .btn-row { justify-content: center; margin-top: 2rem; }


/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.66);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-grid h4 {
  color: var(--white);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-bottom: 0.9rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.45rem; }
.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.5);
}


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
  .hero { padding: 3.5rem 0; }
  section { padding: 3.25rem 0; }

  /* The flattened nav is several lines tall — sticky would eat the viewport */
  .site-header { position: static; }
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    min-height: 0;
  }
  .nav a, .menu a { font-size: 0.88rem; }
  .nav > ul { flex-wrap: wrap; gap: 0.4rem 1.1rem; }
  .grid-2x2 { grid-template-columns: 1fr; }

  /* Flatten the dropdown on small screens */
  .has-menu > button { display: none; }
  .menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 0.4rem 1.1rem;
    background: transparent;
  }
  .menu a { padding: 0.4rem 0; }
  .menu a:hover { background: transparent; }

  .bio { grid-template-columns: 1fr; gap: 1.2rem; }
  .cols-2 { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.8rem; }
  .hero .lead { font-size: 1.05rem; }
}
