/* ==========================================================================
   NERITH — global water solutions
   Brand palette sampled from Nerith brochure_v7.pdf
   ========================================================================== */

:root {
  --navy-900: #0a2c47;
  --navy-800: #0d3757;
  --navy-700: #10456e;
  --navy-600: #17568a;
  --cyan-500: #2da7da;
  --cyan-400: #4bb8e5;
  --cyan-100: #d9eefa;
  --blue-050: #f1f6fc;
  --white: #ffffff;

  --ink: #0a2c47;
  --ink-muted: #5b7186;
  --ink-light: #8299ad;
  --rule: #dbe6f0;

  --ok: #1a8a5a;
  --warn: #c0392b;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --gutter: 24px;
  --radius: 14px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 3px rgba(10, 44, 71, .08);
  --shadow: 0 6px 24px rgba(10, 44, 71, .10);
  --shadow-lg: 0 18px 48px rgba(10, 44, 71, .16);

  --header-h: 78px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan-500); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; color: var(--navy-900); font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p  { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tint { background: var(--blue-050); }
.section--navy { background: var(--navy-900); color: #cfe2f0; }
.section--navy h2, .section--navy h3 { color: #fff; }

.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); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ---------- eyebrow (brochure's rule + caps label) ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan-500);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 3px; background: var(--cyan-500); border-radius: 2px; flex: none; }
.eyebrow--plain::before { display: none; }
.section--navy .eyebrow { color: var(--cyan-400); }

.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-muted); max-width: 62ch; }
.section--navy .lede { color: #b9d2e5; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.7em; border-radius: 100px;
  font-weight: 700; font-size: .95rem; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--cyan-500); color: #fff; box-shadow: 0 6px 18px rgba(45, 167, 218, .35); }
.btn--primary:hover { background: var(--cyan-400); }
.btn--ghost { border-color: var(--rule); color: var(--navy-900); background: #fff; }
.btn--ghost:hover { border-color: var(--cyan-500); color: var(--cyan-500); }
.btn--on-navy { border-color: rgba(255,255,255,.35); color: #fff; background: transparent; }
.btn--on-navy:hover { background: #fff; color: var(--navy-900); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header__inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo img { height: 70px; width: auto; }

.nav { display: flex; align-items: center; gap: 4px; }
/* :not(.btn) throughout — the CTA in the nav is a button and must keep its own
   colours, not inherit the nav link's navy/cyan. */
.nav a:not(.btn) {
  padding: .55em .9em; border-radius: var(--radius-sm);
  color: var(--navy-900); font-weight: 600; font-size: .93rem; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav a:not(.btn):hover { background: var(--blue-050); color: var(--cyan-500); text-decoration: none; }
.nav a:not(.btn).is-active { color: var(--cyan-500); }

/* dropdown */
.nav__item { position: relative; }
.nav__panel {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  width: max-content; min-width: 440px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
/* transparent bridge across the 10px gap so moving the mouse from the
   "Products" link down to the panel never drops the hover */
.nav__panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.nav__item:hover .nav__panel,
.nav__item:focus-within .nav__panel,
.nav__item.is-open .nav__panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.nav__panel a { font-weight: 500; font-size: .9rem; white-space: nowrap; }
/* "All Products" sits first and spans both columns */
.nav__panel-all {
  grid-column: 1 / -1; font-weight: 700 !important; color: var(--cyan-500);
  border-bottom: 1px solid var(--rule); margin-bottom: 4px; padding-bottom: 8px;
}
.nav__panel-all::after { content: " →"; }

.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 10px;
  color: var(--navy-900);
}
.nav__toggle svg { display: block; }

@media (max-width: 980px) {
  .nav__toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 22px;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: .8em .6em; border-bottom: 1px solid var(--blue-050); border-radius: 0; }
  .nav .btn { margin-top: 14px; justify-content: center; }
  .nav__panel {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    box-shadow: none; border: 0; border-radius: 0; padding: 0 0 0 16px;
    min-width: 0; width: auto; grid-template-columns: 1fr;
    display: none;
  }
  /* transform:none is essential — the open-state rule above sets translateX(-50%),
     which on mobile would shove the static panel off the left edge of the screen */
  .nav__item.is-open .nav__panel { display: grid; transform: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #f7fbfe 0%, var(--cyan-100) 100%);
  padding: clamp(56px, 8vw, 96px) 0;
}
.hero::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(180deg, var(--cyan-500), var(--navy-700));
}
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__media img { margin-inline: auto; max-height: 520px; width: auto; filter: drop-shadow(0 24px 48px rgba(10,44,71,.22)); }
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero__media img { max-height: 320px; }
}

/* ---------- page head (interior pages) ---------- */
.pagehead {
  background: var(--navy-900); color: #cfe2f0;
  padding: clamp(48px, 7vw, 88px) 0;
  position: relative; overflow: hidden;
}
.pagehead::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(180deg, var(--cyan-500), var(--cyan-400));
}
.pagehead h1 { color: #fff; }
.pagehead .lede { color: #b9d2e5; }
.pagehead__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.pagehead__media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-inline: auto; }
@media (max-width: 900px) { .pagehead__inner { grid-template-columns: 1fr; } }

/* ---------- breadcrumb ---------- */
.crumb { font-size: .85rem; color: var(--ink-light); padding: 14px 0; border-bottom: 1px solid var(--rule); }
.crumb a { color: var(--ink-muted); }
.crumb span { margin: 0 .5em; color: var(--rule); }

/* ---------- stat cards (brochure cover) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--cyan-500);
  border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.stat__num { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; color: var(--navy-900); line-height: 1.1; letter-spacing: -.03em; }
.stat__num small { font-size: .5em; font-weight: 700; color: var(--ink-muted); margin-left: .15em; }
.stat__label { font-size: .88rem; color: var(--ink-muted); margin-top: 4px; }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--cyan-400); }
.card__media { aspect-ratio: 4 / 3; background: var(--blue-050); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.card__media--contain img { object-fit: contain; padding: 14px; }
.card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: .35em; }
.card__body p { color: var(--ink-muted); font-size: .93rem; flex: 1; }
.card__link { font-weight: 700; font-size: .9rem; color: var(--cyan-500); margin-top: 8px; }
.card__link::after { content: " →"; }

.badge {
  display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: .35em .7em; border-radius: 100px; margin-bottom: 10px;
}
.badge--live { background: var(--cyan-100); color: var(--navy-700); }
.badge--soon { background: #f0f2f5; color: var(--ink-light); }

/* ---------- feature list (brochure "why it matters") ---------- */
.feature { display: flex; gap: 14px; }
.feature__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan-500); margin-top: .55em; flex: none; }
.feature h3 { font-size: 1.08rem; margin-bottom: .2em; }
.feature p { color: var(--ink-muted); font-size: .93rem; margin: 0; }
.section--navy .feature p { color: #a8c4da; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .93rem; }
thead th {
  background: var(--navy-900); color: #fff; text-align: left;
  padding: 15px 18px; font-weight: 700; font-size: .9rem; white-space: nowrap;
}
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--rule); }
tbody tr:nth-child(odd) td { background: #f7fafd; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { font-weight: 600; color: var(--navy-900); }
thead th:first-child { color: #fff; }

.table--compare thead th:nth-child(2) { background: var(--cyan-500); }
.table--compare td:nth-child(2) { background: var(--cyan-100) !important; font-weight: 700; color: var(--navy-900); text-align: center; }
.table--compare td:nth-child(3) { color: var(--ink-muted); text-align: center; }
.table--compare th:nth-child(2), .table--compare th:nth-child(3) { text-align: center; }
.val-good { color: var(--ok); font-weight: 700; }
.val-bad  { color: var(--warn); }

/* ---------- spec rows (EDI limits) ---------- */
.specrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--rule);
}
.specrow__k { color: var(--ink-muted); font-size: .93rem; }
.specrow__v { font-weight: 800; color: var(--navy-900); white-space: nowrap; }
.specrow__v small { font-weight: 600; color: var(--ink-light); margin-left: .35em; font-size: .78em; }

/* ---------- quote / commitment band ---------- */
.commit {
  background: var(--navy-900); color: #fff; border-radius: var(--radius);
  padding: clamp(28px, 4vw, 44px); border-left: 6px solid var(--cyan-500);
}
.commit p { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 700; line-height: 1.4; margin: 0; }

/* ---------- gallery ----------
   Site photography is portrait (phone shots), so the tiles are portrait too. */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }
.gallery img { border-radius: var(--radius); box-shadow: var(--shadow-sm); aspect-ratio: 3/4; object-fit: cover; width: 100%; }

/* Portrait photo sitting beside a column of text — cap the height so it doesn't
   tower over the copy, and centre it in its column. */
.img-portrait {
  max-height: 480px; width: auto; margin-inline: auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* ---------- team ---------- */
.person { text-align: center; }
.person__avatar {
  width: 108px; height: 108px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(150deg, var(--cyan-100), var(--cyan-400));
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800; color: var(--navy-900);
  border: 3px solid #fff; box-shadow: var(--shadow);
}
.person h3 { font-size: 1.05rem; margin-bottom: .1em; }
.person p { color: var(--ink-muted); font-size: .88rem; margin: 0; }

/* ---------- contact ---------- */
.contactline { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; }
.contactline__icon {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--cyan-100); color: var(--navy-700);
  display: grid; place-items: center;
}
.section--navy .contactline__icon { background: rgba(255,255,255,.12); color: var(--cyan-400); }
.contactline__k { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-light); font-weight: 700; }
.contactline__v { font-weight: 600; color: var(--navy-900); }
.section--navy .contactline__v { color: #fff; }
.section--navy .contactline__v a { color: #fff; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 700; color: var(--navy-900); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: .8em 1em; font: inherit; font-size: .95rem;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan-500); box-shadow: 0 0 0 3px rgba(45,167,218,.18);
}
.field textarea { resize: vertical; min-height: 130px; }
.formnote { font-size: .82rem; color: var(--ink-light); }

/* ---------- placeholder notice (products awaiting content) ---------- */
.notice {
  background: #fffaf0; border: 1px dashed #e6c992; border-radius: var(--radius);
  padding: 20px 22px; color: #7a5c22; font-size: .92rem;
}
.notice strong { color: #5c4416; }

/* ---------- footer ---------- */
.footer { background: var(--navy-900); color: #93b2c9; padding: 64px 0 0; font-size: .9rem; }
.footer a { color: #93b2c9; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 1.1em; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__logo {
  background: #fff; border-radius: var(--radius-sm); padding: 12px 14px;
  display: inline-block; margin-bottom: 18px;
}
.footer__logo img { height: 38px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .6em; }
.footer__tagline { color: #fff; font-weight: 800; letter-spacing: .04em; }
.footer__bar {
  border-top: 1px solid rgba(255,255,255,.12); padding: 22px 0;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .82rem; color: #6d8ea8;
}

/* ---------- utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .lede { margin-inline: auto; }
.stack > * + * { margin-top: 22px; }
.muted { color: var(--ink-muted); }
.small { font-size: .82rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- reveal on scroll ----------
   Content is visible by default. The hidden start state only applies once JS has
   confirmed it can run AND that IntersectionObserver is available, so a script
   failure can never leave the page blank. */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}
