/* ===========================================================
   Brewster Builders — Design System
   Modern & Bold construction theme
   =========================================================== */

:root {
  --bg:        #0e1116;   /* near-black charcoal */
  --bg-soft:   #161b22;   /* card / section */
  --bg-soft-2: #1c232d;
  --line:      #2a323d;
  --text:      #e9edf2;
  --muted:     #9aa6b2;
  --accent:    #1e40d8;   /* deep cobalt blue — matched to logo */
  --accent-2:  #4a6ee8;   /* mid royal blue */
  --accent-dk: #1230b0;   /* darkest logo blue */
  --white:     #ffffff;
  --radius:    14px;
  --maxw:      1180px;
  --ease:      cubic-bezier(.22, 1, .36, 1);
  --shadow:    0 18px 50px -20px rgba(0,0,0,.7);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: "Archivo", "Inter", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: 10px;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--accent); color: #ffffff; box-shadow: 0 10px 30px -8px rgba(30,64,216,.5); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 16px 38px -8px rgba(30,64,216,.6); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 18px 38px; font-size: 1.08rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(14,17,22,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 170px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand .mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-dk)); color: #ffffff; border-radius: 9px;
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 6px 18px -6px rgba(30,64,216,.6);
}
.brand small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.brand-logo {
  height: 160px; width: auto; display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.site-footer .brand-logo { height: 100px; }
@media (max-width: 980px) { .nav { height: 110px; } .brand-logo { height: 100px; } }
@media (max-width: 680px) { .nav { height: 80px; } .brand-logo { height: 70px; } }

/* Hero watermark logo */
.hero-watermark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(700px, 90vw); pointer-events: none; z-index: 0;
  opacity: .12; filter: brightness(.9) saturate(1.4);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: .96rem; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--bg-soft); }
.nav-cta { margin-left: 10px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 26px; height: 2.5px; background: var(--text); border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Section scaffolding ---------- */
section { position: relative; }
.section { padding: 110px 0; }
.section-sm { padding: 80px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); display: inline-block; }
.section-title { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 18px; }
.section-lead { color: var(--muted); font-size: 1.12rem; max-width: 620px; }
.center { text-align: center; }
.center .section-lead { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: 170px; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 78% 12%, rgba(30,64,216,.22), transparent 60%),
    radial-gradient(700px 500px at 10% 90%, rgba(30,64,216,.10), transparent 60%);
  z-index: -1;
}
.hero-grid {
  position: absolute; inset: 0; z-index: -2; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
          mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; width: 100%; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); margin-bottom: 24px; }
.hero h1 .stroke { color: transparent; -webkit-text-stroke: 2px var(--accent); }
.hero p.lead { font-size: 1.22rem; color: var(--muted); max-width: 520px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  padding: 8px 16px 8px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); font-size: .85rem; color: var(--muted); font-weight: 600;
}
.hero-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #28d17c; box-shadow: 0 0 0 4px rgba(40,209,124,.18); }

.hero-card {
  background: linear-gradient(160deg, var(--bg-soft) 0%, var(--bg-soft-2) 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 8px;
  box-shadow: var(--shadow); position: relative;
}
.hero-photo {
  border-radius: 14px; aspect-ratio: 4/5; overflow: hidden;
  position: relative; background: #111827;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo .ico { font-size: 4.5rem; filter: grayscale(.2); opacity: .85; }
.hero-float {
  position: absolute; bottom: -22px; left: -22px;
  background: var(--white); color: #11151b; border-radius: 14px; padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.hero-float .big { font-family: "Archivo"; font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--accent-dk); }
.hero-float small { color: #5a6573; font-weight: 600; font-size: .8rem; }

/* ---------- Stats bar ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 46px 0; }
.stat { text-align: center; }
.stat .num { font-family: "Archivo"; font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; color: var(--white); line-height: 1; }
.stat .num .accent { color: var(--accent); }
.stat .lbl { color: var(--muted); font-weight: 600; margin-top: 8px; font-size: .95rem; }

/* ---------- Cards / services ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--accent);
  transition: width .35s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: #3a4856; box-shadow: var(--shadow); }
.card:hover::after { width: 100%; }
.card .ico {
  width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(30,64,216,.12); border: 1px solid rgba(30,64,216,.25);
  font-size: 1.6rem; margin-bottom: 20px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--muted); }
.card .more { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 700; font-size: .92rem; }

/* ---------- Feature split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.checklist { list-style: none; margin-top: 26px; display: grid; gap: 14px; }
.checklist li { display: flex; gap: 13px; align-items: flex-start; color: var(--text); }
.checklist li .tick {
  flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(30,64,216,.14); color: var(--accent); font-weight: 800; font-size: .9rem;
}
.checklist li b { display: block; }
.checklist li span { color: var(--muted); font-size: .94rem; }
.media-frame {
  border-radius: 18px; aspect-ratio: 5/4; border: 1px solid var(--line); overflow: hidden;
  background: #111827; box-shadow: var(--shadow); position: relative;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-frame .ico { font-size: 4rem; opacity: .8; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ---------- Process steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; position: relative; }
.step .n {
  font-family: "Archivo"; font-size: 2.6rem; font-weight: 800; color: transparent;
  -webkit-text-stroke: 1.5px var(--accent); line-height: 1; margin-bottom: 14px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .95rem; }

/* ---------- Portfolio gallery ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 36px 0 44px; }
.filter {
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-weight: 600; cursor: pointer; transition: .2s var(--ease); font-size: .92rem;
}
.filter:hover { color: var(--text); border-color: #3a4856; }
.filter.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3;
  border: 1px solid var(--line); cursor: pointer; transition: transform .35s var(--ease);
}
.tile:hover { transform: scale(1.015); }
.tile .thumb { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .thumb .ico { font-size: 3rem; opacity: .55; }
.tile .overlay {
  position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(8,10,14,.92) 0%, rgba(8,10,14,.2) 55%, transparent 100%);
  opacity: 0; transform: translateY(10px); transition: .35s var(--ease);
}
.tile:hover .overlay { opacity: 1; transform: translateY(0); }
.tile .overlay .tag { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.tile .overlay h3 { font-size: 1.25rem; }
.tile .overlay p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
/* gallery color variations */
.g1 { background: linear-gradient(135deg, #28384f, #1a2433); }
.g2 { background: linear-gradient(135deg, #1f2c3f, #161e2b); }
.g3 { background: linear-gradient(135deg, #2c3a4d, #1c2733); }
.g4 { background: linear-gradient(135deg, #233148, #161f2e); }
.g5 { background: linear-gradient(135deg, #34404f, #20272f); }
.g6 { background: linear-gradient(135deg, #1d2a3d, #141c28); }

/* ---------- Testimonials ---------- */
.quote-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.quote-card .stars { color: var(--accent); letter-spacing: 3px; margin-bottom: 16px; }
.quote-card p { font-size: 1.06rem; }
.quote-card .by { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.quote-card .av { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dk)); display: grid; place-items: center; font-weight: 800; color: #ffffff; }
.quote-card .by b { display: block; }
.quote-card .by small { color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--accent-dk), var(--accent));
  border-radius: 22px; padding: 64px 56px; text-align: center; color: #ffffff;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(#000 1px, transparent 1px), linear-gradient(90deg, #000 1px, transparent 1px);
  background-size: 40px 40px;
}
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); position: relative; }
.cta-band p { font-size: 1.15rem; max-width: 560px; margin: 14px auto 30px; position: relative; font-weight: 500; }
.cta-band .btn-primary { background: #14181e; color: var(--white); box-shadow: 0 14px 40px -10px rgba(0,0,0,.5); position: relative; }
.cta-band .btn-primary:hover { background: #000; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding: 210px 0 70px; position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 360px at 85% 0%, rgba(30,64,216,.14), transparent 60%);
}
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); margin-bottom: 16px; }
.page-hero p { color: var(--muted); font-size: 1.18rem; max-width: 640px; }
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 22px; font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--accent); }

/* ---------- Contact / Form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.info-block { display: grid; gap: 18px; margin-top: 8px; }
.info-item { display: flex; gap: 16px; align-items: flex-start; }
.info-item .ico {
  flex: none; width: 48px; height: 48px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(30,64,216,.12); border: 1px solid rgba(30,64,216,.25); font-size: 1.3rem;
}
.info-item b { display: block; }
.info-item span { color: var(--muted); }
.hours { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.hours .row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); }
.hours .row b { color: var(--text); }

.form-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.field label .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-family: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #5d6b78; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,64,216,.15);
}
.field textarea { resize: vertical; min-height: 130px; }
.field.error input, .field.error select, .field.error textarea { border-color: #ff5a5a; }
.field .err-msg { color: #ff7b7b; font-size: .82rem; margin-top: 6px; display: none; }
.field.error .err-msg { display: block; }
.form-note { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.form-success {
  display: none; text-align: center; padding: 30px;
  background: rgba(40,209,124,.1); border: 1px solid rgba(40,209,124,.35); border-radius: 12px; color: #b6f0d2;
}
.form-success.show { display: block; animation: pop .4s var(--ease); }
.form-success .big { font-size: 2.4rem; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 64px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h4 { font-family: "Archivo"; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer ul a { color: var(--text); opacity: .8; transition: .2s; font-size: .96rem; }
.site-footer ul a:hover { opacity: 1; color: var(--accent); }
.footer-about p { color: var(--muted); margin-top: 16px; max-width: 280px; font-size: .96rem; }
.footer-bottom {
  border-top: 1px solid var(--line); margin-top: 48px; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--muted); font-size: .9rem; flex-wrap: wrap;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner, .split, .contact-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 420px; }
  .grid-3, .steps { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 680px) {
  .nav-links {
    position: fixed; inset: 80px 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(14,17,22,.97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
    padding: 18px 24px 28px; transform: translateY(-130%); transition: transform .35s var(--ease); z-index: 90;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; }
  .nav-cta { margin: 8px 0 0; }
  .nav-toggle { display: flex; }
  .grid-3, .grid-2, .steps, .stats-grid, .gallery, .form-row { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .cta-band { padding: 46px 26px; }
  .hero-float { left: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 80px; }
  .page-hero { padding: 110px 0 50px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
