/* ===================================================================
   Mayfair Fidelio Projects Limited — Site Stylesheet
   Design system: navy / teal / green (from company mark), chevron motif
=================================================================== */

:root {
  /* Palette — drawn from the Mayfair Fidelio mark */
  --navy-950: #071B30;
  --navy-900: #0A2540;
  --navy-800: #123A5E;
  --teal-700: #146575;
  --teal-600: #1B7F92;
  --teal-400: #4FB3BF;
  --green-600: #4E9B3A;
  --green-500: #6FBE44;
  --paper: #F7F9FA;
  --paper-dim: #EEF2F3;
  --ink: #142430;
  --ink-soft: #47606E;
  --line: #DEE6E9;
  --white: #FFFFFF;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --max: 1180px;
  --radius: 6px;
  --shadow-soft: 0 10px 30px -12px rgba(10, 37, 64, 0.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--ink-soft); }
button { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

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

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 12px;
}

.section {
  padding: 88px 0;
}
.section--tight { padding: 64px 0; }
.section--navy {
  background: var(--navy-900);
  color: var(--white);
}
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: #C7D5DD; }
.section--dim { background: var(--paper-dim); }

.section-head {
  max-width: 680px;
  margin-bottom: 48px;
}
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--green-500);
  color: var(--navy-950);
}
.btn--primary:hover { background: var(--green-600); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn--outline {
  background: transparent;
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}
.btn--outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.btn--dark {
  background: var(--navy-900);
  color: var(--white);
}
.btn--dark:hover { background: var(--teal-700); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 37, 64, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 37px;
  position: relative;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--white);
  line-height: 1.1;
}
.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-400);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  color: #D7E2E8;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--white);
  border-color: var(--green-500);
}
.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.nav-toggle svg { width: 24px; height: 24px; display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.is-open .icon-menu { display: none; }
.nav-toggle.is-open .icon-close { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("../images/hero-towers.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(7,27,48,0.97) 0%, rgba(7,27,48,0.90) 32%, rgba(11,45,71,0.68) 58%, rgba(20,101,117,0.42) 100%);
  z-index: 1;
}
.hero-chevrons {
  position: absolute;
  right: -6%;
  bottom: -12%;
  width: 480px;
  opacity: 0.35;
  z-index: 1;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 2;
  padding-top: 60px;
  padding-bottom: 60px;
}
.hero-content { max-width: 860px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-400);
  margin-bottom: 20px;
}
.hero-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--green-500);
  display: inline-block;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin-bottom: 22px;
}
.hero p.lead {
  font-size: 1.15rem;
  color: #D7E2E8;
  max-width: 680px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 28px;
}
.hero-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--white);
}
.hero-stat span { font-size: 0.85rem; color: #A9BFC9; }

/* Page header (non-home hero, smaller) */
.page-header {
  position: relative;
  color: var(--white);
  padding: 150px 0 70px;
  overflow: hidden;
}
.page-header .hero-bg { background-attachment: fixed; }
.page-header .hero-scrim { background: linear-gradient(120deg, rgba(7,27,48,0.95), rgba(11,45,71,0.86) 60%, rgba(20,101,117,0.55)); }
.page-header .container { position: relative; z-index: 2; }
.page-header h1 { color: var(--white); font-size: clamp(2rem, 4vw, 2.7rem); margin-bottom: 14px; }
.page-header p { color: #D7E2E8; max-width: 620px; font-size: 1.05rem; margin: 0; }
.breadcrumb {
  font-size: 0.82rem;
  color: var(--teal-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 600;
}

/* ---------- Cards / Grids ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

/* Named split layouts — used instead of inline grid-template-columns so
   responsive rules below can actually override them (inline styles beat
   media-query classes in specificity, which broke mobile previously). */
.split-140 { grid-template-columns: 1fr 1.4fr; }
.split-130 { grid-template-columns: 1fr 1.3fr; }
.split-100 { grid-template-columns: 1fr 1fr; }
.split-130-rev { grid-template-columns: 1.3fr 1fr; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-soft); transform: translateY(-3px); border-color: transparent; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--teal-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--teal-600);
  flex-shrink: 0;
}
.card-icon svg { width: 21px; height: 21px; }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { font-size: 0.95rem; margin-bottom: 0; }
.card-bar {
  width: 40px;
  height: 3px;
  margin-bottom: 16px;
  border-radius: 2px;
}
.bar-green { background: var(--green-500); }
.bar-teal { background: var(--teal-600); }
.bar-deep { background: var(--navy-800); }

/* Numbered items (procurement / local content — faithful to source deck) */
.numbered-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 48px;
}
.numbered-item { display: flex; gap: 20px; }
.numbered-item .num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--teal-400);
  line-height: 1;
  min-width: 56px;
}
.numbered-item h4 { font-size: 1.02rem; margin-bottom: 6px; color: var(--navy-900); }
.numbered-item p { font-size: 0.93rem; margin: 0; }
.section--navy .numbered-item .num { color: var(--green-500); }

/* Quote block */
.quote-block {
  position: relative;
  padding: 56px 60px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  max-width: 820px;
  margin: 0 auto;
}
.quote-block blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--white);
  margin: 0;
  line-height: 1.4;
}
.quote-block blockquote strong { color: var(--green-500); }
.quote-mark { font-size: 3rem; color: var(--green-500); line-height: 1; font-family: var(--font-display); }

/* ---------- Logo Marquee ---------- */
.marquee-wrap {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll-left 32s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  padding: 0 52px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy-800);
  opacity: 0.72;
  white-space: nowrap;
  filter: grayscale(1);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.marquee-item img {
  max-height: 44px;
  max-width: 140px;
  width: auto;
  height: auto;
  display: block;
}
.marquee-item:hover { opacity: 1; filter: grayscale(0); color: var(--teal-600); }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; overflow-x: auto; }
}

/* ---------- Stat bars (partners by region) ---------- */
.stat-bars { display: flex; align-items: flex-end; gap: 28px; height: 220px; padding-top: 20px; }
.stat-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.stat-bar { width: 100%; border-radius: 4px 4px 0 0; position: relative; }
.stat-bar span { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--navy-900); }
.stat-bar-label { margin-top: 12px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Diagonal divider ---------- */
.chevron-divider {
  height: 64px;
  background: var(--paper);
  position: relative;
}
.chevron-divider svg { width: 100%; height: 100%; display: block; }

/* ---------- Tabs / service nav (services page) ---------- */
.service-block {
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.service-block:last-of-type { border-bottom: none; }
.service-block .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.tag-marine { background: #E4F3F5; color: var(--teal-700); }
.tag-power { background: #E9F3E5; color: var(--green-600); }
.tag-meter { background: #E8EEF4; color: var(--navy-800); }

.service-jump {
  position: sticky;
  top: 78px;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.service-jump ul {
  display: flex;
  gap: 6px;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
}
.service-jump a {
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.service-jump a:hover { background: var(--paper-dim); color: var(--navy-900); }

/* Photo marquee — horizontally auto-scrolling row of photo+caption cards.
   Used for Marine, Smart Metering (always scrolling, both breakpoints) and
   Power & EPC (static/centered on desktop since it's only 3 items, becomes
   a scrolling row on mobile since 3 cards exceed a phone's width). Card
   size is identical across all three sections and across breakpoints, per
   spec — mobile size for mobile, desktop size for desktop, same everywhere. */
.photo-marquee-wrap {
  overflow: hidden;
  position: relative;
  margin-bottom: 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.photo-marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: photo-scroll-left 36s linear infinite;
}
.photo-marquee-track:hover { animation-play-state: paused; }

/* Power & EPC: static, centered, no scroll on desktop (only 3 cards, fits
   comfortably). The duplicated "loop" cards are hidden here since nothing
   is scrolling — showing them would just double up the row pointlessly. */
.photo-marquee-track--power {
  animation: none;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.photo-marquee-track--power .photo-card-dup { display: none; }

.photo-card {
  flex: 0 0 auto;
  width: 260px;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--white);
}
.photo-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.photo-card figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 10px 14px 14px;
}

@keyframes photo-scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-marquee-track { animation: none; overflow-x: auto; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: #A9BFC9;
  padding: 72px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand p { color: #8CA3AF; font-size: 0.92rem; max-width: 300px; }
.site-footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.site-footer ul li { margin-bottom: 11px; font-size: 0.92rem; }
.site-footer a:hover { color: var(--green-500); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 0.82rem;
  color: #6E8794;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.office-card {
  display: flex;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 20px;
}
.office-card .card-icon { margin-bottom: 0; }
.office-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.office-card p { font-size: 0.92rem; margin: 0; }

.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 8px;
}
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(27,127,146,0.14);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-status {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.form-status--success {
  background: #E9F3E5;
  color: var(--green-600);
  border: 1px solid #C7E3BC;
}
.form-status--error {
  background: #FBEAEA;
  color: #B3261E;
  border: 1px solid #F2C4C2;
}
.form-status--sending {
  background: var(--paper-dim);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ===================== Responsive ===================== */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .numbered-list { grid-template-columns: 1fr; }
  .split-140, .split-130, .split-100, .split-130-rev {
    grid-template-columns: 1fr;
  }
  .split-140 > *:first-child,
  .split-130 > *:first-child,
  .split-130-rev > *:first-child {
    margin-bottom: 8px;
  }
}

@media (max-width: 760px) {
  .photo-marquee-wrap { margin-bottom: 28px; }
  .photo-card { width: 190px; }
  .photo-card img { height: 130px; }
  .photo-card figcaption { font-size: 0.78rem; padding: 8px 10px 12px; }
  .photo-marquee-track { animation-duration: 26s; }
  .photo-marquee-track--power {
    animation: photo-scroll-left 20s linear infinite;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
  }
  .photo-marquee-track--power .photo-card-dup { display: block; }

  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--navy-950);
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-cta .btn--outline { display: none; }
  .nav-cta { gap: 10px; }
  .site-header .container { height: 68px; }
  .brand-mark { width: 34px; height: 31px; }
  .brand-text { font-size: 0.94rem; }
  .brand-text span { font-size: 0.6rem; }
  .nav-cta .btn--primary { padding: 10px 16px; font-size: 0.86rem; }

  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .split-140, .split-130, .split-100, .split-130-rev { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section--tight { padding: 40px 0; }

  .hero { min-height: 0; }
  .hero .container { padding-top: 40px; padding-bottom: 48px; }
  .hero h1 { font-size: 1.9rem; }
  .hero p.lead { font-size: 1rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 20px 28px; padding-top: 22px; }
  .hero-stat b { font-size: 1.35rem; }
  .hero-chevrons { width: 260px; opacity: 0.22; }

  .page-header { padding: 108px 0 44px; }
  .page-header .hero-bg { background-attachment: scroll; }
  .page-header h1 { font-size: 1.7rem; }

  .quote-block { padding: 30px 20px; }
  .quote-block blockquote { font-size: 1.15rem; }

  .card { padding: 24px 20px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .service-jump { top: 68px; }
  .service-jump ul { padding: 12px 16px; }
  .stat-bars { gap: 14px; height: 180px; }
  .marquee-item { height: 68px; padding: 0 30px; font-size: 1.05rem; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.65rem; }
  .brand-text span { display: none; }
  .nav-cta .btn--primary { padding: 9px 13px; font-size: 0.8rem; }
}
