/* Hydromenta Systems — unequal mosaic tiles + contact slab */
:root {
  --blue:      #004878;
  --blue-mid:  #11587F;
  --blue-deep: #002F4E;
  --foam:      #B8E0F0;
  --mist:      #E4F1F6;
  --paper:     #F3F8FA;
  --sheet:     #FFFFFF;
  --ink:       #0D1E2A;
  --muted:     #4A6474;
  --border:    #C5D8E2;
  --grout:     #D7E7EE;
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --maxw:      1180px;
  --serif:     "Ibarra Real Nova", "Times New Roman", serif;
  --sans:      "Commissioner", system-ui, -apple-system, sans-serif;
  --gap:       14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--grout);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .brand-text strong, .tile-num, .slab-mail, blockquote p {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}

h1 { font-size: clamp(2.15rem, 4.6vw, 3.7rem); font-weight: 600; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
  min-width: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--blue); color: #F4F8FA; padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  letter-spacing: .04em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
    background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-primary { background: var(--blue); color: #F4F8FA; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-light { background: #F4F8FA; color: var(--blue-deep); }
.btn-outline { background: transparent; color: #F4F8FA; border-color: rgba(244, 248, 250, .4); }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(243, 248, 250, .92);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 28px -22px rgba(13, 30, 42, .45);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img { border-radius: 6px; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 17px; letter-spacing: .01em; }
.brand-text em {
  font-style: normal; font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); font-family: var(--sans); font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; transition: color .2s var(--ease);
}
.nav .nav-cta {
  color: #F4F8FA; background: var(--blue); padding: 9px 16px; border-radius: 999px;
  letter-spacing: .08em;
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 1px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mosaic stage */
.stage { padding: 28px 0 8px; }
.stage:first-of-type { padding-top: 96px; }

.mosaic-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 18px 0 14px;
}
.mosaic-head span {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.mosaic-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }

.mosaic {
  display: grid;
  gap: var(--gap);
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.tile {
  background: var(--sheet);
  border: 1px solid rgba(0, 72, 120, .08);
  border-radius: 18px;
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.tile h3 { margin: 8px 0 10px; }
.tile p { color: var(--muted); }
.tile-kicker {
  display: block;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--blue-mid); font-weight: 700;
}
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--mist); color: var(--blue);
  font-family: var(--serif); font-weight: 600; font-size: 15px;
}

/* Hero mosaic: large copy + two small + wave */
.mosaic-hero {
  grid-template-columns: 1.55fr .72fr .72fr;
  grid-template-areas:
    "hero year place"
    "hero wave wave";
}
.tile-hero {
  grid-area: hero;
  padding: 36px 34px 28px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tile-hero > * { min-width: 0; max-width: 100%; }
.tile-year { grid-area: year; }
.tile-place { grid-area: place; }
.tile-wave { grid-area: wave; min-height: 168px; }

.eyebrow {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue-mid); font-weight: 700; margin-bottom: 14px;
}
.lede { margin: 16px 0 22px; color: var(--muted); max-width: 38ch; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.flow-mark {
  margin-top: auto;
  width: min(280px, 100%);
  height: auto;
  opacity: .92;
}
.flow-stroke path {
  stroke-dasharray: 28 18;
  animation: flow-run 2.8s linear infinite;
}
.flow-b { animation-delay: -.9s; }
.flow-c { animation-delay: -1.6s; }
.drop { animation: drop-run 3.6s ease-in-out infinite; }
.d2 { animation-delay: -1.2s; }
.d3 { animation-delay: -2.1s; }

@keyframes flow-run {
  to { stroke-dashoffset: -92; }
}
@keyframes drop-run {
  0%, 100% { transform: translateY(0); opacity: .85; }
  50% { transform: translateY(18px); opacity: 1; }
}
.d1 { transform-box: fill-box; transform-origin: center; }
.d2 { transform-box: fill-box; transform-origin: center; }
.d3 { transform-box: fill-box; transform-origin: center; }

.tile-deep {
  background: var(--blue-deep);
  color: #F4F8FA;
  border-color: transparent;
}
.tile-deep .tile-kicker { color: var(--foam); }
.tile-deep .mark { color: var(--foam); background: rgba(184, 224, 240, .12); }
.tile-deep p,
.tile-deep .tile-note { color: #D7EAF2; }
.tile-num {
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  color: #F4F8FA;
  margin: 10px 0 8px;
  letter-spacing: -0.04em;
}

.tile-foam {
  background: var(--mist);
  border-color: transparent;
}
.tile-foam h2 { font-size: 1.45rem; margin: 8px 0 10px; }

.tile-belief {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-style: italic;
  color: var(--ink);
  line-height: 1.35;
  max-width: 36ch;
  margin-top: 8px;
}
.wave {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 64px; display: block;
}
.wave-a { fill: var(--foam); opacity: .55; animation: wave-shift 7s ease-in-out infinite; }
.wave-b { fill: var(--blue); opacity: .22; animation: wave-shift 9s ease-in-out infinite reverse; }
@keyframes wave-shift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-36px); }
}
.wave-a, .wave-b { transform-box: fill-box; }

/* Practice mosaic: tall + mid + wide */
.mosaic-practice {
  grid-template-columns: 1.15fr 1fr 1fr;
  grid-template-areas:
    "pipe pressure treat"
    "pipe sim treat"
    "muni plant env";
}
.tile-pipe { grid-area: pipe; min-height: 280px; }
.tile-pressure { grid-area: pressure; }
.tile-sim { grid-area: sim; }
.tile-treat { grid-area: treat; }
.tile-muni { grid-area: muni; }
.tile-plant { grid-area: plant; }
.tile-env { grid-area: env; }

.tile-partner { background: var(--paper); }
.tile-partner h3 { font-size: 1.2rem; }

/* Method mosaic */
.mosaic-method {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "a b c"
    "quote quote quote";
}
.mosaic-method .tile:nth-child(1) { grid-area: a; }
.mosaic-method .tile:nth-child(2) { grid-area: b; }
.mosaic-method .tile:nth-child(3) { grid-area: c; }
.tile-quote {
  grid-area: quote;
  background: var(--blue);
  color: #F4F8FA;
  border-color: transparent;
  padding: 40px 36px;
}
.tile-quote p {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  color: #F4F8FA;
  font-style: italic;
  font-weight: 500;
  max-width: 28ch;
}
.tile-quote cite {
  display: block;
  margin-top: 16px;
  font-style: normal;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--foam);
  font-weight: 700;
  font-family: var(--sans);
}

/* FAQ mosaic */
.mosaic-faq {
  grid-template-columns: .85fr 1.15fr;
}
.tile-faq-lead { background: var(--mist); border-color: transparent; }
.tile-faq-lead p { margin-top: 12px; }
.tile-faq { padding: 12px 22px 8px; }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  width: 100%; background: none; border: 0; padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: left; cursor: pointer; color: var(--ink);
  font: 600 1.02rem/1.3 var(--serif);
}
.faq-ico { position: relative; flex: 0 0 16px; width: 16px; height: 16px; }
.faq-ico::before, .faq-ico::after {
  content: ""; position: absolute; background: var(--blue); border-radius: 1px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.faq-ico::before { top: 7px; left: 0; width: 16px; height: 2px; }
.faq-ico::after { top: 0; left: 7px; width: 2px; height: 16px; }
.faq-item.open .faq-ico::after { transform: scaleY(0); opacity: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-item.open .faq-a { max-height: 280px; }
.faq-a p { color: var(--muted); margin: 0 0 18px; padding-right: 20px; }

/* Contact slab */
.contact-slab {
  margin-top: 36px;
  background: var(--blue-deep);
  color: #F4F8FA;
  padding: 72px 0;
}
.slab-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 36px 48px;
  align-items: center;
}
.slab-kicker {
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--foam); font-weight: 700; margin-bottom: 12px;
}
.contact-slab h2 { color: #F4F8FA; }
.slab-copy p:last-child { color: #D7EAF2; margin-top: 14px; max-width: 42ch; }
.slab-card {
  background: rgba(244, 248, 250, .06);
  border: 1px solid rgba(244, 248, 250, .16);
  border-radius: 18px;
  padding: 28px 26px;
}
.slab-mail {
  display: inline-block;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  color: #F4F8FA;
  border-bottom: 1px solid rgba(184, 224, 240, .45);
  padding-bottom: 6px;
  word-break: break-word;
}
.slab-addr {
  color: #D7EAF2;
  margin: 16px 0 22px;
  line-height: 1.5;
}
.slab-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Footer */
.site-footer {
  background: #001F35;
  color: #F4F8FA;
  padding: 48px 0 28px;
}
.site-footer .brand-text strong { color: #F4F8FA; }
.site-footer .brand-text em { color: #B8D4E2; }
.footer-inner { display: flex; flex-direction: column; gap: 20px; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-tag {
  font-family: var(--serif); font-style: italic; font-size: 1.05rem;
  color: #D7EAF2; margin: 0;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.footer-nav a {
  color: #D7EAF2; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  transition: color .2s;
}
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 20px; border-top: 1px solid rgba(244, 248, 250, .14);
  color: #C5DCE6; font-size: 14px;
}

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .flow-stroke path, .drop, .wave-a, .wave-b { animation: none; }
}

/* Hover AFTER .reveal.in so lift is not overwritten */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
  .nav .nav-cta:hover { background: var(--blue-mid); color: #fff; transform: translateY(-2px); }
  .btn-primary:hover {
    transform: translateY(-2px);
    background: var(--blue-mid);
    box-shadow: 0 14px 28px -12px rgba(0, 72, 120, .55);
  }
  .btn-ghost:hover { transform: translateY(-2px); background: var(--ink); color: #F4F8FA; border-color: var(--ink); }
  .btn-light:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .45);
  }
  .btn-outline:hover { transform: translateY(-2px); background: rgba(244, 248, 250, .1); }
  .tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px -24px rgba(13, 30, 42, .4);
    border-color: rgba(0, 72, 120, .22);
  }
  .tile-deep:hover, .tile-quote:hover {
    border-color: transparent;
    box-shadow: 0 20px 44px -22px rgba(0, 20, 36, .7);
  }
  .faq-q:hover { color: var(--blue); }
  .slab-mail:hover { border-bottom-color: var(--foam); color: var(--foam); }
  .footer-nav a:hover { color: #fff; }
  .slab-card:hover { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .5); }
}

/* Tablet: mosaic compresses, still uneven */
@media (max-width: 980px) {
  .mosaic-hero {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hero hero"
      "year place"
      "wave wave";
  }
  .tile-hero { min-height: 0; }
  .mosaic-practice {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "pipe pressure"
      "pipe sim"
      "treat treat"
      "muni plant"
      "env env";
  }
  .mosaic-method {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "a b"
      "c c"
      "quote quote";
  }
  .mosaic-faq, .slab-inner { grid-template-columns: 1fr; }
  .mosaic-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Mobile: even stack, even spacing */
@media (max-width: 720px) {
  :root { --gap: 12px; }
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; align-items: stretch;
    background: rgba(243, 248, 250, .98); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 22px 22px;
    transform: translateY(-120%);
    transition: transform .35s var(--ease);
    z-index: 90;
  }
  .nav.open { transform: translateY(0); }
  .nav a {
    padding: 14px 4px; font-size: 15px; border-bottom: 1px solid var(--border); color: var(--ink);
  }
  .nav .nav-cta { text-align: center; margin-top: 12px; border: 0; }

  .wrap { padding: 0 16px; }
  .stage { padding: 16px 0 4px; }
  .stage:first-of-type { padding-top: 88px; }
  .contact-slab { margin-top: 24px; padding: 56px 0; }

  .mosaic-hero,
  .mosaic-practice,
  .mosaic-method,
  .mosaic-faq {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
  }
  .mosaic-hero > *,
  .mosaic-practice > *,
  .mosaic-method > *,
  .mosaic-faq > * {
    grid-area: unset;
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    max-width: 100%;
  }
  .tile-quote p { max-width: none; }

  .tile { padding: 22px 20px; border-radius: 16px; }
  .tile-hero { padding: 26px 20px 20px; }
  .tile-quote { padding: 28px 22px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn,
  .slab-actions .btn { width: 100%; flex: 1 1 auto; }
  .flow-mark { width: 200px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 420px) {
  :root { --gap: 12px; }
  .header-inner { height: 66px; }
  .nav { inset: 66px 0 auto 0; }
  .stage:first-of-type { padding-top: 82px; }
  .tile-num { font-size: 2.4rem; }
  h1 { font-size: 1.85rem; line-height: 1.18; }
  .lede { font-size: 1rem; max-width: none; }
  .tile-belief { font-size: 1.15rem; }
  .slab-card { padding: 22px 18px; }
  .mosaic-head { margin: 12px 0 12px; }
}
