/*
 * Marlborough Water Heater Services
 * Modern, responsive local service website
 */

:root {
  --navy: #0b2340;
  --navy-dark: #07182c;
  --blue: #1167a8;
  --blue-light: #eaf5fc;
  --orange: #ea6d25;
  --orange-dark: #c75416;
  --cream: #f8f6f2;
  --white: #ffffff;
  --ink: #182536;
  --muted: #5e6a78;
  --line: #dce4e9;
  --success: #2d8a61;
  --shadow-sm: 0 4px 16px rgba(11, 35, 64, .08);
  --shadow: 0 15px 38px rgba(11, 35, 64, .12);
  --radius: 14px;
  --container: 1180px;
  --serif: 'Montserrat', Arial, sans-serif;
  --sans: 'Inter', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #f59b62; outline-offset: 3px; }

.container { width: min(calc(100% - 40px), var(--container)); margin: 0 auto; }
.skip-link { position: fixed; z-index: 1000; left: 12px; top: -100px; padding: 10px 16px; background: var(--white); color: var(--navy); font-weight: 700; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); border-bottom: 1px solid transparent; backdrop-filter: blur(10px); transition: box-shadow .2s, border-color .2s; }
.header.scrolled { border-color: var(--line); box-shadow: 0 3px 16px rgba(11,35,64,.06); }
.header-container { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.logo-text { display: inline-block; font-family: var(--serif); font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: -.7px; white-space: nowrap; }
.logo-accent { color: var(--orange); }
.nav-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 23px; }
.nav-link { color: #445365; font-size: 14px; font-weight: 600; transition: color .2s; }
.nav-link:hover { color: var(--blue); }
.header-cta { margin-left: auto; }
.icon-phone { width: 18px; height: 18px; flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 45px; padding: 11px 20px; border: 1px solid transparent; border-radius: 5px; font-weight: 700; font-size: 14px; transition: transform .2s, background .2s, color .2s, border-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: var(--white); box-shadow: 0 5px 13px rgba(234,109,37,.24); }
.btn-primary:hover { background: var(--orange-dark); color: var(--white); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.7); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn-large { min-height: 53px; padding: 14px 26px; font-size: 15px; }
.btn-full { width: 100%; }
.mobile-menu-btn { display: none; padding: 8px; border: 0; background: transparent; }
.hamburger { width: 24px; height: 2px; margin: 5px 0; display: block; background: var(--navy); }
.mobile-nav-overlay { display: none; }

.hero { position: relative; min-height: 670px; isolation: isolate; display: flex; align-items: center; color: var(--white); }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--navy); }
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,20,38,.94) 0%, rgba(7,27,50,.84) 42%, rgba(7,27,50,.45) 68%, rgba(7,27,50,.28) 100%); }
.hero-container { padding: 85px 0 74px; }
.hero-content { max-width: 720px; }
.hero-title { margin: 0 0 20px; font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); line-height: 1.09; letter-spacing: -2px; color: var(--white); }
.highlight { color: #f4a166; }
.hero-subtitle { max-width: 625px; margin: 0 0 29px; font-size: 18px; line-height: 1.65; color: #e4edf4; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 23px; margin-top: 37px; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #e9f0f6; }
.trust-icon { width: 18px; height: 18px; color: #f6a265; }

.trust-section { position: relative; z-index: 2; margin-top: -46px; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); box-shadow: var(--shadow); }
.trust-card { padding: 29px 23px 27px; border-right: 1px solid var(--line); }
.trust-card:last-child { border-right: 0; }
.trust-card-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 15px; background: var(--blue-light); color: var(--blue); }
.trust-card-icon svg { width: 23px; height: 23px; }
.trust-card-title { margin: 0 0 7px; font: 700 15px/1.3 var(--serif); color: var(--navy); }
.trust-card-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

section:not(.hero):not(.trust-section) { padding: 105px 0; }
.section-header { max-width: 750px; margin: 0 auto 46px; text-align: center; }
.section-title { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(28px, 3.6vw, 42px); line-height: 1.22; letter-spacing: -1.2px; color: var(--navy); }
.section-subtitle { margin: 0; color: var(--muted); font-size: 16px; }

.services { background: var(--cream); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.service-card { position: relative; padding: 29px 25px 26px; border: 1px solid #e3e6e7; background: var(--white); transition: transform .2s, box-shadow .2s; }
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.service-card.featured { border: 2px solid var(--orange); padding: 28px 24px 25px; }
.featured-badge { position: absolute; top: -13px; right: 18px; padding: 5px 11px; background: var(--orange); color: var(--white); border-radius: 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.service-icon { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: 19px; background: var(--blue-light); color: var(--blue); }
.service-icon svg { width: 26px; height: 26px; }
.service-title { min-height: 50px; margin: 0 0 11px; font: 700 17px/1.45 var(--serif); color: var(--navy); }
.service-text { min-height: 110px; margin: 0 0 18px; font-size: 13.5px; line-height: 1.63; color: var(--muted); }
.service-features { list-style: none; padding: 0; margin: 0 0 20px; border-top: 1px solid var(--line); }
.service-features li { position: relative; padding: 8px 0 8px 18px; border-bottom: 1px solid var(--line); color: #485766; font-size: 12.5px; }
.service-features li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.service-cta { color: var(--blue); font-weight: 800; font-size: 13px; }
.service-cta:hover { color: var(--orange); }

.cost-section { background: var(--white); }
.cost-content { display: grid; grid-template-columns: 1.35fr .65fr; gap: 65px; align-items: center; }
.cost-text .section-title { max-width: 740px; }
.cost-intro { max-width: 720px; margin: 0 0 28px; color: var(--muted); }
.cost-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 23px; }
.cost-card { position: relative; min-height: 190px; padding: 18px 15px; border: 1px solid var(--line); background: #fbfcfd; }
.featured-cost { border: 2px solid var(--orange); padding: 17px 14px; background: #fffaf7; }
.popular-badge { position: absolute; top: -11px; left: 12px; padding: 3px 8px; background: var(--orange); color: var(--white); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.cost-card-title { margin: 0 0 8px; font: 700 14px var(--serif); color: var(--navy); }
.cost-price { margin-bottom: 8px; color: var(--orange); font: 800 20px/1.2 var(--serif); letter-spacing: -.6px; }
.cost-desc { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.52; }
.cost-note { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.cost-image { min-height: 465px; position: relative; overflow: hidden; background: var(--navy); }
.cost-image img { width: 100%; height: 465px; object-fit: cover; }

.why-us { background: var(--blue-light); }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.why-card { padding: 27px 24px; background: var(--white); border: 1px solid #d8e8f2; }
.why-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 16px; color: var(--orange); background: #fff4ec; }
.why-icon svg { width: 22px; height: 22px; }
.why-title { margin: 0 0 9px; color: var(--navy); font: 700 17px/1.35 var(--serif); }
.why-text { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

.process { background: var(--white); }
.process-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.process-steps::before { content: ''; position: absolute; top: 28px; left: 12.5%; right: 12.5%; height: 2px; background: #d5e2ea; }
.process-step { position: relative; text-align: center; }
.step-number { position: relative; z-index: 1; width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 20px; border: 5px solid var(--white); border-radius: 50%; background: var(--blue); color: var(--white); font: 800 21px var(--serif); box-shadow: 0 0 0 1px #d5e2ea; }
.step-title { margin: 0 0 9px; color: var(--navy); font: 700 17px var(--serif); }
.step-text { max-width: 240px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.65; }
.process-cta { margin-top: 43px; text-align: center; }

.service-area { background: var(--navy); color: var(--white); }
.service-area-content { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 70px; }
.service-area .section-title { color: var(--white); }
.service-area-intro { margin: 0 0 27px; color: #c7d4de; }
.service-areas-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; margin-bottom: 25px; }
.area-item { display: flex; align-items: center; gap: 8px; color: #e9f2f7; font-size: 14px; }
.area-icon { width: 17px; height: 17px; color: #f4a166; }
.service-area-note { margin: 0; color: #c7d4de; font-size: 13px; font-style: italic; }
.service-area-map { overflow: hidden; background: #173d60; }
.service-area-map img { width: 100%; height: 370px; object-fit: cover; opacity: .78; mix-blend-mode: screen; }

.faq { background: var(--cream); }
.faq-list { max-width: 900px; margin: 0 auto; }
.faq-item { margin-bottom: 10px; border: 1px solid #dfe3e5; background: var(--white); }
.faq-question { width: 100%; min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border: 0; background: transparent; color: var(--navy); text-align: left; font-weight: 700; line-height: 1.4; }
.faq-icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--orange); transition: transform .25s; }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-answer p { padding: 0 20px 20px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.cta-section { position: relative; overflow: hidden; background: var(--orange); text-align: center; }
.cta-section::before, .cta-section::after { content: ''; position: absolute; width: 350px; height: 350px; border: 45px solid rgba(255,255,255,.08); border-radius: 50%; }
.cta-section::before { top: -210px; left: -90px; }
.cta-section::after { bottom: -250px; right: -80px; }
.cta-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.cta-title { margin: 0 0 12px; color: var(--white); font: 800 clamp(30px, 4vw, 45px)/1.2 var(--serif); letter-spacing: -1.3px; }
.cta-text { margin: 0 auto 27px; color: #fff4ed; font-size: 17px; }
.cta-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 13px; }
.btn-white { background: var(--white); color: var(--navy); border-color: var(--white); box-shadow: none; }
.btn-white:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.cta-section .btn-outline.btn-white { color: var(--white); background: transparent; border-color: rgba(255,255,255,.75); }
.cta-section .btn-outline.btn-white:hover { background: var(--white); color: var(--orange); }

.contact { background: var(--white); }
.contact-grid { display: grid; grid-template-columns: .88fr 1.12fr; gap: 76px; align-items: start; }
.contact-intro { margin: 0 0 29px; color: var(--muted); }
.contact-details { display: grid; gap: 20px; }
.contact-item { display: flex; align-items: flex-start; gap: 14px; }
.contact-icon { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; color: var(--blue); background: var(--blue-light); }
.contact-icon svg { width: 21px; height: 21px; }
.contact-text h4 { margin: 0 0 2px; color: var(--navy); font: 700 14px var(--serif); }
.contact-text p, .contact-text a { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.contact-text a { color: var(--blue); font-weight: 700; }
.contact-cta { margin-top: 28px; }
.contact-form-card { padding: 33px; border-top: 4px solid var(--orange); background: var(--cream); box-shadow: var(--shadow-sm); }
.form-title { margin: 0 0 6px; color: var(--navy); font: 700 24px var(--serif); }
.form-subtitle { margin: 0 0 25px; color: var(--muted); font-size: 13.5px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; color: var(--navy); font-size: 13px; font-weight: 700; }
.form-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #ccd4d9; border-radius: 3px; background: var(--white); color: var(--ink); font-size: 14px; transition: border-color .2s, box-shadow .2s; }
textarea.form-input { min-height: 94px; resize: vertical; }
.form-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(17,103,168,.12); }
.form-note { margin: 13px 0 0; color: #707a83; font-size: 10.5px; line-height: 1.5; text-align: center; }
.form-message { margin-top: 14px; padding: 12px; background: #e5f4ec; color: #14613d; border-left: 3px solid var(--success); font-size: 13px; }

.footer { padding: 64px 0 0; background: var(--navy-dark); color: #b9c7d2; }
.footer-grid { display: grid; grid-template-columns: 1.45fr .7fr 1fr .8fr; gap: 45px; padding-bottom: 49px; }
.footer-logo { margin-bottom: 15px; }
.footer .logo-text { color: var(--white); }
.footer-text { max-width: 340px; margin: 0 0 19px; color: #aebdca; font-size: 13px; line-height: 1.65; }
.footer-phone { display: inline-flex; align-items: center; gap: 8px; color: #f4a166; font-weight: 800; font-size: 15px; }
.footer-phone .icon-phone { width: 17px; }
.footer-title { margin: 3px 0 16px; color: var(--white); font: 700 15px var(--serif); }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li, .footer-list a { margin-bottom: 8px; color: #afbec9; font-size: 12.5px; line-height: 1.45; }
.footer-list a:hover { color: #f4a166; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.12); }
.copyright, .footer-legal { margin: 0; color: #8396a7; font-size: 11.5px; }
.footer-legal { display: flex; gap: 18px; }
.footer-link:hover { color: var(--white); }
.mobile-sticky-call { display: none; }

@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-title, .service-text { min-height: auto; }
  .service-card { display: flex; flex-direction: column; }
  .service-cta { margin-top: auto; }
  .cost-content, .service-area-content { gap: 40px; }
  .header-container { gap: 16px; }
  .nav-list { gap: 15px; }
}

@media (max-width: 860px) {
  .header-container { min-height: 68px; }
  .nav, .header-cta { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-nav-overlay { position: fixed; z-index: 300; inset: 0; padding: 20px; background: rgba(4,17,32,.66); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .mobile-nav-overlay.open { opacity: 1; visibility: visible; }
  .mobile-nav-content { position: absolute; top: 0; right: 0; width: min(350px, 88vw); height: 100%; padding: 28px; display: flex; flex-direction: column; background: var(--white); transform: translateX(100%); transition: transform .28s; }
  .mobile-nav-overlay.open .mobile-nav-content { transform: translateX(0); }
  .mobile-nav-close { align-self: flex-end; padding: 0; border: 0; background: transparent; color: var(--navy); }
  .mobile-nav-close svg { width: 32px; height: 32px; }
  .mobile-nav-list { list-style: none; padding: 25px 0; margin: 0; }
  .mobile-nav-link { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--navy); font: 700 18px var(--serif); }
  .mobile-cta { margin-top: auto; }
  .hero { min-height: 625px; }
  .hero-overlay { background: linear-gradient(90deg, rgba(5,20,38,.92), rgba(7,27,50,.74)); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-card:nth-child(2) { border-right: 0; }
  .trust-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cost-content, .service-area-content, .contact-grid { grid-template-columns: 1fr; }
  .cost-image { display: none; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  body { padding-bottom: 63px; }
  .container { width: min(calc(100% - 30px), var(--container)); }
  section:not(.hero):not(.trust-section) { padding: 67px 0; }
  .hero { min-height: 602px; align-items: flex-start; }
  .hero-container { padding: 78px 0 58px; }
  .hero-title { font-size: 38px; letter-spacing: -1.45px; }
  .hero-subtitle { font-size: 15px; line-height: 1.65; }
  .hero-cta { display: grid; grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .hero-trust { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 27px; }
  .trust-section { margin-top: 0; }
  .trust-grid { grid-template-columns: 1fr; box-shadow: none; }
  .trust-card, .trust-card:nth-child(2) { padding: 19px 18px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; }
  .trust-card:last-child { border-bottom: 0; }
  .trust-card-icon { grid-row: span 2; margin: 0; }
  .trust-card-title { align-self: end; margin: 0; }
  .trust-card-text { align-self: start; }
  .section-header { margin-bottom: 31px; }
  .section-title { font-size: 29px; letter-spacing: -.8px; }
  .services-grid, .why-grid { grid-template-columns: 1fr; }
  .service-card, .service-card.featured { padding: 26px 22px; }
  .cost-cards { grid-template-columns: 1fr; }
  .cost-card { min-height: 0; padding: 19px; }
  .cost-card.featured-cost { padding: 18px; }
  .process-steps { grid-template-columns: 1fr; gap: 28px; }
  .process-steps::before { top: 27px; bottom: 27px; left: 27px; right: auto; width: 2px; height: auto; }
  .process-step { display: grid; grid-template-columns: 56px 1fr; gap: 17px; text-align: left; }
  .step-number { margin: 0; }
  .step-content { padding-top: 4px; }
  .step-text { max-width: none; margin: 0; }
  .service-area-content { gap: 31px; }
  .service-areas-list { grid-template-columns: 1fr; }
  .service-area-map img { height: 235px; }
  .faq-question { padding: 16px; font-size: 14px; }
  .faq-answer p { padding: 0 16px 17px; font-size: 13px; }
  .cta-title { font-size: 30px; }
  .cta-text { font-size: 15px; }
  .cta-buttons { display: grid; grid-template-columns: 1fr; }
  .contact-grid { gap: 42px; }
  .contact-form-card { padding: 25px 20px; }
  .footer { padding-top: 48px; }
  .footer-grid { grid-template-columns: 1fr; gap: 29px; padding-bottom: 33px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mobile-sticky-call { position: fixed; z-index: 99; bottom: 0; left: 0; right: 0; min-height: 61px; display: flex; justify-content: center; align-items: center; gap: 8px; background: var(--orange); color: var(--white); font-size: 16px; font-weight: 800; box-shadow: 0 -3px 12px rgba(0,0,0,.16); }
  .mobile-sticky-call .icon-phone { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
