/* =========================================================
   Bennetts Bricklaying & Construction — Design System
   Mobile-first. No frameworks. CSS custom properties.
   ========================================================= */

:root {
  /* Brand */
  --brick: #9c2b26;
  --brick-dark: #7a1f1b;
  --brick-light: #c14a3f;

  /* Neutrals */
  --off-white: #f7f5f2;
  --charcoal: #23211f;
  --warm-grey: #6e6660;
  --warm-grey-light: #d8d3cc;
  --white: #ffffff;

  /* Type */
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --container-max: 1280px;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(35, 33, 31, 0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick); text-decoration: none; }
a:hover { color: var(--brick-dark); }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
p { margin: 0 0 var(--space-sm); color: var(--warm-grey); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section { padding: var(--space-xl) 0; }
.section--tight { padding: var(--space-lg) 0; }
.bg-off-white { background: var(--off-white); }
.bg-charcoal { background: var(--charcoal); color: var(--white); }
.bg-charcoal p, .bg-charcoal h2, .bg-charcoal h3 { color: var(--white); }
.bg-brick { background: var(--brick); color: var(--white); }
.bg-brick p, .bg-brick h2, .bg-brick h3 { color: var(--white); }

.text-center { text-align: center; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brick);
  margin-bottom: var(--space-xs);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--brick); color: var(--white); }
.btn--primary:hover { background: var(--brick-dark); color: var(--white); }
.btn--secondary { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn--secondary:hover { background: var(--charcoal); color: var(--white); }
.btn--on-dark { background: var(--white); color: var(--charcoal); }
.btn--on-dark:hover { background: var(--warm-grey-light); }
.btn--outline-on-dark { background: transparent; color: var(--white); border-color: var(--white); }
.btn--outline-on-dark:hover { background: var(--white); color: var(--charcoal); }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* ---------- Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--warm-grey-light);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.site-header.is-loaded { opacity: 1; }
.site-header.is-hidden { opacity: 0; pointer-events: none; }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  max-width: 1560px;
}
.site-logo { font-size: 0.75rem; font-weight: 800; color: var(--charcoal); }
.site-logo span { color: var(--brick); }
.site-logo img { max-height: 35px; width: auto; height: auto; }

.nav-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0.5rem;
}
.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--charcoal);
  margin: 6px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: var(--space-xl) var(--space-md);
  transition: right 0.3s ease;
  overflow-y: auto;
}
.primary-nav.is-open { right: 0; }
.primary-nav ul { display: flex; flex-direction: column; gap: 0.25rem; }
.primary-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--charcoal);
  font-weight: 600;
  border-bottom: 1px solid var(--warm-grey-light);
}
.primary-nav .btn { margin-top: var(--space-md); width: 100%; }
.nav-close {
  background: none; border: none; font-size: 1.5rem; position: absolute; top: var(--space-sm); right: var(--space-sm);
}
.nav-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(35,33,31,0.5); z-index: 90;
}
.nav-backdrop.is-open { display: block; }

.header-phone { display: none; font-weight: 700; color: var(--charcoal); }

@media (min-width: 1500px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    height: auto;
    width: auto;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }
  .primary-nav ul { display: flex; flex-direction: row; gap: 0.6rem; align-items: center; }
  .primary-nav a { border-bottom: none; padding: 0; white-space: nowrap; font-size: 0.9rem; }
  .primary-nav .btn { margin-top: 0; width: auto; flex-shrink: 0; display: inline-flex; padding: 0.9rem 1.75rem; }
  .primary-nav ul { flex-shrink: 1; min-width: 0; }
  .nav-close, .nav-backdrop { display: none; }
  .site-header__inner { gap: var(--space-md); }
  .header-phone { display: inline-flex; align-items: center; gap: 0.4rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: var(--white);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(35,33,31,0.15) 0%, rgba(35,33,31,0.75) 100%);
}
.hero__inner { position: relative; z-index: 2; padding-bottom: var(--space-2xl); }
.hero h1 { color: var(--white); max-width: 20ch; }
.hero p.lead { color: var(--warm-grey-light); font-size: 1.15rem; max-width: 50ch; }

/* Hero slider (homepage only) */
.hero__slides { position: absolute; inset: 0; z-index: 0; }
.hero__slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero__slide.is-active { opacity: 1; }
.hero__dots {
  position: absolute;
  z-index: 2;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: 0.5rem;
}
.hero__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  padding: 0;
}
.hero__dot.is-active { background: var(--white); border-color: var(--white); }

/* ---------- Trust bar / stat counters ---------- */
.trust-bar {
  background: var(--charcoal);
  color: var(--white);
}
.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  text-align: center;
}
.trust-bar__stat .stat-number {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  display: block;
}
.trust-bar__stat .stat-label {
  color: var(--warm-grey-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (min-width: 720px) {
  .trust-bar__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Card grids ---------- */
.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--warm-grey-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__media { aspect-ratio: 4/3; background: var(--warm-grey-light); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; }
.card__body h3 { font-size: 1.15rem; }
.card__body p { flex: 1; }
.card__link { font-weight: 700; margin-top: auto; }

/* Service tile */
.service-tile {
  padding: var(--space-md);
  border: 1px solid var(--warm-grey-light);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.service-tile:hover { border-color: var(--brick); box-shadow: var(--shadow); }
.service-tile__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--off-white);
  border-radius: 50%;
  margin-bottom: var(--space-sm);
  color: var(--brick);
  font-size: 1.5rem;
}
.service-tile h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.service-tile a.stretched-link::after { content: ''; position: absolute; inset: 0; }
.service-tile { position: relative; }

/* Sector card with image */
.sector-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; color: var(--white); }
.sector-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sector-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35,33,31,0.1), rgba(35,33,31,0.85)); }
.sector-card__body { position: absolute; bottom: 0; left: 0; right: 0; padding: var(--space-md); z-index: 1; }
.sector-card h3 { color: var(--white); margin-bottom: 0.25rem; }
.sector-card a.stretched-link::after { content: ''; position: absolute; inset: 0; }

/* ---------- Client logos ---------- */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  align-items: center;
  justify-items: center;
}
.logo-strip img { max-height: 56px; filter: grayscale(100%); opacity: 0.75; transition: opacity 0.2s ease, filter 0.2s ease; }
.logo-strip img:hover { filter: none; opacity: 1; }
@media (min-width: 720px) { .logo-strip { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Testimonial ---------- */
.testimonial { max-width: 760px; margin: 0 auto; text-align: center; }
.testimonial blockquote {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--white);
  margin: 0 0 var(--space-md);
}
.testimonial cite { font-style: normal; color: var(--warm-grey); font-weight: 600; }

/* ---------- CTA strip ---------- */
.cta-strip {
  background: var(--brick);
  color: var(--white);
  padding: var(--space-xl) 0;
  text-align: center;
}
.cta-strip h2 { color: var(--white); }
.cta-strip .phone-link { font-size: 1.5rem; font-weight: 800; color: var(--white); display: block; margin-bottom: var(--space-md); }

/* ---------- Forms ---------- */
.form-field { margin-bottom: var(--space-sm); }
.form-field label { display: block; font-weight: 700; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--warm-grey-light);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--brick);
  outline-offset: 1px;
}
.search-form input[type="search"] {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--warm-grey-light);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}
.form-honeypot { position: absolute; left: -9999px; }
.form-success { background: #e6f4ea; border: 1px solid #34a853; color: #1e4620; padding: var(--space-sm); border-radius: var(--radius); }
.form-error { background: #fce8e6; border: 1px solid var(--brick); color: var(--brick-dark); padding: var(--space-sm); border-radius: var(--radius); }

/* ---------- Gallery filters ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--space-md); }
.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--warm-grey-light);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
}
.filter-btn.is-active, .filter-btn:hover { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }
.gallery-item { transition: opacity 0.2s ease; }
.gallery-item[hidden] { display: none; }

/* ---------- Case study meta ---------- */
.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.meta-list dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warm-grey); }
.meta-list dd { margin: 0; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: var(--warm-grey-light); padding: var(--space-2xl) 0 var(--space-md); }
.footer-grid { display: grid; gap: var(--space-lg); grid-template-columns: 1fr; margin-bottom: var(--space-lg); }
.footer-grid h4 { color: var(--white); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-sm); }
.footer-grid a { color: var(--warm-grey-light); }
.footer-grid a:hover { color: var(--white); }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-accreditations { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-md); margin-bottom: var(--space-md); }
.footer-accreditations h4 { color: var(--white); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-sm); }
.logo-strip--footer { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: var(--space-md); }
.logo-strip--footer img {
  max-height: 48px;
  background: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  filter: none;
  opacity: 1;
}
.logo-strip--footer span { color: var(--warm-grey-light); font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-md); font-size: 0.85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); }
@media (min-width: 960px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Utilities ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brick); color: var(--white); padding: 1rem; z-index: 999;
}
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
