/* M&E Group — from designrules.md. Do not invent new colors, fonts, or motion. */
:root {
  --ink: #0B0B0D;
  --white: #FFFFFF;
  --accent: #E4FF3B;
  --body-1: #54585F;
  --body-2: #5C6067;
  --body-3: #33353A;
  --muted-1: #8B8E94;
  --muted-2: #9A9DA3;
  --line: #ECECEE;
  --fill: #F5F5F0;
  --on-yellow: #33350E;
  --max: 1280px;
  --pad: 32px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: #6B6F76; }
* { box-sizing: border-box; }
img { max-width: 100%; display: block; }
input::placeholder,
textarea::placeholder { color: var(--muted-2); }

@keyframes wordIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes floatCard {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(-3deg); }
}
@keyframes floatCard2 {
  0%, 100% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(12px) rotate(4deg); }
}

.word-in { opacity: 0; animation: wordIn .7s var(--ease) forwards; }
.word-in-d1 { animation-delay: .1s; }
.word-in-d2 { animation-delay: .2s; }
.word-in-d3 { animation-delay: .34s; }
.word-in-d4 { animation-delay: .46s; }
.word-in-d5 { animation-delay: .5s; }
.word-in-d6 { animation-delay: .64s; }
.word-in-d7 { animation-delay: .78s; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-brand img {
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 18px;
}
.nav-links a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.nav-links a.is-active { font-weight: 600; }

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.nav-cta {
  text-decoration: none;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-cta:hover { color: #fff; }
.nav-cta-short { display: none; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .25s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
.site-nav.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.site-nav.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-nav.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.site-nav.is-open .nav-mobile {
  display: block;
}
.nav-mobile-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad) 28px;
  display: flex;
  flex-direction: column;
}
.nav-mobile-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.nav-mobile-link.is-active {
  font-weight: 700;
}
.nav-mobile-cta {
  margin-top: 20px;
  text-decoration: none;
  text-align: center;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 700;
}
.nav-mobile-cta:hover { color: #fff; }

/* Consultation modal */
.consult-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--pad);
}
.consult-modal[hidden] {
  display: none !important;
}
.consult-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 13, 0.48);
}
.consult-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 64px rgba(11, 11, 13, 0.18);
}
.consult-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.consult-modal-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 10px;
}
.consult-modal-title {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0;
}
.consult-modal-lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--body-1);
  margin: 10px 0 24px;
}
.consult-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.consult-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.consult-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.consult-field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted-1);
}
.consult-field input,
.consult-field select,
.consult-field textarea {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink);
  padding: 13px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
}
.consult-field textarea {
  resize: vertical;
  min-height: 96px;
}
.consult-field input:focus,
.consult-field select:focus,
.consult-field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.consult-form-error {
  margin: 0;
  font-size: 13.5px;
  color: #b42318;
}
.consult-form-submit {
  align-self: stretch;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 14px 22px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
}
.consult-form-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted-1);
  text-align: center;
}
.consult-form-note a {
  color: var(--ink);
  font-weight: 600;
}
.consult-success {
  text-align: center;
  padding: 12px 0 4px;
}
.consult-success h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.consult-success p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--body-1);
  margin: 0 0 22px;
}
.consult-success .consult-form-submit {
  width: 100%;
}

@media (max-width: 640px) {
  .consult-modal-panel { padding: 28px 20px 22px; }
  .consult-form-row { grid-template-columns: 1fr; }
  .consult-modal-title { font-size: 24px; }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 180px var(--pad) 60px;
}
.page-hero .eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.page-hero h1,
.hero-h1 {
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0;
}
.page-hero .lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--body-1);
  max-width: 640px;
  margin-top: 24px;
}

.band-dark {
  background: var(--ink);
  border-radius: 28px;
  margin: 0 32px;
  padding: 90px 48px;
  position: relative;
  overflow: hidden;
}
.band-lime {
  background: var(--accent);
  border-radius: 28px;
  margin: 0 32px;
  padding: 90px 48px;
  text-align: center;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 100px var(--pad) 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.site-footer img {
  height: 22px;
  width: auto;
  margin-bottom: 16px;
}
.footer-desc {
  font-size: 13.5px;
  color: var(--muted-1);
  max-width: 260px;
  line-height: 1.6;
  margin: 0;
}
.footer-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s, background .2s, color .2s;
}
.footer-social:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.footer-label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 14px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  color: var(--body-2);
}
.footer-links a {
  color: inherit;
  text-decoration: none;
}
.footer-copy {
  margin-top: 32px;
  font-size: 12.5px;
  color: var(--muted-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
}
.footer-copy a {
  color: inherit;
  text-decoration: none;
}
.footer-copy a:hover {
  color: var(--ink);
}

@media (max-width: 960px) {
  :root { --pad: 20px; }

  .nav-links { display: none !important; }
  .nav-toggle { display: inline-flex; }
  .site-nav.is-open {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: var(--line);
  }
  .nav-inner { padding: 14px var(--pad); }
  .nav-cta { padding: 10px 14px; font-size: 13px; }
  .nav-cta-full { display: none; }
  .nav-cta-short { display: inline; }

  .hero-h1,
  .page-hero h1 { font-size: 44px !important; line-height: 1.08 !important; }
  .page-hero { padding: 130px var(--pad) 40px; }
  .page-hero .lead { font-size: 16.5px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer { padding: 72px var(--pad) 32px; }
  .float-card { display: none !important; }

  .band-dark,
  .band-lime { margin: 0 16px; padding: 64px 28px; border-radius: 22px; }

  /* Shared grids used across pages (override inline template columns) */
  .grid-2,
  .why-grid,
  .contact-grid,
  .featured-post,
  .maps-grid { grid-template-columns: 1fr !important; gap: 28px !important; }

  .benefits-grid,
  .values-grid,
  .services-grid,
  .posts-grid,
  .standards-grid,
  .subservices-grid,
  .related-grid,
  .stories-grid,
  .sector-grid,
  .offices-grid,
  .grid-3,
  .grid-4,
  .workflow-4,
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  div.benefits-grid[style],
  div.values-grid[style],
  div.services-grid[style],
  div.posts-grid[style],
  div.standards-grid[style],
  div.subservices-grid[style],
  div.related-grid[style],
  div.stories-grid[style],
  div.sector-grid[style],
  div.offices-grid[style],
  div.grid-3[style],
  div.grid-4[style],
  div.stat-grid[style] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Spanning promo cells create implicit columns — full-bleed them instead */
  .benefits-grid > [style*="grid-column"],
  .services-grid > [style*="grid-column"],
  .subservices-grid > [style*="grid-column"],
  .standards-grid > [style*="grid-column"],
  .stat-grid > [style*="grid-column"],
  [style*="grid-column:2"],
  [style*="grid-column: 2"] {
    grid-column: 1 / -1 !important;
  }

  /* Yellow / dark feature bands with inline spacing */
  #cta,
  #values,
  #ai,
  section[style*="margin:0 32px"],
  section[style*="margin:32px 32px"],
  section[style*="margin: 0 32px"] {
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
  #cta,
  #values,
  #ai,
  section[style*="padding:90px 48px"],
  section[style*="padding:100px 48px"],
  section[style*="padding:88px 48px"] {
    padding: 64px 28px !important;
    border-radius: 22px !important;
  }
  #cta h2,
  #values h2,
  #ai h2 {
    font-size: 30px !important;
    line-height: 1.15 !important;
  }

  /* Hero sections */
  section[style*="padding:180px"] {
    padding-top: 130px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Photo slots — cover heroes shrink; contain (blog) sizes to the image */
  image-slot:not([fit="contain"])[style*="height:560px"] { height: 300px !important; }
  image-slot:not([fit="contain"])[style*="height:420px"] { height: 260px !important; }
  image-slot:not([fit="contain"])[style*="height:340px"] { height: 220px !important; }
  .hero-media { height: 300px !important; }

  .featured-post {
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 24px !important;
  }

  .yt-embed { min-height: 220px !important; }
  .alliance-row { flex-wrap: wrap !important; }
}

@media (max-width: 640px) {
  :root { --pad: 16px; }

  .hero-h1,
  .page-hero h1 { font-size: 36px !important; }
  .nav-cta { padding: 10px 12px; font-size: 12.5px; }
  .footer-grid { grid-template-columns: 1fr; }

  .benefits-grid,
  .values-grid,
  .services-grid,
  .posts-grid,
  .standards-grid,
  .subservices-grid,
  .related-grid,
  .stories-grid,
  .sector-grid,
  .offices-grid,
  .grid-3,
  .grid-4,
  .workflow-4,
  .stat-grid,
  div.benefits-grid[style],
  div.values-grid[style],
  div.services-grid[style],
  div.posts-grid[style],
  div.standards-grid[style],
  div.subservices-grid[style],
  div.related-grid[style],
  div.stories-grid[style],
  div.sector-grid[style],
  div.offices-grid[style],
  div.grid-3[style],
  div.grid-4[style],
  div.stat-grid[style] {
    grid-template-columns: 1fr !important;
  }

  /* Spanning cells force implicit columns — reset on small screens */
  .benefits-grid > [style*="grid-column"],
  .services-grid > [style*="grid-column"],
  .subservices-grid > [style*="grid-column"],
  .standards-grid > [style*="grid-column"],
  .stat-grid > [style*="grid-column"],
  [style*="grid-column:2"],
  [style*="grid-column: 2"],
  [style*="grid-column:2 /"],
  [style*="grid-column:2 / span"] {
    grid-column: 1 / -1 !important;
  }

  #cta,
  #values,
  #ai,
  section[style*="margin:0 32px"],
  section[style*="margin:32px 32px"] {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }
  #cta,
  #values,
  #ai,
  section[style*="padding:90px 48px"],
  section[style*="padding:100px 48px"],
  section[style*="padding:88px 48px"] {
    padding: 48px 20px !important;
    border-radius: 18px !important;
  }
  #cta h2,
  #values h2,
  #ai h2 { font-size: 26px !important; }

  section[style*="padding:180px"] {
    padding-top: 112px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  section[style*="padding:120px"],
  section[style*="padding:140px"] {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  image-slot:not([fit="contain"])[style*="height:560px"] { height: 220px !important; }
  image-slot:not([fit="contain"])[style*="height:420px"] { height: 200px !important; }
  image-slot:not([fit="contain"])[style*="height:340px"] { height: 180px !important; }
  image-slot:not([fit="contain"])[style*="height:160px"] { height: 140px !important; }
  .hero-media { height: 220px !important; }

  /* Blog/media photos: full image, no letterbox bars (JS sets aspect-ratio) */
  image-slot[fit="contain"] {
    height: auto !important;
    max-height: none !important;
  }

  .featured-post {
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 20px !important;
    padding: 16px !important;
  }
  .featured-post h2 {
    font-size: 24px !important;
  }

  .article-prose p { font-size: 18px !important; }
  .yt-embed { min-height: 200px !important; margin: 28px 0 36px !important; }

  /* Prevent horizontal overflow from large type / absolute cards */
  body { overflow-x: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .word-in,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
