/* George & Son Plumbing
   Palette: deep navy + Shane's gold, with copper for the pipe.
   Type: Archivo (display) + Public Sans (body). */

:root {
  --navy: #12324a;
  --navy-deep: #0c2435;
  --gold: #ebb22f;        /* main accent: fills, buttons, bands */
  --gold-deep: #d69e1a;   /* hover */
  --gold-ink: #7e5e07;    /* gold for text on light backgrounds (passes contrast) */
  --copper: #a35f27;
  --paper: #f5f7f8;
  --mist: #e4edf2;
  --line: #cfdbe2;
  --ink: #1b2a33;
  --muted: #4f616d;
  --on-navy: #c9d6df;
  --white: #ffffff;

  --focus: var(--gold-ink);

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--navy); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-ink); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 85%;
  line-height: 1.08;
  color: var(--navy);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 750; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--navy); padding: 0.6rem 1rem; z-index: 100; font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 247, 248, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 6px 20px -12px rgba(12, 36, 53, 0.45); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--navy); }
.brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; flex: none; white-space: nowrap;
  background: var(--navy); color: var(--white);
  font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 1.05rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 5px var(--gold);
}
.brand-mark span { color: var(--gold); margin: 0 0.05em; }
.brand-name { font-family: var(--display); font-stretch: 85%; font-weight: 800; font-size: 1.2rem; line-height: 1.05; }
.brand-name small {
  display: block; font-family: var(--body); font-weight: 400; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.01em;
}
.site-nav { display: flex; gap: 1.4rem; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: var(--gold-ink); }

.call {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  background: var(--navy); color: var(--white); text-decoration: none;
  font-family: var(--display); font-stretch: 85%; font-weight: 750; font-size: 1.1rem;
  padding: 0.55rem 1rem; border-radius: var(--radius);
}
.call:hover { background: var(--navy-deep); color: var(--gold); }
.call-label { font-family: var(--body); font-weight: 400; font-size: 0.8rem; color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--body); font-weight: 700; font-size: 1rem;
  padding: 0.85rem 1.4rem; border-radius: var(--radius);
  border: 2px solid transparent;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-deep); color: var(--navy); }
.btn-ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

/* ---------- Hero (navy) ---------- */
.hero {
  --focus: var(--gold);
  padding: clamp(2.5rem, 6vw, 5rem) 0 0;
  background: var(--navy);
  color: var(--on-navy);
}
.hero h1 { color: var(--white); max-width: 14ch; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-kicker { color: var(--gold); font-weight: 600; margin-bottom: 0.9rem; }
.lede { font-size: 1.2rem; max-width: 36rem; }
.hero .lede { color: var(--on-navy); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1rem; }
.hero .btn-ghost { border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.hero .btn-ghost:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.hours-note { font-size: 0.92rem; color: #9fb3c1; }

.hero-photo {
  margin: 0; position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #1a3f5b 0 14px, #173852 14px 28px);
  box-shadow: 14px 14px 0 0 var(--gold);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 45% 30%; }
.hero-photo.no-photo::before {
  content: "Add images/hero.jpg";
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #9fb3c1; font-size: 0.9rem;
}

/* The lineage: a copper pipe run with a fitting for each generation.
   On scroll, gold "flows" along the pipe and lights each fitting as it reaches it. */
.lineage {
  --flow: 1;
  list-style: none; margin: clamp(3.5rem, 7vw, 5rem) 0 0; padding: 2.6rem 0 clamp(2.5rem, 5vw, 3.5rem);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  position: relative;
}
.lineage::before,
.lineage::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0;
  height: 10px; border-radius: 5px;
}
.lineage::before { background: linear-gradient(180deg, #d79b63 0%, var(--copper) 55%, #7d4519 100%); }
.lineage::after {
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold) 50%, #b8860b 100%);
  box-shadow: 0 0 18px rgba(235, 178, 47, 0.55);
  transform-origin: left center;
  transform: scaleX(var(--flow));
}
.lineage li { position: relative; display: flex; flex-direction: column; gap: 0.2rem; }
.lineage li::before {
  content: ""; position: absolute; top: calc(-2.6rem - 7px); left: 0; z-index: 1;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-deep);
  box-shadow: 0 0 0 4px var(--navy), inset 0 0 0 4px #d79b63;
  transition: background-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.lineage li.lit::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--navy), inset 0 0 0 4px #fff3c4, 0 0 22px 4px rgba(235, 178, 47, 0.6);
  transform: scale(1.12);
}
.lineage-when { font-size: 0.9rem; color: var(--gold); font-weight: 600; }
.lineage-who {
  font-family: var(--display); font-stretch: 80%; font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--white); line-height: 1.05;
}
.lineage-what { color: var(--on-navy); max-width: 26ch; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); margin: 0 0 0.6em; max-width: 34rem; }

/* Services */
.services { background: var(--white); border-bottom: 1px solid var(--line); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 4px solid var(--gold); }
.service { padding: 1.6rem 1.6rem 1.8rem 0; border-bottom: 1px solid var(--line); }
.service-lead { grid-row: span 2; padding-right: 2.5rem; border-right: 1px solid var(--line); }
.service:not(.service-lead) { padding-left: 2rem; }
.service-grid .service:nth-child(3),
.service-grid .service:nth-child(5) { border-left: 1px solid var(--line); }
.service ul { list-style: none; margin: 0; padding: 0; }
.service li { padding: 0.45rem 0 0.45rem 1.25rem; position: relative; }
.service li::before {
  content: ""; position: absolute; left: 0; top: 0.95em;
  width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold-deep);
}
.service-lead h3 { font-size: 1.7rem; }

/* Family */
.family-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.family-story p { max-width: 38rem; font-size: 1.1rem; }
.creds {
  --focus: var(--gold);
  background: var(--navy); color: var(--on-navy);
  padding: 2rem; border-radius: var(--radius);
  border-top: 6px solid var(--gold);
}
.creds h2 { color: var(--white); font-size: 1.6rem; }
.cred-list { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.cred-list li { padding: 0.55rem 0 0.55rem 1.6rem; border-bottom: 1px solid rgba(255, 255, 255, 0.14); position: relative; }
.cred-list li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.95rem;
  width: 0.7rem; height: 0.38rem;
  border-left: 2.5px solid var(--gold); border-bottom: 2.5px solid var(--gold);
  transform: rotate(-45deg);
}
.qbcc { font-size: 1.05rem; color: var(--white); margin-bottom: 0.4rem; }
.qbcc strong { font-family: var(--display); font-stretch: 85%; font-size: 1.35rem; color: var(--gold); margin-left: 0.25rem; }
.creds-note { font-size: 0.92rem; margin: 0; color: #9fb3c1; }
.mp-logo { margin-top: 1rem; background: #fff; padding: 0.5rem; border-radius: 4px; width: 100%; max-width: 300px; height: auto; }

/* Four-way test (gold band) */
.test { background: var(--gold); --focus: var(--navy); }
.test h2 { color: var(--navy); }
.test-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.test-grid > div p { color: #3d2f05; font-size: 1.1rem; }
.test-list { margin: 0; padding: 0; list-style: none; counter-reset: q; }
.test-list li {
  counter-increment: q;
  display: grid; grid-template-columns: 3.4rem 1fr; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid rgba(18, 50, 74, 0.25);
  font-family: var(--display); font-stretch: 90%; font-weight: 650;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); color: var(--navy); line-height: 1.25;
}
.test-list li:first-child { border-top: 1px solid rgba(18, 50, 74, 0.25); }
.test-list li::before {
  content: counter(q);
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  font-size: 1.05rem; font-weight: 800;
  background: var(--navy); color: var(--gold);
  border: 2px solid var(--navy);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
/* Before an item scrolls into place, its number sits as an outline; it fills in as you reach it */
.js-scroll .test-list li:not(.on)::before { background: transparent; color: var(--navy); transform: scale(0.85); }

/* Contact */
.contact { background: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
.contact-details > p { color: var(--muted); max-width: 30rem; }
.contact-details dl { margin: 2rem 0 0; }
.contact-details dl div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.contact-details dl div:first-child { border-top: 3px solid var(--gold); }
.contact-details dt { color: var(--muted); font-size: 0.95rem; }
.contact-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.contact-form {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 2rem);
}
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-weight: 600; font-size: 0.95rem; }
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--white);
  border: 1px solid #b6c6d0; border-radius: 4px;
  padding: 0.7rem 0.8rem; width: 100%;
}
textarea { resize: vertical; min-height: 8rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(235, 178, 47, 0.55); border-color: var(--gold-ink); }
.field.invalid input, .field.invalid textarea { border-color: #b3261e; }
.field-error { color: #b3261e; font-size: 0.88rem; }
.hp { position: absolute; left: -9999px; }
.contact-form .btn { width: 100%; margin-top: 0.3rem; font-size: 1.05rem; }
.contact-form .btn[disabled] { opacity: 0.6; cursor: progress; }
.form-status { margin: 1rem 0 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: #1e6b3a; }
.form-status.err { color: #b3261e; }

/* Footer */
.site-footer {
  --focus: var(--gold);
  background: var(--navy-deep); color: var(--on-navy);
  padding: 2.5rem 0; font-size: 0.95rem;
  border-top: 6px solid var(--gold);
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--gold); }
.site-footer strong { color: var(--white); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-inner p { margin: 0; }
.copy { align-self: end; }

.mobile-call { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .call { margin-left: auto; }
  .hero-grid, .family-grid, .test-grid, .contact-grid, .section-head { grid-template-columns: 1fr; }
  .section-head { gap: 0; }
  .hero-photo { order: -1; aspect-ratio: 16 / 9; box-shadow: 10px 10px 0 0 var(--gold); margin-right: 10px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-lead { grid-row: auto; grid-column: 1 / -1; border-right: 0; padding-right: 0; }
  .service:not(.service-lead) { padding-left: 0; padding-right: 1.5rem; }
  .service-grid .service:nth-child(3),
  .service-grid .service:nth-child(5) { border-left: 1px solid var(--line); padding-left: 1.5rem; }
}

@media (max-width: 640px) {
  body { padding-bottom: 4rem; }
  .call { display: none; }
  /* The sticky gold bar handles calling on phones, so the hero's call button would just repeat it */
  .hero-actions .btn-primary { display: none; }
  .brand-name { font-size: 1.1rem; }
  /* Pipe runs down the left on phones */
  .lineage { grid-template-columns: 1fr; padding: 0 0 2.5rem 2.4rem; gap: 1.6rem; }
  .lineage::before, .lineage::after { top: 0; bottom: 2.5rem; left: 7px; right: auto; width: 10px; height: auto; }
  .lineage::after { transform-origin: center top; transform: scaleY(var(--flow)); }
  .lineage li::before { top: 0.15rem; left: calc(-2.4rem); }
  .service-grid { grid-template-columns: 1fr; }
  .service-grid .service:nth-child(3),
  .service-grid .service:nth-child(5) { border-left: 0; padding-left: 0; }
  .service:not(.service-lead) { padding-right: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-details dl div { grid-template-columns: 5rem 1fr; }
  .mobile-call {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--gold); color: var(--navy); text-align: center; text-decoration: none;
    font-family: var(--display); font-stretch: 85%; font-weight: 800; font-size: 1.2rem;
    padding: 0.95rem 1rem calc(0.95rem + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px -8px rgba(12, 36, 53, 0.4);
  }
  .mobile-call:hover { color: var(--navy); }
}

@media (prefers-reduced-motion: reduce) {
  .lineage li::before, .test-list li::before, .site-header { transition: none; }
}

/* Turnstile spam check sits above the send button */
.cf-turnstile { margin: 0.4rem 0 1rem; min-height: 65px; }
