/* ==========================================================================
   Flowterra — Every Stage. One Solution.
   Water & wastewater consultancy, Ireland.

   Type   : Roboto throughout, regular and medium only
            (labels in the same face, letterspaced)
   Colour : a teal-to-green ramp read as the stages of a treatment train
   ========================================================================== */

:root {
  /* Stage ramp — inlet (deep) through to discharge (green) */
  --deep:      #06262e;
  --deep-2:    #0b3a44;
  --teal:      #0e5b69;
  --flow:      #1b93a3;
  --green:     #3e9b6d;

  /* Surfaces */
  --paper:     #f4f6f4;
  --paper-2:   #e9edeb;
  --white:     #ffffff;
  --line:      #d2ddda;
  --line-soft: #e3eae8;

  /* Text */
  --ink:       #0e1f22;
  --ink-soft:  #47605f;
  --ink-invert:#eef4f2;

  --mint:      #b7ebe4;          /* the eyebrow colour used on flowterra.ie */
  --bar:       rgba(10, 26, 29, 0.82);

  --radius: 0;

  /* Type scale */
  --step--1: 0.8125rem;
  --step-0:  1.0625rem;
  --step-1:  1.1875rem;
  --step-2:  clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  --step-3:  clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --step-4:  clamp(2.75rem, 1.5rem + 5.4vw, 5.25rem);

  /* Rhythm */
  --gap:     clamp(1.5rem, 3vw, 3rem);
  --section: clamp(4rem, 8vw, 7.5rem);
}

/* --------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-0);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--flow); }

:focus-visible {
  outline: 2px solid var(--flow);
  outline-offset: 3px;
  border-radius: 1px;
}

h1, h2, h3, h4 {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -0.021em;
  line-height: 1.08;
  color: var(--deep);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------- primitives -- */

.wrap {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
}
.wrap--tight { width: min(100% - 2.5rem, 900px); }

.prose { max-width: 63ch; }
.prose p + h3 { margin-top: 2.2em; }
.prose h3 + p { margin-top: 0.7em; }

.label {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--flow);
  margin: 0 0 1.4rem;
}
.label--quiet { color: var(--ink-soft); }
.label--invert { color: rgba(255, 255, 255, 0.72); }

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
}

.section { padding-block: var(--section); }
.section--paper2 { background: var(--paper-2); }
.section--tight { padding-block: clamp(3rem, 5vw, 4.5rem); }

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  line-height: 1;
  padding: 1.05rem 1.5rem;
  border: 1px solid var(--deep);
  border-radius: var(--radius);
  background: var(--deep);
  color: var(--white);
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:hover { background: var(--teal); border-color: var(--teal); color: var(--white); }

.btn--ghost { background: transparent; color: var(--deep); }
.btn--ghost:hover { background: var(--deep); color: var(--white); }

.btn--ondark { background: var(--white); border-color: var(--white); color: var(--deep); }
.btn--ondark { color: #08343d; }
.btn--ondark:hover { background: var(--mint); border-color: var(--mint); color: #08343d; }

.btn--ghost-ondark { background: transparent; border-color: rgba(255,255,255,0.5); color: var(--white); }
.btn--ghost-ondark:hover { background: var(--white); border-color: var(--white); color: var(--deep); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.arrow-link {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--teal);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.arrow-link::after { content: " \2192"; }
.arrow-link:hover { color: var(--deep); }

/* Media boxes -----------------------------------------------------------
   The stage-colour fill sits behind the photograph, so a lazy image that has
   not arrived yet shows colour rather than a hole.                        */

.media {
  position: relative;
  background-color: var(--deep-2);
  background-image: var(--img, none),
    linear-gradient(155deg,
      color-mix(in oklab, var(--accent, var(--teal)) 92%, #000 8%),
      color-mix(in oklab, var(--accent, var(--teal)) 45%, var(--deep) 55%));
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  overflow: hidden;
}
/* Content photographs are real <img> elements — search engines and screen
   readers need to see them. The .media box supplies the crop. */
.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  /* The still frame sits under everything, so the bar looks the same before
     the video loads, on phones, and when motion is not wanted. */
  background: var(--deep) url('../img/header-water.jpg') center / cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.site-header__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The dark wash that keeps the wordmark and navigation legible over moving water. */
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bar);
}
.site-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  min-height: 82px;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 34px; height: 34px; }
.brand__name {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--white);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.9rem;
  align-items: center;
}
.nav a {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--white); border-bottom-color: rgba(255, 255, 255, 0.45); }
.nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--green); }

/* ----------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 76vh, 700px);
  background-color: var(--deep);
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  color: var(--white);
  overflow: hidden;
}
/* A teal wash rather than a neutral scrim: it is what ties the photograph to
   the palette, and it is how the banner reads on flowterra.ie. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(8, 52, 61, 0.82) 12%, rgba(8, 52, 61, 0.42) 62%),
    linear-gradient(180deg, rgba(8, 52, 61, 0.30), rgba(8, 52, 61, 0.30));
}
.hero > * { position: relative; z-index: 1; }

/* The banner ignores the usual centred column: on flowterra.ie the headline
   starts near the left edge and runs much wider. */
.hero__body {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-block: clamp(3rem, 7vw, 5rem);
  padding-inline: clamp(1.25rem, 6.3vw, 6rem);
}

.hero__eyebrow {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0 0 1.4rem;
}

.hero h1 {
  font-size: clamp(3.1rem, 8.7vw, 8rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--white);
  max-width: 14ch;
}

/* The quieter second action: a rule under the words, arrow after them. */
.hero__link {
  align-self: center;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}
.hero__link::after { content: " \2192"; }
.hero__link:hover { color: var(--mint); border-bottom-color: var(--mint); }

.hero .btn-row { gap: 1.6rem; align-items: center; }

.hero__side {
  position: absolute;
  right: 1.1rem;
  bottom: 2.5rem;
  z-index: 1;
  writing-mode: vertical-rl;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 700px) { .hero__side { display: none; } }

/* Signature: the treatment train the tagline is talking about --------------- */

.train {
  position: relative;
  z-index: 1;
  background: var(--deep);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.train__inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 1.15rem;
}
.train__inner::-webkit-scrollbar { display: none; }

.train__stage {
  flex: 1 0 auto;
  min-width: 8.5rem;
  padding-right: 1.5rem;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}
.train__stage::before {
  content: "";
  display: block;
  height: 3px;
  margin-bottom: 0.7rem;
  background: var(--stage, var(--flow));
  transform-origin: left;
  animation: train-draw 0.7s cubic-bezier(0.32, 0.72, 0, 1) both;
  animation-delay: var(--delay, 0s);
}

@keyframes train-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* -------------------------------------------------------------- page top -- */

.pagehead {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(15rem, 30vw, 22rem);
  background-color: var(--deep);
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  color: var(--white);
}
.pagehead::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 38, 46, 0.6), rgba(6, 38, 46, 0.88));
}
.pagehead > * { position: relative; z-index: 1; }
.pagehead__body { padding-block: clamp(2.5rem, 5vw, 4rem); }
.pagehead h1 { color: var(--white); font-size: var(--step-3); max-width: 20ch; }
.pagehead .label { color: rgba(255, 255, 255, 0.72); }
.pagehead__sub {
  margin-top: 1.1rem;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.85);
}
.pagehead--slim { min-height: clamp(11rem, 20vw, 15rem); }

/* --------------------------------------------------------------- layout -- */

.split {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 5vw, 5rem); }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split__aside { position: sticky; top: 2rem; }
}

.stack > * + * { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* Index of services, used on the homepage — a list, not a card grid ------- */

.index { border-top: 1px solid var(--line); }
.index__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 2rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.index__row:hover { background: var(--paper-2); }
.index__row:hover .index__name { color: var(--flow); }
.index__ref {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent, var(--flow));
  padding-top: 0.35rem;
}
.index__name {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--deep);
  letter-spacing: -0.015em;
  transition: color 0.15s ease;
}
.index__note { color: var(--ink-soft); font-size: 1rem; }
@media (min-width: 760px) {
  .index__row { grid-template-columns: 5.5rem minmax(0, 15rem) minmax(0, 1fr); align-items: baseline; }
}

/* Service sections ------------------------------------------------------- */

.service {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  padding-top: clamp(2.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.service + .service { margin-top: clamp(3rem, 6vw, 5rem); }
.service__media { aspect-ratio: 4 / 3; }
.service__ref {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent, var(--flow));
  margin: 0 0 0.9rem;
}
.service__ref::before {
  content: "";
  display: block;
  width: 3.25rem;
  height: 3px;
  background: var(--accent, var(--flow));
  margin-bottom: 1rem;
}
.service h2 { font-size: var(--step-2); }
.service__intro { margin-top: 1rem; max-width: 56ch; color: var(--ink-soft); }

.checklist {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  columns: 2;
  column-gap: 2.5rem;
}
.checklist li {
  break-inside: avoid;
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.55rem;
  font-size: 1rem;
  line-height: 1.45;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--flow));
}
@media (max-width: 620px) { .checklist { columns: 1; } }

@media (min-width: 900px) {
  .service { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 4vw, 4rem); }
  /* Flipped rows mirror the columns as well as the order, so the text always
     gets the wide side. */
  .service--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .service--flip .service__media { order: 2; }
  .service__media { aspect-ratio: 3 / 4; }
}

/* Full-bleed statement band --------------------------------------------- */

.band {
  position: relative;
  background-color: var(--deep);
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding-block: clamp(4.5rem, 9vw, 8rem);
}
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(6, 38, 46, 0.92) 30%, rgba(6, 38, 46, 0.55));
}
.band > * { position: relative; z-index: 1; }
.band h2 { color: var(--white); font-size: var(--step-3); max-width: 18ch; }
.band p { color: rgba(255, 255, 255, 0.85); max-width: 54ch; margin-top: 1.3rem; }

/* Expectations — a plain, scannable list ---------------------------------- */

.expect { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.expect li {
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--deep);
  display: flex;
  gap: 1rem;
}
.expect li::before {
  content: "\2014";
  color: var(--flow);
  flex: none;
}

/* Quote ------------------------------------------------------------------ */

.quote { border-left: 3px solid var(--flow); padding-left: clamp(1.25rem, 3vw, 2.5rem); }
.quote blockquote {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--deep);
}
.quote figcaption {
  margin-top: 1.2rem;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Enquiry strip ---------------------------------------------------------- */

.cta {
  background: var(--deep);
  color: var(--white);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}
.cta h2 { color: var(--white); font-size: var(--step-2); }
.cta p { color: rgba(255, 255, 255, 0.8); margin-top: 1rem; max-width: 48ch; }
.cta__inner { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .cta__inner { grid-template-columns: minmax(0, 1fr) auto; } }

/* Form ------------------------------------------------------------------- */

.form { margin-top: 2.5rem; }
.field { margin-bottom: 1.5rem; }
.field label {
  display: block;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--deep);
  margin-bottom: 0.5rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--flow); }
.field__hint { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.45rem; }

.form__row { display: grid; gap: 0 1.5rem; }

/* Honeypot — off-screen rather than display:none, which bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (min-width: 700px) { .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--deep);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  padding-block: 2.5rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2.5rem;
}
.site-footer__tag {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-left: auto; }
.site-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer__legal {
  width: 100%;
  padding-top: 1.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------- motion -- */

/* The hidden state only applies once site.js has added .js-reveal, so the
   page is never blank if the script does not run. */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); }
.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  .site-header__video { display: none; }
  .js-reveal .reveal, .js-reveal .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .train__stage::before { animation: none; }
  * { scroll-behavior: auto !important; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  color: var(--deep);
  padding: 0.75rem 1rem;
  z-index: 20;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ------------------------------------------------------- photo slots --
   Declared here, not in the HTML: a url() inside a custom property is
   resolved against this stylesheet, so the paths are relative to
   assets/css/. Replace a file in assets/img/ and every page using it
   updates. */

.ph-about-band { --img: url('../img/about-band.jpg'); }
.ph-about-header { --img: url('../img/about-header.jpg'); }
.ph-contact-header { --img: url('../img/contact-header.jpg'); }
.ph-hero-banner { --img: url('../img/hero-banner.jpg?v=2'); }
.ph-home-band { --img: url('../img/home-band.jpg'); background-position: center bottom; }  /* the clarifiers sit along the bottom of this aerial */
.ph-services-header { --img: url('../img/services-header.jpg'); }
.ph-why-header { --img: url('../img/why-header.jpg'); }
