/* EMKAY Groups — electromechanical (MEPF) website */

:root {
  --navy: #101c2c;
  --navy-deep: #0b1420;
  --gold: #c7a45b;
  --gold-deep: #8d6d32;
  --text: #343a40;
  --muted: #5c6570;
  --line: rgba(16, 28, 44, 0.1);
  --grey: #f4f6f8;
  --header: 76px;
  --display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --body: "Inter", "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: #fff;
  line-height: 1.7;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--display);
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
a, a:hover { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
::selection { background: rgba(199, 164, 91, 0.35); color: var(--navy); }

.container { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 2000;
  background: var(--gold); color: var(--navy); padding: 0.55rem 0.9rem; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 0.8rem;
  color: var(--gold-deep);
  font-family: var(--display);
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 1.8rem; height: 1px; background: var(--gold); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 48px; padding: 0.75rem 1.25rem;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--display); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.button:hover { transform: translateY(-2px); }
.button-gold, .button-gold:hover { background: var(--gold); color: var(--navy); }
.button-gold:hover { background: #d4b56e; }
.button-ghost, .button-ghost:hover { border-color: rgba(255,255,255,0.55); color: #fff; background: transparent; }
.button-ghost:hover { background: #fff; color: var(--navy); }
.button-line, .button-line:hover { border-color: rgba(16,28,44,0.18); color: var(--navy); background: #fff; }
.button-line:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.button:focus-visible, a:focus-visible, .nav-toggle:focus-visible, .mepf__panel:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1030; height: var(--header);
  background: #fff; box-shadow: 0 1px 0 rgba(16,28,44,0.06);
}
.home .site-header:not(.is-scrolled) { background: transparent; box-shadow: none; }
.home .site-header:not(.is-scrolled) .brand {
  background: #fff; border-radius: 8px; padding: 0.28rem 0.5rem 0.18rem;
}
.home .site-header:not(.is-scrolled) .desktop-nav a { color: rgba(255,255,255,0.92); }
.home .site-header:not(.is-scrolled) .nav-toggle__bar { background: #fff; }
.site-header.is-scrolled { background: #fff; box-shadow: 0 1px 0 rgba(16,28,44,0.08); }

.header-bar { height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand img { height: 44px; width: auto; }
.desktop-nav { display: flex; align-items: center; gap: 1.6rem; }
.desktop-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.desktop-nav a { font-family: var(--display); font-size: 0.92rem; font-weight: 500; color: var(--navy); }
.desktop-nav a[aria-current="page"], .desktop-nav a:hover { color: var(--gold-deep); }
.home .site-header:not(.is-scrolled) .desktop-nav a[aria-current="page"],
.home .site-header:not(.is-scrolled) .desktop-nav a:hover { color: var(--gold); }

.nav-toggle {
  width: 44px; height: 44px; border: 0; background: transparent;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
}
.nav-toggle__bar { width: 22px; height: 1.5px; background: var(--navy); }
.mobile-drawer { background: var(--navy); color: #fff; width: min(100%, 380px); }
.mobile-drawer .offcanvas-title { color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; }
.mobile-links { list-style: none; margin: 0.5rem 0 1.5rem; padding: 0; }
.mobile-links a { display: block; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); color: #fff; font-family: var(--display); font-size: 1.3rem; }
.mobile-links a[aria-current="page"], .mobile-links a:hover { color: var(--gold); }

/* Hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr);
  color: #fff; background: var(--navy); overflow: hidden;
}
.hero__media, .hero__media img, .hero__shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__media { z-index: 0; }
.hero__media img {
  object-fit: cover; object-position: center center;
  opacity: 0; z-index: 0; transform: scale(1.06);
  transition: opacity 0.9s ease, transform 1.35s ease;
}
.hero__media img.is-active { opacity: 1; z-index: 2; transform: scale(1); }
.hero__media img.is-leaving { opacity: 1; z-index: 1; transform: scale(1); transition: none; }
.hero__shade {
  z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, rgba(11,20,32,0.94) 0%, rgba(11,20,32,0.78) 34%, rgba(11,20,32,0.28) 62%, rgba(11,20,32,0.45) 100%);
}
.hero__content {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header) + 2.4rem) 3.2rem 2.8rem max(1.4rem, 4vw);
}
.hero .eyebrow { color: var(--gold); }
.hero h1 {
  max-width: 9em; margin-bottom: 0.9rem; color: #fff;
  font-size: clamp(2.3rem, 4.4vw, 4.15rem); font-weight: 700; line-height: 1.02;
}
.hero__lead { max-width: 32rem; color: rgba(255,255,255,0.86); font-size: 1.02rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.mepf {
  position: relative; z-index: 2;
  display: flex; min-height: 100%;
  margin-left: -2.2rem;
}
.mepf__panel {
  flex: 1 1 0; min-width: 0; border: 0; padding: 0;
  margin: 0 0 0 -2.2rem;
  color: #fff; cursor: pointer; text-align: left;
  background: rgba(11, 20, 32, 0.55);
  clip-path: polygon(2.4rem 0, 100% 0, calc(100% - 2.4rem) 100%, 0 100%);
  transition: flex-grow 0.65s cubic-bezier(0.22, 0.8, 0.24, 1), background 0.45s ease;
}
.mepf__panel:first-child { margin-left: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 2.4rem) 100%, 0 100%); }
.mepf__panel:nth-child(2) { background: rgba(16, 28, 44, 0.46); }
.mepf__panel:nth-child(3) { background: rgba(11, 20, 32, 0.6); }
.mepf__panel:nth-child(4) { background: rgba(8, 14, 22, 0.68); }
.mepf__panel.is-open { flex-grow: 3.6; background: rgba(11, 20, 32, 0.32); }
.mepf__skew, .mepf__face { display: flex; height: 100%; min-height: 100%; }
.mepf__face {
  flex-direction: column; justify-content: flex-end; align-items: flex-start;
  width: 100%; padding: 2rem 1.4rem 2.4rem 2.8rem;
}
.mepf__panel:first-child .mepf__face { padding-left: 1.4rem; }
.mepf__letter {
  font-family: var(--display); font-weight: 700; line-height: 0.85;
  font-size: clamp(2.6rem, 4vw, 4.4rem); letter-spacing: -0.05em;
}
.mepf__panel.is-open .mepf__letter { color: var(--gold); }
.mepf__copy {
  display: grid; gap: 0.25rem;
  max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(10px);
  transition: max-height 0.5s ease, opacity 0.4s ease, transform 0.5s ease;
}
.mepf__panel.is-open .mepf__copy {
  max-height: 11rem; opacity: 1; transform: none; margin-top: 0.85rem;
}
@media (hover: hover) and (pointer: fine) {
  .mepf:hover .mepf__panel.is-open:not(:hover) { flex-grow: 1; background: rgba(11, 20, 32, 0.58); }
  .mepf:hover .mepf__panel.is-open:not(:hover) .mepf__letter { color: #fff; }
  .mepf:hover .mepf__panel.is-open:not(:hover) .mepf__copy {
    max-height: 0; opacity: 0; transform: translateY(10px); margin-top: 0;
  }
  .mepf__panel:hover { flex-grow: 3.6; background: rgba(11, 20, 32, 0.32); }
  .mepf__panel:hover .mepf__letter { color: var(--gold); }
  .mepf__panel:hover .mepf__copy { max-height: 11rem; opacity: 1; transform: none; margin-top: 0.85rem; }
}
.mepf__copy small {
  color: var(--gold); font-family: var(--display); font-weight: 600;
  letter-spacing: 0.16em; font-size: 0.72rem;
}
.mepf__copy strong { font-family: var(--display); font-size: 1.45rem; letter-spacing: -0.03em; }
.mepf__copy span { color: rgba(255,255,255,0.82); font-size: 0.92rem; max-width: 16rem; }

.regions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--navy-deep); color: #fff;
}
.regions a {
  padding: 1.35rem 1.25rem 1.2rem; border-right: 1px solid rgba(255,255,255,0.08);
  min-height: 148px; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.85rem;
}
.regions a:last-child { border-right: 0; }
.regions img { width: 72px; height: 72px; object-fit: contain; object-position: left center; }
.regions strong { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; }
.regions a:hover { background: #132233; }
.regions a:hover img { filter: brightness(1.15); }

.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section-grey { background: var(--grey); }
.section h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.8rem; }
.lede { color: var(--muted); max-width: 40rem; font-size: 1.05rem; }

.service-grid, .office-grid, .feature-grid { display: grid; gap: 1rem; }
.service-grid { grid-template-columns: repeat(3, 1fr); margin-top: 2rem; }
.service-card, .office-card, .feature-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem 1.25rem 1.2rem;
}
.service-card span, .feature-card span {
  display: block; color: var(--gold-deep); font-family: var(--display);
  font-size: 0.75rem; letter-spacing: 0.12em; font-weight: 600; margin-bottom: 0.6rem;
}
.service-card h3, .office-card h3, .feature-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.service-card p, .office-card p, .feature-card p { margin: 0; color: var(--muted); }
.feature-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 0.9rem; }
.feature-grid { grid-template-columns: 1.4fr 1fr; margin-top: 1.5rem; }
.office-grid { grid-template-columns: repeat(4, 1fr); margin-top: 1.5rem; }
.office-card address { font-style: normal; white-space: pre-line; color: var(--navy); font-weight: 500; }

.quote {
  background: var(--navy); color: rgba(255,255,255,0.86); border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.5rem);
}
.quote p { font-family: var(--display); font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.35; letter-spacing: -0.03em; color: #fff; margin: 0; }
.quote span { display: block; margin-top: 1rem; color: var(--gold); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }

.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.certs__thumb {
  display: block; width: 100%; padding: 0; border: 0; background: #fff; color: var(--navy);
  border-radius: 16px; overflow: hidden; cursor: zoom-in; text-align: left;
  box-shadow: 0 14px 36px rgba(16, 28, 44, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.certs__thumb:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(16, 28, 44, 0.14); }
.certs__thumb img { width: 100%; height: 240px; object-fit: cover; object-position: top center; background: #fff; }
.certs__thumb span { display: block; padding: 0.8rem 1rem 1rem; font-family: var(--display); font-weight: 600; }
.cert-zoom {
  width: min(880px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0;
  border: 0; background: transparent; overflow: visible;
}
.cert-zoom::backdrop { background: rgba(8, 14, 22, 0.84); }
.cert-zoom img {
  width: 100%; height: auto; max-height: calc(100vh - 6rem); object-fit: contain;
  background: #fff; border-radius: 10px;
}
.cert-zoom[open] img { animation: cert-in 0.38s ease; }
.cert-zoom p { margin: 0.7rem 0 0; color: #fff; font-family: var(--display); }
.cert-zoom__close {
  position: absolute; top: -0.2rem; right: 0; border: 0; background: #fff; color: var(--navy);
  border-radius: 999px; min-height: 40px; padding: 0.35rem 0.9rem; cursor: pointer; font-family: var(--display); font-weight: 600;
}
@keyframes cert-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

/* Inner pages */
.page-hero { padding: calc(var(--header) + 3rem) 0 2.2rem; background: var(--grey); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 14em; }

.country-nav {
  position: sticky; top: var(--header); z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
}
.country-nav ul {
  display: flex; gap: 0.4rem; list-style: none; margin: 0; padding: 0.7rem 0; overflow-x: auto;
}
.country-nav a {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0.35rem 0.9rem;
  border-radius: 999px; font-family: var(--display); font-weight: 600; white-space: nowrap;
}
.country-nav a.is-active, .country-nav a:hover { background: var(--navy); color: #fff; }

.country { padding: 3.2rem 0 1rem; scroll-margin-top: 140px; }
.country__head { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; margin-bottom: 1.6rem; align-items: end; }
.country__index { color: var(--gold); font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.16em; font-weight: 700; }
.country h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 0.2rem 0 0.4rem; }
.country__meta { color: var(--muted); }
.country__meta strong { color: var(--navy); }
.country address { font-style: normal; white-space: pre-line; margin: 0; color: var(--navy); }

.sector { margin: 1.4rem 0 0.4rem; }
.sector h3 {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 0.7rem;
}
.directory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.directory article {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0.95rem 1rem;
}
.directory h4 { margin: 0 0 0.2rem; font-size: 1.02rem; }
.directory p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.feature-project {
  display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 1rem; margin-bottom: 0.8rem; align-items: stretch;
}
.feature-project img { width: 100%; height: 320px; object-fit: cover; border-radius: 16px; }
.feature-project div {
  background: var(--navy); color: #fff; border-radius: 16px; padding: 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
}
.feature-project h3 { color: #fff; font-size: 1.6rem; margin-bottom: 0.35rem; }
.feature-project p { margin: 0; color: rgba(255,255,255,0.78); }
.note {
  margin-top: 0.8rem; padding: 1rem 1.1rem; background: #fff; border-left: 3px solid var(--gold); color: var(--muted);
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2rem; }
.contact-card { background: #fff; border-radius: 18px; padding: 1.4rem; box-shadow: 0 18px 40px rgba(16,28,44,0.06); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 0.35rem; font-family: var(--display); font-size: 0.86rem; font-weight: 600; color: var(--navy); }
.field input, .field textarea {
  width: 100%; border: 1px solid #e3e5e8; border-radius: 12px; padding: 0.8rem 0.9rem; color: var(--navy);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(199,164,91,0.18); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #9c3b3b; }
.field-error { min-height: 1.1rem; margin: 0.25rem 0 0; color: #9c3b3b; font-size: 0.8rem; }
.form-note { color: var(--muted); font-size: 0.84rem; }
.form-status { margin-top: 0.8rem; padding: 0.9rem 1rem; border-radius: 12px; background: #f7f3ea; border: 1px solid rgba(199,164,91,0.5); color: var(--navy); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#contact-form { position: relative; }

/* Footer */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,0.74); padding: 3.2rem 0 1.2rem; margin-top: 3rem; }
.site-footer .brand { display: inline-flex; background: #fff; border-radius: 8px; padding: 0.28rem 0.5rem 0.16rem; }
.site-footer .brand img { height: 40px; filter: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 0.7fr 1fr; gap: 1.5rem; }
.site-footer h2 { color: #fff; font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.35rem; }
.site-footer a:hover { color: var(--gold); }
.footer-bar {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.88rem;
}
.parent-link { color: var(--gold); }

@media (max-width: 991.98px) {
  .desktop-nav { display: none; }
  .regions, .service-grid, .office-grid, .directory, .feature-project, .country__head, .contact-grid, .footer-grid, .feature-grid, .certs {
    grid-template-columns: 1fr 1fr;
  }
  .feature-project, .country__head, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
}
@media (min-width: 992px) {
  .nav-toggle { display: none; }
}
@media (max-width: 640px) {
  .regions, .service-grid, .office-grid, .directory, .feature-grid, .certs { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero__actions .button { width: 100%; }
  .hero h1 { font-size: 2.15rem; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__content { padding-bottom: 1.2rem; }
  .mepf { flex-direction: column; min-height: 28rem; margin-left: 0; padding: 0 0 0.6rem; }
  .mepf__panel { margin-left: 0; clip-path: polygon(0 0.7rem, 100% 0, 100% calc(100% - 0.7rem), 0 100%); }
  .mepf__panel:first-child { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.7rem), 0 100%); }
  .mepf__face { flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.85rem 1.15rem 1rem; }
  .mepf__letter { font-size: 1.8rem; }
  .mepf__panel.is-open .mepf__copy { margin-top: 0.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button:hover { transform: none; }
  .mepf__panel, .mepf__copy, .mepf__skew, .hero__media img { transition: none; }
  .hero__media img, .hero__media img.is-active, .hero__media img.is-leaving { transform: none; }
  .mepf__copy { max-height: none; opacity: 1; transform: none; margin-top: 0.6rem; }
  .certs__thumb:hover, .cert-zoom[open] img { transform: none; animation: none; }
}
