/* ============================================================
   DESIGN SYSTEM — "Control Joint"  (Direction A, adopted 2026-08-09)

   Palette drawn from jobsite materials rather than corporate navy/gold.
   The signature device is the control joint: the groove a finisher cuts
   into a fresh slab so that when it moves, it cracks along a line someone
   chose instead of at random. Section boundaries use that same scored line.

   Every text/background pair below was MEASURED, not eyeballed. Ratios at
   the bottom of this block. --hivis is #B03B0B rather than a brighter
   #C2410C specifically because the brighter value scored 4.19 on the slab
   ground and failed AA.
   ============================================================ */

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

:root {
  --slab: #E9E7E2;        /* cured concrete — page ground */
  --paper: #FFFFFF;
  --wet: #3E4644;         /* wet pour, grey-green — dark sections */
  --form-dark: #22262A;   /* formwork shadow — nav, footer */
  --chalk: #2C5F9E;       /* chalk line — links */
  --hivis: #B03B0B;       /* safety orange — the single CTA colour */
  --hivis-dark: #8A2E08;
  --ink: #1B1D1C;
  --muted: #5C625F;
  --rule: #CFCBC3;
  --rule-soft: #DEDAD3;

  /* Legacy aliases — older markup still references these names. */
  --navy: var(--wet);
  --steel: var(--chalk);
  --gold: var(--hivis);
  --gold-hover: var(--hivis-dark);
  --white: var(--paper);
  --text: var(--ink);
  --light-gray: var(--slab);
  --border: var(--rule);

  /* Only system faces. Nothing here is loaded over the network, so what is
     declared is what renders — see tests/design-defects.test.js defect 6. */
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1080px;
  --radius: 3px;

  /* MEASURED CONTRAST (WCAG AA needs 4.5:1 for body text)
     ink/paper 16.95 · ink/slab 13.71 · muted/paper 6.24 · muted/slab 5.05
     white/hivis 6.04 · hivis/paper 6.04 · hivis/slab 4.89
     white/wet 9.70 · white/form-dark 15.23 · chalk/paper 6.49 */
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--slab);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 { font-size: clamp(2.05rem, 4.4vw, 3rem); font-weight: 800; line-height: 1.07; letter-spacing: -.025em; color: var(--ink); }
h2 { font-size: clamp(1.45rem, 2.7vw, 1.95rem); font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin-bottom: 1rem; }
h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); margin-bottom: .35rem; }
p { margin-bottom: 1.15rem; color: var(--muted); line-height: 1.72; }
a { color: var(--chalk); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 3.4rem 0; }

/* SIGNATURE — the control joint. A scored line with a highlight beneath,
   the way a saw cut catches light. Used at every section boundary. */
.section-white, .section-gray { position: relative; }
.section-white::before, .section-gray::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to bottom, #B9B4AA 0 1px, rgba(255,255,255,.85) 1px 2px);
}
.section-white { background: var(--paper); }
.section-gray { background: var(--slab); }
.section-dark { background: var(--wet); color: var(--paper); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark p { color: #C9D0CD; }

/* Section heading — an uppercase eyebrow rule rather than a coloured bar */
.section-heading {
  display: block;
  font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--hivis); margin-bottom: 1.1rem;
}
.section-dark .section-heading { color: #E9A87C; }
.text-body { max-width: 68ch; }

/* Navigation */
nav {
  background: var(--form-dark);
  padding: .8rem 0;
  position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.nav-logo { color: var(--paper); font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; text-decoration: none; flex-shrink: 0; }
.nav-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.nav-phone { color: #D7D3CB; font-size: .9rem; text-decoration: none; font-weight: 600; }
.nav-phone:hover { color: var(--paper); text-decoration: none; }
.nav-cta {
  background: var(--hivis); color: var(--paper);
  padding: .55rem 1.1rem; border-radius: var(--radius);
  font-weight: 700; font-size: .9rem; text-decoration: none;
  transition: background .15s; white-space: nowrap;
}
.nav-cta:hover { background: var(--hivis-dark); text-decoration: none; }
@media (max-width: 600px) {
  /* .nav-phone is NOT hidden here — mobile is where tap-to-call converts. */
  .nav-phone { font-size: .85rem; }
  .nav-inner { flex-wrap: wrap; }
}

/* Hero — flat paper, no gradient. Two columns: argument and form. */
.hero { background: var(--paper); color: var(--ink); padding: 3.4rem 0 3rem; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: start; }
.hero-content h1 { color: var(--ink); margin-bottom: .9rem; }
.hero-content .subheadline {
  font-size: 1.08rem;
  color: var(--muted);   /* explicit — the base p rule would otherwise win */
  margin-bottom: 1.5rem;
  max-width: 46ch;
}

/* Hero facts — a ruled spec table, not a checklist of adjectives */
.hero-trust-list { list-style: none; margin-bottom: 1.4rem; border-top: 1px solid var(--rule); }
.hero-trust-list li {
  padding: .7rem 0; border-bottom: 1px solid var(--rule);
  color: var(--ink); font-size: .93rem;
}
.hero-trust-list li::before { content: "✓"; color: var(--hivis); font-weight: 800; margin-right: .6rem; }
.hero-phone-cta { color: var(--muted); font-size: .93rem; }
.hero-phone-cta a { color: var(--hivis); font-weight: 700; text-decoration: none; }
.hero-phone-cta a:hover { text-decoration: underline; }

/* Hero form card — the orange top edge is the only flourish it gets */
.hero-form-card {
  background: var(--paper);
  color: var(--ink);  /* required: .hero sets a colour that would otherwise
                         paint these labels white on a white card */
  border: 1px solid var(--rule);
  border-top: 3px solid var(--hivis);
  border-radius: var(--radius);
  padding: 1.7rem;
}
.hero-form-card h3 { color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; font-weight: 700; }
.hero-form-card .form-group { margin-bottom: .85rem; }
.hero-form-card .form-group label { font-size: .79rem; }
.hero-form-card .btn-submit {
  width: 100%; background: var(--hivis); color: var(--paper);
  padding: .85rem; border: none; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: var(--font); transition: background .15s; margin-top: .4rem;
}
.hero-form-card .btn-submit:hover { background: var(--hivis-dark); }
.consent-check {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .78rem; color: var(--muted); margin-top: .5rem;
}
.consent-check input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

/* Buttons */
.btn-primary {
  background: var(--hivis); color: var(--paper);
  padding: .85rem 1.7rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
  text-decoration: none; display: inline-block; transition: background .15s;
}
.btn-primary:hover { background: var(--hivis-dark); text-decoration: none; }
.btn-secondary {
  background: transparent; color: var(--paper);
  padding: .85rem 1.7rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; border: 1.5px solid rgba(255,255,255,.7);
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background .15s, color .15s;
}
.btn-secondary:hover { background: var(--paper); color: var(--wet); text-decoration: none; }

/* Trust bar — quiet rule, not a solid orange band */
.trust-bar { background: var(--paper); border-bottom: 1px solid var(--rule); padding: .85rem 0; }
.trust-bar ul {
  display: flex; gap: 2.2rem; list-style: none; justify-content: center;
  flex-wrap: wrap; font-weight: 600; font-size: .88rem; color: var(--ink);
}
.trust-bar li::before { content: "✓ "; color: var(--hivis); font-weight: 800; }

/* Services — a single ruled block, so a 4th card can never orphan */
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0; margin-top: 1.6rem;
  border: 1px solid var(--rule); background: var(--rule);
}
.service-card { background: var(--paper); padding: 1.4rem; border: 0; }
.service-card h3 { color: var(--ink); }
.service-card p { font-size: .88rem; margin-bottom: 0; line-height: 1.58; }

.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin-top: 1.4rem; }
.service-item { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.service-item-icon { width: 26px; height: 26px; min-width: 26px; background: var(--hivis); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700; }
.service-item-name { font-weight: 600; color: var(--ink); font-size: .93rem; }

.sub-service { border-left: 3px solid var(--hivis); padding: .9rem 1.3rem; margin-bottom: 1.2rem; background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }

/* Why-choose list */
.why-list { list-style: none; margin-top: 1.2rem; }
.why-list li { padding: .7rem 0 .7rem 1.6rem; border-bottom: 1px solid var(--rule); position: relative; color: var(--ink); }
.why-list li::before { content: "→"; color: var(--hivis); position: absolute; left: 0; font-weight: 700; }

/* Trust signals */
.trust-signals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.trust-signal { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--hivis); border-radius: var(--radius); padding: 1.3rem; }
.trust-signal .icon { font-size: 1.5rem; margin-bottom: .5rem; color: var(--hivis); }
.trust-signal h3 { font-size: 1rem; margin-bottom: .3rem; }
.trust-signal p { font-size: .88rem; margin-bottom: 0; }

.seasonal-banner { background: var(--wet); color: var(--paper); padding: 1.3rem 1.6rem; border-radius: var(--radius); margin-bottom: 1.8rem; }
.seasonal-banner h3 { color: var(--paper); }
.seasonal-banner p { color: #C9D0CD; margin-bottom: 0; }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 700; margin-bottom: .3rem; font-size: .82rem; color: var(--wet); letter-spacing: .015em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .65rem .75rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: .96rem; font-family: var(--font); background: #FCFBF9;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--chalk); outline-offset: -1px; border-color: var(--chalk);
}
.form-group input.error, .form-group select.error, .form-group textarea.error { border-color: #B42318; }
.field-error { color: #B42318; font-size: .8rem; margin-top: .25rem; display: none; }
.field-error.visible { display: block; }
.form-error-message { background: #FEF3F2; border: 1px solid #B42318; color: #B42318; padding: .9rem; border-radius: var(--radius); margin-top: 1rem; display: none; }
.form-error-message.visible { display: block; }
.honeypot { display: none !important; }

/* Contact page phone block */
.contact-phone { text-align: center; padding: 2.2rem 0; background: var(--wet); color: var(--paper); }
.contact-phone p { color: #C9D0CD; margin-bottom: .4rem; }
.contact-phone a { color: var(--paper); font-size: 1.9rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }

/* Service area */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; margin: 1.3rem 0; }
.area-tag { background: var(--paper); border: 1px solid var(--rule); padding: .45rem .9rem; border-radius: var(--radius); font-size: .88rem; text-align: center; color: var(--ink); }
.areas-not-served { margin-top: 1.6rem; font-size: .92rem; color: var(--muted); }

/* CTA */
.cta-section { background: var(--paper); color: var(--ink); text-align: center; padding: 3.2rem 0; position: relative; }
.cta-section::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(to bottom, #B9B4AA 0 1px, rgba(255,255,255,.85) 1px 2px); }
.cta-section h2 { color: var(--ink); margin-bottom: .5rem; }
.cta-section p { color: var(--muted); margin-bottom: 1.5rem; }

/* FAQ */
.faq-list { margin-top: 1.2rem; border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-question {
  width: 100%; background: none; border: none; display: flex;
  justify-content: space-between; align-items: center; padding: 1.05rem 0;
  font-size: .99rem; font-weight: 650; color: var(--ink); cursor: pointer;
  text-align: left; font-family: var(--font); gap: 1rem;
}
.faq-chevron { font-size: .72rem; color: var(--hivis); transition: transform .2s; flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner { padding-bottom: 1.15rem; color: var(--muted); line-height: 1.72; }

/* Split + image */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem; align-items: center; }
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }
.img-placeholder {
  background: linear-gradient(150deg, #5C6B63, #3A4741 60%, #2A332E);
  border-radius: var(--radius); aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4); font-size: 2.4rem;
}

/* Photo band — wide slot for real photography, replacing the cramped
   half-column image that forced the body copy into a narrow gutter. */
.photo-band {
  aspect-ratio: 21/6;
  background: linear-gradient(150deg, #5C6B63, #3A4741 60%, #2A332E);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35); font-size: 2.6rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) { .photo-band { aspect-ratio: 16/9; } }

/* Long-form body copy. Same words as before — given a readable measure and
   real vertical rhythm so the page's own headings can carry the structure. */
.prose { max-width: 70ch; }
.prose > h2 {
  font-size: 1.28rem; letter-spacing: -.02em; color: var(--ink);
  margin: 2.2rem 0 .6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule);
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose > h3 {
  font-size: 1.03rem; color: var(--wet); margin: 1.5rem 0 .4rem;
}
.prose p { margin-bottom: 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem 1.1rem; }
.prose li { margin-bottom: .5rem; color: var(--muted); line-height: 1.68; }
.prose li strong { color: var(--ink); }
.prose > p:first-of-type { font-size: 1.06rem; color: var(--ink); }

/* Footer */
footer { background: var(--form-dark); color: #9AA09D; padding: 2.6rem 0 1.8rem; font-size: .87rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.5fr; gap: 2.2rem; margin-bottom: 1.8rem; }
.footer-brand .footer-name { color: var(--paper); font-weight: 700; font-size: 1rem; margin-bottom: .4rem; }
.footer-brand .footer-phone { color: var(--hivis); font-size: 1.08rem; font-weight: 700; text-decoration: none; display: block; margin-top: .4rem; }
.footer-col-heading { color: var(--paper); font-weight: 700; font-size: .78rem; margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .11em; }
.footer-links { display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { color: #9AA09D; }
.footer-links a:hover { color: var(--paper); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.1rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* Utility pages */
.error-page { text-align: center; padding: 6rem 0; }
.error-page h1 { font-size: 5rem; color: var(--hivis); }
.thankyou-page { text-align: center; padding: 5rem 0; }
.thankyou-page .checkmark { font-size: 3.4rem; margin-bottom: 1rem; color: var(--hivis); }

/* Sticky mobile call bar */
.mobile-call-bar { display: none; }
@media (max-width: 768px) {
  .mobile-call-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--hivis); box-shadow: 0 -2px 12px rgba(0,0,0,.25);
  }
  .mobile-call-bar a {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .9rem 1rem; color: var(--paper); font-weight: 700; font-size: 1.05rem;
    text-decoration: none; min-height: 48px;
  }
  .mobile-call-bar a:hover, .mobile-call-bar a:focus { text-decoration: none; background: var(--hivis-dark); }
  body { padding-bottom: 56px; }
}

/* ── Mobile hardening ──────────────────────────────────────────────────────
   Measured on the live site at 390px, 2026-08-09. Home-services traffic is
   overwhelmingly phones, so these are conversion fixes, not polish. */
@media (max-width: 768px) {
  /* iOS Safari force-zooms the whole page when a focused input is under 16px.
     Every visible field measured 15.36px, so tapping any of them yanked the
     layout sideways mid-form. 16px is the threshold, not a preference. */
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }

  /* 44px minimum tap target. 18 visible controls measured under it — the nav
     phone link was 22px and footer links 17px. */
  .nav-logo,
  .nav-phone { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-links a,
  .footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
  .consent-check { padding: .35rem 0; }
  .consent-check input[type="checkbox"] { width: 22px; height: 22px; }

  /* Pull the form up toward the fold. The hero previously pushed it to 605px
     on an 844px screen, so the thing the page exists for was nearly offscreen. */
  .hero { padding: 1.6rem 0 1.8rem; }
  .hero-content h1 { font-size: clamp(1.75rem, 8vw, 2.15rem); }
  .hero-content .subheadline { font-size: 1rem; margin-bottom: 1rem; }
  .hero-trust-list { margin-bottom: 1rem; }
  .hero-trust-list li { padding: .5rem 0; font-size: .89rem; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 2.4rem 0 2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .trust-bar ul { gap: 1.1rem; }
  section { padding: 2.6rem 0; }
  .split { grid-template-columns: 1fr; gap: 1.8rem; }
  .split.reverse { direction: ltr; }
}
@media (max-width: 480px) {
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}
