/* Stanley Roofing Service - stanleyroofingservice.com
   Modern, mobile-first, accessible stylesheet */

:root {
  --red: #3955b8;
  --red-dark: #2a44a3;
  --charcoal: #1a2a5c;
  --charcoal-light: #2a3a78;
  --gray-50: #f4f7fc;
  --gray-100: #eaf0f8;
  --gray-200: #dde4f0;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.14);
  --radius: 10px;
  --radius-lg: 16px;
  --container: 1200px;
  --transition: 200ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--charcoal-light); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--gray-50); }
.center { text-align: center; }
.lead { font-size: 1.15rem; max-width: 700px; margin: 0 auto 2rem; color: var(--gray-700); }

/* ---------- Top contact bar ---------- */
.topbar {
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar a { color: var(--white); }
.topbar a:hover { color: var(--red); text-decoration: none; }
.topbar-phone { font-weight: 700; }

/* ---------- Header / nav ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--charcoal);
  flex-shrink: 0;
  min-width: 0;
}
.logo:hover { text-decoration: none; }
.logo-img {
  height: 42px !important;
  width: auto !important;
  max-width: 220px;
  max-height: none;
  display: block;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .logo-img { height: 36px !important; max-width: 180px; }
}
/* Homepage: larger logo for stronger brand presence */
body.home .header .logo-img {
  height: 96px !important;
  max-width: 380px;
}
@media (max-width: 520px) {
  body.home .header .logo-img { height: 64px !important; max-width: 260px; }
}
/* Footer logo: white silhouette so it shows on the dark navy background */
.footer .logo-img {
  height: 40px !important;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
.nav-links a {
  color: var(--charcoal);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--red); text-decoration: none; }

.nav-cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-weight: 700;
}
.nav-cta:hover { background: var(--red-dark); color: var(--white) !important; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--charcoal);
  margin: 5px 0;
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--charcoal) 0%, #0f1845 100%);
  color: var(--white);
  padding: 5rem 0 5.5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 23, 70, 0.75), rgba(17, 23, 70, 0.90)),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(255,255,255,0.04) 22px 44px);
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero h1 span { color: var(--red); display: inline; }
.hero-sub {
  font-size: 1.2rem;
  color: var(--gray-200);
  max-width: 640px;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.hero-badges {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-200);
  font-size: 0.95rem;
}
.hero-badge svg { color: var(--red); flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none !important;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--white);
}
.btn-dark {
  background: var(--charcoal);
  color: var(--white);
  border-color: var(--charcoal);
}
.btn-dark:hover {
  background: var(--charcoal-light);
  color: var(--white);
}

/* ---------- Service cards ---------- */
.grid {
  display: grid;
  gap: 1.75rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red);
}
.card-icon {
  width: 56px;
  height: 56px;
  background: rgba(57, 86, 184, 0.12);
  color: var(--red);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.card h3 { margin-bottom: 0.65rem; }
.card p { margin-bottom: 1rem; font-size: 0.97rem; }
.card-link {
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.card-link::after { content: "→"; transition: transform var(--transition); }
.card-link:hover::after { transform: translateX(4px); }

/* ---------- Project gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.project {
  position: relative;
  background: var(--charcoal);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  margin: 0;
  height: 220px;
}
.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.project img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}
.project-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
  overflow: hidden;
  z-index: 1;
}
.project-placeholder svg {
  width: 100%;
  height: 100%;
  display: block;
}
.project figcaption {
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
  background: var(--white);
  font-size: 0.98rem;
  border-top: 1px solid var(--gray-200);
}

/* ---------- Trust strip ---------- */
.trust-strip {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 2.5rem 0;
}
.trust-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}
.trust-item-num {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.trust-item-label {
  font-size: 0.95rem;
  color: var(--gray-700);
  font-weight: 600;
}

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.step {
  position: relative;
  padding: 1.75rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.step-num {
  position: absolute;
  top: -16px;
  left: 1.5rem;
  width: 36px;
  height: 36px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
.step h3 { margin-top: 0.75rem; font-size: 1.1rem; }
.step p { margin: 0; font-size: 0.95rem; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.95); font-size: 1.1rem; margin-bottom: 1.75rem; }
.cta-banner .btn-primary {
  background: var(--white);
  color: var(--red);
  border-color: var(--white);
}
.cta-banner .btn-primary:hover {
  background: var(--charcoal);
  color: var(--white);
  border-color: var(--charcoal);
}
.cta-banner .btn-outline {
  border-color: var(--white);
  color: var(--white);
}

/* ---------- Service area ---------- */
.area-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
  width: 100%;
  justify-content: center;
}
.area-grid a {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--charcoal);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
  transition: all var(--transition);
}
@media (max-width: 520px) {
  .area-grid a { font-size: 0.88rem; padding: 0.55rem 1rem; }
}
.area-grid a:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  text-decoration: none;
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 820px;
  margin: 2rem auto 0;
}
.faq details {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--red);
  font-weight: 400;
  transition: transform var(--transition);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.5rem 1.25rem; margin: 0; }

/* ---------- Form ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  max-width: 620px;
  margin: 0 auto;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.15rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--charcoal);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition);
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(57, 86, 184, 0.15);
}
.form-group textarea { min-height: 110px; resize: vertical; }

/* ---------- Footer ---------- */
.footer {
  background: var(--charcoal);
  color: var(--gray-200);
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.footer a { color: var(--gray-200); font-size: 0.94rem; }
.footer a:hover { color: var(--red); text-decoration: none; }
.footer-brand p { color: var(--gray-400); font-size: 0.95rem; max-width: 360px; }
.footer-brand .logo-text strong { color: var(--white); }
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: var(--gray-400);
  font-size: 0.88rem;
}

/* ---------- Breadcrumbs ---------- */
.crumbs {
  background: var(--gray-50);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  color: var(--gray-600);
}
.crumbs a { color: var(--gray-700); }
.crumbs span { margin: 0 0.5rem; color: var(--gray-400); }

/* ---------- Inner page header ---------- */
.page-head {
  background: linear-gradient(135deg, var(--charcoal) 0%, #0f1845 100%);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.page-head h1 { color: var(--white); margin-bottom: 0.75rem; }
.page-head p { color: var(--gray-200); font-size: 1.15rem; max-width: 720px; margin: 0 auto; }

/* ---------- Content prose ---------- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.prose h3 { margin-top: 2rem; margin-bottom: 0.7