/* ==========================================================================
   Roofing Company Basildon — Design System
   Slate grey and terracotta, sampled from natural slate and brick chimneys
   in the client's own project photos.
   Signature motif: "ridge zigzag" — a roofline silhouette divider,
   distinct from other roofing builds' motifs.
   ========================================================================== */

:root {
  --slate: #3C4A54;
  --slate-dark: #232D34;
  --slate-deeper: #171E23;
  --terracotta: #C1633D;
  --terracotta-dark: #9A4C2E;
  --cream: #F5F1EA;
  --stone: #8B8781;
  --stone-light: #E6E1D7;
  --white: #FFFFFF;
  --ink: #1E2226;

  --font-display: 'Bitter', serif;
  --font-body: 'Mulish', sans-serif;

  --max-width: 1200px;
  --radius: 3px;
  --shadow-soft: 0 14px 30px rgba(23, 30, 35, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  margin: 0 0 0.5em;
  color: var(--slate-dark);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.1vw, 1.4rem); }
p { margin: 0 0 1em; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.76rem;
  color: var(--terracotta-dark);
  margin-bottom: 0.7em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.9em 1.75em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--slate-dark); }
.btn-dark { background: var(--slate-dark); color: var(--white); }
.btn-dark:hover { background: var(--slate-deeper); }

/* ===== Ridge zigzag motif (signature divider) ===== */
.ridge-divider { position: relative; height: 34px; width: 100%; overflow: hidden; line-height: 0; }
.ridge-divider svg { width: 100%; height: 100%; display: block; }

/* Top bar */
.top-bar { background: var(--slate-deeper); color: var(--stone-light); font-size: 0.84rem; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.top-bar a { color: var(--white); }
.top-bar .top-bar-phone { font-weight: 700; display:flex; align-items:center; gap:0.4em; }
.top-bar .top-bar-phone svg { width: 15px; height: 15px; }

/* Nav */
.main-header { background: var(--white); border-bottom: 1px solid var(--stone-light); position: sticky; top: 0; z-index: 100; }
.main-header .container { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.5rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 44px; height: 44px; background: var(--slate-dark); color: var(--white); display: flex; align-items: center; justify-content: center; border-radius: var(--radius); flex-shrink: 0; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: 0.01em; line-height: 1.05; color: var(--slate-dark); }
.brand-text span { display: block; font-size: 0.56rem; letter-spacing: 0.18em; color: var(--stone); font-family: var(--font-body); font-weight: 700; margin-top: 4px; text-transform: uppercase; }

.main-nav > ul { display: flex; align-items: center; gap: 1.55rem; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a, .main-nav .dropdown-toggle {
  font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  color: var(--ink); display: flex; align-items: center; gap: 0.3rem; background: none; border: none; cursor: pointer; padding: 0.5rem 0;
  white-space: nowrap;
}
.main-nav > ul > li > a:hover, .main-nav .dropdown-toggle:hover { color: var(--terracotta); }
.main-nav .dropdown-toggle .chev { transition: transform 0.15s ease; font-size: 0.7em; }
.main-nav li.open .dropdown-toggle .chev { transform: rotate(180deg); }

.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; background: var(--white); border: 1px solid var(--stone-light); border-top: 3px solid var(--terracotta);
  min-width: 250px; max-height: 70vh; overflow-y: auto; padding: 0.5rem 0; box-shadow: var(--shadow-soft); z-index: 50;
}
.main-nav li.open .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 0.62rem 1.15rem; font-family: var(--font-body); font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.dropdown-menu li a:hover { background: var(--cream); color: var(--terracotta-dark); }

.nav-cta { display: flex; align-items: center; gap: 0.9rem; }
.nav-phone { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--terracotta); line-height: 1.1; }
.nav-phone small { font-family: var(--font-body); font-weight: 700; font-size: 0.6rem; letter-spacing: 0.1em; color: var(--stone); text-transform: uppercase; }
.nav-toggle { display: none; background: none; border: 2px solid var(--slate-dark); padding: 0.5rem 0.7rem; cursor: pointer; font-size: 1.1rem; color: var(--slate-dark); }

/* Hero */
.hero { position: relative; color: var(--white); overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(23,30,35,0.93) 0%, rgba(23,30,35,0.76) 42%, rgba(23,30,35,0.4) 100%); }
.hero-content { position: relative; z-index: 1; padding: 5.2rem 0 4.4rem; max-width: 700px; }
.hero-content h1 { color: var(--white); }
.hero-content .eyebrow { color: var(--terracotta); }
.hero-content p.lead { font-size: 1.12rem; max-width: 560px; color: var(--stone-light); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.7rem; }
.hero-trust { display: flex; gap: 1.8rem; flex-wrap: wrap; margin-top: 2.3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.2); }
.hero-trust .stat { display: flex; align-items: center; gap: 0.6rem; }
.hero-trust .stat svg { width: 24px; height: 24px; color: var(--terracotta); flex-shrink: 0; }
.hero-trust .stat span { font-size: 0.84rem; color: var(--stone-light); }

.page-hero { background: var(--slate-dark); color: var(--white); padding: 3.1rem 0 2.9rem; }
.page-hero h1 { color: var(--white); }
.page-hero .eyebrow { color: var(--terracotta); }
.page-hero p.lead { max-width: 640px; color: var(--stone-light); font-size: 1.03rem; }
.breadcrumbs { font-size: 0.8rem; color: var(--stone-light); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--white); }
.breadcrumbs a:hover { color: var(--terracotta); }
.breadcrumbs span { margin: 0 0.4em; }

/* Sections */
section { padding: 4.2rem 0; }
.section-white { background: var(--white); }
.section-cream { background: var(--cream); }
.section-stone { background: var(--stone-light); }
.section-dark { background: var(--slate-dark); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-head { max-width: 680px; margin-bottom: 2.4rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Services grid */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.service-card { background: var(--white); border: 1px solid var(--stone-light); padding: 1.7rem 1.5rem; transition: transform 0.15s ease, box-shadow 0.15s ease; display: flex; flex-direction: column; gap: 0.7rem; border-top: 3px solid var(--terracotta); }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.service-card .icon { width: 44px; height: 44px; color: var(--slate-dark); }
.service-card .icon svg { width: 100%; height: 100%; }
.service-card h3 { font-size: 1.05rem; margin-bottom: 0.2em; }
.service-card p { font-size: 0.92rem; color: var(--stone); margin-bottom: 0.4em; flex-grow: 1; }
.service-card .card-link { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; color: var(--terracotta); letter-spacing: 0.04em; }

/* Feature split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split-reverse .split-media { order: 2; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.icon-panel { background: var(--cream); border: 2px solid var(--terracotta); border-radius: var(--radius); padding: 3rem; display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; }
.icon-panel svg { width: 55%; max-width: 220px; height: auto; color: var(--slate-dark); }
.checklist li { display: flex; gap: 0.7em; align-items: flex-start; margin-bottom: 0.8em; font-size: 0.97rem; }
.checklist li svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.1em; color: var(--terracotta); }

/* Gallery */
.gallery-grid { columns: 2; column-gap: 1rem; }
.gallery-grid figure { break-inside: avoid; margin: 0 0 1rem; overflow: hidden; box-shadow: var(--shadow-soft); }
.gallery-grid figcaption { font-size: 0.8rem; padding: 0.65rem 0.85rem; background: var(--slate-dark); color: var(--stone-light); }

.process-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) { .process-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .process-grid { grid-template-columns: 1fr; } }

/* Trust / stats band */
.trust-band { background: var(--slate-deeper); color: var(--white); padding: 2.7rem 0; }
.trust-band .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.6rem; }
.trust-band .stat { text-align: center; flex: 1; min-width: 150px; }
.trust-band .stat svg { width: 30px; height: 30px; color: var(--terracotta); margin-bottom: 0.5rem; }
.trust-band .stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; }
.trust-band .stat span { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--stone-light); }

/* FAQ */
.faq-list { max-width: 800px; }
.faq-item { border-bottom: 1px solid var(--stone-light); padding: 1.35rem 0; }
.faq-item summary { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.6rem; color: var(--terracotta); line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin-top: 0.85rem; color: var(--stone); }

/* Coverage */
.area-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.area-chip { background: var(--white); border: 1px solid var(--stone-light); border-left: 3px solid var(--terracotta); padding: 0.85rem 1.1rem; font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 0.5em; color: var(--slate-dark); }
.area-chip a { color: inherit; display: block; width: 100%; }

/* CTA band */
.cta-band { background: var(--terracotta); color: var(--white); padding: 3.6rem 0; text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band .phone-huge { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 5vw, 3.1rem); display: block; margin: 0.5rem 0 1.5rem; }

/* Footer */
.site-footer { background: var(--slate-deeper); color: var(--stone-light); padding: 3.6rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.2rem; padding-bottom: 2.4rem; }
.footer-brand .brand-text { color: var(--white); }
.footer-brand p { font-size: 0.9rem; color: var(--stone-light); margin-top: 1.1rem; }
.footer-col h4 { font-family: var(--font-body); color: var(--white); font-size: 0.82rem; letter-spacing: 0.1em; margin-bottom: 1.1rem; text-transform: uppercase; }
.footer-col li { margin-bottom: 0.55em; font-size: 0.88rem; }
.footer-col a:hover { color: var(--terracotta); }
.footer-legal-name { font-size: 0.78rem; color: #6E7981; margin-top: 1.1rem; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--slate-dark); padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; font-size: 0.78rem; color: #6E7981; }
.footer-bottom a:hover { color: var(--terracotta); }

/* 404 */
.error-page { padding: 6.5rem 0; text-align: center; }
.error-page h1 { font-size: clamp(4.5rem, 13vw, 8.5rem); color: var(--stone-light); -webkit-text-stroke: 2px var(--slate-dark); }

/* Utility */
.center-text { text-align: center; }
.prose p { color: var(--stone); }

/* Responsive */
@media (max-width: 980px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 1.8rem; }
  .split-reverse .split-media { order: 0; }
  .area-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { columns: 1; }
}
@media (max-width: 720px) {
  .main-nav { display: none; position: fixed; inset: 0; top: 76px; background: var(--white); z-index: 99; padding: 1.5rem; overflow-y: auto; }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li { border-bottom: 1px solid var(--stone-light); }
  .main-nav > ul > li > a, .main-nav .dropdown-toggle { padding: 1rem 0; justify-content: space-between; width: 100%; }
  .dropdown-menu { position: static; border: none; box-shadow: none; padding-left: 1rem; max-height: none; }
  .nav-toggle { display: block; }
  .nav-phone { display: none; }
  .main-header .container { flex-wrap: nowrap; padding: 0.7rem 1rem; }
  .brand-text { display: none; }
  .nav-cta { gap: 0.5rem; }
  .nav-cta .btn-primary { padding: 0.7em 1.1em; font-size: 0.78rem; }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-band .container { justify-content: space-around; }
}
@media (max-width: 380px) {
  .nav-cta .btn-primary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
