/* ==========================================================================
   Nu Mech — clean rebuild
   Design tokens extracted from the live site (Divi) computed styles.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Zalando Sans SemiExpanded";
  src: url("../assets/fonts/ZalandoSansSemiExpanded-Light.ttf") format("truetype");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans SemiExpanded";
  src: url("../assets/fonts/ZalandoSansSemiExpanded-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --blue: #095191;
  --ink: #333333;
  --body: #666666;
  --light: #eaeaea;
  --white: #ffffff;
  --font: "Zalando Sans SemiExpanded", Helvetica, Arial, sans-serif;
  --container: 1396px;
  --pad-section: 54px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.3;
  color: var(--body);
  background: var(--white);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1; color: var(--ink); }
p { margin: 0 0 1em; }

.container {
  width: 90%;
  max-width: var(--container);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 12px 28px;
  background: transparent;   /* so <button class="btn"> has no UA grey fill */
  border: 2px solid transparent;
  border-radius: 25px;
  transition: background-color .25s, color .25s, border-color .25s;
  cursor: pointer;
}
.btn-light { color: var(--white); border-color: var(--white); }
.btn-light:hover { background: var(--white); color: var(--blue); }
.btn-blue { color: var(--blue); border-color: var(--blue); }
.btn-blue:hover { background: var(--blue); color: var(--white); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--white);
  height: 81px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand img { width: 72px; height: auto; }  /* 40% smaller, fits the white bar */
.main-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 34px;
}
.main-nav a {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  color: var(--body);
  transition: color .2s;
}
.main-nav a:hover { color: var(--blue); }
/* blue square brackets on hover, positioned so they don't shift the layout */
.main-nav a::before,
.main-nav a::after {
  color: var(--blue);
  font-weight: 700;
  opacity: 0;
  transition: opacity .2s;
  position: absolute;
  top: 0;
}
.main-nav a::before { content: "["; left: -11px; }
.main-nav a::after  { content: "]"; right: -11px; }
.main-nav a:hover::before,
.main-nav a:hover::after { opacity: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: 0; padding: 6px;
  cursor: pointer;
}
.nav-toggle span {
  width: 26px; height: 2px; background: var(--blue); display: block;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 800px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: var(--white);
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);  /* darker video overlay */
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--pad-section);
  padding-bottom: 165px;           /* text overlay raised 100px (was 65px from bottom) */
  display: flex;
  align-items: flex-start;         /* top-align both columns so their tops line up */
  justify-content: space-between;
  gap: 48px;
}
.hero-left { flex: 1 1 56%; }
.hero-right { flex: 0 1 38%; }
.hero-title {
  font-size: 72px;   /* main banner text, 10% smaller */
  line-height: 1;
  color: var(--white);
}
.word-rotator {
  position: relative;
  height: 76px;
  margin-top: 4px;
}
.word-rotator .rot {
  position: absolute;
  top: 0; left: 0;
  font-size: 72px;   /* matches .hero-title, 10% smaller */
  line-height: 1;
  font-weight: 500;
  color: var(--white);
  opacity: 0;
  white-space: nowrap;
  animation: wordFadeLoop 12s infinite;
}
/* delays need the same specificity as `.word-rotator .rot` or the shorthand's
   implicit delay:0 wins and all three words animate in sync */
.word-rotator .rot-1 { animation-delay: 0s; }
.word-rotator .rot-2 { animation-delay: 3s; }
.word-rotator .rot-3 { animation-delay: 6s; }
@keyframes wordFadeLoop {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  25%  { opacity: 1; }
  30%  { opacity: 0; }
  100% { opacity: 0; }
}
.hero-lead {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.hero-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  background: var(--blue);   /* nu-mech blue bar, white text */
  padding-block: 18px;
}
.hero-strip-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--white);
}

/* ==========================================================================
   Packaged solution
   ========================================================================== */
.packaged {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  /* full-bleed photo with a hard white gradient over the right half */
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0) 50%, #fff 50% 100%),
    url("../assets/img/rooftop-ventilation-outlet-2.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;    /* parallax: image stays fixed while content scrolls */
  padding-block: var(--pad-section);
}
.packaged .container { width: 90%; }
.packaged-text {
  margin-left: auto;
  width: 50%;
  max-width: 560px;
}
.eyebrow {
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  color: var(--blue);
  margin-bottom: 18px;
}
.packaged-text p { font-size: 16px; line-height: 1.4; }
.packaged-text .btn { margin-top: 14px; }

/* ==========================================================================
   2-column parallax band — fixed photo on one side, text on the white half.
   Shared pattern (same as .packaged): used for services items, etc.
   `--side` set via modifier; image set inline via --bg (path relative to THIS
   stylesheet, i.e. ../assets/img/...).
   ========================================================================== */
.split-band {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 620px;
  padding-block: 54px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;   /* parallax */
}
.split-band--right { background-image: linear-gradient(90deg,  rgba(255,255,255,0) 50%, #fff 50% 100%), var(--bg); }
.split-band--left  { background-image: linear-gradient(270deg, rgba(255,255,255,0) 50%, #fff 50% 100%), var(--bg); }
.split-text { width: 50%; max-width: 560px; }
.split-band--right .split-text { margin-left: auto; }
.split-band--left  .split-text { margin-right: auto; }
.split-text .eyebrow { margin-bottom: 16px; }
.split-text p { font-size: 16px; line-height: 1.6; margin: 0 0 14px; }
.split-text p:last-child { margin-bottom: 0; }
@media (max-width: 980px) {
  .split-band { min-height: 0; background-image: var(--bg) !important; background-attachment: scroll; }
  .split-band::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.9); }
  .split-band .container { position: relative; z-index: 1; }
  .split-text { width: 100%; max-width: none; }
}
/* bulleted lists used inside split bands (e.g. sector lists) */
.split-text .list-block { margin-bottom: 28px; }
.split-text .list-block:last-child { margin-bottom: 0; }
.split-text .tick-list { list-style: none; margin: 0; padding: 0; }
.split-text .tick-list li {
  position: relative;
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
}
.split-text .tick-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .6em;
  width: 7px; height: 7px;
  background: var(--blue);
}

/* ==========================================================================
   Case studies (blue)
   ========================================================================== */
.case-studies {
  position: relative;
  background: var(--blue) url("../assets/img/bg.jpg") center/cover;
  background-attachment: fixed;   /* parallax */
  color: var(--white);
  padding-block: 72px;
}
/* bg.jpg is already blue-toned, so a lighter overlay keeps the pipework visible
   while preserving contrast for the text and cards */
.case-studies::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(8, 33, 62, .35);   /* navy blue, 35% over the pipework image */
}
.case-studies .container { position: relative; z-index: 1; }
.cs-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}
.cs-intro h3 { font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 18px; }
.cs-intro p { color: var(--white); margin-bottom: 18px; }
.cs-blurb { color: var(--white); font-size: 16px; line-height: 1.5; }
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.cs-card {
  position: relative;
  overflow: hidden;
  background: #095191;   /* solid brand blue, 100% */
  padding: 26px 26px 26px;
  display: flex;
  flex-direction: column;
}
/* 35% white overlay on hover */
.cs-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.cs-card:hover::after { opacity: .35; }
.cs-icon { color: var(--white); display: block; margin-bottom: 16px; line-height: 0; }
.cs-card h4 { color: var(--white); font-size: 23px; margin-bottom: 12px; }
.cs-loc { color: #8fc3e8; font-size: 15px; margin-bottom: 4px; }
.cs-cat { color: var(--white); font-size: 15px; margin-bottom: 22px; }
.cs-card img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-top: auto; }

/* ==========================================================================
   Lighting banner
   ========================================================================== */
.banner {
  min-height: 650px;
  background: url("../assets/img/gym-lighting-banner.jpg") center/cover no-repeat;
  background-attachment: fixed;   /* parallax */
}

/* ==========================================================================
   Support
   ========================================================================== */
.support { padding-block: 72px; background: var(--white); }
.support-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 0;
}
.support-head h3 { font-size: 20px; font-weight: 700; color: var(--blue); margin-bottom: 14px; }
.support-head p { font-size: 16px; }
.support-head .btn { margin-top: 10px; }
.support-sub { color: var(--ink); font-weight: 500; margin: 22px 0 0; }
.support-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.sup-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; margin-bottom: 16px; }
.sup-card h4 { font-size: 18px; color: var(--ink); margin-bottom: 10px; }
.sup-card p { font-size: 15px; line-height: 1.45; }

/* ==========================================================================
   Clients
   ========================================================================== */
.clients { background: var(--light); padding-block: 64px; }
.clients-head { text-align: center; margin-bottom: 40px; }
.clients-head h2 { font-size: 44px; color: var(--blue); margin-bottom: 20px; }
.clients-head p { max-width: 760px; margin: 0 auto 14px; font-size: 16px; line-height: 1.5; }

.logo-scroller {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-block: 14px;
  --fade: 48px;
  -webkit-mask: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
.logo-track {
  display: inline-flex;
  min-width: max-content;
  will-change: transform;
}
.logo-group {
  display: inline-flex;
  gap: 100px;
  padding-right: 100px;
  align-items: center;
}
/* JS duplicates the group, so the track is two identical halves; shifting by
   exactly -50% lands copy 2 where copy 1 was — a seamless, skip-free loop.
   Animation is gated on .is-ready so it only runs once the clone exists. */
.logo-track.is-ready.logo-track-right { animation: scroll-right 20s linear infinite; }
.logo-track.is-ready.logo-track-left  { animation: scroll-left 17s linear infinite; }
@keyframes scroll-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes scroll-left  { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.logo-tile { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.logo-tile img { height: 100px; width: auto; object-fit: contain; }
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--blue);
  color: var(--white);
  padding-block: 56px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col p { font-size: 15px; line-height: 1.5; }
.footer-col .btn { margin-top: 6px; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { font-size: 15px; }
.footer-nav a:hover, .footer-contact a:hover { text-decoration: underline; }
.footer-line { margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.footer-ico { flex: 0 0 auto; color: var(--white); }
.footer-contact > p:first-child { margin-bottom: 18px; }
.footer-nav { gap: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .25);
  font-size: 14px;
}
.footer-bottom p { margin: 0; }
.footer-legal a { margin-left: 22px; }
.footer-legal a:hover { text-decoration: underline; }

/* ==========================================================================
   Scroll-in animation (Divi "fadeTop" equivalent)
   ========================================================================== */
/* Progressive enhancement: only hide when JS has opted in (.js-anim on <html>),
   so content is always visible without JS or if the observer never fires. */
.js-anim .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js-anim .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .cs-head, .support-head { grid-template-columns: 1fr; gap: 24px; }
  .support-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .packaged { background-image: url("../assets/img/rooftop-ventilation-outlet-2.jpg"); background-position: center top; background-attachment: scroll; }
  /* fixed backgrounds are janky on touch devices — use normal scroll */
  .case-studies, .banner { background-attachment: scroll; }
  .packaged::after { content:""; position:absolute; inset:0; background:rgba(255,255,255,.86); }
  .packaged .container { position: relative; z-index: 1; }
  .packaged-text { width: 100%; max-width: none; }
}
@media (max-width: 760px) {
  .hero-content { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-title, .word-rotator .rot { font-size: 52px; }
  .word-rotator { height: 58px; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 81px; left: 0; right: 0;
    background: var(--white);
    display: none;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-top: 1px solid #eee; }
  .main-nav a { display: block; padding: 14px 20px; }
  /* Browse the Case Study archive: 1-row swipe carousel on mobile */
  .cs-grid {
    grid-template-columns: none;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cs-grid::-webkit-scrollbar { display: none; }
  .cs-grid > * { flex: 0 0 100%; scroll-snap-align: center; }   /* one centred card per view */
  .support-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-strip-inner { flex-direction: column; gap: 6px; }
}

/* Carousel nav arrows (injected by JS) — only shown on mobile */
.cs-nav { display: none; }
@media (max-width: 760px) {
  .cs-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 22px;
  }
  .cs-nav-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s;
  }
  .cs-nav-btn:hover, .cs-nav-btn:active { background: #fff; color: var(--blue); }
}
