/* SmartWash Solutions – home page
   Built from Debbie's Figma design (SWS-Web, frame 62:30, 1543px wide).
   Measurements below are taken from that frame. */

:root {
  --navy: #2e3068;
  --blue-dark: #243c7e;
  --text: #2c407d;
  --sky: #34a9df;
  --green: #5eb245;
  --green-dark: #4c9a35;
  --card: #dff0f6;
  --white: #fff;

  --page-max: 1543px;
  --pad: clamp(20px, 8.23vw, 127px);   /* 127px side margin at full design width */
  --font: "Lato", "Helvetica Neue", Arial, sans-serif;

  /* Motion: one curve for the whole page — fast start, soft landing */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 27px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

h1, h2 { font-weight: 900; line-height: 1.2; }
h1 { font-size: 40px; }
h2 { font-size: 32px; }

.inner {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--navy); color: var(--white); padding: 8px 16px; border-radius: 4px;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  height: 40px;
  padding: 0 17px;
  border-radius: 200px;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  line-height: 40px;
  white-space: nowrap;
  transition: background-color .2s ease, transform 160ms var(--ease-out);
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: scale(0.97); }

/* ---------- Three-colour divider bar ---------- */
.color-bar {
  height: 16px;
  background: url("images/color-bar.svg") center / 100% 100% no-repeat;
}

/* ---------- Header + hero ---------- */
.hero {
  position: relative;
  min-height: 679px;
  background: #fff;
  color: var(--blue-dark);
  isolation: isolate;
}
/* The splash sits on its own layer so it can "settle" on page load.
   It scales with the screen width so it keeps the same spacing from the text
   as the design; the top of the image is white, so extra height is seamless. */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: url("images/hero-bg.jpg") right bottom / 100% auto no-repeat;
  transform-origin: right bottom;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.logo { margin-top: 51px; flex: 0 1 455px; }
.logo img { width: 455px; }

.nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 23px;
  margin-right: -2px;
}

.utility-nav, .main-nav ul { display: flex; }
.utility-nav { gap: clamp(28px, 4.3vw, 66px); color: var(--sky); }
.main-nav { margin-top: 26px; }
.main-nav ul { gap: clamp(24px, 5.2vw, 80px); color: var(--navy); }
.utility-nav a, .main-nav a { font-weight: 900; font-size: 18px; line-height: 27px; white-space: nowrap; transition: color 150ms ease; }
.main-nav a { font-weight: 700; }
.utility-nav a { font-weight: 700; }
.utility-nav a:hover, .main-nav a:hover { color: var(--green); }
.lang span { display: inline-block; margin-left: 10px; font-weight: 300; font-size: 20px; transform: translateY(-4px); }

.menu-toggle { display: none; }

.hero__copy {
  max-width: min(804px, 18px + 51vw);   /* 786px text + 18px offset; 786/1543 = 51% */
  padding: 99px 0 165px 18px;
}
.hero__copy p { margin-top: 22px; max-width: 786px; }
.hero__copy .btn { margin-top: 22px; margin-left: -2px; }

/* ---------- Proven Performance ---------- */
.performance { padding: 76px 0 87px; text-align: center; color: var(--blue-dark); }
.performance h2 { line-height: 40px; }
.performance__lead { line-height: 40px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 323px));
  justify-content: center;
  margin-top: 41px;
  color: var(--navy);
}
.stats li { display: flex; flex-direction: column; align-items: center; }
.stats__icon { height: 103px; display: flex; align-items: flex-end; justify-content: center; }
.stats__label {
  display: block;
  max-width: 191px;
  margin-top: 25px;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

/* ---------- Shared feature-section layout ---------- */
.feature {
  position: relative;
  min-height: 468px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.feature__copy h2 { margin-bottom: 22px; }
.feature__copy .btn { margin-top: 36px; }
.feature__copy--center { max-width: calc(836px + 2 * var(--pad)); padding-block: 60px; text-align: center; color: var(--white); }
.feature__copy--center p { max-width: 836px; margin-inline: auto; }

/* Photo sections with a coloured "multiply" wash over the photo */
.feature--photo { background: center / cover no-repeat; }
.feature--photo::before,
.feature--photo::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  mix-blend-mode: multiply;
}

.feature--spinach { background-image: url("images/spinach.jpg"); }
.feature--spinach::before,
.feature--spinach::after { background: rgba(94, 178, 69, .65); }   /* two stacked 65% green layers in Figma */

.feature--glove { min-height: 471px; background-image: url("images/glove.jpg"); background-position: 50% 76%; }
.feature--glove::before { background: rgba(36, 60, 126, .89); }
.feature--glove::after { display: none; }
.feature--glove .feature__copy--center { max-width: calc(807px + 2 * var(--pad)); }

/* Improve Process Control */
.feature--process {
  background: var(--white) url("images/process-bg.svg") center / 100% 100% no-repeat;
}
.feature--process .feature__copy { max-width: 564px; padding-block: 60px; }
.feature--process__art {
  position: absolute;
  top: 0; right: 0;
  width: 61%;               /* 941 / 1543 */
  height: 100%;
  object-fit: contain;
  object-position: left center;
  z-index: -1;
}

/* ---------- Gain a Full-Service Partner ---------- */
.partner {
  display: grid;
  grid-template-columns: 49.64% 1fr;   /* 766 / 1543 */
  min-height: 467px;
  background: url("images/partner-bg.svg") right center / 51.2% 100% no-repeat;
}
.partner__photo img { width: 100%; height: 100%; object-fit: cover; }
.partner__copy {
  align-self: center;
  max-width: calc(564px + 96px + var(--pad));
  padding: 60px var(--pad) 60px 96px;
}
.partner__copy .btn { margin-top: 48px; }

/* ---------- A Revolutionary Food Safety System ---------- */
.system {
  position: relative;
  min-height: 484px;
  padding: 114px 0 60px;
  text-align: center;
  color: var(--white);
  background: url("images/greens.jpg") 50% 73% / cover no-repeat;
  isolation: isolate;
}
.system::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(94, 178, 69, .89);
  mix-blend-mode: multiply;
}
.system__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 344px));
  justify-content: center;
  column-gap: clamp(24px, 6.6vw, 100px);
  margin-top: 52px;
}
.system__cols img { height: 52px; width: auto; margin: 0 auto; }
.system__cols h3 { margin-top: 30px; font-weight: 900; font-size: 20px; line-height: 1.2; }
.system__cols p { line-height: 1.2; }

/* ---------- Food Safety You Can Trust ---------- */
.trust { padding-top: 74px; text-align: center; overflow: hidden; }
.trust .inner { z-index: 1; max-width: calc(873px + 2 * var(--pad)); }
.trust h2 { margin-bottom: 22px; }
.trust .btn { margin-top: 28px; }
.trust__art {
  width: 101.75%;           /* image runs 17px past each edge in Figma */
  margin: -129px 0 0 -1.1%;
  aspect-ratio: 1570 / 450; /* only the top 450px of the strip shows */
  overflow: hidden;
}
.trust__art img { width: 100%; }

/* ---------- Testimonials ---------- */
.testimonials { padding: 47px 0 70px; text-align: center; color: var(--text); }
.testimonials .inner { max-width: calc(1344px + 2 * 20px); padding-inline: 20px; }
.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 70px;
  margin-top: 38px;
  text-align: left;
}
.quote {
  position: relative;
  min-height: 359px;
  padding: 52px 71px 100px 62px;
  background: var(--card);
}
.quote blockquote { max-width: 504px; }
.quote figcaption { position: absolute; right: 42px; bottom: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 359px;
  padding: 59px 0 43px;
  background: var(--sky);
  color: var(--white);
}
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute; top: 0; z-index: -1;
  background: url("images/molecule.webp") center / cover no-repeat;
  mix-blend-mode: multiply;
}
.site-footer::after { left: 55.8%; width: 45.6%; height: 358px; }
.site-footer::before { left: -3.8%; width: 56.3%; height: 442px; transform: rotate(180deg); }

.site-footer .inner {
  display: grid;
  grid-template-columns: 365px 244px 303px 1fr;
  grid-template-rows: 1fr auto;
  min-height: 257px;
}
.site-footer__logo { grid-column: 1; grid-row: 1 / 3; margin: 13px 0 0 21px; }
.site-footer__links { grid-row: 1; }
.site-footer__links:nth-of-type(1) { grid-column: 2; }
.site-footer__links:nth-of-type(2) { grid-column: 3; }
.site-footer__logo img { width: 227px; }
.site-footer__links a,
.site-footer__contact > a:not(.site-footer__social),
.newsletter label { font-weight: 900; line-height: 35px; }
.site-footer__links a { font-weight: 700; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__contact { grid-column: 4; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: flex-start; }
.site-footer__contact > a:not(.site-footer__social) { font-weight: 700; }
.site-footer__copy { grid-column: 2 / 4; align-self: end; }

.newsletter { margin-top: 11px; }
.newsletter label { display: block; font-weight: 700; }
.newsletter__field {
  display: flex;
  width: 301px;
  max-width: 100%;
  height: 38px;
  margin-top: 10px;
  border-radius: 19px;
  background: var(--white);
}
.newsletter input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 18px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  border-radius: 19px 0 0 19px;
}
.newsletter input:focus { outline: none; }
.newsletter__field:focus-within { outline: 3px solid var(--navy); outline-offset: 2px; }
.newsletter button {
  width: 63px;
  border: 0;
  border-radius: 19px;
  background: var(--green);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.newsletter button { transition: background-color .2s ease, transform 160ms var(--ease-out); }
.newsletter button:hover { background: var(--green-dark); }
.newsletter button:active { transform: scale(0.97); }
.site-footer__social { margin-top: 25px; }
.site-footer__social img { width: 24px; }

/* =========================================================
   Smaller screens
   ========================================================= */
@media (max-width: 1280px) {
  .logo img { width: 340px; }
  .utility-nav a, .main-nav a { font-size: 16px; }
  .site-footer .inner { grid-template-columns: 1.2fr 1fr 1fr 1.4fr; column-gap: 24px; }
  .site-footer__logo { margin-left: 0; }
}

/* Tablet / phone: collapse the menu */
@media (max-width: 1060px) {
  .masthead { align-items: center; padding-top: 20px; }
  .logo { margin-top: 0; flex: 0 1 300px; }
  .logo img { width: 100%; }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border: 0; background: transparent; cursor: pointer;
  }
  .menu-toggle__bars,
  .menu-toggle__bars::before,
  .menu-toggle__bars::after {
    display: block; width: 26px; height: 3px; border-radius: 2px;
    background: var(--navy); position: relative; transition: transform .2s ease;
  }
  .menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle__bars::before { top: -8px; }
  .menu-toggle__bars::after { top: 8px; }
  .nav-open .menu-toggle__bars { background: transparent; }
  .nav-open .menu-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
  .nav-open .menu-toggle__bars::after { transform: translateY(-8px) rotate(-45deg); }

  /* Menu drops 8px and fades in; closes a little faster than it opens.
     visibility keeps the closed menu out of the tab order and away from clicks. */
  .nav-wrap {
    display: flex;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
    position: absolute;
    top: 84px; left: 0; right: 0; z-index: 20;
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 8px var(--pad) 20px;
    margin: 0;
    background: var(--white);
    box-shadow: 0 12px 24px rgba(46, 48, 104, .15);
  }
  .nav-open .nav-wrap {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
  }
  .main-nav { margin-top: 0; }
  .main-nav ul, .utility-nav { flex-direction: column; gap: 0; }
  .main-nav a, .utility-nav a { display: block; padding: 10px 0; font-size: 18px; }
  .utility-nav { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--card); }

  .hero__copy { padding: 60px 0 200px; max-width: 640px; }

  .partner__copy { padding-left: 48px; }

  /* Footer: logo on its own row, then three columns, copyright last */
  .site-footer .inner { grid-template-columns: 1fr 1fr 1.4fr; grid-template-rows: auto; row-gap: 28px; }
  .site-footer__logo { grid-row: 1; grid-column: 1 / -1; margin: 0; }
  .site-footer__links { grid-row: 2; }
  .site-footer__links:nth-of-type(1) { grid-column: 1; }
  .site-footer__links:nth-of-type(2) { grid-column: 2; }
  .site-footer__contact { grid-row: 2; grid-column: 3; }
  .site-footer__copy { grid-row: 3; grid-column: 1 / -1; }
}

/* Improve Process Control, 1024–1200px: keep two columns, but give the text a
   narrower column and let the art fill the right side, trimming it at the page
   edge (not next to the text) so the splash never runs under the copy. */
@media (min-width: 1024px) and (max-width: 1200px) {
  .feature--process .feature__copy { max-width: 44vw; }
  .feature--process__art {
    width: 52%;
    object-fit: cover;
    object-position: 35% center;
  }
}

/* Below 1024px there isn't room side by side: stack the text above the art. */
@media (max-width: 1023.98px) {
  .feature--process { flex-direction: column; align-items: stretch; min-height: 0; }
  .feature--process .feature__copy { max-width: 640px; padding-block: 56px 0; }
  .feature--process__art {
    position: static; z-index: auto;
    width: 100%; max-width: 720px; height: auto;
    margin: 8px auto 0;
  }
}

/* Testimonials: one card per row once two would get too narrow */
@media (max-width: 900px) {
  .testimonials__grid { grid-template-columns: 1fr; gap: 32px; max-width: 637px; margin-inline: auto; }
  .quote { min-height: 0; }
}

@media (max-width: 760px) {
  body { font-size: 17px; line-height: 26px; }
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }

  .hero { min-height: 0; }
  .hero::before { background-position: 62% bottom; background-size: auto 420px; }
  .hero__copy { padding: 36px 0 190px; }
  .hero__copy p { margin-top: 16px; max-width: none; }

  .performance { padding: 48px 0 56px; }
  .performance h2, .performance__lead { line-height: 1.35; }
  .performance__lead { margin-top: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 36px; margin-top: 32px; }
  .stats__icon { height: 90px; }
  .stats__icon img { max-height: 90px; width: auto; }
  .stats__label { font-size: 19px; margin-top: 16px; }

  .feature { min-height: 0; }
  .feature__copy--center { padding-block: 56px; }
  .feature__copy .btn { margin-top: 28px; }

  .feature--process .feature__copy { padding-block: 48px 0; }

  .partner { grid-template-columns: 1fr; background-size: 100% 100%; }
  .partner__photo img { aspect-ratio: 16 / 10; }
  .partner__copy { padding: 48px var(--pad) 56px; max-width: none; }
  .partner__copy .btn { margin-top: 28px; }

  .system { padding: 56px 0; }
  .system__cols { grid-template-columns: 1fr; row-gap: 36px; margin-top: 36px; }
  .system__cols h3 { margin-top: 16px; }

  .trust { padding-top: 48px; }
  .trust .btn { margin-top: 24px; }
  .trust__art { margin-top: -10px; }

  .testimonials { padding: 40px 0 48px; }
  .testimonials__grid { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; }
  .quote { min-height: 0; padding: 32px 24px 104px; }

  .site-footer { padding: 44px 0 32px; }
  .site-footer::before { width: 100%; left: 0; }
  .site-footer::after { display: none; }
  .site-footer .inner { grid-template-columns: 1fr 1fr; grid-template-rows: auto; row-gap: 28px; }
  .site-footer__logo { grid-row: auto; grid-column: 1 / -1; margin: 0; }
  .site-footer__links { grid-row: auto; }
  .site-footer__links:nth-of-type(1) { grid-column: 1; }
  .site-footer__links:nth-of-type(2) { grid-column: 2; }
  .site-footer__copy { grid-row: auto; }
  .site-footer__logo img { width: 180px; }
  .site-footer__contact { grid-row: auto; grid-column: 1 / -1; }
  .site-footer__copy { grid-column: 1 / -1; font-size: 15px; }
}

/* =========================================================
   Motion
   ========================================================= */

/* 1. Hero: the splash settles from 104% and the copy rises in, one line at a time.
      "backwards" fill only holds the start frame during the delay, so after the
      animation the button's own press/hover transforms work normally. */
@keyframes hero-settle { from { transform: scale(1.04); } }
@keyframes rise-in     { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade-in     { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: hero-settle 1.6s var(--ease-out) backwards; }
  .hero__copy > * { animation: rise-in 600ms var(--ease-out) 100ms backwards; }
  .hero__copy > :nth-child(2) { animation-delay: 180ms; }
  .hero__copy > :nth-child(3) { animation-delay: 260ms; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__copy > * { animation: fade-in 400ms ease backwards; }
}

/* 2 & 3. Scroll reveal. Only hidden when the script is running (html.js), so the
   content is always visible if JavaScript fails. The script removes data-reveal
   once an element has arrived, handing it back to its normal styles.
   --i staggers items in a group by 80ms each. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
html.js [data-reveal="art"]  { transform: scale(0.96); transition-duration: 800ms; }   /* ASAP unit + splash */
html.js [data-reveal="rise"] { transform: translateY(24px); transition-duration: 800ms; } /* vegetable strip */
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Reduced motion: gentle fades only, no movement */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal],
  html.js [data-reveal="art"],
  html.js [data-reveal="rise"] {
    transform: none;
    transition: opacity 400ms ease;
  }
}

/* 6. Hero water shimmer (ripple.js). The canvas is an exact copy of the still
      splash that gently ripples; it fades in over the CSS image after the
      settle animation. Hidden on phones, where ripple.js doesn't run. */
.hero__ripple {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
}
.hero__ripple.is-live { opacity: 1; }
@media (max-width: 760px) { .hero__ripple { display: none; } }
