/* =====================================================================
   Mainline Plumbing Co. — design demo
   Palette: deep hydro teal-black, cool paper, wet-teal accent,
   red reserved strictly for emergency.
   Type: Archivo (display) + IBM Plex Sans (text).
   ===================================================================== */

:root {
  --ink:        #0A2A33;
  --ink-2:      #0E353F;
  --ink-3:      #14434F;
  --paper:      #F1F4F3;
  --surface:    #FFFFFF;
  --steel:      #4C5F65;
  --steel-line: #CDD8D5;
  --chrome:     #E2E8E6;
  --current:    #00BFA6;
  --current-hi: #39E0CB;
  --link:       #0B6E5E;
  --emergency:  #C63A22;
  --on-ink:     #EAF3F1;
  --on-ink-dim: #A7BEBF;

  --wrap: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);

  --step--1: 0.875rem;
  --step-0:  1rem;
  --step-1:  1.125rem;
  --step-2:  1.375rem;
  --step-3:  clamp(1.6rem, 1.1rem + 2vw, 2.25rem);
  --step-4:  clamp(2rem, 1.2rem + 3.4vw, 3.15rem);
  --step-5:  clamp(2.4rem, 1.5rem + 3.4vw, 3.9rem);

  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

h1, h2, h3 {
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }

img, svg { max-width: 100%; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.visually-hidden, .skip-link:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.5rem; left: 0.5rem;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--current);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--on-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid var(--btn-bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 0.95rem 1.5rem; font-size: var(--step-1); }

.btn--primary {
  --btn-bg: var(--current);
  --btn-fg: var(--ink);
}
.btn--primary:hover { --btn-bg: var(--current-hi); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--on-ink); }

/* on dark backgrounds */
.hero .btn--ghost { --btn-fg: var(--on-ink); border-color: rgba(234,243,241,0.5); }
.hero .btn--ghost:hover { --btn-bg: var(--on-ink); --btn-fg: var(--ink); border-color: var(--on-ink); }

/* ---------- emergency bar ---------- */
.emergency-bar {
  background: var(--emergency);
  color: #fff;
}
.emergency-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem 1.5rem;
  padding-block: 0.25rem;
}
.emergency-bar p { font-size: var(--step--1); font-weight: 500; }
.emergency-bar__call {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding-block: 0.35rem;
  color: #fff;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
  white-space: nowrap;
}
.emergency-bar__call:hover { text-decoration: underline; }
.emergency-bar__call svg { width: 1rem; height: 1rem; fill: currentColor; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--steel-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand__mark { width: 34px; height: 34px; }
.brand__text {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: lowercase;
}
.brand__text span {
  display: block;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--steel);
}
.brand__text--light { color: var(--on-ink); }
.brand__text--light span { color: var(--on-ink-dim); }

.site-nav { margin-left: auto; }
.site-nav__list {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav__list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s var(--ease);
}
.site-nav__list a:hover { border-color: var(--current); }
.site-nav__toggle { display: none; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.link-call {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.link-call:hover { color: var(--link); }
.link-call--lg { font-size: var(--step-3); display: inline-flex; align-items: center; min-height: 44px; margin-block: 0.5rem 1rem; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: var(--on-ink);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(0,191,166,0.16), transparent 60%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero__kicker {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--current-hi);
  margin-bottom: 1.1rem;
}
.hero__title {
  font-size: var(--step-5);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  max-width: 15ch;
}
.hero__lead {
  max-width: 46ch;
  margin-top: 1.4rem;
  font-size: var(--step-1);
  color: var(--on-ink);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 1.3rem 0 0;
  border-top: 1px solid rgba(234,243,241,0.14);
  font-size: var(--step--1);
  color: var(--on-ink-dim);
}
.hero__trust li { position: relative; padding-left: 1.1rem; }
.hero__trust li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45em;
  width: 0.5rem; height: 0.5rem;
  background: var(--current);
  border-radius: 1px;
  transform: rotate(45deg);
}

.hero__figure {
  align-self: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
    var(--ink-3);
  border: 1px solid rgba(57,224,203,0.22);
  border-radius: 8px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,0.6);
}
.schematic {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .schematic { animation: rise 0.7s var(--ease) both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.schematic__pipes .pipe { stroke: #33606B; }
.schematic .part-label {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  fill: #B7CDCE;
  letter-spacing: 0.01em;
}

/* water flow */
.schematic__water .water {
  stroke-dasharray: 16 12;
  animation: flow 1s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -28; } }

@media (prefers-reduced-motion: reduce) {
  .schematic__water .water { animation: none; stroke-dasharray: none; }
}

/* ---------- stats ---------- */
.stats {
  background: var(--ink-2);
  color: var(--on-ink);
  border-bottom: 3px solid var(--current);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(234,243,241,0.12);
}
.stat {
  background: var(--ink-2);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
  text-align: center;
}
.stat__num {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-size: var(--step-4);
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--on-ink-dim);
}

/* ---------- section shell ---------- */
section { padding-block: clamp(3.5rem, 8vw, 7rem); }
section[id] { scroll-margin-top: 88px; }
.stats { padding-block: 0; }
.emergency-bar, .site-header { padding-block: 0; }

.section-head { max-width: 52ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head h2 { font-size: var(--step-4); }
.section-head p {
  margin-top: 0.8rem;
  font-size: var(--step-1);
  color: var(--steel);
}

/* ---------- services ---------- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--steel-line);
  border: 1px solid var(--steel-line);
}
.service {
  background: var(--surface);
  padding: clamp(1.5rem, 2.5vw, 2rem);
}
.service h3 {
  font-size: var(--step-2);
  margin-bottom: 0.6rem;
}
.service p { color: var(--steel); font-size: 0.97rem; }
.service--feature {
  grid-column: span 3;
  background: var(--ink);
  color: var(--on-ink);
  display: grid;
  gap: 0.75rem 3rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
}
.service--feature h3 { color: #fff; font-size: var(--step-3); }
.service--feature p { color: var(--on-ink); grid-row: 2; }
.service--feature .service__link { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: start; }
.service__link {
  display: inline-flex;
  align-items: center;
  align-self: start;
  min-height: 44px;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: var(--current-hi);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 currentColor;
  padding-bottom: 2px;
}
.service__link:hover { color: #fff; }

/* ---------- pricing ---------- */
.pricing { background: var(--chrome); }
.pricing__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.pricing__copy h2 { font-size: var(--step-4); margin-bottom: 1rem; }
.pricing__copy p { color: var(--steel); font-size: var(--step-1); max-width: 44ch; }
.pricing__list { list-style: none; margin: 0; padding: 0; }
.pricing__list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 1.1rem 0;
  border-top: 2px solid var(--ink);
}
.pricing__list li:last-child { border-bottom: 2px solid var(--ink); }
.pricing__k { font-family: "Archivo", sans-serif; font-weight: 700; }
.pricing__v { color: var(--steel); }

/* ---------- process ---------- */
.process__steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--steel-line);
  border-block: 1px solid var(--steel-line);
}
.process__step {
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.75rem, 3vw, 2.5rem);
}
.process__n {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-size: var(--step-4);
  color: var(--current);
  line-height: 1;
  margin-bottom: 0.8rem;
}
.process__step h3 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.process__step p { color: var(--steel); font-size: 0.97rem; }

/* ---------- reviews ---------- */
.reviews { background: var(--ink); color: var(--on-ink); }
.reviews .section-head h2 { color: #fff; }
.reviews .section-head p { color: var(--on-ink-dim); }
.reviews__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.review {
  margin: 0;
  background: var(--ink-2);
  border: 1px solid rgba(234,243,241,0.12);
  border-top: 3px solid var(--current);
  padding: clamp(1.5rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.review p { font-size: var(--step-1); color: var(--on-ink); }
.review__by { margin-top: auto; }
.review__name {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: #fff;
}
.review__meta { display: block; font-size: var(--step--1); color: var(--on-ink-dim); }

/* ---------- area ---------- */
.area__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.area__copy h2 { font-size: var(--step-4); margin-bottom: 1rem; }
.area__copy p { color: var(--steel); font-size: var(--step-1); max-width: 42ch; margin-bottom: 1.75rem; }
.area__list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--steel-line);
  border: 1px solid var(--steel-line);
}
.area__list li {
  background: var(--surface);
  padding: 0.85rem 1rem;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- call ---------- */
.book { background: var(--ink-2); color: var(--on-ink); }
.book__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.book__copy h2 { font-size: var(--step-4); color: #fff; margin-bottom: 1rem; }
.book__copy p { color: var(--on-ink); max-width: 44ch; margin-bottom: 1.25rem; }
.book__hours { margin: 0.5rem 0 0; display: grid; gap: 0.5rem; }
.book__hours div { display: flex; justify-content: space-between; gap: 1rem; max-width: 22rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(234,243,241,0.14); }
.book__hours dt { font-family: "Archivo", sans-serif; font-weight: 600; }
.book__hours dd { margin: 0; color: var(--on-ink-dim); }

.call-panel {
  background: var(--ink);
  border: 1px solid rgba(57,224,203,0.22);
  border-top: 3px solid var(--current);
  border-radius: 8px;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  gap: 1rem;
  justify-items: stretch;
  text-align: center;
}
.btn--xl {
  padding: 1.2rem clamp(0.75rem, 3vw, 1.5rem);
  white-space: nowrap;
  font-size: clamp(1.05rem, 0.8rem + 1.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.btn--xl svg { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
.call-panel__note { color: var(--on-ink-dim); font-size: var(--step--1); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--on-ink);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(234,243,241,0.14);
}
.site-footer__brand p { margin-top: 0.9rem; color: var(--on-ink-dim); max-width: 34ch; font-size: 0.95rem; }
.site-footer__nav { display: grid; gap: 0.6rem; align-content: start; }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--on-ink); text-decoration: none; font-weight: 500; width: fit-content; }
.site-footer__nav a:hover { color: var(--current-hi); }
.site-footer__meta { display: grid; gap: 0.5rem; align-content: start; color: var(--on-ink-dim); font-size: 0.95rem; }
.site-footer__phone { display: inline-flex; align-items: center; min-height: 44px; font-family: "Archivo", sans-serif; font-weight: 700; color: var(--on-ink); font-size: var(--step-1); text-decoration: none; }
.site-footer__phone:hover { color: var(--current-hi); }
.site-footer__legal { padding-top: 1.5rem; }
.site-footer__legal p { font-size: var(--step--1); color: var(--on-ink-dim); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__figure { max-width: 440px; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .service--feature { grid-column: span 2; grid-template-columns: 1fr; }
  .service--feature p { grid-row: auto; }
  .service--feature .service__link { grid-column: 1; grid-row: auto; }
  .pricing__inner, .area__inner, .book__inner { grid-template-columns: 1fr; }
  .process__steps { grid-template-columns: 1fr; }
  .reviews__grid { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .site-header__inner {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.6rem;
    min-height: 60px;
  }
  .brand { margin-right: auto; padding-block: 0.35rem; }

  .site-nav { position: static; margin-left: 0; }

  .site-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid var(--steel-line);
    border-radius: var(--radius);
    cursor: pointer;
    flex: 0 0 auto;
  }
  .site-nav__toggle-bars,
  .site-nav__toggle-bars::before,
  .site-nav__toggle-bars::after {
    content: "";
    display: block;
    width: 18px; height: 2px;
    background: var(--ink);
    position: relative;
  }
  .site-nav__toggle-bars::before { position: absolute; top: -6px; }
  .site-nav__toggle-bars::after { position: absolute; top: 6px; }

  .site-nav__list {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--steel-line);
    box-shadow: 0 16px 30px -18px rgba(10,42,51,0.35);
    padding: 0.25rem var(--pad) 0.5rem;
  }
  .site-nav__list.is-open { display: flex; }
  .site-nav__list a { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--steel-line); }
  .site-nav__list li:last-child a { border-bottom: 0; }

  .site-header__actions { margin-left: 0; gap: 0.5rem; flex: 0 0 auto; }
  .site-header__actions .link-call { display: none; }
  .site-header__actions .btn { padding: 0.62rem 0.9rem; font-size: 0.92rem; white-space: nowrap; }

  .pricing__list li { flex-direction: column; gap: 0.15rem; }
  .pricing__v { color: var(--steel); }

  .stats__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .service--feature { grid-column: span 1; }
  .services__grid { grid-column: auto; }
  .area__list { grid-template-columns: repeat(2, 1fr); }
  .site-footer__inner { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 100%; }
}

@media (max-width: 340px) {
  .area__list { grid-template-columns: 1fr; }
}
